if (Dominio==null)
	var Dominio = "http://" + location.hostname;btOn = new Image();
btOff = new Image();function ShowHideTarja(p1, p2, p3, p4, p5, p6)
{
	var objConteudo = document.getElementById(p1);
	var objTabela =  document.getElementById(p2);
	var objCor1 =  document.getElementById(p3);
	var objCor2 =  document.getElementById(p4);
	var objTitulo =  document.getElementById(p5);
	var objBotao =  document.getElementById(p6);
	if(objConteudo.style.display == 'none')
	{
		objConteudo.style.display = 'inline';
		objTabela.className ='On';
		if (objTabela.className == 'On') 
		{
			objCor1.className = 'TarjaCor1On';
			objCor2.className = 'TarjaCor2On';
			objTitulo.className = 'TarjaTituloOn';
			objBotao.className = 'TarjabotaoOn';
		}
	}
	else
	{
		objConteudo.style.display = 'none';
		objTabela.className = 'Off';
		if (objTabela.className != 'On') 
		{
			objCor1.className = 'TarjaCor1';
			objCor2.className = 'TarjaCor2';
			objTitulo.className = 'TarjaTitulo';
			objBotao.className = 'Tarjabotao';
		}
	}
}
 
function ShowHideOp(x)	{
	if (document.getElementById(x).style.display == "" || document.getElementById(x).style.display == "inline" )
	{
		eval("document.getElementById('"+ x +"').style.display = 'none'");
		eval("document.getElementById('"+ x +"Mais').style.display = 'inline'");
		eval("document.getElementById('"+ x +"Menos').style.display = 'none'");
	}
	else
	{
		eval("document.getElementById('"+ x +"').style.display = 'inline'");
		eval("document.getElementById('"+ x +"Mais').style.display = 'none'");
		eval("document.getElementById('"+ x +"Menos').style.display = 'inline'");
	}
}function ShowHide2(x) {
	if (document.getElementById(x).style.display == "" || document.getElementById(x).style.display == "inline" )
	{
		eval("document.getElementById('"+ x +"').style.display = 'none'");
		eval("document.getElementById('"+ x +"Mais').style.display = 'inline'");
		eval("document.getElementById('"+ x +"Menos').style.display = 'none'");
	}
	else
	{
		eval("document.getElementById('"+ x +"').style.display = 'inline'");
		eval("document.getElementById('"+ x +"Mais').style.display = 'none'");
		eval("document.getElementById('"+ x +"Menos').style.display = 'inline'");
	}
}function showSubmenu(objLocal, objNumero, objSubAcao){
	var idReal = objLocal;
	if(objLocal.match(/_/))
		idReal = objLocal.split("_")[1];
		
	document.getElementById(objLocal + "_" + objNumero).className = idReal + objSubAcao;
}function gotourl() 
{
	var i, args=gotourl.arguments; document.tv1_returnValue = false;
	for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}function ShowHideVWS(x) {
	if (document.getElementById('tr' + x).style.display == "" || document.getElementById('tr' + x).style.display == "inline" )
	{
		eval("document.getElementById('tr"+ x +"').style.display = 'none'");
		eval("document.getElementById('span"+ x +"').style.fontWeight = 'normal'");
		
	}
	else
	{
		eval("document.getElementById('tr"+ x +"').style.display = 'inline'");
		eval("document.getElementById('span"+ x +"').style.fontWeight = 'bold'");
	}
}function OverMenuTD(x)
{
	var objTD = x;
	if (objTD.className == "item")
		objTD.className = "itemOver";
	else
		objTD.className = "item";
}var menuIntervalo = "";
var menuOver =  "";function fechaMenu(objMenu)
{
    var fechaMenu = "fecharMenu('"+objMenu+"')";
    menuIntervalo = window.setInterval(fechaMenu,1000);
}function fecharMenu(objMenu)
{
    document.getElementById(objMenu).style.display = 'none'
}function ProximoCampo(p_campo, p_campo2)
{
    if (document.getElementById(p_campo))   
    {
	    if(document.getElementById(p_campo).value.length==document.getElementById(p_campo).maxLength)
	        document.getElementById(p_campo2).focus();
    }    
}function OverImagem(x,y)
{ 
	try
	{
		document.getElementById(x).src = eval(y).src;
	}
	catch(e)
	{}
}function AbrirJanela(p_nome, p_url, p_largura, p_altura, p_topo, p_esquerda)
{
	window.open(p_url, p_nome, 'width=' + p_largura + ', height=' + p_altura + ', top=' + p_topo +',left=' + p_esquerda + '');
}function Abre360(p_carro)
{
	AbrirJanela('360_'+ p_carro, Dominio + '/360/' + p_carro, 550, 475, '50%', '50%');
}function ZoomDestaqueModelo()
{
	document.getElementById('divDestaqueZoom').style.visibility = 'hidden';
}function SomenteNumero(e)
{
	var key = window.event ? e.keyCode : e.which;
	var keychar = String.fromCharCode(key);
	reg = /\d/;
	return (reg.test(keychar));
}function LimpaCampoSelecao(p_campo)
{
	campo = document.getElementById(p_campo);
	campo.length = 0;
	campo.options[0] = new Option ("Selecione","");
}function MudaImagem(x,y)
{
	document.images[x].src = eval(y).src;
}function BuscaCampo(p_campo, p_campoDestino, p_modulo, p_AjaxNamespace)
{
	if (eval(p_AjaxNamespace))
	{
		campo = document.getElementById(p_campo);
		campoDestino = document.getElementById(p_campoDestino);
		//if (!isNaN(campo.value))
		if (campo)
		{
			if (campo.value!="")
			{
				campo.disabled = true;
				campoDestino.disabled = true;
				campoDestino.length = 0;
				campoDestino.options[0] = new Option ("Carregando ...","");
				
				if (p_modulo=="Cidade")
					eval(p_AjaxNamespace).AjCidades(campo.value, Retorno);
				
				if (p_modulo=="Modelo")
					eval(p_AjaxNamespace).AjModelos(campo.value, Retorno);
			}
			else
			{
				campoDestino.length = 0;
				campoDestino.options[0] = new Option ("Selecione","");
			}
		}
	}
}
//recebe o resultado da busca e http://pop.la o dropdowlist
function Retorno(res)
{
	var obj = res.value;
	
	if (obj != null && obj.Rows.length > 0) 
	{
		campoDestino.length = 0;
		for (var i = 0; i < obj.Rows.length; i++)
		{
			if (i==0)
				campoDestino.options[i] = new Option ("Selecione","");
			
			campoDestino.options[i+1] = new Option (obj.Rows[i].Nome,obj.Rows[i].idConteudo);
			if (obj.Rows[i].idConteudo == idConteudo)
				campoDestino.options[i+1].selected = true;
		}
	}
	else
		campoDestino.length = 0;
		campoDestino.options[0] = new Option ("Selecione","");
			
	campoDestino.disabled = false;
	campo.disabled = false;
	
	if (idConteudo==null || idConteudo=="")
		campoDestino.options[0].selected = true;	
}//***************************************//INICIO PONTTO SERVIÇOS//***************************************//
function abreMenu(elemento){
var arg = abreMenu.arguments.length;
  for (a=0;a<arg;a++){
    document.getElementById(abreMenu.arguments[a]).style.display="block";
  }};function fechaMenu(elemento){
var arg = fechaMenu.arguments.length;
  for (a=0;a<arg;a++){
    document.getElementById(fechaMenu.arguments[a]).style.display="none";
  }};function muda(elemento,bgcolor,color){
elemento.style.background=bgcolor;
elemento.style.color=color;
};