
function ADDTOCART(lan)
	{				

					cobj = new ajax();
					document.getElementById("CARTCOM").innerHTML = "";
					cobj.xmlHttp.onreadystatechange=function()
					  {  
								if (cobj.xmlHttp.readyState==1)
								 {
									document.getElementById("SEIMG").innerHTML= "Please wait... ";
									//cobj.xmlHttp.readyState =4; 
								 }						
								if (cobj.xmlHttp.readyState==4)
								 {	
									if(document.getElementById("IMGSIDEBAR"))document.getElementById("IMGSIDEBAR").innerHTML=cobj.xmlHttp.responseText;
									document.getElementById("SEIMG").innerHTML= '<img src="imgsInner/to_shopcart_button.gif" width="167" height="35" onClick="ADDTOCART(\''+lan+'\')" style="cursor:hand">';
									WRITETEXT(0);

								} 
				     }
					url="shoppingcart/cartAjax.php?USID="+document.getElementById("USID").value+"&PRID="+document.getElementById("PRID").value+"&lan="+lan;
					cobj.xmlHttp.open("GET",url,true);
					cobj.xmlHttp.send(null);

    }

function WRITETEXT(i)
		{ 

			text="product has been added check cart summery";
			document.getElementById("CARTCOM").innerHTML =document.getElementById("CARTCOM").innerHTML+text.charAt(i);
			i++; 
		    if(i == text.length){ clearTimeout(id);waitDELETE();i=0;}
			else { id = setTimeout("WRITETEXT("+i+")",10);}
		}
j=0;
function waitDELETE()
		{
j++;
		if(j==15){clearTimeout(id);document.getElementById("CARTCOM").innerHTML="";j=0;}
		else {id = setTimeout("waitDELETE()",100);}

		}
function RemoveItem(x)
		{

					dscobj = new ajax();
					now = new Date();
					dscobj.xmlHttp.onreadystatechange=function()
					  {  
								if (dscobj.xmlHttp.readyState==1)
								 {
									document.getElementById("SCITEMS").innerHTML= '<div style=" width:300px; padding:10px;filter:shadow(color:gray, strenght:10, direction:135);" align="center"><div style="background-color:#FFFFFF; "> <img src="imgsInner/ajax-loader2.gif">Please wait... deleting item </div></div>';
									//dscobj.xmlHttp.readyState =4; 
								 }						
								if (dscobj.xmlHttp.readyState==4)
								 {	
									if(document.getElementById("SCITEMS"))document.getElementById("SCITEMS").innerHTML=dscobj.xmlHttp.responseText;
									GETSUMMERYCART();
								} 
				     }
					url="shoppingcart/cartAjaxN.php?prid="+x+"&time=" + now.getTime();
					dscobj.xmlHttp.open("GET",url,true);
					dscobj.xmlHttp.send(null);



		}

function GETSUMMERYCART()
		{

					getobj = new ajax();				
					getobj.xmlHttp.onreadystatechange=function()
					  {  
								if (getobj.xmlHttp.readyState==1)
								 {
									document.getElementById("IMGSIDEBAR").innerHTML= "";
									//cobj.xmlHttp.readyState =4; 
								 }						
								if (getobj.xmlHttp.readyState==4)
								 {	
									if(document.getElementById("IMGSIDEBAR"))document.getElementById("IMGSIDEBAR").innerHTML=getobj.xmlHttp.responseText;
								} 
				     }
					url="shoppingcart/cartAjax3.php";
					getobj.xmlHttp.open("GET",url,true);
					getobj.xmlHttp.send(null);



		}