function mostra_proposta() {	
	if (document.getElementById("tabProposta").style.display == 'none')
	{ document.getElementById("tabProposta").style.display = '';
	  document.getElementById("tabProposta2").style.display = '';
		document.getElementById("tabDetalhes").style.display = 'none';
		document.getElementById("tabRevenda").style.display = 'none';
		document.getElementById("tabIndicar").style.display = 'none';
		document.getElementById("tabIndicar2").style.display = 'none';
		document.getElementById("tabDetalhesVei2").style.display = 'none';
	} else 
	{ document.getElementById("tabProposta").style.display = 'none';
	  document.getElementById("tabProposta2").style.display = 'none';
		document.getElementById("tabDetalhes").style.display = '';
		document.getElementById("tabRevenda").style.display = '';
		document.getElementById("tabDetalhesVei2").style.display = '';
	}	
}

function mostra_indicar() {
	if (document.getElementById("tabIndicar").style.display == 'none') 
	{ document.getElementById("tabIndicar").style.display = '';
	  document.getElementById("tabIndicar2").style.display = '';
		document.getElementById("tabDetalhes").style.display = 'none';
		document.getElementById("tabRevenda").style.display = 'none';
		document.getElementById("tabProposta").style.display = 'none';
		document.getElementById("tabProposta2").style.display = 'none';
		document.getElementById("tabDetalhesVei2").style.display = 'none';
	} else 
	{ document.getElementById("tabIndicar").style.display = 'none';
	  document.getElementById("tabIndicar2").style.display = 'none';
		document.getElementById("tabDetalhes").style.display = '';
		document.getElementById("tabRevenda").style.display = '';
		document.getElementById("tabDetalhesVei2").style.display = '';
	}
}

function marcar(foto,codigo) {
	if (foto.indexOf("b_favoritos_mais.jpg") > 0)
	{ window.document.btnimage.src="figuras/b_favoritos_menos.jpg";	  
	  setcook(codigo,true);
	} else
	{ window.document.btnimage.src="figuras/b_favoritos_mais.jpg";	  
	  setcook(codigo,false);
	}
}

function checar2(codigo)
{ cook = unescape(document.cookie);
  var tmp = cook.split(";"); 
  var total = tmp.length;
  for (i = 0; i < total; i++)
  { if (codigo == tmp[i]) { window.document.btnimage.src="figuras/b_favoritos_menos.jpg"; }
  }
}

function checkincveiculos(form) {
    var erro_string = "";  
    if (form.codplano.options[form.codplano.options.selectedIndex].value == 0)     { erro_string += "Selecione um Plano \n";        }
    if (form.codtipo.options[form.codtipo.options.selectedIndex].value == 0)       { erro_string += "Selecione um Tipo \n";        }
    if (form.codmarca.options[form.codmarca.options.selectedIndex].value == 0)     { erro_string += "Selecione uma Marca \n";      }
    if (form.codmodelo.options[form.codmodelo.options.selectedIndex].value == 0)   { erro_string += "Selecione um Modelo \n";      }
    if (form.codcor.options[form.codcor.options.selectedIndex].value == 0)         { erro_string += "Selecione uma Cor \n";        }
    if (form.codcombu.options[form.codcombu.options.selectedIndex].value == 0)     { erro_string += "Selecione um Combustível \n"; }
    if (form.anofab.options[form.anofab.options.selectedIndex].value == 0)         { erro_string += "Selecione Ano Fabricação \n"; }
    if (form.anomod.options[form.anomod.options.selectedIndex].value == 0)         { erro_string += "Selecione Ano Modelo \n";     }
    if (erro_string == "") { return true; } else { alert(erro_string); return false; }    
}

function check_incveiculos(form) {
    var erro_string = "";      
    if (form.codtipo.options[form.codtipo.options.selectedIndex].value == 0)       { erro_string += "Selecione um Tipo \n";        }
    if (form.codmarca.options[form.codmarca.options.selectedIndex].value == 0)     { erro_string += "Selecione uma Marca \n";      }
    if (form.codmodelo.options[form.codmodelo.options.selectedIndex].value == 0)   { erro_string += "Selecione um Modelo \n";      }
    if (form.codcor.options[form.codcor.options.selectedIndex].value == 0)         { erro_string += "Selecione uma Cor \n";        }
    if (form.codcombu.options[form.codcombu.options.selectedIndex].value == 0)     { erro_string += "Selecione um Combustível \n"; }
    if (form.anofab.options[form.anofab.options.selectedIndex].value == 0)         { erro_string += "Selecione Ano Fabricação \n"; }
    if (form.anomod.options[form.anomod.options.selectedIndex].value == 0)         { erro_string += "Selecione Ano Modelo \n";     }
    if (erro_string == "") { return true; } else { alert(erro_string); return false; }    
}

function check_anuncie(form) {
    var erro_string = "";  
    if (form.codestado.options[form.codestado.options.selectedIndex].value == 0)  { erro_string += "Selecione Estado \n"; }
    if (form.codcidade.options[form.codcidade.options.selectedIndex].value == 0)  { erro_string += "Selecione Cidade \n"; }    
    if (erro_string == "") { return true; } else { alert(erro_string); return false; }    
}
