function janela(URL){
window.open(URL,"Investbem","width=120,height=300,scrollbars=NO")
}
/*
função exibe cidades
*/

var xmlHttp

/* Essa funo manda a ID selecionada do combo de estados para a pgina que ir filtrar as cidades */
function PreencheCombo(cod,url,campo,mostra)
{
xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Este browser no suporta HTTP Request")
		return
	}
	url=url+".php?"+campo+"="+cod // recebe o ID do estado para filtrar as cidade
	url=url+"&sidjs="+Math.random()
	if (mostra=="exibe_cidade")
	{
		xmlHttp.onreadystatechange=cidades
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)	
	}
	else if (mostra=="exibe_cidade2")
	{
		xmlHttp.onreadystatechange=cidades2
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)	
	}

}

/* Essa funo ir exibir o resultado na DIV */
function cidades()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("exibe_cidade").innerHTML=xmlHttp.responseText
	}
}
/* Essa funo ir exibir o resultado na DIV */
function cidades2()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("exibe_cidade2").innerHTML=xmlHttp.responseText
	}
}

function bairro()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("exibe_bairro").innerHTML=xmlHttp.responseText
	}
}

/* Instancia */
function GetXmlHttpObject()
{
var objXMLHttp=null

	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
return objXMLHttp
}
