//BENOETIGT NEXTURL

	var constloeschen = 1;
	var constaendern = 2;
	var constanlegen = 3;
	var ShopName = "";
	
	function Detailseite() {	

		Bild = "";
		oProdukt = "";
		oDetail = "";
		notavail = "";
		sProdukt = "";
		BestNr = "";
		Preis = "";
		StandardPreis = "";
		sHersteller = "";
		lasthead = "";
		ShowBestNr = "";
		eclass = "";
		edescription = "";
		pe = "";
		sTree = "";
		sGId = "";
		KdBestNr = "";
		Bereich = "";
		TZ = "";
		Picto = "";
		Lagerort = "";
		oTxt = "";
		techZ = "";
		TZ = "";
		Picto = "";
	}
	
	function Kapitel (sKapitelKopfzeile,sKapitelUeberschrift,sKapitelBeschreibung) {
		if (sKapitelKopfzeile==''){
			sKapitelKopfzeile='';
		}
		if (sKapitelUeberschrift==''){
			sKapitelUeberschrift='';
		}
		if (sKapitelBeschreibung==''){
			sKapitelBeschreibung='';
		}
		this.KapitelKopfzeile = sKapitelKopfzeile;
		this.KapitelUeberschrift= sKapitelUeberschrift;
		this.KapitelBeschreibung= sKapitelBeschreibung;
	}

	function LadeWarenkorb (x,y){

		parent.frames.warenkorb.location.href = nextURL(1, "_wak.s_warenkorb.asp","Swt=1", "Upe=" + parent.g_oAccount.Treerechte);
	}

	function AddToWak (BestNr, i, typ, clientpos, jump, wherefrom, kdid, sks, bkto, sGId) {


		var sKstelle = "";
		var sKto = "";
		if (!parent.frames.Inhalt.Fav){
			vonFav=false;
		} else {
			vonFav=true;
		}
		Flag="";
			termin="";
			if (typ==constloeschen||typ==constanlegen){
				Amt = 0;
			} else if(typ==constaendern) {
				Amt = parent.frames.Inhalt.document.forms[0].elements[clientpos*4+3].value;
				if ((Amt*1)+""=="NaN" || Amt<1){
					Amt = 0;
				}
				sKstelle = parent.frames.Inhalt.document.forms[0].elements[clientpos*4+2].value;
				sKto = parent.frames.Inhalt.document.forms[0].elements[clientpos*4+1].value;
				termin = parent.frames.Inhalt.document.forms[0].elements[clientpos*4].value;
			} else {

				Amt = parent.frames.Inhalt.document.forms[0].elements[i].value;
				if ((Amt*1)+""=="NaN" || Amt<1){
					Amt = 0;
				}
			}
			BestNr=BestNr+"";
			if (typ==constloeschen || typ==constaendern){
				parent.frames.warenkorb.location.href = nextURL ("_wak.s_warenkorb.asp", "Pano=" + BestNr, "Amt=" + Amt, "Psix=" + i, "Cmd=" + typ, "Apc=" + sKstelle, "Aa=" + sKto, "Adt=" + termin, "Swt=" + jump, "Cano=" + kdid, "Gid=" + sGId, "Shop=" + ShopName, "Upe=" + parent.g_oAccount.Treerechte);
			} else if (typ==constanlegen){
				parent.frames.warenkorb.location.href = nextURL ("_wak.s_warenkorb.asp", "Cmd=" + typ, "Swt=" + jump, "Shop=" + ShopName, "Upe=" + parent.g_oAccount.Treerechte);
			} else {
				if (jump==""){
					jump="2";
				}
				parent.frames.warenkorb.location.href = nextURL ("_wak.s_schnellbestellung.asp", "Pano1=" + BestNr, "Amt1=" + Amt, "GId1=" + sGId, "Apc1=","Swt=" + jump,"Cmd=4","Upe=" + parent.g_oAccount.Treerechte);
			}
		
	}

	
	function Produkt (name, preis, pfid, Menge, Position, Bestellung, Hersteller, Datum, kdbestnr, kostenstelle, PE, kdprdid, check, showId, kdid, termin, bkto, sGId) {
		/*
		-name : Produkname/Bezeichnung
		-preis :  Produktpreis in Cent
		-pfid :  interne ProduktId als EINDEUTIGER Identyfier
		-Amt :  ..nomen est omen
		-Position :  Position im Warenkorb, muss angegeben werden, da nicht immer stetig aufgefüllt
		-Bestellung :  BestellId des entsprechenden zum Produkt gehörenden Warenkorb (BestHist)
		-Hersteller : ..nomen est omen
		-Datum : Das Datum an dem dieses Produkt per Bestellung bestellt wurde (BestHist)
		-kdbestnr : Kundenbestellnummer, wurde beim Versand festgelegt
		-kostenstelle : Die vom Kunden angegebene oder durch die Dll voreingestellte Kostenstelle
		-PE : Preiseinheit, hat Einfluß auf Gesamtpreis (Amt steht für die tatsächliche Anzahl, 
		nicht PE's)
		-kdprdid : Kundenspezifische Bestellnummer
		-check : Produkt ist optional ausgewählt oder nicht (BestHist)
		-showId : Die ProduktNr die im Shop als solche angezeigt werden soll
		-kdid : KundenId notwendig zum mappe (Indikator für Kundenspez. Produkte)
		-termin : Das Wunsch-Lieferdatum das optional vom Kunden angegeben werden kann
		-bkto : Das Wunsch-Buchungskonto des Kunden
		*/

		if (PE=="" || PE=="0" || PE=="<null>" || PE+"x"=="undefinedx") {PE=1;}
		this.Next = 0;
		this.Prev = 0;
		this.KundenId = kdid;
		this.GesAmt = 0;
		this.sGId = sGId;
		this.PosId = 0;
		this.Buchungskonto = bkto;
		this.Termin = termin;
		this.KSA_PId = "";	
		this.Details = true;	
		if (Menge>0 && preis>0){
			if (Math.round( ( Number(Menge) / Number(PE) ) * Number(preis))==0){Summe++;}
			Summe += Math.round( ( Number(Menge) / Number(PE) ) * Number(preis));
		} else {
		}
		this.showId = showId;
		this.Menge = Menge + "";
		this.ArtNr = pfid;
		this.Pos = Position;
		this.check = check;
		this.KundenProduktId = kdprdid;
		this.Hersteller = Hersteller;
		this.PE = PE;
		if (kostenstelle + "x" == "undefinedx"){
			kostenstelle="";
		}
		this.kostenstelle = kostenstelle;
		this.PreSetBudgetNo =  new Array;
		this.PreSetBudgetAccount = new Array;
		this.Datum = toDate(Datum);
		this.kdbestnr = kdbestnr;
		this.kostenstelle = kostenstelle;
		this.BestId = Bestellung;
		iGesPreis = Math.round( ( Number(Menge) / Number(PE) ) * Number(preis) )*100;
		if (iGesPreis==0){iGesPreis=1;}
		this.GesPreis = iGesPreis;
		this.GesPreis = PreisToString(Math.round(this.GesPreis/100));
		this.Preis = PreisToString(preis);
		this.GruppenBild= "";
		this.GruppenLink= "";
		this.GruppenName= name;
		this.Anhaengen = ProduktAnhaengen;
	}

	function ProduktAnhaengen (oProdukt) {

		this.Next = oProdukt;
		oProdukt.Prev = this;
	}
	
	
	function Detail (name, wert) {

		this.Next = 0;
		this.DetailName = name;
		this.value = wert;
		this.Anhaengen = DetailAnhaengen;
	}
	
	function Beschreibung (name, Text, Img) {

		this.Name = name;
		this.Text = Text;
		this.Bild = Img;
	}	
	
	function DetailAnhaengen (oDetail) {

		this.Next = oDetail;	
	}
	
	function AddressList () {

		this.InvoiceAddrId = 0;
		this.ShippingAddrId = 0;
		this.AccountAddrId = 0;		
		this.Addr = 0;	
		this.Addresses = new Array ();
		
		this.Add = AddressListAddAddress;
		this.GetWithId = AddressListGetAddress;		
		this.Address = AddressGetAddress;
	}
		
	function AddressListGetAddress (Id) {

		var oAddr = 0;
		
		for (var i = 0; i < this.Addresses.length; ++i) {
			oAddr = this.Addresses[i];
			if (oAddr) {
				if (oAddr.Id == Id) return (oAddr);
			}
		} 
		return (0);
	}

	function AddressGetAddress (Ix) {

		if (Ix < 0 || Ix > this.Addresses.length) {
			return this.InvoiceAddrId;
		} else {
			if (!this.Addresses[Ix]) return this.InvoiceAddrId;
			return this.Addresses[Ix];
		}

	}

	function AddressListAddAddress (oNewAddr) {

		var oAddr = 0;

		for (var i = 0; i < this.Addresses.length; ++i) {
			oAddr = this.Addresses[i];
			if (oAddr.Id == oNewAddr.Id) break;
		} 
		this.Addresses [i] = oNewAddr;
		return (i);
	}

	function Address (Id) {		

		this.Id = Id;
		this.Purpose = 0;
		this.Name1 = 0;
		this.Name2 = 0; 
		this.Name3 = 0;
		this.AP1 = 0;
		this.AP2  = 0;
		this.Addr1 = 0;
		this.Addr2 = 0;
		this.Addr3 = 0;
		this.Addr4  = 0;
		this.ZIP = 0;
		this.City1 = 0;
		this.City2 = 0;
		this.Country = 0;
		this.CountryISO = 0;
		this.PhoneArea1 = 0;
		this.Phone1 = 0;
		this.PhoneArea2 = 0;
		this.Phone2 = 0;
		this.Mobile = 0;
		this.FaxAreaFax = 0;
		this.Website = 0;
		this.Email1 = 0;
		this.Email2 = 0;
		this.Logo = 0;
		this.Anmk = 0;
	}

function loesche_wak(validate){

	if (validate==true) {
		Fenster=window.open(nextURL("_wak.c_wak_bestaetigen.htm"), "hinweis", "height=250, width=235");
	} else {
		parent.Programm.AddToWak ('','','3','','1','2')
	}
}


