function renderNavMenu() {
   $("#navmenu a").mouseover(function()   { $(this).addClass("on");    });
   $("#navmenu a").mouseout(function()    { $(this).removeClass("on"); });
   /*
   $(".menu_lev2 a").mouseover(function() { $(this).addClass("on");    });
   $(".menu_lev2 a").mouseout(function()  { $(this).removeClass("on"); });
   */
}

function renderScrollableLayers(parentObj) {
   $(parentObj+" .scroll-pane").jScrollPane({
      scrollbarWidth:7, 
      scrollbarMargin:0,
      dragMinHeight:50,
      dragMaxHeight:50,
      dragMaxWidth:25,
      showArrows:false,
      arrowSize: 3
   });
}

$(document).ready(function() {
   renderNavMenu();
   $('img[@src$=.png]').ifixpng();
   $('.png').ifixpng();
   if (!$.browser.opera) { renderScrollableLayers(""); }
});

window.onload = function() {
   if ($.browser.opera) { renderScrollableLayers(""); }
}

window.onresize = function() {
   if ($.browser.msie) { document.location.href=document.location.href; }
}

$(document).ready(function(){
    
    var currentIndex = 0;
    var visibileImages = 3;
    var howmanyImages = $("#menu_premi .link_premio").length;
     
    // prev button
    $("#left").click(function(){
      if (currentIndex > 0) {
         currentIndex -= 1;
         $("#menu_premi .link_premio").animate({"left": "+=118px"}, "normal");
      }
    });

    // next button
    $("#right").click(function(){
      if (currentIndex < howmanyImages - visibileImages) {
         currentIndex += 1;
         $("#menu_premi .link_premio").animate({"left": "-=118px"}, "normal");
      }
    });
    
});
