      function getHTTPObject(){
      	if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
      	else if (window.XMLHttpRequest) return new XMLHttpRequest();
      	else {
      	alert("Your browser does not support ActiveXObject (MS.XMLHTTP).");
      	return null;
      	}
      }

      // Change the value of the outputText field
      function setOutput(){
      	if(httpObject.readyState == 4){
			doGetCart();
      		//alert(httpObject.responseText);
			//
      	}
      }


      function setCart(){
      	if(httpObjectCart.readyState == 4){
		//document.getElementById("cart").innerHTML=httpObjectCart.responseText;
		document.getElementById("cartStatus").innerHTML=httpObjectCart.responseText;
		popupWindow('popup1',true);
      	}
      }

      // Implement business logic

      //function doAdd(pid, qty){
	  function doAdd(pid){
		//var q = document.getElementById("qty_"+pid).value;
	
		
		
		
		//if(q=="0" || q=="00"){
		//	alert("There is nothing add to cart. You input of 0 quantity.");
		//	return;
		//}
		//if(q=="" || q==" " || q=="  "){
		//	alert("There is nothing add to cart. Please enter number of quantity.");
		//	return;	
		//}
      	httpObject = getHTTPObject();
      	if (httpObject != null) {
      		httpObject.open("GET", "add.php?pid=" + pid);
      		httpObject.send(null);
      		httpObject.onreadystatechange = setOutput;
      	}
      }


	

      function doGetCart(){
      	httpObjectCart = getHTTPObject();
      	if (httpObjectCart != null) {
      		httpObjectCart.open("GET", "ajax-cart.php");
      		httpObjectCart.send(null);
      		httpObjectCart.onreadystatechange = setCart;
      	}
      }



      var httpObject = null;
      var httpObjectCart = null;



