//== "Produkt löschen" - Knopf ==============================================//
function shop_produktloeschen_submit()
{
	document.warenkorb.submit();
}
//===========================================================================//

//== Bestellung =============================================================//
function shop_menge(op)
{
	str="";
	if (op.value=="+") str="add";
	if (op.value=="-") str="sub";

	window.location.href="/home/layout_ihaservice_de/bestellung_0_17_4748.html?menge="+op.name+"_"+str;
}
//===========================================================================//

//== formular ===============================================================//
function shop_feld_sel(feld) {document.getElementById("feld"+feld).className="normal_sel";}
function shop_feld(feld) {document.getElementById("feld"+feld).className="normal";}

function shop_textarea_sel(feld) {document.getElementById(feld).className="textarea_sel";}
function shop_textarea(feld) {document.getElementById(feld).className="textarea";}

function shop_lieferanschrift()
{
	if (document.jetzt_bestellen.lieferandresse.checked)
	{
		document.getElementById("lieferanschrift").style.visibility="visible";
		document.getElementById("lieferanschrift").style.height="292px";
	}
	else
	{
		document.getElementById("lieferanschrift").style.visibility="hidden";
		document.getElementById("lieferanschrift").style.height="1px";
	}

}

function shop_zahlungsart()
{
	if (!document.jetzt_bestellen.zahlungsart) return;
	zahlungsart=document.jetzt_bestellen.zahlungsart.selectedIndex+1
	
	if (zahlungsart==1)
	{
		document.getElementById("bankinformationen").style.visibility="visible";
		document.getElementById("bankinformationen").style.height="170px";
	}
	else
	{
		document.getElementById("bankinformationen").style.visibility="hidden";
		document.getElementById("bankinformationen").style.height="1px";
	}
}

function shop_dehoga()
{
	if (document.jetzt_bestellen.dehoga_mitglied.checked)
	{
		document.getElementById("dehogainformationen").style.visibility="visible";
		document.getElementById("dehogainformationen").style.height="170px";
	}
	else
	{
		document.getElementById("dehogainformationen").style.visibility="hidden";
		document.getElementById("dehogainformationen").style.height="1px";
	}
}

function vorzugs_check(feld)
{
	//== wegspeichern ob es angeklickt war ====================================//
	angeklickt=feld.checked;
	//=========================================================================//
	//== alle Häkchen entfernen ===============================================//
	if (document.jetzt_bestellen.mitglied) document.jetzt_bestellen.mitglied.checked=false;
	if (document.jetzt_bestellen.dehoga_mitglied) document.jetzt_bestellen.dehoga_mitglied.checked=false;
	if (document.jetzt_bestellen.haendler) document.jetzt_bestellen.haendler.checked=false;
	if (document.jetzt_bestellen.schueler) document.jetzt_bestellen.schueler.checked=false;
	if (document.jetzt_bestellen.bildungseinrichtung) document.jetzt_bestellen.bildungseinrichtung.checked=false;
	//=========================================================================//

	//== den einen Hacken zurück setzen(wenn er da war) =======================//
	feld.checked=angeklickt;
	//=========================================================================//

	//== Dehoga-Box anzeigen? =================================================//
	shop_dehoga();
	//=========================================================================//
}
//===========================================================================//

//== mein Shop ===============================================================//
function shop_storno(bestellung_id)
{
	document.storno.bestellung_id.value=bestellung_id;
	document.storno.submit();
}
//===========================================================================//

//== Shopadmin ==============================================================//
function shopadmin_optionen_check(op)
{
	normal_only=document.adminform.normal_only.checked;
	iha_only=document.adminform.iha_only.checked;
	dehoga_only=document.adminform.dehoga_only.checked;
	haendler_only=document.adminform.haendler_only.checked;
	schueler_only=document.adminform.schueler_only.checked;
	bildungseinrichtung_only=document.adminform.bildungseinrichtung_only.checked;

	document.adminform.normal_only.checked=false;
	document.adminform.iha_only.checked=false;
	document.adminform.dehoga_only.checked=false;
	document.adminform.haendler_only.checked=false;
	document.adminform.schueler_only.checked=false;
	document.adminform.bildungseinrichtung_only.checked=false;

	if(op.name=="normal_only") document.adminform.normal_only.checked=normal_only;
	if(op.name=="iha_only") document.adminform.iha_only.checked=iha_only;
	if(op.name=="dehoga_only") document.adminform.dehoga_only.checked=dehoga_only;
	if(op.name=="haendler_only") document.adminform.haendler_only.checked=haendler_only;
	if(op.name=="schueler_only") document.adminform.schueler_only.checked=schueler_only;
	if(op.name=="bildungseinrichtung_only") document.adminform.bildungseinrichtung_only.checked=bildungseinrichtung_only;

}

function shopadmin_status_change(bestellung_id)
{
	a_new=window.open("http://www.hotellerie.de/modules/shop/bestellstatus_aendern.php?bestellung_id="+bestellung_id,"a_new","directories=0,location=0,menubar=0,resizable=1,scrollbars=0,status=1,toolbar=0,width=512,height=100,left=400,top=400");    
	a_new.focus();
}

function shopadmin_get_date(obj) 
{
	var my_date = showModalDialog("/ghosts/calendar.php","","dialogHeight: 235px; dialogWidth: 185px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: Yes; status: No;");
	if (my_date != null) obj.value = my_date;
}

function shop_scroll(formname,poswert) 
{
	formname.pos.value=poswert;
	formname.submit();
}

function shop_rechnung_erstellen(bestellung_id)
{
	if (document.rechnung_erstellen.nur_vorschau.checked)
	{
		width=700;
		height=600;
		width_pos=(screen.width/2)-(width/2);
		height_pos=(screen.height/2)-(height/1.5);
		eval('a_new=window.open("","a_new","directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=0,width='+width+',height='+height+',left='+width_pos+',top='+height_pos+',screenX='+width_pos+',screenY='+height_pos+'");');
		a_new.location.href="http://www.hotellerie.de/modules/shop/rechnung.php?bestellung_id="+bestellung_id;
		a_new.focus();
	}
	else
	{
		if (confirm("Möchten Sie wirklich die Rechnung als PDF erzeugen?\nEine Bearbeitung ist dann nicht mehr möglich und die Rechnungsnummer wird fest vergeben."))
		{
			width=400;
			height=200;
			width_pos=(screen.width/2)-(width/2);
			height_pos=(screen.height/2)-(height/1.5);
			eval('b_new=window.open("","b_new","directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=0,width='+width+',height='+height+',left='+width_pos+',top='+height_pos+',screenX='+width_pos+',screenY='+height_pos+'");');
			b_new.location.href="http://bn.homeip.net/hotellerie_shop/pdf.php?bestellung_id="+bestellung_id+"&hostname="+window.location.hostname;
			b_new.focus();
		}
	}
	
}

function shop_lieferschein_erstellen(bestellung_id)
{
	if (document.lieferschein_erstellen.nur_vorschau_lieferschein.checked)
	{
		width=700;
		height=600;
		width_pos=(screen.width/2)-(width/2);
		height_pos=(screen.height/2)-(height/1.5);
		eval('a_new=window.open("","a_new","directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=0,width='+width+',height='+height+',left='+width_pos+',top='+height_pos+',screenX='+width_pos+',screenY='+height_pos+'");');
		a_new.location.href="http://www.hotellerie.de/modules/shop/rechnung.php?lieferschein=ja&bestellung_id="+bestellung_id;
		a_new.focus();
	}
	else
	{
		width=400;
		height=200;
		width_pos=(screen.width/2)-(width/2);
		height_pos=(screen.height/2)-(height/1.5);
		eval('b_new=window.open("","b_new","directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=0,width='+width+',height='+height+',left='+width_pos+',top='+height_pos+',screenX='+width_pos+',screenY='+height_pos+'");');
		b_new.location.href="http://bn.homeip.net/hotellerie_shop/pdf_lieferschein.php?bestellung_id="+bestellung_id+"&hostname="+window.location.hostname;
		b_new.focus();
	}
}

function shop_stornierung_erstellen(bestellung_id)
{
	if (document.stornierung_erstellen.nur_vorschau_stornierung.checked)
	{
		width=700;
		height=600;
		width_pos=(screen.width/2)-(width/2);
		height_pos=(screen.height/2)-(height/1.5);
		eval('a_new=window.open("","a_new","directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=0,width='+width+',height='+height+',left='+width_pos+',top='+height_pos+',screenX='+width_pos+',screenY='+height_pos+'");');
		a_new.location.href="http://www.hotellerie.de/modules/shop/rechnung.php?storniert=ja&bestellung_id="+bestellung_id;
		a_new.focus();
	}
	else
	{
		width=400;
		height=200;
		width_pos=(screen.width/2)-(width/2);
		height_pos=(screen.height/2)-(height/1.5);
		eval('b_new=window.open("","b_new","directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=0,width='+width+',height='+height+',left='+width_pos+',top='+height_pos+',screenX='+width_pos+',screenY='+height_pos+'");');
		b_new.location.href="http://bn.homeip.net/hotellerie_shop/pdf_stornierung.php?bestellung_id="+bestellung_id+"&hostname="+window.location.hostname;
		b_new.focus();
	}
}

function shop_rechnung_refresh()
{
	self.location.href="/home/layout_ihaservice_de/shop__admin_0_17_4791.html?todo=rechnungen";
}
//===========================================================================//

//== Shopkategorie löschen (Nutzerbestätigung) ==============================//
function shopthema_del()
{
	if (confirm("Das Thema wirklich löschen")==false) return false;
	return true;
}
//===========================================================================//
