function FormataCampo(strNMCampo, formato, intOnFocus, nomeForm) {
	
	var strNull = '';
	
	if (intOnFocus == 1) {
		if (window.document.forms[nomeForm].elements[strNMCampo].value + '' == formato) {
			window.document.forms[nomeForm].elements[strNMCampo].value = '';
		}
	}
	
	if (intOnFocus == 0) {
		if (window.document.forms[nomeForm].elements[strNMCampo].value + '' == '') {	
			window.document.forms[nomeForm].elements[strNMCampo].value = formato;
		}
	}
		
}

function montaBody(){

m = screen.availWidth;

if (m == "800") {
document.body.bgColor='#FFFFF';
document.body.style.margin='0px 0px 0px 0px';
document.body.style.overflowX = 'hidden';
document.body.background='images/fnd.jpg';

}
else {
document.body.bgColor='#FFFFF';
document.body.style.margin='0px 0px 0px 0px';
document.body.style.overflowX = 'hidden';
document.body.background='images/fnd.jpg'

}

}

function abrir(URL) {

   var width = 560;
   var height = 397;

   var left = 10;
   var top = 10;

   window.open(URL,'', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}


function valida(form){
	
if (document[form].nome.value == ""){
 document[form].nome.focus();
 alert('Informe o seu nome');
}
else if (document[form].email.value == ""){
 document[form].email.focus();
 alert('Informe o seu e-mail');
}
else if (document[form].email.value.match(/(\w+)@(.+)\.(\w+)$/) == null){
 document[form].email.focus();
 document[form].email.select();
 alert('E-mail inválido');
}
else if (document[form].mensagem.value == ""){
 document[form].mensagem.focus();
 alert('Digite sua mensagem');  
 }  
 else{
   document[form].submit();
 }
}

