var xmlHttp
function adddigitalproduct(str, imageid)
{
	//alert('product id'+str);
	document.getElementById("buyimage"+imageid).style.cursor= "default";
	document.getElementById("buyimage"+imageid).src = "http://anandmurtigurumaa.com/store/wp-content/themes/default/images/bt_small_bought.gif";
	if (str.length==0)
	{ 
		document.getElementById("digitalcartdisplay").innerHTML=""
		return
	}
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="http://anandmurtigurumaa.com/store/wp-content/themes/default/shopping-cart-update-ajax.php"
	url=url+"?q="+str
	url=url+"&param=adddigitalproduct"
	url=url+"&sid="+Math.random()
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged2
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function deletedigitalproduct(str)
{
	  
	 
	 
	  if (str.length==0)
		  { 
			  document.getElementById("digitalcartdisplay").innerHTML=""
			  return
		  }
		  
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null)
	  {
	  alert ("Browser does not support HTTP Request")
	  return
	  } 
	  
	var url="http://anandmurtigurumaa.com/store/shopping-cart-update-ajax.php"
	url=url+"?q="+str
	url=url+"&param=deletedigitalproduct"
	url=url+"&sid="+Math.random()
	alert(url);
	xmlHttp.onreadystatechange=stateChanged2 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 





function stateChanged2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
	 	  alert(xmlHttp.responseText );
	 	
	 	//document.getElementById("digitalcartdisplay").innerHTML=xmlHttp.responseText 
		  document.getElementById("digitalcart").innerHTML=xmlHttp.responseText 
	 } 
}



function GetXmlHttpObject()
{
	var xmlHttp=null;
	
	try
	 {
		 // Firefox, Opera 8.0+, Safari
		 xmlHttp=new XMLHttpRequest();
	 }
	 
	catch (e)
	 {
		 // Internet Explorer
		 try
		  {
		  	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		  }
		 catch (e)
		  {
		  	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
	 }
	 
	return xmlHttp;
}
