SSLServer="https://www.ssl-id.de/andere-postkarten.de/Shop/";
Server="http://www.andere-postkarten.de/Shop/";
debug=0;
function onLoad() {
	if(debug) alert(
		"Gestartet: "+
		"\nName: "+name+
		"\nlocation: "+location+
		"\nreferrer: "+document.referrer+
		"\ndomain: "+document.domain 
		// "\nShopReferrer: "+ShopReferrer
	);
}
function Anmeldung(SID, Sprache){
	url=SSLServer+"Anmeldung/index.php?P1="+SID+"&setSprache="+Sprache;
	if(debug) alert("URL: "+url);
	window.open(url, "Anmeldung", "top=50, left=200, width=427, height=320, location=no, status=no, menubar=no, resizable=no, scrollbars=no, toolbar=no ");
}
function AnmeldungSchliessen(){
	url=Server+"VNavigation.php?setReload=1";
	if(debug)  alert("Anmeldung wird geschlossen."+url);	
	window.close();
	/* opener.open(url, "VNavigation"); */	
}
function Abmeldung(SID){
	url=Server+"Anmeldung/Abmeldung.php?P1="+SID;
	if(debug) alert("Abmeldung URL: "+url);
	parent.location.href=url;
}
function AGB(Sprache){
	if(debug)  alert("AGB gestartet:");
	window.open(Server+"AGB/"+Sprache+".html","AGB");
}
function BildOn(ArtikelNr){
	document.getElementsByName(ArtikelNr)[0].style.visibility="visible";
	for(i=0;i<=3;i+=2){
		document.getElementsByName("Anzahl(1)")[i].style.visibility="hidden";
	}
}
function BildOff(ArtikelNr){
	document.getElementsByName(ArtikelNr)[0].style.visibility="hidden";
	for(i=0;i<=3;i+=2){
		document.getElementsByName("Anzahl(1)")[i].style.visibility="visible";
	}
}
function ElementSchalter(Element,Zustand){
	if(Schalter=="Ein" || Schalter=="Aus"){
		if (Schalter=="Ein")  Wert="visible";
		if (Schalter=="Aus")  Wert="hidden";
		document.getElementsByName(Feld)[0].style.visibility=Wert;
	}
}
function Einstellungen(Seite, SID, Fenster){
	if(debug)  alert("Einstellungen");
	if(debug)  alert("Einstellungen("+Seite+","+SID+","+Fenster+")");
	url=SSLServer+"Einstellungen/index.php?";
	url=url+"P1="+SID;
	url=url+"&P2="+Seite+".php";
	url=url+"&P3="+Fenster;
	if(debug)  alert("Einstellungen("+url+")");
	window.open(url, "Einstellungen",
	"top=50, left=100, width=700, height=550, location=no, status=yes, menubar=no, resizable=yes, scrollbars=no, toolbar=no ");
}
function EinstellungenSchliessen(SID, Fenster){
	if(debug)  alert("Einstellungen("+SID+","+Fenster+")"+" werden geschlossen");
	if(Fenster=="Bestellung") Bestellung(SID);
	window.close();
}
function Bestellung(SID){
	if(debug)  alert("Bestellung("+SSLServer+"Bestellung.php?P1="+SID+")");
	window.open(SSLServer+"Bestellung.php?P1="+SID, "Bestellung",
			"top=25, left=25, width=750, height=550, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, toolbar=no ");
}
function BestellungSchliessen(SID, Ende){
	if(debug)  alert("Bestellung wird geschlossen");
	// if(debug)  alert("Bestellung wird geschlossen ("+ShopReferrer+")");
       // window.open(ShopReferrer, "VNavigation");
       if (Ende) Abmeldung(SID);       	
	window.close();
}

function VNavigationReload() {
	parent.HNavigation.location.reload();
	parent.Haupt.location.reload();
	parent.Einkaufskorb.location.reload();
}
function HauptAuswahl(Hauptkategorie, Unterkategorie, ArtikelNr){
	url="setHaupt="+encodeURIComponent(Hauptkategorie)+"&setUnter="+encodeURIComponent(Unterkategorie)+"&ArtikelNr(shop)="+encodeURIComponent(ArtikelNr);
	//alert(url);
	parent.VNavigation.location.href="VNavigation.php?"+url;
	parent.Haupt.location.href="Einkauf.php?"+url;
	parent.VNavigation.location.reload();
}
function ShopSchliessen(SID){
	if(debug)  alert("bye, bye");
	Abmeldung(SID);
}

