function ajax_CreateXMLHttpRequest()
{
	var xmlHttpRequest = null;
	/* For Firefox, Mozilla, Safari	*/
	if (window.XMLHttpRequest)
	{
		xmlHttpRequest = new XMLHttpRequest();
	}
	/* For Microsoft Internet Explorer */
	else if (typeof ActiveXObject != "undefined")
	{
		xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}
	return xmlHttpRequest;
}
					
function addToCart(ele,artist_upload_id,price)
{
	var ajaxObj = ajax_CreateXMLHttpRequest();
	if (ajaxObj != null)
	{
		var url=baseurl+"/artist/ajax/addtocart.php";
		url=url+"?artist_upload_id="+artist_upload_id+"&price="+price;
		
		ajaxObj.open("POST", url, true);
		ajaxObj.onreadystatechange = function(){addToCallCallBack(ele,ajaxObj,artist_upload_id)};
		ajaxObj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxObj.send(url);
	}
}
function addToCallCallBack(ele,ajaxObj,artist_upload_id)
{
	if (ajaxObj.readyState==4)
	{
		var responseTxt = ajaxObj.responseText;	
		
		ele.parentNode.innerHTML='<b style="color:#962507">IN YOUR CART</b>';
		document.getElementById('cartdiv').innerHTML=parseFloat(document.getElementById('cartdiv').innerHTML)+1;
		//alert(responseTxt);	
		//document.location.href='imgdetail.php?auid='+artist_upload_id;
	}
}

