function VerificaDados() {
with (document.dados){
	if (nome.value.length==0) {
		alert("Por favor, digite seu nome.");
		return false;
	}
	if (email.value.length==0) {
		alert("Por favor, digite seu email.");
		return false;
	}
    if (email.value.indexOf('@' , 0) == -1){
		alert("E-mail inválido.");
		return false;		
		}
    if (email.value.indexOf('.' , 0) == -1){
		alert("E-mail inválido.");
		return false;		
		}
   if (email.value.length<5) {
		alert("E-mail inválido.");
		return false;
      }
}
}

function Mascara(formato, objeto)

{
	campo = eval(objeto);
	
	//TELEFONE
	if(formato=='TELEFONE'){
		if(campo.value.length == 0)
			campo.value += "(";
		else if(campo.value.length == 3)
			campo.value += ") ";
		else if(campo.value.length == 9)
			campo.value += ".";
	}
	
	//CEP
	if(formato=='CEP'){
		if(campo.value.length == 5)
			campo.value += ".";
		}
}
function calc(){
	with (document.impresso){
		var a = (aluguel.value).replace(",", ".");
		parseFloat(a);
		
		var i = (irr.value).replace(",", ".");
		parseFloat(i);
	
		var ip = parseFloat(iptu.value);
		var t = (a-i+ip);
		t = (t).toFixed(2);
		total.value = t;
	}
}
//
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//

// painel



function scrollOver(){
	onMouseover="this.scrollAmount=1"
}
function scrollOut(){
	onMouseout="this.scrollAmount=4"
}


function altRowColor() {
  var objTables = document.getElementsByTagName('table');
  var tableQty = objTables.length;
  for(i = 0; i < tableQty; i++) {
    var rowQty = objTables[i].rows.length;
    for(j = 0; j < rowQty; j++) {
      if(j % 2 == 0) {
        objTables[i].rows[j].className = 'odd';
      } else {
        objTables[i].rows[j].className = 'even';
      }
    }
  }
}

function abreguias(link) {
	window.open(link,'guias','width=780,height=400,noresizable,scrollbars=yes');
}

function abrecarimbo(link) {
	window.open(link,'resposta','width=300,height=300,noresizable,scrollbars=no');
}

function abrenews(link) {
	window.open(link,'link','width=640,height=400,noresizable,scrollbars=yes');
}
//
function right(e) {
	var msg = "Site protegido.";
	if (navigator.appName == 'Netscape' && e.which == 3) {
		alert(msg);  
		return false;
	}
	else
		if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
		alert(msg); 
		return false;
	}
	return true;
}
document.onmousedown = right;
// End -->

function mostrar(nome){
	if(nome.style.display=='none'){
		nome.style.display=''}
		else{
			nome.style.display='none'};
}
function sucess(l) {
	window.alert("OBRIGADO\nSeu formulário foi enviado com sucesso em breve entraremos em contato.");
	window.location = 'index2.php?link='+l+'';
}
