var xmlHttp, s_id1, tooltip_id

function addtocart_ajax(action, item, count){ 
	//alert(action);
	xmlHttp=GetXmlHttpObject1()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="shopping.asp?action="+action+"&item="+item+"&count="+count;

	xmlHttp.onreadystatechange=stateChanged1
	
	//xmlHttp.open("POST",url,true)
	//xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

	show_cart();
  
	//shopping.asp?action=add&item=1&count=1
	//xmlHttp.send("action="+action+"&item="+item+"&count="+count);
}

function addtocart_ajax_dvd(action, item, count, type){ 
	//alert(action);
	xmlHttp=GetXmlHttpObject1()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="shopping.asp?action="+action+"&item="+item+"&count="+count+"&type="+type;

	xmlHttp.onreadystatechange=stateChanged1
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

	show_cart();
 }

function removefromcart_ajax(action, item, count){ 
	xmlHttp=GetXmlHttpObject1()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	//shopping.asp?action=del&item=<%= objKey %>&count=1
	var url="shopping.asp?action="+action+"&item="+item+"&count="+count;

	xmlHttp.onreadystatechange=stateChanged1	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	show_cart();
}

function show_cart(){ 
	xmlHttp=GetXmlHttpObject1()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	var d = new Date();
	var t = d.getTime();
	var url="shopping.asp?dt="+t;
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged1

	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged1() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		document.getElementById("show_cart").innerHTML=xmlHttp.responseText;
		document.getElementById("loading_div").innerHTML= "";
		document.getElementById("loading_div").style.display= "none";
	}else{
		document.getElementById("loading_div").style.display= "";
		document.getElementById("loading_div").innerHTML= "Your product updating in bottom. Please wait...!";
	}
}

function GetXmlHttpObject1(){
	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;
}