naw=navigator.appName;
naw2=navigator.userAgent;
naw3=navigator.platform
explorer9=false;
explorer10=false;
mozilla=false;


if (naw.indexOf("Netscape")!=-1) {mozilla=true;}
if (naw.indexOf("Explorer")!=-1 && naw2.indexOf("Opera")==-1) {
    explorer=true;
	if (naw2.indexOf("MSIE 9.0")!=-1) explorer9=true;
	if (naw2.indexOf("MSIE 10.0")!=-1) explorer10=true;
}

if (explorer9||explorer10||mozilla) {
     document.writeln('<style type="text/css"><!--\n#top .age_category ul li a span.small { display: inline-block;margin-left: -1px;margin-right: -1px;}\n--></style>')
}
     
          
function esurf_getGrenNameFromImgSrc(imgDOMEl) {
          if (typeof(imgDOMEl.srcNormalFullPath)=="undefined") imgDOMEl.srcNormalFullPath=imgDOMEl.src
          if (typeof(imgDOMEl.srcHoverPath)=="undefined") imgDOMEl.srcHoverPath=imgDOMEl.src.substring(0, imgDOMEl.src.lastIndexOf("/")+1)    
          if (typeof(imgDOMEl.srcHoverName)=="undefined") imgDOMEl.srcName=imgDOMEl.src.substring(imgDOMEl.src.lastIndexOf("/")+1, imgDOMEl.src.length)    
          
          newFileName=imgDOMEl.srcHoverPath+"hover/"+imgDOMEl.srcName;
          return newFileName;
}          
          
$(document).ready(function () {

  
  $("#content_left ul ul:first li").hover(function () {
        $(this).addClass("hover");
        // Gdyby po najeżdżaniu miało się zapalać na zielono to ikonki w poniższym kodzie pozamieniają się tak ODKOMENTUJ
        //$(this).find("img").get(0).src=esurf_getGrenNameFromImgSrc($(this).find("img").get(0));
  }, function () {
        $(this).removeClass("hover");
        // Gdyby po najeżdżaniu miało się zapalać na zielono to ikonki w poniższym kodzie pozamieniają się tak ODKOMENTUJ
        //$(this).find("img").get(0).src=$(this).find("img").get(0).srcNormalFullPath;
  })      

  $("#content_left ul ul:first li.active").find("img").each(function(index, element) {
          element.src=esurf_getGrenNameFromImgSrc(element);
  })

  
  if ($(".sliderAnyth").length > 0) {
	  $(".sliderAnyth").anythingSlider({
	      autoPlay		: true,
	      startStopped    : false, // If autoPlay is on, this can force it to start stopped
	      buildStartStop      : false,           
	      width           : 706,   
	      height			: 228,
	      delay           : 5000,
	      buildArrows         : true,
	      animationTime   : 1200, 
	      // toggleControls  : true, // if true, then slide in controls on hover and slider change, hide @ other times	
	      onSlideComplete : function(slider){
	          //alert("Welcome to Slide #" + slider.currentPage);
	      }
	  });	    
	
	  $(".sliderAnyth").anythingSlider(1);
  
	  $(".sliderAnyth").data('AnythingSlider').startStop(true)
  }

});          

                         
$('.age_category').ready(function() {   
        
    $('.age_category').find("ul").css({position: "relative", overflow : "hidden"})        
    $('.age_category ul li').append("<div class='left_verticaller_a' style='width: 2px;height: 38px;position: absolute;top: 0;left: -1px;background: url(\"images2/age_left_red_verticaller.jpg\");display: none;overflow: hidden;'></div>");

    $('.age_category ul li').css({position: "relative", "background-image": "url('images2/age_left.jpg')"}).first().css("background-position", "top left").append("<div class='left_verticaller_b' style='width: 2px;height: 38px;position: absolute;top: 0;right: -1px;background: url(\"images2/age_left_verticaller.jpg\");display: block;overflow: hidden;'></div>");;
    $('.age_category ul li').last().css({"background": "url('images2/age_left_last.jpg') top right no-repeat"});

    
    $.turnRed=function (element) {

         $(element).css({
             background: "url('images2/age_left_red.jpg') top "+($(element).hasClass("left")?"left":"right")+" repeat-x"
         })
                  
         if ($(element).hasClass('right')) $(element).css({"background": "url('images2/age_left_red_last.jpg') top right no-repeat"});
         if (($(element).hasClass("left"))) {$(element).find(".left_verticaller_a").css("left", "-10000px")};
         
         $(element).find(".left_verticaller_a").css("display", "block");
        

    }
    
    $('.age_category ul li').each(function() {

            
                if ($(this).hasClass("activ")) {
                           
                    $.turnRed(this);
                    
                    
                } else {
            
                    $(this).hover(
                            function () {
                                
                                 $.turnRed(this);     
                               
                            }, function () {
                                $(this).css({
                                            background: "url('images2/age_left.jpg') top "+($(this).hasClass("left")?"left":"right")+" repeat-x"
                                })
                                
                               if ($(this).hasClass('right')) $(this).css({"background": "url('images2/age_left_last.jpg') top right no-repeat"});
                                
                                
                                $(this).find(".left_verticaller_a").css("display", "none");
                                
                            }
                    )  
                
                }
                

    });
    
});


