function GetXmlHttpObject()
{ 
var objXMLHttp=null

if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}


function pagina(str,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11,str12,str13,str14,str15,str16,str17,str18)
{

xmlHttppg=GetXmlHttpObject()
if (xmlHttppg==null)
{
alert ("Sem suporte a HTTP Request")
return
}

if (str18=='')
{
alert("Defina o cep !");
}

str15=getCheckedValue(str15)
 
var url=str+".php";
url=url+"?rand="+new Date().getTime()+"&uid="+str2+"&cat="+str3+"&departamentox="+str4+"&nomeproduto="+str5+"&subdepartamento="+str6+"&fabricante="+str7+"&n="+str8+"&ord="+str9+"&produtoid="+str10+"&pgant="+str11+"&acao="+str12+"&regid="+str13+"&qtde="+str14+"&formaentrega="+str15+"&pesotot="+str16+"&subtotaltot="+str17+"&cep="+str18+"&"+Math.random();
window.location.hash="topo"; 
xmlHttppg.onreadystatechange=stateChangedpg
xmlHttppg.open("GET",url,true)
xmlHttppg.send(null)
}


function exibirparc(str,str2,str3)
{
xmlHttpprc=GetXmlHttpObject()
if (xmlHttpprc==null)
{
alert ("Sem suporte a HTTP Request")
return
} 
var url="parcelamento.php";
url=url+"?rand="+new Date().getTime()+"&uid="+str+"&forma="+str2+"&produtoid="+str3+"&"+Math.random(); 
xmlHttpprc.onreadystatechange=stateChangedprc
xmlHttpprc.open("GET",url,true)
xmlHttpprc.send(null)
}

function exibirsub(str,str2)
{
xmlHttpsb=GetXmlHttpObject()
if (xmlHttppg==null)
{
alert ("Sem suporte a HTTP Request")
return
} 
var url="exibirsubcategorias.php";
url=url+"?rand="+new Date().getTime()+"&uid="+str+"&cat="+str2+"&"+Math.random(); 
xmlHttpsb.onreadystatechange=stateChangedsb
xmlHttpsb.open("GET",url,true)
xmlHttpsb.send(null)
}

function exibirdepsub(str,str2)
{
xmlHttpsb=GetXmlHttpObject()
if (xmlHttppg==null)
{
alert ("Sem suporte a HTTP Request")
return
} 
var url="exibirdepsub.php";
url=url+"?rand="+new Date().getTime()+"&uid="+str+"&fabricante="+str2+"&"+Math.random(); 
xmlHttpsb.onreadystatechange=stateChangedsb
xmlHttpsb.open("GET",url,true)
xmlHttpsb.send(null)
}

function stateChangedprc() 
{ 
if (xmlHttpprc.readyState==4 || xmlHttpprc.readyState=="complete")
{ 
document.getElementById("parcelamento").innerHTML=xmlHttpprc.responseText 
} 
else
{
document.getElementById("parcelamento").innerHTML='<img src="imagens/loading.gif" border=0>';
}
}

function stateChangedclf() 
{ 
if (xmlHttpclf.readyState==4 || xmlHttpclf.readyState=="complete")
{ 
document.getElementById("exibirpg").innerHTML=xmlHttpclf.responseText 
} 
else
{
document.getElementById("exibirpg").innerHTML='<img src="imagens/loading.gif" border=0>';
}
}

function stateChangedpg() 
{ 
if (xmlHttppg.readyState==4 || xmlHttppg.readyState=="complete")
{ 
document.getElementById("exibirpg").innerHTML=xmlHttppg.responseText 
} 
else
{
document.getElementById("exibirpg").innerHTML='<img src="imagens/loading.gif" border=0>';
}
} 

function stateChangedsb() 
{ 

if (xmlHttpsb.readyState==4 || xmlHttpsb.readyState=="complete")
{ 
document.getElementById("subcategorias").innerHTML=xmlHttpsb.responseText 
} 
else
{
document.getElementById("subcategorias").innerHTML='<img src="imagens/loading.gif" border=0>';
}
} 

