function crosslink(tabela) {
	var tb = document.getElementById(tabela);

	if (tb.style.display == "none" || tb.style.display == "") {
		var box1 = document.getElementById("1");
		var box2 = document.getElementById("2");
		var box3 = document.getElementById("3");
		var box4 = document.getElementById("4");
		var box5 = document.getElementById("5");
		if(box1) box1.style.display = "none";
		if(box2) box2.style.display = "none";
		if(box3) box3.style.display = "none";
		if(box4) box4.style.display = "none";
		if(box5) box5.style.display = "none";
		tb.style.display = "block";
	 }
	 else {
		tb.style.display = "none";
	}
}


function Validar_Orcamento() {
	if (document.form_orcamento.YourName.value=="") {
		alert("O seu nome é obrigatório!");
		document.form_orcamento.YourName.focus();
		return;
	}	
	/*if (document.form_orcamento.empresa.value=="") {
		alert("A sua empresa é obrigatório!");
		document.form_orcamento.empresa.focus();
		return;
	}	*/
	if (document.form_orcamento.YourEmail.value=="") {
		alert("O seu e-mail é obrigatório!");
		document.form_orcamento.YourEmail.focus();
		return;
	}
	else {
		if (!Validar_Email(document.form_orcamento.YourEmail.value)) {
			alert("O seu e-mail é inválido!");
			document.form_orcamento.YourEmail.select();
			return;
		}
	}
	if (document.form_orcamento.YourTel.value=="") {
		alert("O seu telefone com DDD é obrigatório!");
		document.form_orcamento.YourTel.focus();
		return;
	}	
	if (document.form_orcamento.comments.value=="") {
		alert("A mensagem é um campo obrigatório!");
		document.form_orcamento.comments.focus();
		return;
	}
	document.form_orcamento.submit();		
}
function Validar_Email(email)
{
	if(email.length < 6) {
		return false;
	}
	var x = 0;
	for (var c=0;c<email.length;c++) {
		if (email.substring(c,c+1) == '@') {
			x = c;
		}
	}
	var y = 0;
	if (x > 0) {
		for (c=x;c<email.length;c++) {
			if (email.substring(c,c+1)=='.') {
				y = c;
				var valida = 1;
			}
		}
		if (y > 0) {
			var dominio = '';
			for (c=x;c<y;c++) {
				dominio = dominio + email.substring(1,c);
			}
		}
	}
	else {
		return false;
	}					
	if (y <= x+2){
		return false;
	}				
	if (valida == 1){
		return true;
	}
}

