var xmlHttp
var objDiv

function showUser(pagename,str,subcateid,productid)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;  //"getsubcategory.php"
url=url+"?category_id="+str
url=url+"&subcategory_id="+subcateid
url=url+"&product_id="+productid
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

/* Added By Chirag */
function showSuboccasion(pagename,occasionid)
{ 

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename; // "getsuboccasion.php"
url=url+"?occasion_id="+ occasionid
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateOccasionChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showProducts(pagename,categoryid,subcategoryid,productid)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;  //"getsubcategory.php"
url=url+"?category_id="+categoryid
url=url+"&subcategory_id="+subcategoryid
url=url+"&product_id="+productid
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedProduct
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

/* this is for the Pointer for Diamond in Product Assembly  */
function showPointer(pagename,shapeid,pointerid,tempid1,divname)
{ 

objDiv = divname;   // THIS IS THE DIV NAME WHERE THE PAGE OR CONTROL IS DISPLAY

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;  //"getsubcategory.php"
url=url+"?shape_id="+shapeid
url=url+"&pointer_id="+pointerid
url=url+"&tempid1="+tempid1
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedPointer
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

/*Added By chirag on 12_12_07*/
function showState(pagename,str)
{ 	
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;
url=url+"?country="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedState
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showCity(pagename,str,statename)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;
url=url+"?country="+str
url=url+"&state="+statename
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedCity
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showShipState(pagename,str, state)
{ 
xmlHttp1=GetXmlHttpObject()
if (xmlHttp1==null)
 {
 alert ("Browser does not support HTTP Request");
 return
 }
var url=pagename;
url=url+"?s_country="+str+"&s_state="+state;
url=url+"&sid="+Math.random();
xmlHttp1.onreadystatechange=stateChangedShipState
xmlHttp1.open("GET",url,true)
xmlHttp1.send(null)
}

function showShipCity(pagename,str,statename,cityname)
{
xmlHttp2=GetXmlHttpObject()
if (xmlHttp2==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;
url=url+"?s_country="+str
url=url+"&s_state="+statename
url=url+"&s_city="+cityname
url=url+"&sid="+Math.random()
xmlHttp2.onreadystatechange=stateChangedShipCity
xmlHttp2.open("GET",url,true)
xmlHttp2.send(null)
}



function showCopyShipCity(pagename,str,statename)
{
xmlHttp3=GetXmlHttpObject()
if (xmlHttp3==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;
url=url+"?s_country="+str
url=url+"&s_state="+statename
url=url+"&sid="+Math.random()
xmlHttp3.onreadystatechange=stateChangedCopyShipCity
xmlHttp3.open("GET",url,true)
xmlHttp3.send(null)
}





function showProfileState(pagename,str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;
url=url+"?country="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedProfileState
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showProfileCity(pagename,str,statename)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;
url=url+"?country="+str
url=url+"&state="+statename
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedProfileCity
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedProfileState() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById("profilestate").innerHTML=xmlHttp.responseText 
 } 
}

function stateChangedProfileCity() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById("profilecity").innerHTML=xmlHttp.responseText 
 } 
}

function stateChangedShipState() 
{ 
if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
 { 
	 document.getElementById("shippingstate").innerHTML=xmlHttp1.responseText 
 } 
}

function stateChangedState() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById("billingstate").innerHTML=xmlHttp.responseText 
 } 
}

function stateChangedShipCity() 
{ 
if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
 { 
	 document.getElementById("shippingcity").innerHTML=xmlHttp2.responseText 
 } 
}


function stateChangedCopyShipCity() 
{ 
if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")
 { 
	 document.getElementById("shippingcity").innerHTML=xmlHttp3.responseText 
 } 
}


function stateChangedCity() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById("billingCity").innerHTML=xmlHttp.responseText 
 } 
}

function stateChangedProduct() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById("optProduct").innerHTML=xmlHttp.responseText 
 } 
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById("optSubcategory").innerHTML=xmlHttp.responseText 
 } 
}	


// this is for sub Occasion
function stateOccasionChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById("suboccasion").innerHTML=xmlHttp.responseText 
 } 
}	


// this is to set the div Tag for the Diamond Pointer 
function stateChangedPointer() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById(objDiv).innerHTML=xmlHttp.responseText 
 } 
}


function ShowPromotionCode(pagename,user_name,series_name)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;  //"getsubcategory.php"
url=url+"?user_name="+user_name
url=url+"&series_name="+series_name
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedPromotion
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedPromotion() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById("optBinseries").innerHTML=xmlHttp.responseText 
 } 
}


function ShowDiamonddetail(pagename,fromprice,toprice,fromcarat,tocarat,fromcut,tocut,fromcolor,tocolor,fromclarity,toclarity,visibledepth,visibletable,visiblefluorescene,visibleculet)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;  
url=url+"?fromprice="+ fromprice
url=url+"&toprice="+ toprice
url=url+"&fromcarat="+ fromcarat
url=url+"&tocarat="+ tocarat
url=url+"&fromcut="+ fromcut
url=url+"&tocut="+ tocut
url=url+"&fromcolor="+ fromcolor
url=url+"&tocolor="+ tocolor
url=url+"&fromclarity="+ fromclarity
url=url+"&toclarity="+ toclarity
url=url+"&visibledepth="+ visibledepth
url=url+"&visibletable="+ visibletable
url=url+"&visiblefluorescene="+ visiblefluorescene
url=url+"&visibleculet="+ visibleculet
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedDiamondData
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedDiamondData() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById("optDiamondData").innerHTML=xmlHttp.responseText 
 } 
}

function ShowPageNavigation1(pagename,fromprice,toprice,fromcarat,tocarat,fromcut,tocut,fromcolor,tocolor,fromclarity,toclarity,visibledepth,visibletable,visiblefluorescene,visibleculet,currentpage,sortby)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;  
url=url+"?fromprice="+ fromprice
url=url+"&toprice="+ toprice
url=url+"&fromcarat="+ fromcarat
url=url+"&tocarat="+ tocarat
url=url+"&fromcut="+ fromcut
url=url+"&tocut="+ tocut
url=url+"&fromcolor="+ fromcolor
url=url+"&tocolor="+ tocolor
url=url+"&fromclarity="+ fromclarity
url=url+"&toclarity="+ toclarity
url=url+"&visibledepth="+ visibledepth
url=url+"&visibletable="+ visibletable
url=url+"&visiblefluorescene="+ visiblefluorescene
url=url+"&visibleculet="+ visibleculet
url=url+"&currentpage="+ currentpage
url=url+"&sortby="+ sortby
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedDiamondData
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function ShowPageNavigation2(pagename,fromprice,toprice,fromcarat,tocarat,fromcut,tocut,fromcolor,tocolor,fromclarity,toclarity,visibledepth,visibletable,visiblefluorescene,visibleculet,currentpage)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename;  
url=url+"?fromprice="+ fromprice
url=url+"&toprice="+ toprice
url=url+"&fromcarat="+ fromcarat
url=url+"&tocarat="+ tocarat
url=url+"&fromcut="+ fromcut
url=url+"&tocut="+ tocut
url=url+"&fromcolor="+ fromcolor
url=url+"&tocolor="+ tocolor
url=url+"&fromclarity="+ fromclarity
url=url+"&toclarity="+ toclarity
url=url+"&visibledepth="+ visibledepth
url=url+"&visibletable="+ visibletable
url=url+"&visiblefluorescene="+ visiblefluorescene
url=url+"&visibleculet="+ visibleculet
url=url+"&currentpage="+ currentpage
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedDiamondData
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function ViewSetting(pagename,categoryid,subcategoryid,rawmaterialid,pointerid)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=pagename; 
url=url+"?category_id="+ categoryid
url=url+"&subcategory_id="+ subcategoryid
url=url+"&rawmaterial_id="+ rawmaterialid
url=url+"&pointer_id="+ pointerid
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateCategoryChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateCategoryChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById("subcategory").innerHTML=xmlHttp.responseText 
 } 
}

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;
}
