   
      $.fn.wait = function(time, type) {
        time = time || 2000;
        type = type || "fx";
        return this.queue(type, function() {
            var self = this;
            setTimeout(function() {
                $(self).dequeue();
            }, time);
        });
      };
      
      
$(document).ready(function(){
 
  Cufon.replace('.myriad', { fontFamily: 'Myriad Pro'});
  
  $('.lightbox,.colorbox').colorbox({opacity:'0.6', maxWidth: 900});

  if(!(navigator.userAgent.toLowerCase().indexOf('msie 6') != -1)){
    //$('.corners').corner("keep");
    $('.box.corners .header, .article.corners .header').corner("keep top");
    $('#menu a.active').corner("top");
      
    $('.submenu .body h3:first').corner("top");
    $('.submenu .body h3:last').corner("bottom");  
  }
  
  if(/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) && !(navigator.userAgent.toLowerCase().indexOf('msie 6') != -1) ){
    $('.corners').each(function(){
      $(this).width($(this).width()-2).css('margin-bottom','0px');
      $(this).parent().width($(this).parent().width()-2).css('margin-bottom','20px');
      $(this).corner("round 8px").parent().css('padding', '1px').css('background-color', '#a7d5d7').corner("round 10px")

    });
     $('#menu .corners').parent().css('background-color', 'transparent').css('margin-bottom','0px');
     $('#footer .corners').parent().css('background-color', '#F4FBFB').css('margin-bottom','0px'); 

  }
  else if(!(navigator.userAgent.toLowerCase().indexOf('msie 6') != -1)) {
    $('.corners').corner("keep");

  }
  
  $('.jcalendar_content').jcalendar();
  
  
          $(".kontakt_mapa .pos").mouseover(function() {
             $(this).children(".desc").stop(true, true).animate({opacity: "show", top: "-194"}, "slow");
          });
          
          $(".kontakt_mapa .pos").mouseout(function() {
            $(this).children(".desc").wait(100).animate({opacity: "hide", top: "-214"}, "fast");
          });

  
  $('#slider_content .items').cycle({
      		  fx: 'fade',
      		  timeout:13000,
      		  pager: '#pager'
          });
});
