// JavaScript Document
function stringTrim(umaString) {
   stemp = umaString;
   while (stemp.charAt(0)==' ') {
      stemp = stemp.substring(1, stemp.length);
   }
   while (stemp.charAt(stemp.length-1)==' ') {
      stemp = stemp.substring(0, stemp.length-1);
   }
   return stemp;
}

function validaFormCli() {
 	valnome = stringTrim(document.formCli.nome.value);
	valemail = stringTrim(document.formCli.email.value);
	document.formCli.nome.value = valnome;
	document.formCli.email.value = valemail;
	flagok = (valnome.length>0) && (valemail.length>0);
    return flagok;
}

function enviaFormCli() {
    if (validaFormCli()) {
	    document.formCli.submit();
			document.formCli.nome.value = "";
			document.formCli.tel.value = "";
			document.formCli.email.value = "";
			document.formCli.mensagem.value = "";
	} else {
	    alert('Erro de validação dos dados. Os campos marcados com * são de preenchimento obrigatório.');
			document.formCli.nome.focus();
	}
}

function ajustuTrem() {

var postop = (getInsideWindowHeight() - 422) / 2;
var posleft = (getInsideWindowWidth() - 780) / 2;
if (postop < 0) { postop = 0; } 
if (posleft < 0) { posleft = 0; } 

//setObjTop('contato',postop+100);
setObjLeft('contato',posleft+467);

//show('contato')

}
