function imKorb() {
	var rest = document.cookie;
	var anz = 0;
	gesamt = 0;
	for (i = 0; i <= document.cookie.length; i++) {
		if (rest.indexOf('[') >= 0) {
			rest = rest.substring(rest.indexOf('[')+1,rest.length);
			anz+=1;
		}
	}
	if (anz > 0) {
		index = document.cookie.indexOf("TheBasket");
		countbegin = (document.cookie.indexOf("=", index) + 1);
		countend = document.cookie.indexOf(";", index);
		if (countend == -1) 	countend = document.cookie.length;
		fulllist = document.cookie.substring(countbegin, countend);
		totprice = 0;
		itemlist = 0;
		for (var i = 0; i <= fulllist.length; i++) {
			if (fulllist.substring(i,i+1) == '[') {
				itemstart = i+1;
				thisitem = 1;
			}
			else if (fulllist.substring(i,i+1) == ']') {
				itemend = i;
				thequantity = fulllist.substring(itemstart, itemend);
				itemtotal = 0;
				itemtotal = (eval(theprice*thequantity));
				temptotal = itemtotal * 100;
				totprice = totprice + itemtotal;
				itemlist=itemlist+1;
			}
			else if (fulllist.substring(i,i+1) == '|') {
				if (thisitem==1) theitem = fulllist.substring(itemstart, i);
				if (thisitem==2) theprice = fulllist.substring(itemstart, i);
				thisitem++;
				itemstart=i+1;
			}
		}
//		gesamt = totprice;
		value = parseInt(totprice*100+0.5);
		if (isNaN(value) == true) value = eval('0');
		newPounds = String(value).substr(0,String(value).length-2);
		if (newPounds == '') newPounds = '0';
		if (isNaN(newPounds) == true) newPounds = eval('0');
		newPence = String(value).substr(String(value).length-2,2);
		if (isNaN(newPence) == true) newPence = eval('0');
		if (eval(newPence) <= 9) newPence='0'+eval(newPence);
		if (eval(newPence) == 0) newPence='00';
		gesamt = newPounds+'.'+newPence;
	}
//	alert(anz);
	if (anz > 0) document.write(anz+' Artikel<br>'+gesamt+' &euro;');
//	else document.write('Ihr Warenkorb<br>ist noch leer.');
}

function bestellung(bestelltext) {
        document.location.href = "korb.html?"+bestelltext;
}

function auswahl() {
	for(i=0;i<document.produkte.gewaehlt.length;++i)
		if(document.produkte.gewaehlt.options[i].selected == true)
		document.location.href = "korb.html?"+document.produkte.gewaehlt.options[i].value;
}

function auswahl2(n) {
	for(i=0;i<document.forms[n].gewaehlt.length;++i)
		if(document.forms[n].gewaehlt.options[i].selected == true)
		document.location.href = "korb.html?"+document.forms[n].gewaehlt.options[i].value;
}

function Bildwechsel(Bildname,Bildobjekt) {
			window.document[Bildname].src = Bildobjekt.src;
}

function $_bildgross(bildname) {
	F1 = open("bilder/"+bildname+"_vollbild.jpg","BildFenster","width=800,height=600,left=0,top=0,dependent=YES");
	F1.focus();

}
function bildgross(bildname) {
	if (!bildname) {
		bildname = document.location.href;
		bildname = bildname.slice(bildname.lastIndexOf("/")+1,bildname.lastIndexOf("."));
	}
	F1 = open("bild.php?"+bildname,"BildFenster","width=850,height=650,left=0,top=0,dependent=yes");
	F1.focus();
}

function $_techdat(name)  {
	name = "techdat.php";
	F2 = open(name,"TechnischeDaten","width=570,height=450,top=0,left=100,dependent=YES,scrollbars=YES,resizable=YES");
	F2.focus();
}

function techdat(name)  {
	if (!name) {
		name = document.location.href;
		name = name.slice(name.lastIndexOf("/")+1,name.lastIndexOf("."));
	}
	F2 = open("techdat.php?"+name,"TechnischeDaten","width=570,height=450,top=0,left=100,dependent=YES,scrollbars=YES,resizable=YES");
	F2.focus();
}