function requestCartclass(prodid) {
var quantid ='cartquantity_' + prodid;
var buttonid ='ajaxbutton' + prodid;
var quant = document.getElementById(quantid).value;
var button = document.getElementById(buttonid).innerHTML;

this.prodid=prodid;
this.quantid = quantid;
this.buttonid = buttonid;
this.quant = quant;
this.button = button;
var url4 = "./add_to_cart2.php?action=add_ajax&products_id=";
document.getElementById(this.buttonid).style.display = 'none';
//var IpopTop = (document.body.clientHeight - document.getElementById(this.buttonid).innerHTML.offsetHeight) / 2;
//var IpopLeft = (document.body.clientWidth - document.getElementById(this.buttonid).innerHTML.offsetWidth) / 2;
//document.getElementById(this.buttonid).innerHTML.style.left=IpopLeft + document.body.scrollLeft;
//document.getElementById(this.buttonid).innerHTML.style.top=IpopTop + document.body.scrollTop;
document.getElementById(this.buttonid).innerHTML = '<span id="popuup_div" class="popup_msg"><img src="<?php echo DIR_WS_TEMPLATES . $template_dir; ?>/images/loading.gif" alt="Loading" border="0" /><br />Product Added to<br />your Shopping Cart<br /></span>';
document.getElementById(this.buttonid).style.display = 'inline';
//document.getElementById('popup_add_to_cart').style.display = 'block';
http.open("GET", url4 + this.prodid + '&cart_quantity=' + this.quant, true);
http.onreadystatechange = handleHttpResponse4;
setTimeout("http.send(null)", 1000);

	function handleHttpResponse4() {
		if (http.readyState == 4) {
			  if(http.status==200) {
			  	var results=http.responseText;
//			alert("The server replied with: " + button + buttonid);
	//		  document.getElementById('shoppingcartContent2').innerHTML = results;
 			  document.getElementById('shoppingcartContent').innerHTML = results;
			  document.getElementById(buttonid).innerHTML = button;
			  document.getElementById(buttonid).style.display = 'inline';
			  }
  			}
		}

}

function requestCart2(prodid) {
var myPoint = new requestCartclass(prodid);
}

function getHTTPObject() {
  var xmlhttp;

  if(window.XMLHttpRequest){
    xmlhttp = new XMLHttpRequest();
  }
  else if (window.ActiveXObject){
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (!xmlhttp){
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    }

}
  return xmlhttp;


}
var http = getHTTPObject(); // We create the HTTP Object
