oldObj = "";
oldValor = "";
inteiro = new RegExp("[0-9]");
decimal = new RegExp("[\,]");
arroba = new RegExp("[@]");
ponto = new RegExp("[\.]");
hexa = new RegExp("[0-9a-fA-F]");
minutos = new RegExp("\:");
semCaracterEspeciais = new RegExp("[\"!@#$%&*{}^~´`?/><()=+;?,.\\|]");
function whois(){ //function consulta de dominio
		var domain = document.all.domain.value;
	$(document).ready(function(){
		$('.whois').attr('href','whois.php?domain='+domain).colorbox({iframe:true, innerWidth:450, innerHeight:200});
		});
	}
function news(){ //function consulta de dominio
		var newsletters = document.all.news.value;
	$(document).ready(function(){
		$('.news').attr('href','modulos/ad_email.php?email='+newsletters).colorbox({iframe:true, innerWidth:450, innerHeight:200});
		});
	}
function boletos(){ //function consulta de dominio
		var cliente = document.all.bcliente.value;
		var fatura = document.all.bfatura.value;
		var datav = document.all.bvenc.value;
	$(document).ready(function(){
		$('.boletos').attr('href','boleto.php?cliente='+cliente+'&fatura='+fatura+'&datav='+datav).colorbox({iframe:true, innerWidth:450, innerHeight:200});
		});
}
function central(){ //function portal cliente
	$(document).ready(function(){
		$('.central').attr('href','central/logon.php').colorbox({iframe:true, innerWidth:450, innerHeight:200});
		});
}
function recuperar(){ //function portal cliente
	$(document).ready(function(){
		$('.recuperar').attr('href','central/recuperar.php').colorbox({iframe:true, innerWidth:450, innerHeight:200});
		});
}
function format_date(obj)
	{
	  valor = obj.value;
	  if(valor != oldValor || oldObj != obj){
		for(i=0;i<valor.length;i++){
		  if(!inteiro.test(valor.charAt(i))){
			valor = valor.substring(0,i) + valor.substring(i+1,valor.length);
			i = -1;
		  }
		}
		if(valor.length < 1){
		  valor = "";
		}else if(valor.length > 2 && valor.length < 4){
		  valor = valor.substring(0,2) + "/" + valor.substring(2,valor.length);
		}else if(valor.length > 2 && valor.length < 5){
		  valor = valor.substring(0,2) + "/" + valor.substring(2,4) + "/" + valor.substring(4,valor.length);
		}else if(valor.length > 4){
		  valor = valor.substring(0,2) + "/" + valor.substring(2,4) + "/" + valor.substring(4,8);
		}
		obj.value = valor;
		oldValor = valor;
		oldObj = obj;
	  }
	}
function checkNum(obj){
	valor = obj.value;
	  if(valor != oldValor || oldObj != obj){
		for(i=0;i<valor.length;i++){
		  if(!inteiro.test(valor.charAt(i))){
			valor = valor.substring(0,i) + valor.substring(i+1,valor.length);
			i = -1;
		  }
		}
		obj.value = valor;
		oldValor = valor;
		oldObj = obj;
}
}
