function setsiemaxcookie()
{

var cookieName="einkaufswagen";
var cookieValue=0;
var nDays=0;
var today = new Date();
var expire = new Date();
if (nDays==null || nDays==0) nDays=1;
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie = cookieName+"="+escape(cookieValue)+ ";expires="+expire.toGMTString()+";domain=www.allcarrepair.com;path=/;";
}


function add_artikel(id,preis,titel)
{

check = confirm('Diesen Artikel:\n"'+titel+'" \nEUR '+preis+'\nhinzufügen?');
if(check == true)
{
var cookieName="einkaufswagen";
var theCookie=""+document.cookie;
var ind=theCookie.indexOf(cookieName);
var trenner='';
var ind1=theCookie.indexOf(';',ind);
if (ind1==-1) ind1=theCookie.length; 
//alert(unescape(theCookie.substring(ind+cookieName.length+1,ind1)+"|"+id));
var nDays=0;
var today = new Date();
var expire = new Date();
if (nDays==null || nDays==0) nDays=1; 
expire.setTime(today.getTime() + 3600000*24);

if(ind1 != 0)
{
trenner='|';
var artikel_str='';
artikel_str=unescape(theCookie.substring(ind+cookieName.length+1,ind1));

if(artikel_str.length >1 & artikel_str.indexOf("|")!=-1)
{
	artikel_arr=artikel_str.split("|");
	if(artikel_arr[0].length > 10)artikel_arr.shift();
	artikel=artikel_arr.join("|")+'|'+id;
}
else {
	if(artikel_str.length > 10)artikel=id;
	else artikel=artikel_str+'|'+id;

	}
}
else artikel=id;
document.cookie = cookieName+"="+escape(unescape(artikel))+ ";expires="+expire.toGMTString()+"";
document.formu.outputfeld.value=(document.formu.outputfeld.value*1)+1;
}
}



function getsiemaxcookie() {
var cookieName="einkaufswagen";
var theCookie=""+document.cookie;
//alert(unescape(theCookie));
var ind=theCookie.indexOf(cookieName);
if (ind==-1 || cookieName==""){
return "0";
} 

else {
var ind1=theCookie.indexOf(';',ind);

var artikel_arr;
var artikel_str;
if (ind1==-1) ind1=theCookie.length;
artikel_str=unescape(theCookie.substring(ind+cookieName.length+1,ind1))
artikel_arr=artikel_str.split("|");
//alert(unescape(theCookie));
//alert(artikel_arr[0]);
if(artikel_arr[0].length > 10)artikel_arr.shift();
return artikel_arr.length;

}
}

function ucwords(x)
{
arr=x.split(" ");
y=arr.length; 
text="";
for (i=0;i < y;i++)
{
text=text+arr[i].substring(0,1).toUpperCase() + arr[i].substring(1) + " ";
}
return text.replace(/( )*$/,"");
}
