function VerificaCampo(Campo, Nome) {
	if (trim(Campo.value)=="") {
		alert("O campo \""+Nome+"\" não pode estar em branco!");
		Campo.value="";
		Campo.focus();
		return false;
	}
	else
		return true;	
}

function VerificaEMail(Campo) {
	if (trim(Campo.value)=="" || Campo.value.indexOf('@', 0) == -1 || Campo.value.indexOf('.', 0) == -1) {
		alert("E-Mail invalido!");
		Campo.focus();
		Campo.select();
		return false;
	}
	else
		return true;
}

function trim(string) {
	var str = string.replace(/^\s*/, "");
	str = str.replace(/\s*$/, "");
	return str;
}


 function checkBrowser(){
  this.ver=navigator.appVersion
  this.dom=document.getElementById?1:0
  this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
  this.ie4=(document.all && !this.dom)?1:0;
  this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
  this.ns4=(document.layers && !this.dom)?1:0;
  this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5)
  return this
 }
 bw=new checkBrowser()
 function hideIt(div){
  if(bw.bw){
   div="divLoadCont"
   obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?document[div]:0; 
   obj.visibility='hidden'
  }
 }
 onload=hideIt;

////////////////////////////////////////////////////
mostra=new Array()
function over(n){
	if(typeof(mostra[n])!="undefined")clearTimeout(mostra[n])
	document.getElementById("d"+n).style.visibility="visible"
}
function out(n){
	mostra[n]=setTimeout('document.getElementById("d'+n+'").style.visibility="hidden"',100)
}


function formatar_mascara(src, mascara) {
	var campo = src.value.length;
	var saida = mascara.substring(0,1);
	var texto = mascara.substring(campo);
	if(texto.substring(0,1) != saida) {
		src.value += texto.substring(0,1);
	}
}


