// efeitos

window.addEvent("domready",function(){

	divtexto0=$("texto0").getSize().size.y
	divimg0=$("farhart").getSize().size.y
	
	tam=40;
	conta0=divimg0-tam;
	
	if (divimg0 > divtexto0){
		$("texto0").setStyle("height", conta0);
	}
	//altura2=window.getHeight()
	//largura=$("corpo").getSize().size.x
	//largura=193
	//largura2=window.getWidth()
	
	
	//conta=altura2-altura;
	//conta=conta/2;
	//conta=conta+300;
	//conta=conta.toInt();
	//alert(conta)
	
	//conta2=largura2-largura;
	//conta2=conta2/2;
	//conta2=conta2.toInt();
	//alert(conta2)
	
//	if(altura2 > altura){
	//	$("corpo").setStyle("top", "100px");
//		$("corpo").setStyle("left", conta+"px");
//	}
})


function informativo(){
	if (document.frm_informativo.txt_mail.value.indexOf("@")==-1 || document.frm_informativo.txt_mail.value.indexOf('.')==-1) {
		alert ("Preencha o campo E-MAIL corretamente!");
		document.frm_informativo.txt_mail .focus();
		return false;
	}
return true;
}

function contato(){
	if (document.frm_contato.txt_nome.value.length < 4){
		alert ("Preencha o campo NOME corretamente!");
		document.frm_contato.txt_nome.focus();
		return false;
	}
	if (document.frm_contato.txt_mail.value.indexOf("@")==-1 || document.frm_contato.txt_mail.value.indexOf('.')==-1) {
		alert ("Preencha o campo E-MAIL corretamente!");
		document.frm_contato.txt_mail .focus();
		return false;
	}
	if (document.frm_contato.txt_telefone.value.length < 14){
		alert ("Preencha o campo TELEFONE!");
		document.frm_contato.txt_telefone.focus();
		return false;
		
	}	if (document.frm_contato.txt_msg.value.length < 4){
		alert ("Preencha o campo MENSAGEM!");
		document.frm_contato.txt_msg.focus();
		return false;
	}
return true;
}

function mascara(o,f){
    v_obj=o
    v_fun=f
    setTimeout("execmascara()",1)
}

function execmascara(){
    v_obj.value=v_fun(v_obj.value)
}



function telefone(v){
    v=v.replace(/\D/g,"")                 //Remove tudo o que não é dígito
    v=v.replace(/^(\d\d)(\d)/g,"($1) $2") //Coloca parênteses em volta dos dois primeiros dígitos
    v=v.replace(/(\d{4})(\d)/,"$1-$2")    //Coloca hífen entre o quarto e o quinto dígitos
    return v
}

function blockError()
{
	return true;
}
window.onerror = blockError;

