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 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;
}
}
function launchColorBox(url){
		$.colorbox({href:url,width:"800", height:"475",iframe:true});
		
}
function ajaximagem(uid,idg){ //function ajax de consulta de dominio
var Imagem;
try {
	// Firefox, Opera 8.0+, Safari
Imagem=new XMLHttpRequest();
} catch (e) {
// Internet Explorer
try {
Imagem=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e){
try {
Imagem=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("Seu navegador não suporta AJAX!");
return false;
}
}
}
Imagem.onreadystatechange=function() {
if(Imagem.readyState==4) {
//document.myForm.time.value=Imagem.responseText;
document.getElementById("visualiza").innerHTML=Imagem.responseText;
}else{
// é mostrado enquanto a função é executada
document.getElementById("visualiza").innerHTML='<img src="img/loadingAnimation.gif">';
}
}
var url = "modulos/imagem.php";
url=url+"?id_imagem="+uid;
url=url+"&id_galeria="+idg;
url=url+"&sid="+Math.random();
Imagem.open("GET",url,true);
Imagem.send(null);
}
function mural(){ //function portal cliente
	$(document).ready(function(){
		$('.mural').attr('href','mural.php').colorbox({iframe:true, innerWidth:550, innerHeight:460});
		});
}
function reserva(){ //function portal cliente
	$(document).ready(function(){
		$('.reserva').attr('href','reserva.php').colorbox({iframe:true, innerWidth:320, innerHeight:250});
		});
}
function disableRightClick(e)
{
 
  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers) 
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      return false;
    }
  }
  else
  {
    return false;
  }
}
disableRightClick();
