/*function mostrar() { 
   $("#pop").fadeIn('slow'); 
} //checkHover

$(document).ready(function (){
//Conseguir valores de la img 
   var img_w = $("#pop img").width() + 10; 
   var img_h = $("#pop img").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 = $(this).height(); 
    
   //Centra el popup    
   w = (w/2) - (img_w/2); 
   h = (h/2) - (img_h/2); 
   $("#pop").css("left",w + "px"); 
   $("#pop").css("top",h + "px");
   
   //temporizador, para que no aparezca de golpe 
   setTimeout("mostrar()",1500);
   //mostrar();
   
   //Función para cerrar el popup 
   $("#pop").click(function (){ 
      $(this).fadeOut('slow'); 
   });
});*/

$(document).ready(function(){
    pop=$("div#pop-up");
    if($('#abrirPopup').length==0)abrir();

    $('body').click(function() {
        cerrar();
    });
    
    $("#fondo_popup").click(function() {
        cerrar();
    });
    
    // recuperamos el alto del documento
   //var altoDocumento = $(document).height();
 
   // Agregamos la capa al final del body
   //$("body").append("<div id='div-overlay'></div>");
 
   // Aplicamos el alto del documento a nuestra capa y algunos css
//   $("#fondo_popup")
//      .height(altoDocumento)
//      .css({
//         'opacity' : 0.6,
//         'width': '100%',
//         'background-color': '#000000',
//         'position': 'absolute',
//         'top': 0,
//         'left': 0,
//         'z-index': 99
//      });

//funciones abrir cerrar
function abrir()
{
    //pop.stop().css('display','block').animate({'left':'24%','opacity':1} ,0);
}

function cerrar()
{ 
    pop.stop().animate({'left':'-30%','opacity':0},900,function(){pop.css('display','none');});
    //$("#content_popup").css("display","none");
    //$("#content_popup").stop().animate({'left':'-30%','opacity':0},900,function(){pop.css('display','none');});
    $('#fondo_popup').fadeOut('slow', function(){
    });
}

    
    
    //$('#abrirPopup').click(function(e){e.preventDefault();abrir();});
});
