var xmlHttp

function showDetails(webcat,pid,stylecode,itemid,color)
{ 
if(document.form1.color.value==""){
alert("Please select an item color");
return false;
}
//alert(pid);
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../productdetails-ajax.php"
url=url+"?webcat="+webcat + "&pid="+ pid + "&stylecode="+stylecode + "&itemid="+ itemid + "&color="+ color
url=url+"&sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function showPriceImage(webcat,pid,stylecode,itemid,color,prodsize)
{ 
//alert("Size");
if(document.form1.prodsize.value==""){
alert("Please select an item size");
return false;
}

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="../productdetails-ajax.php"
url=url+"?webcat="+webcat + "&pid="+ pid + "&stylecode="+stylecode + "&itemid="+ itemid + "&color="+ color + "&prodsize="+ prodsize
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged1
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	//document.getElementById("itemdescr").innerHTML=xmlHttp.responseText 
 	returned_text = xmlHttp.responseText 
 	return_text_array = returned_text.split("|")
 	document.getElementById("itemdescr").innerHTML=	return_text_array[0]
 	document.getElementById("productcontainer").innerHTML =  return_text_array[1]
 	document.getElementById("productcontainer2").innerHTML =  return_text_array[2]
    initCufon();
    $('.cloud-zoom').CloudZoom();
 } 
}

function stateChanged1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	returned_text = xmlHttp.responseText ;
 	return_text_array = returned_text.split("|");
 	document.getElementById("div_price").innerHTML=	return_text_array[0];
     Cufon.replace('#div_price', { fontFamily: 'Gotham HTF'});
 	//document.getElementById("productcontainer").innerHTML =  return_text_array[1]
 	itemid =  return_text_array[2];
 	document.form1.itemid.value =  return_text_array[2];
    initCufon();
    $('.cloud-zoom').CloudZoom();
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
