// JavaScript Document

var cart = {
	
	getObj : function (id)
	{
		var proid = document.getElementById('proid') ;
		var numpro = document.getElementById('listnum') ;
		proid.value +=  id + ","  ;
		numpro.value +=  1 + ","  ;
	},
	
	getProid : function ()
	{
		var numpro = document.getElementById('sendcart') ;
		numpro.submit() ;
	},
	
	isdom : function (url){
		var xmlhttp = false;
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}catch (E){
				xmlhttp = false;
			}
		}
		if (!xmlhttp && typeof XMLHttpRequest!='undefined')    xmlhttp = new XMLHttpRequest();
		xmlhttp.open("GET",url,false);
		xmlhttp.send(null);
		return xmlhttp;
	 },
 
	makechange : function (url,a){
		xmlhttp = this.isdom(url);
		t = xmlhttp.responseText;		//alert(t) ;
		
		if(t.indexOf('||')>0){
			t = t.split('||');  
			this.getResult(t);
		}else{
			obj = document.getElementById(a);
			obj.innerHTML = t;
		}
	},
	
	getResult : function (a){
		for(i=0;i<a.length;i++){
			obj=document.getElementById('cart'+i);
			obj.innerHTML=a[i];
		}
	}
}


