
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}

   
      $.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('.furtiger', {fontFamily: 'Frutiger CE Roman'}); 
         Cufon.replace('.furtiger_bold', {fontFamily: 'Frutiger CE Bold'});  
         Cufon.replace('#logo_text', {fontFamily: 'Frutiger CE Light'});
         Cufon.replace('#dodavatel,#investor,#media', {fontFamily: 'Frutiger CE Light'});
         Cufon.replace('#main_menu .menu_item', {fontFamily: 'Frutiger CE Roman'});
         Cufon.replace('#main_menu .menu_item.active', {fontFamily: 'Frutiger CE Bold'});
         Cufon.replace('.pro', {fontFamily: 'Frutiger CE Bold'});
         Cufon.replace('h2.furtiger, h3.furtiger', {fontFamily: 'Frutiger CE Roman'});
         Cufon.replace('h2.furtiger_light, h3.furtiger_light', {fontFamily: 'Frutiger CE Light'}); 
         Cufon.replace('#map_button', {fontFamily: 'Frutiger CE Roman'});
         Cufon.replace('.date.furtiger', {fontFamily: 'Frutiger CE Light'});
         
         jQuery('.lightbox').colorbox({maxWidth:800, close:'Zavřít', opacity:0.5, current: '{current} z {total}'});
         
          $(".kontakty .mapa .popup").mouseover(function() {
             $(this).children(".popup_content").stop(true, true).animate({opacity: "show", top: "-194"}, "slow");
          });
          
          $(".kontakty .mapa .popup").mouseout(function() {
            $(this).children(".popup_content").wait(100).animate({opacity: "hide", top: "-214"}, "fast");
          });
          
          $(".contact .mapa .popup").mouseover(function() {
             $(this).children(".popup_content").stop(true, true).animate({opacity: "show", top: "-194"}, "slow");
          });
          
          $(".contact .mapa .popup").mouseout(function() {
            $(this).children(".popup_content").wait(100).animate({opacity: "hide", top: "-214"}, "fast");
          });
                                            
          $('#left_col_imgs').cycle({
      		  fx: 'fade',
      		  timeout:5000
          });
          
          $('#banner_items').cycle({
      		  fx: 'fade',
      		  timeout:5000,
      		  pager: '#square_nav'
          });

         
      });

