function createXMLHttpRequest(){
	if (window.ActiveXObjective)
	{
		xmlHttpRequest = new ActiveXObject('Microsoft.XMLHTTP');
	}else if(window.XMLHttpRequest){
		xmlHttpRequest = new XMLHttpRequest();
	}
	return xmlHttpRequest;
}
function car(url){
	var xmlHttp = createXMLHttpRequest();
	var http = url + 'cart/js.php';
	var sendstr = 'url=' + url;
	xmlHttp.open('POST',http);
	xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlHttp.send(sendstr);
	xmlHttp.onreadystatechange = function(){
		if (xmlHttp.readyState == 4){
			if (xmlHttp.status == 200){
				var obj = document.getElementById('cart_hf');
				if (obj){
					obj.innerHTML = xmlHttp.responseText
				}
			}
		}
	}
}
//sendToCookie("{siteurl}","{goodsImages}{main_image}","{goodsname}","{price}")
function sendToCookie(url,picaddress,goodsname,goodsprice){
	var xmlHttp = createXMLHttpRequest();
	var http = url + 'goodsCookie.php';
	var goodsHttp = document.location.href;
	var postStr = 'goodsHttp=' + goodsHttp + '&picaddress=' + picaddress + '&goodsname=' + goodsname + '&price=' + goodsprice;
	xmlHttp.open('POST',http);
	xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlHttp.send(postStr);
	xmlHttp.onreadystatechange = function(){
		if (xmlHttp.readyState == 4){
			if (xmlHttp.status == 200){
			var obj = document.getElementById('goodsFormCookie_div');
			if (obj){
				if (xmlHttp.responseText != ''){
						document.getElementById('goodsFormCookie_div').innerHTML = xmlHttp.responseText;
					}else{
						document.getElementById('goodsFormCookie_div').innerHTML = 'You have no items to compare.';
					}
				}
			}
		}
	}
}
