// JavaScript Document
function mostrar() { 
   $("#pop").fadeIn('slow'); 
} //checkHover

function cerrar() { 
   	  $("#pop").fadeOut('slow'); 
   }

$(document).ready(function (){  	
   
   //Conseguir valores de la img 
   var img_w = $("#pop").width();// + 10; 
   var img_h = $("#pop").height();// + 28; 
    
   //Darle el alto y ancho 
   $("#pop").css('width', img_w + 'px'); 
   $("#pop").css('height', img_h + 'px'); 
    
   //Esconder el popup 
   $("#pop").hide();
    //Consigue valores de la ventana del navegador 
   var w = $(this).width(); 
   var h = 600;//$(this).height(); 
    
   //Centra el popup    
   var pos_w = (w/2);
   var pimg_w = (img_w/2); 
   var pos_h = (h/2);
   var pimg_h = (img_h/2); 
   
   var pos_width = (pos_w - pimg_w);
   var pos_height = (pos_h - pimg_h);
   
   $("#pop").css("left",pos_width + "px"); 
   //$("#pop").css("top",pos_height + "px");
   // temporizador, para que no aparezca de golpe 
   setTimeout("mostrar()",300);
   
    //Función para cerrar el popup 
   $("#pop").click(function (){ 
      $(this).fadeOut('slow'); 
   });
   
   setTimeout("cerrar()",8000);
   
});