function enviar(b){
$.ajax({
	type: "POST",
	url:"contacto_procesar.php",
	data:$("#njpablo_form").serialize(),
	beforeSend: function(){},
	success: function(response){	   	
	if (response.indexOf('<!0!>')==0){        		   
		b.hideAndUnload();	   		
		new Boxy(response,{
			afterShow: function() {	
			  var self = this; 
			  setTimeout(function() { self.hideAndUnload(); }, 1500); 
			}
		      });	   			   
	}else{
		$("#contacto_error").html(response);
		setTimeout("$('#contacto_error').html('')",1250);   
	}		
   }
 });
}

function cargarGal(cat,id){
$.ajax({
	type: "POST",
	url:"gt.php",
	data:"cat="+cat+"&id="+id,
	beforeSend: function(){},
	success: function(response){	 		
		$("#njpablo-galeria-cuerpo-contenido").fadeOut('slow', function() {							
			$("#njpablo-galeria-foto").html('<div style="padding-left:0px;padding-top:150px;color:#DDDDDD;text-align:center;"><img src="i/cargando.gif"><br/>Aguarde un instante...</div>');
			$("#njpablo-galeria-subfotos").html("");
			$("#njpablo-galeria-cuerpo-contenido").fadeIn('slow', function() {					
				$("#njpablo-galeria-cuerpo-contenido").fadeOut('slow', function() {														
					$("#njpablo-galeria-cuerpo-contenido").html(response);										
					$("#njpablo-galeria-cuerpo-contenido").fadeIn('slow');			
				});										
			});										
		});		
   }
 });
}

function cargarIMG(cat,gal,id){
$.ajax({
	type: "POST",
	url:"gt.php",
	data:"cat="+cat+"&gal="+gal+"&id="+id,
	beforeSend: function(){},
	success: function(response){	 				
		$("#njpablo-galeria-foto").fadeOut('slow', function() {		
			$("#njpablo-galeria-foto").html('<div style="padding-left:0px;padding-top:150px;color:#DDDDDD;text-align:center;"><img src="i/cargando.gif"><br/>Aguarde un instante...</div>');
			$("#njpablo-galeria-foto").fadeIn('slow', function(){			
				$("#njpablo-galeria-foto").fadeOut('slow', function(){				
					$("#njpablo-galeria-foto").html(response);
					$("#njpablo-galeria-foto").fadeIn('slow');				
				});			
			});					
		});												
   }
 });
}

