function verificaChecado(){
	if(document.getElementById('mesmo').checked){
		document.getElementById('cidade_e').disabled = true;
		document.getElementById('estado_e').disabled = true;
		//document.getElementById('aba_2').style.display = 'none';
		
	}
	else{
		document.getElementById('cidade_e').disabled = false;
		document.getElementById('estado_e').disabled = false;
		//document.getElementById('aba_2').style.display = '';
	}
}

function verifica_form(param)
{
	if(	param.data_e.value == '')
	{
		alert('Data de devolução inválida.');
		aba(2);
		param.data_e.focus();
		return false;

	}
	
}

function mudaFocoCampo(campo,valor,proximo){
	if(valor.length == 2 || valor.length == 5){
		document.getElementById(campo).value = valor + "/";
	}
} // mudaFocoCampo

function mudaFocoCampoHora(campo,valor,proximo){
	if(valor.length == 2){
		document.getElementById(campo).value = valor + ":";
	}
} // mudaFocoCampoHora

//função para diminuir o tamanho do flash em caso de foto unica

function getPageSize() {
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY){
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else {
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	if(yScroll < windowHeight) pageHeight = windowHeight;
	else pageHeight = yScroll;
	if(xScroll < windowWidth) pageWidth = windowWidth;
	else pageWidth = xScroll;
	arrayPageSize = {pageWidth:pageWidth,pageHeight:pageHeight,windowWidth:windowWidth,windowHeight:windowHeight}
	return arrayPageSize;
}

function select_show(param)
{
	if(navigator.appName == 'Microsoft Internet Explorer')
	{
		for(i=0; i < document.forms.length; i++)
		{
			for(j=0; j < document.forms[i].elements.length; j++)
			{
				if(document.forms[i].elements[j].type == 'select-one')
				{
					if(param == 1) {document.forms[i].elements[j].style.visibility = 'hidden'}
					if(param == 2) {document.forms[i].elements[j].style.visibility = 'visible'}
				}
			}
		}
	}
}

function abrir(caminho)
{
	//pegando altura do body - ie6
	var pageSize = getPageSize();
	document.getElementById('mascara').style.height = (pageSize.pageHeight + 'px');		
	document.getElementById('mascara').style.display 	= '';
	document.getElementById('caixa').style.display 	= '';
	
	select_show(1);

}

function selecionarGrupo()
{
	document.getElementById('mascara').style.display 	= 'none';
	document.getElementById('caixa').style.display 	= 'none';
	
	for (i=0;i<document.formcarros.grupos.length;i++){
		if (document.formcarros.grupos[i].checked)
		{
			document.getElementById('carro').value = document.formcarros.grupos[i].value;
			document.getElementById('mascara').style.display 	= 'none';
			document.getElementById('caixa').style.display 	= 'none';
		}
	}
	
	select_show(2);
}

function fechar()
{
	document.getElementById('mascara').style.display 	= 'none';
	document.getElementById('caixa').style.display 	= 'none';
	select_show(2);
}

function aba(param)
{
	try
	{
		document.getElementById('aba_' + marcado).className = 'aba_nao';
		document.getElementById('aba_cont_' + marcado).style.display = 'none';
	}
	catch(e){}
	
	document.getElementById('aba_' + param).className = 'aba_sim';
	document.getElementById('aba_cont_' + param).style.display = '';
	
	marcado = param;
}