function WELink(ziel)
{
window.location.href = ziel + "#" + getCookie('WEInfoDetails')
}




function addToBasket(bGvSwAnjO)
{
var anJtcXwqI=parseInt(bGvSwAnjO.Qty.value);
if(anJtcXwqI<=0 || isNaN(anJtcXwqI))
	{
	alert('Die Menge muß größer als 0 sein.');
	bGvSwAnjO.Qty.select();bGvSwAnjO.Qty.focus();
	}
	else
	{
	addItem(bGvSwAnjO);bGvSwAnjO.reset();top.toggleFolder('buy');
	if(parent.frames.length>0 && parent.frames[0].document.forms[0])
		{
		parent.frames[0].document.forms[0].Total.value=formatAmount(showTotal());
		}
	}
}


function addItem(bGvSwAnjO)
{
var cMxSiIlnq=parseFloat(bGvSwAnjO.BasePrice.value);
var i=0,dKoibRqSi=0,eLrwEvXgp='',fBviClIyq='',gXapLiRcz='',hzSlRtvIx='\n',iZcDwIObw='';
var jMzdTuHri=getCookie('INtexOrder');
var kFxaqPzkG=getCookie('INtexDetails');
if(bGvSwAnjO.length>6)
	{
	var lVcEziIlv=(bGvSwAnjO.length-6);
	for(i=0;i<lVcEziIlv;i++)
		{
		dKoibRqSi=bGvSwAnjO.elements[i].options[bGvSwAnjO.elements[i].options.selectedIndex].value;
		cMxSiIlnq+=parseFloat(dKoibRqSi);
		eLrwEvXgp=bGvSwAnjO.elements[i].name+bGvSwAnjO.elements[i].options[bGvSwAnjO.elements[i].options.selectedIndex].text;gXapLiRcz+=delimdetail+eLrwEvXgp;
		hzSlRtvIx+=eLrwEvXgp+'\n';
		}
	}
if(bGvSwAnjO.name=='')
	{
	iZcDwIObw='N/A';
	}
	else
	{
	iZcDwIObw=bGvSwAnjO.name;
	}
fBviClIyq=iZcDwIObw+delimdetail+bGvSwAnjO.Qty.value+delimdetail+cMxSiIlnq+delimdetail+bGvSwAnjO.Post.value+delimdetail+bGvSwAnjO.ItemDesc.value+gXapLiRcz;
if (jMzdTuHri!=null)
	{
	if(jMzdTuHri.length<2700)
		{
		jMzdTuHri+=delimitem+fBviClIyq;
		setCookie('INtexOrder',jMzdTuHri);
		alert('Folgendes wurde in Ihren Warenkorb aufgenommen:\n\n'+bGvSwAnjO.ItemDesc.value+hzSlRtvIx+'\nMenge : '+bGvSwAnjO.Qty.value+'\nEinzelpreis : Euro '+bGvSwAnjO.BasePrice.value);
		}
		else
		{
		if(kFxaqPzkG!=null && navigator.appName.indexOf('Explorer')==-1)
			{
			if(kFxaqPzkG.length<2700)
 				{
				kFxaqPzkG+=delimitem+fBviClIyq;setCookie('INtexDetails',kFxaqPzkG);
				alert('Folgendes wurde in Ihren Warenkorb aufgenommen:\n\n'+bGvSwAnjO.ItemDesc.value+hzSlRtvIx+'\nMenge : '+bGvSwAnjO.Qty.value+'\nEinzelpreis : Euro '+bGvSwAnjO.BasePrice.value);
				}
				else
				{
				alert('Ihr Einkaufskorb ist voll.\n'+chkbutton+'.\n\n');
				}
			}
			else
			{
			if(navigator.appName.indexOf('Explorer')==-1)
				{
				kFxaqPzkG=delimitem+fBviClIyq;
				setCookie('INtexDetails',kFxaqPzkG);
				alert('Folgendes wurde in Ihren Warenkorb aufgenommen:\n\n'+bGvSwAnjO.ItemDesc.value+hzSlRtvIx+'\nMenge : '+bGvSwAnjO.Qty.value+'\nEinzelpreis : Euro '+bGvSwAnjO.BasePrice.value);
				}
				else	
				{
				alert('Ihr Warenkorb ist voll. '+chkbutton);
				}
			}
		}
	}
	else
	{
	jMzdTuHri=fBviClIyq;
	setCookie('INtexOrder',jMzdTuHri);
	alert('Folgendes wurde in Ihren Warenkorb aufgenommen:\n\n'+bGvSwAnjO.ItemDesc.value+hzSlRtvIx+'\nMenge : '+bGvSwAnjO.Qty.value+'\nEinzelpreis : Euro '+bGvSwAnjO.BasePrice.value);
	}
}


function showTotal()
{
var mFeQbiYcd=getCookie('INtexOrder');
var nDjHfPliq=getCookie('INtexDetails');
if(nDjHfPliq!=null)
	{
	mFeQbiYcd+=nDjHfPliq;
	}
var i=0,j=0,ZzXaQkYyI=0,EeEybTeZx=0,oYcWqaIyh=0,pjTreWbOv=0,qJtEqinXb=0;
if (mFeQbiYcd!=null)
	{
	var XxEwQvVIZ=splitData(mFeQbiYcd,delimitem);
	var CcCxSwQui=new Array('');
	for(i=0;i<XxEwQvVIZ.length;i++)
		{
		CcCxSwQui[i]=splitData(XxEwQvVIZ[i],delimdetail);
		ZzXaQkYyI=parseFloat(CcCxSwQui[i][2])*parseInt(CcCxSwQui[i][1]);
		oYcWqaIyh=parseFloat(CcCxSwQui[i][3])*parseInt(CcCxSwQui[i][1]);
		pjTreWbOv+=oYcWqaIyh;
		EeEybTeZx+=ZzXaQkYyI;
		}
	if(pjTreWbOv<minpost)
		{
		pjTreWbOv=minpost;
		}
		else
		{
		if(pjTreWbOv>maxpost)
			{
			pjTreWbOv=maxpost;
			}
		}
	qJtEqinXb=EeEybTeZx+(EeEybTeZx*ratecharge)+pjTreWbOv;
	}
	return qJtEqinXb;
}



function canRun(rUtEjiIoy)
{
if((navigator.appName.indexOf('Explorer')!=-1 && parseInt(navigator.appVersion)<4) || (navigator.appName.indexOf('Explorer')==-1 && parseInt(navigator.appVersion)<3))
	{
	alert('Leider wird Ihr Browser nicht unterstützt. Verwenden Sie eine neuere Version.');
	parent.location.href=rUtEjiIoy;
	}
}



function getNewNum()
{
var vKmjHYvdf=new Date('Aug 1, 1999');
var PJtREwBoV=new Date();
return (Math.round((PJtREwBoV.getTime()-vKmjHYvdf.getTime())/1000));
}



function goToPage(rUtEjiIoy)
{
location.href=rUtEjiIoy;
}




function getCookie(name)
{
var cookiename=name+'=';
if(document.cookie.length>0)
	{
	vKmjHYvdf=document.cookie.indexOf(cookiename);
	if(vKmjHYvdf!=-1)
		{
		vKmjHYvdf+=cookiename.length;VcWqxImTt=document.cookie.indexOf(';',vKmjHYvdf);
		if(VcWqxImTt==-1)
			{
			VcWqxImTt=document.cookie.length;
			}
		return unescape(document.cookie.substring(vKmjHYvdf,VcWqxImTt));
		}
	}
	return null;
}




function setCookie(name, value, expires, path, domain, secure)
{
document.cookie=name+'='+escape(value)+((expires==null) ? '' : '; expires='+expires.toGMTString())+((path == null) ? '' : '; path=' + path) + ((domain == null) ? '' : '; domain='+domain)+((secure==null) ? '' : '; secure');
}




function delCookie(name)
{
var expirydate=new Date('July 1, 2000 23:00:00');
setCookie(name,null,expirydate);
}




function splitData(aWaNJoUiz,tPbWxAqiQ)
{
var i=0,j=0,k=0;
var BgVsWaNJo=new Array(aWaNJoUiz);
for(i=0;i<aWaNJoUiz.length;i++)
	{
	var tFfHrObXs=aWaNJoUiz.substring(i,aWaNJoUiz.length);
	var x=tFfHrObXs.indexOf(tPbWxAqiQ);
	if(x>0)
		{
		k=x+i;BgVsWaNJo[j++]=aWaNJoUiz.substring(i,k);i+=x;
		}
		else
		{
		BgVsWaNJo[j++]=tFfHrObXs;i=aWaNJoUiz.length;
		}
	}
	return BgVsWaNJo;
}




function stopShopping(rUtEjiIoy,sdfDZwQSx)
{
var yObDFvqio=getCookie('INtexOrder');
if(yObDFvqio!=null)
	{
	if(confirm('Wollen Sie den Warenkorb leeren\n und zur Startseite zurückkehren?'))
		{
		delCookie('INtexOrder');delCookie('INtexDetails');
		if(parent.frames.length>0 && parent.frames[0].document.forms[0])
			{
			parent.frames[0].document.forms[0].Total.value=currencysymbol+'0.00';
			}
		parent.location.href=rUtEjiIoy;
		}
	}
	else
	{
	parent.location.href=rUtEjiIoy;
	}
}




function stopAction(rUtEjiIoy)
{
if(confirm('Wollen Sie den Einkauf abbrechen und den Warenkorb leeren?'))
	{
	delCookie('INtexOrder');delCookie('INtexDetails');
	if(parent.frames.length>0 && parent.frames[0].document.forms[0])
		{
		parent.frames[0].document.forms[0].Total.value=currencysymbol+'0.00';
		}
	location.href=rUtEjiIoy;
	}
}




function reminder()
{
if(confirm('Haben Sie die Bestellung gedruckt?\n\nWenn nicht, drücken Sie "OK"\noder "Abbrechen" zum Abbruch.'))
	{
	print();
	delCookie('INtexOrder');
	delCookie('INtexDetails');
	if(parent.frames.length>0 && parent.frames[0].document.forms[0])
		{
		parent.frames[0].document.forms[0].Total.value=currencysymbol+'0.00';
		}
	}
}




function printOrder()
{
print();
delCookie('INtexOrder');
delCookie('INtexDetails');
} 




function acceptTrans()
{
delCookie('INtexOrder');
delCookie('INtexDetails');
document.open();
document.write('<CENTER><P>&nbsp;<P><FONT COLOR="#00008B"><U><H2> Einkauf erfolgreich abgeschlossen.</H2></U></FONT>');
document.write('<P><B>Vielen Dank für den Einkauf bei uns.</B></CENTER>');
document.close();
if(parent.frames.length>0 && parent.frames[0].document.forms[0])
	{
	parent.frames[0].document.forms[0].Total.value=currencysymbol+'0.00';
	}
}




function stopTrans()
{
if(confirm('Diesen Einkauf abbrechen?'))
	{
	delCookie('INtexOrder');
	delCookie('INtexDetails');
	document.open();
	document.write('<P>&nbsp;<P><FONT COLOR="#FF0000"><U><H2 ALIGN="center"> Einkauf abgebrochen!</H2></U></FONT>');
	document.close();
	if(parent.frames.length>0 && parent.frames[0].document.forms[0])
		{
		parent.frames[0].document.forms[0].Total.value=currencysymbol+'0.00';
		}
	}
}

function formatAmount(lVcEziIlv)
{
var vdKMpTwPr=false,dvBQPmiBo='';
if(lVcEziIlv<0)
	{
	lVcEziIlv*=-1;
	vdKMpTwPr=true;
	}
var n=new String(lVcEziIlv);
if(n.indexOf('.')==-1)
	{
	n+='.00';
	}
	else
	{
	if(n.indexOf('.')==n.length-2)
		{
		n+='0';
		}
		else
		{
		n=n.substring(0,n.indexOf('.')+3);
		}
	}
if(n.length>6 && n.length<10)
	{
	dvBQPmiBo=n.substring(0,n.indexOf('.')-3)+','+n.substring(n.indexOf('.')-3,n.length);
	}
	else
	{
	if(n.length>9 && n.length<13)
		{
		dvBQPmiBo=n.substring(0,n.indexOf('.')-6)+','+n.substring(n.indexOf('.')-6, n.indexOf('.')-3)+','+n.substring(n.indexOf('.')-3,n.length);
		}
		else
		{
		dvBQPmiBo=n;
		}
	}
if(vdKMpTwPr)
	{
	return('('+currencysymbol+dvBQPmiBo+')');
	}
	else
	{
	return(currencysymbol+dvBQPmiBo);
	}
}




function padString(strg,what,chars,where)
{
while(strg.length<chars)
	{
	if(where=='Left')
		{
		strg=what+strg;
		}
		else
		{
		strg+=what;
		}
	}
return(strg);
}



