 
       $(document).ready(function(){
    
$(document).pngFix();

$(".slogan").hide();
//$(".slogan").show();
$(".slogan").fadeIn(4000);

$(".news_data").corner("3px");
$(".gallery_box_top").corner("5px");





        
        $(".more").tooltip({
          top: -25,
          left: 30,
          fade: 650, 
          showBody: " - ",
          showURL: false,
          track: true
          });
        $(".icon_link").tooltip({
          top: -25,
          left: 30,
          fade: 250,
          showBody: " - ",
          showURL: false,
          track: true
          });
        $(".footer_link").tooltip({
          top: -25,
          left: 30,
          fade: 250,
          showBody: " - ",
          showURL: false,
          track: true
          });
        $(".spi_link").tooltip({
          top: -25,
          left: 30,
          fade: 650, 
          showBody: " - ",
          showURL: false,
          track: true
          });
        



//$('#flash').cycle({ 
//    fx:      'custom',
//    speedIn:  2500, 
//    speedOut: 2500,
//    cssBefore: {  
//        left: 322,  
//        top:  93,  
//        width: 0,  
//        height: 0,  
//        opacity: 1, 
//        zIndex: 1 
//    }, 
//    animOut: {  
//        opacity: 0  
//    }, 
//    animIn: {  
//        left: 0,  
//        top: 0,  
//        width: 644,  
//        height: 196  
//    }, 
//    cssAfter: {  
//        zIndex: 0 
//    }, 
//    delay: 5000 
//});

$('#flash').cycle({ 
    fx:    'fade', 
    speed:  1000,
    timeout:  8000
 });
$('.sprite').cycle({ 
    fx:    'fade', 
    speed:  1000,
    //random:   1,
    timeout:  5000
 });

////==============FOTO POPUP================      


//centering popup  
   function centerPopup(){  
   //request data for centering  
   var windowWidth = document.documentElement.clientWidth;  
   var windowHeight = document.documentElement.clientHeight;  
   var popupHeight = $(".popup").height();  
   var popupWidth = $(".popup").width();  
   //centering  
   $(".popup").css({  
  "position": "absolute",  
  //"top": windowHeight/2-popupHeight/2,  
  "left": windowWidth/2-popupWidth/2  
  });  
  //only need force for IE6
  /*$(".popup_background").css({  
  "height": windowHeight,
  "width": windowWidth
  });  */
  }  


   $(".open_popup").click(function(e){
    e.preventDefault();
    centerPopup();
    $(".popup_background").css({"opacity": "0.3"});
    
   $(".popup_background").fadeIn("slow");
   $(".popup_foto").load($(this).attr('rel'));
   $(".popup").fadeIn("slow");
   //$(".popup_foto").load(this.href);
   
    });
   
   //zamyka po kliknieciu na popup
   $(".popup").click(function(){
    $(".popup_background").fadeOut("slow");  
   $(".popup").fadeOut("slow");
   

});
   
   //zamyka po kliknieciu na background
   $(".popup_background").click(function(){
    $(".popup_background").fadeOut("slow");  
   $(".popup").fadeOut("slow");
});
   
   //zamyka po nacisnieciu escape
   $(document).keypress(function(e){  
   if(e.keyCode==27){  
   $(".popup_background").fadeOut("slow");  
   $(".popup").fadeOut("slow"); 
   }  
   });
   
   
   
   
   }); // koniec dokument ready
          
