// wdmr - web designer marcos rodrigues - http://www.gsc.ppg.br/wdmr/ - abril/2006

function openWin(url,name) {
	popupWin = window.open(url, name, "status=no,menubar=no,scrollbars=yes,toolbar=no,resizable=no,width=518,height=450,top=0,left=0");
}
function dicas(url,name) {
	popupWin = window.open(url, name, "status=no,menubar=no,scrollbars=no,toolbar=no,resizable=no,width=642,height=482,top=0,left=0");
}
function validate() {
	d = document.orcamento;
	if (document.orcamento.Empresa.value.length < 3) {
		alert("Por favor, informe o Nome da Empresa.");
		d.Empresa.focus()
		return false;
	}
	if (document.orcamento.Endereco.value.length < 3) {
		alert("Por favor, informe o Endereço da empresa.");
		d.Endereco.focus()
		return false;
	}
	if (document.orcamento.Cidade.value.length < 3) {
		alert("Por favor, informe o nome da Cidade.");
		d.Cidade.focus()
		return false;
	}
	if (document.orcamento.CEP.value.length < 8) {
		alert("Por favor, informe o CEP.");
		d.CEP.focus()
		return false;
	}
	if (isNaN(d.CEP.value)){
		alert ("O campo " + d.CEP.name + " deve conter apenas números!");
		d.CEP.focus();
		d.CEP.select();
		return false;
	}
	if (document.orcamento.UF.value.length != 2) {
		alert("Por favor, informe a Sigla do Estado.");
		d.UF.focus()
		return false;
	}
/*	if (NaN(d.UF.value)){
		alert ("O campo " + d.UF.name + " deve conter apenas LETRAS!");
		d.UF.focus();
		d.UF.select();
		return false;
	}*/

	if (document.orcamento.Email.value.length < 3) {
		alert("Por favor, informe o seu E-mail.");
		d.Email.focus()
		return false;
	}
	parte1 = d.Email.value.indexOf("@");
	parte2 = d.Email.value.indexOf(".");
	parte3 = d.Email.value.length;
	
	if (!(parte1 >= 2 && parte2 >= 6 && parte3 >= 8)) {
		alert ("O campo " + d.Email.name + " deve conter um endereço eletrônico válido!");
		d.Email.focus();
		d.Email.select();
		return false;
         }
	if (document.orcamento.DDD.value.length != 3) {
		alert("Por favor, informe o DDD com 3 dígitos\nEx.: 011.");
		d.DDD.focus()
		d.DDD.select()
		return false;
	}
	if (isNaN(d.DDD.value)){
		alert ("O campo " + d.DDD.name + " deve conter apenas números!");
		d.DDD.focus();
		d.DDD.select();
		return false;
	}

	if (document.orcamento.Fone.value.length < 7) {
		alert("Por favor, informe o número do Telefone\nou verifique a digitação.");
		d.Fone.focus()
		return false;
	}

	if (isNaN(d.Fone.value)){
		alert ("O campo " + d.Fone.name + " deve conter apenas números!");
		d.Fone.focus();
		d.Fone.select();
		return false;
	}
	if (document.orcamento.Contato.value.length < 3) {
		alert("Por favor, informe o nome para Contato.");
		d.Contato.focus()
		return false;
	}
	return true;
}

IMAGE01 = "img/bullet.gif"  
IMAGE02 = "img/branca.gif"

function imgover(imgname){
     imgname.src = IMAGE01
}

function imgout(imgname){
     imgname.src = IMAGE02
}

function GerarSWF($arquivo,$id,$largura,$altura,$fundo_cor,$exibe_menu,$transOpaco){
    document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=6,0,0,0" width="' + $largura + '" height="' + $altura + '" id="' + $id + '" name="' + $id + '">');
    document.writeln('<param name="movie" value="' + $arquivo + '" />');
    document.writeln('<param name="bgcolor" value="' + $fundo_cor + '" />');
    document.writeln('<param name="menu" value="' + $exibe_menu + '" />');
    document.writeln('<param name="quality" value="high" />');
    document.writeln('<param name="wmode" value="' + $transOpaco + '" />');
    document.writeln('<embed src="' + $arquivo + '" bgcolor="' + $fundo_cor + '" menu="' + $exibe_menu + '" quality="high" id="' + $id + '" width="' + $largura + '" height="' + $altura + '" wmode="' + $transOpaco + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
    document.writeln('</object>');
}

// Para funcionar o menu no IEca

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);