<!--
//Copyright 2008 Virtual Design Media  All Rights Reserved
//Ajax Cartbox For vCommercePRO eCommerce Solutions
var req;
function cart_update(act, osc, pid, qty, chkact){
	if(osc){
		osid = '&osCsid='+osc;
	}else{
		osid = '';
	}
	//alert(act+'&nbsp;'+ osid +'&nbsp;'+ pid +'&nbsp;'+ qty +'&nbsp;'+ chkact);
	if(act == 'remove'){
		var url = "shop_cart.php?action=remove_item&products_id="+pid+osid;
	}else if(act == 'qty_update_input'){
		var url = "shop_cart.php?action=qty_update_input&products_id="+pid+"&cart_quantity="+qty+osid;
	}else{
		if(chkact){
			if(chkact == '5000'){
				//qty = parseInt(qty) + parseInt(1);
				var url = "shop_cart.php?action=update_qty&products_id="+pid+"&cart_quantity="+qty+osid;
			}else if(chkact == '6000'){
				//qty = qty - 1;
				var url = "shop_cart.php?action=remove_update_qty&products_id="+pid+"&cart_quantity="+qty+osid;
			}
		}
		
	}
		// Internet Explorer
   try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
   catch(e) {
      try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
      catch(oc) { req = null; }
   }

   // Mozailla/Safari
   if (!req && typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); }

   // Call the processChange() function when the page has loaded
   if (req != null) {
      req.onreadystatechange = processChange;
      req.open("GET", url, true);
      req.send(null);
   }
}

function processChange() {
   // The page has loaded and the HTTP status code is 200 OK
   if (req.readyState == 4 && req.status == 200) {
      // Write the contents of this URL to the searchResult layer
	    getObject("catChange").innerHTML = req.responseText;
   }
}

function getObject(name) {
   var ns4 = (document.layers) ? true : false;
   var w3c = (document.getElementById) ? true : false;
   var ie4 = (document.all) ? true : false;

   if (ns4) return eval('document.' + name);
   if (w3c) return document.getElementById(name);
   if (ie4) return eval('document.all.' + name);
   return false;
}
//-->