function maskData(obj, obj_vld){
	
	var vlCampo = obj.value;

	var dia = vlCampo.substring(0,2);
	var mes = vlCampo.substring(2,4);
	var ano = vlCampo.substring(4,8);
	var tm = vlCampo.length;
	var data = new Date(); 
	
	if(obj.value!=""){
		if((tm < 10 && tm > 0) || !(vlCampo.charAt(2)=="/" && vlCampo.charAt(5)=="/")){
			
			if (tm == 8){
				if((dia >=0   && dia <= 31) &&
				   (mes >=0   && mes <= 12)){
				    obj_vld.value = true;  
					obj.value = dia+"/"+mes+"/"+ano;
				   	obj.style.color="000000";
				}else{
					obj_vld.value = false;
					obj.style.color="FF0000";
					obj.focus();
				}
			}else{
				obj_vld.value = false;
				obj.style.color="FF0000";
				obj.focus();
			}
		}else{
			obj_vld.value = true;
			obj.style.color="000000";
		}
	}
}
function Verifica_Email(obj,obj_vld) {
 
 	var email = obj.value;
 	
 	if (obj.value!=""){
 		if(!email.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+.[a-zA-Z0-9._-]+)/gi)){
			obj_vld.value = false;
			obj.style.color="FF0000";
			obj.focus();
  		}else{
			obj_vld.value = true;
  			obj.style.color="000000";
  		}
  	}
 }
 
 function isEmpty(text){
   var enter1 = "\n",
       enter2 = "\r",
       espaco = " ",
       tab = "\t";

   if (text == "") return true;

   //A verifica se o caracter selecionada possui valor vahlido
   for (var indice = 0; indice < text.length; indice++){
      if (text.charAt(indice) != espaco && 
         text.charAt(indice) != tab &&
         text.charAt(indice) != enter1 && 
         text.charAt(indice) != enter2 )
         return false;
   }
   return true;
}

function vld_num(obj)
{
	if (isNaN(obj))
	alert('Valor Inválido !!');
return false;
}


function fgc_num(xval,tipo)
{
	vlr      = xval.value;
	vlr_last = vlr.charAt(vlr.length-1);
	vlr_code = vlr.charCodeAt(vlr.length-1);
	if (tipo==1)
	{
		if (isNaN(vlr_last))
			xval.value = vlr.substring(0,vlr.length-1);

	xval.value = xval.value.replace(',','');
	xval.value = xval.value.replace('.','');
	}		
	else
	{
		if (!(isNaN(vlr_last)) && vlr_code != 32)
			xval.value = vlr.substring(0,vlr.length-1);
	}
return false;		
}