function displaynone() {
	document.getElementById('pop').style.display='none';
}
$(document).ready(function(){
						   
	$("body").append('<div id="dialog"></div>');
	$("#dialog").append('Carregando').css("display","none").attr("className","jqmWindow");
	//$.jqm.params.modal = true;
	$('.jqModal').attr('href', '#');
	$("#dialog").jqm(
		{
			onShow : function(hash){hash.w.fadeIn("normal");},
			onHide : function(hash){hash.w.fadeOut("fast");hash.o.fadeOut("normal");},
			ajax : '@rel',
			trigger : '.jqModal'
		}
		);

	 /* Configura o LightBox */
	 $('a.box').lightBox({
	 	imageLoading:  'imagens/lightbox/loading.gif',
		imageBtnClose: 'imagens/lightbox/close.gif',
		imageBtnPrev:  'imagens/lightbox/prev.gif',
		imageBtnNext:  'imagens/lightbox/next.gif'
	 });
	 
	/* Configura as mascaras */
	 $('.cnpj').mask('99.999.999/9999-99');
	 $('.cpf').mask('999.999.999-99');
	 $('.celular').mask('(99)9999-9999');
	 $('.telefone').mask('(99)9999-9999');
	 $('.dtnascimento').mask('99/99/9999');
	 
	/* Configuração de selects */
	 
	 $("select#galerias").change(function(){
	 	$("select#galerias option:selected").each(function(){
	 		window.location = '?pagina=galerias&galid='+$(this).val();
	 	});
	 });
 
 	/* Configuração dos thumb da galeria */
	$(".galthumb").click(function(){
		endereco = $(this).attr('href');
		$('.galfoto').attr('src',endereco).fadeIn('2000');	
		return false;		
	});
	
	/* Configuração validação do formulario */
	
	$('#validaForm').validate({
		errorLabelContainer: $("#validaForm div.erros"),
		rules:{
			insc_email:{
				email: true
			}
		}
	});
	
	/* Configuração do Botão do Filtro */
	
	$('#click').click(function(){
		$('#filtro_').slideToggle('slow');
		
	});
	// */
	$('#filtro form').submit(function(){
		$('#filtro_').slideUp('fast');
		
	});

	/*  Post It */
	
	//Fecha a Janela	
	$('#close a').click(function(){
		$('#postit').fadeOut('slow');
		return false;
	});
	
	/* jQModal */
	
	var showModal = function(hash){
		$(hash.w).fadeIn('2000').show();
	}
	
	var hideModal = function(hash) { 
		$(hash.w).fadeOut('2000',function(){ hash.o.remove(); });
	}
	
	$('#show').jqm({
		ajax:		'@href',
		trigger: 	'#recados a',
		onShow: 	showModal,
		onHide: 	hideModal
	});
	
});
