// JavaScript Document
  
  var img = new Image();
  img.src = URL+"images/bottom-box1-hover.gif";
  var img = new Image();
  img.src = URL+"images/bottom-box2-hover.gif";
  var img = new Image();
  img.src = URL+"images/bottom-box4-hover.gif";
  
 $(document).ready(function(){
      //ovladani input pro nwl
      $('#iNwl').focus(function(){
        if( $(this).val() == 'Váš@e-mail' )
        {
            $(this).val('');
        }
      }).blur(function(){
        if( $(this).val() == '' )
        {
            $(this).val('Váš@e-mail');
        }
      });

      //ovladani input pro search
      $('#iSearch').focus(function(){
        if( $(this).val() == 'Vyhledat' )
        {
            $(this).val('');
        }
      }).blur(function(){
        if( $(this).val() == '' )
        {
            $(this).val('Vyhledat');
        }
      });

      //TOPMENU
      $('.menuItem').hover(
          function(){
              $(this).removeClass('menuItem').addClass('menuItemHover').fadeOut(250).fadeIn(250);;
          },
          function(){
              $(this).removeClass('menuItemHover').addClass('menuItem');
          }
      );

      //TOPMENU A SUBMENU
      var Timer;
      var menuDelay = 0.5;
      $('#menuFirst').mouseover(
          function(){
              $('#menuFirstSubmenu').fadeIn(250);
              clearTimeout(Timer);
          }).mouseout(
          function(){
              Timer = setTimeout("$('#menuFirstSubmenu').fadeOut(500)", menuDelay*1000);
          });
      $('#menuFirstSubmenu').mouseout(
          function(){
              Timer = setTimeout("$('#menuFirstSubmenu').fadeOut(500)", menuDelay*1000);
          }).mouseover(
          function(){
              clearTimeout(Timer);
          });

      //loga + prohlídka
      $('#logo').mouseover(
        function(){
          $(this).fadeTo("fast",0.2, function(){$(this).fadeTo("slow",1)});
        }
      );
      $('#rweLogo').mouseover(
        function(){
          $(this).fadeTo("fast",0.2, function(){$(this).fadeTo("slow",1)});
        }
      );
      $('#prohlidka').mouseover(
        function(){
          $(this).fadeTo("fast",0.2, function(){$(this).fadeTo("slow",1)})
        }
      );
      
      //FOOTER BOXS and LINKS Effects
      $('#box1').hover(
        function(){
          $(this).removeClass('box1_bg').addClass('box1_bg_hover');
        },
        function(){
          $(this).removeClass('box1_bg_hover').addClass('box1_bg');
        }
      );
      $('#box2').hover(
        function(){
          $(this).removeClass('box2_bg').addClass('box2_bg_hover');
        },
        function(){
          $(this).removeClass('box2_bg_hover').addClass('box2_bg');
        }
      );
      $('#box4').hover(
        function(){
          $(this).removeClass('box4_bg').addClass('box4_bg_hover');
        },
        function(){
          $(this).removeClass('box4_bg_hover').addClass('box4_bg');
        }
      );
      $('#box3').hover(
        function(){
          $('#button_nwl').attr('src',URL+'images/button-nwl-hover.gif').fadeOut(100).fadeIn(100);
        },
        function(){
          $('#button_nwl').attr('src',URL+'images/button-nwl.gif').fadeOut(100).fadeIn(100);
        }
      );
      $('#search').hover(
        function(){
          $('#button_search').attr('src',URL+'images/button-search-hover.gif').fadeOut(100).fadeIn(100);
        },
        function(){
          $('#button_search').attr('src',URL+'images/button-search.gif').fadeOut(100).fadeIn(100);
        }
      );
      
      //A href s parametrem rel=nofollow budou odkazovat do nového okna
      $("a[rel*=nofollow]").click(
        function(event){
        	window.open(this.href);
          event.preventDefault();
        }
      );
      $("a[rel*=external]").click(
        function(event){
        	window.open(this.href);
          event.preventDefault();
        }
      );


 });
