$(function(){
  /*
  if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 7 && parseInt(jQuery.browser.version) > 4)
  {
    var ie_lt_7 = true;
  }
  */

  //nahrazky textu v headings za obrazky
  $(".sc_img").each( function()
      {
        $(this).find("h1, h2").html("");
        $(this).find("img").appendTo( $(this).find("h1, h2") ).css("display", "block");                 
      }
   );

  $("body").supersleight({shim: 'x.gif'});
  
  $("#menu a img, #header a img").hover(
    function()
    { 
      if (ie_lt_7)
      {
        if ( $(this).is('img[src=x.gif]') )
        {
          var newfilter = $(this).css('filter');
          newfilter = newfilter.replace(/.png/, "2.png");
          $(this).css('filter', newfilter);
        }
      }
      else
      {
        this.src=(this.src).replace(/.png/, "2.png");
      }
    }, 
    function()
    { 
      if (ie_lt_7)
      {
        if ( $(this).is('img[src=x.gif]') )
        {
          var newfilter = $(this).css('filter');
          newfilter = newfilter.replace(/2.png/, ".png");
          $(this).css('filter', newfilter);
        }      
      }
      else
      {
        this.src=(this.src).replace(/2.png/, ".png");
      }
    }
  );
  if (!ie_lt_7)
  {
    $("#menu li").hover(function(){ $(this).addClass("hover") }, function(){ $(this).removeClass("hover") });
  }
  
  $("a[href^=http://]").not(".local").attr('target', '_blank');
  
  $("#dc-tbl tr").hover(function(){ $(this).addClass("hover") }, function(){ $(this).removeClass("hover") });
  $("ul.minimenu span.falseA").click( function()
      {
        if ( !($(this).hasClass("active")) )
        {
          var newimg = ($(this).attr("id"))+'.jpg';
          $("#pg_elmage img.classimg").attr("src", "pic/classes/"+newimg);
          $("ul.minimenu li.active").removeClass("active");
          $(this).parent().addClass("active");
        }
      }
    );
});

