        $(document).ready(function()
        {
        	/*
            $('.jcarousel').jcarousel({ scroll: 1, initCallback: theCarousel, itemVisibleInCallback: nextCallback });
            
            function theCarousel(carousel)
            {
                $("ul.jthumbs li").click(function() {
                  carousel.scroll($.jcarousel.intval($(this).attr('ref')));
	        });
            }          

            function nextCallback(carousel, li, index)
            {
                $('#nav ul a').removeClass("active");
                $("a#item_" + index).addClass("active");
            }
            */

            if($.fn.diapo)
            {
            	$('.pix_diapo').diapo({
	            	loaderOpacity:0.5, 
    	        	piePosition:	'top:5px; right:10px', 
        	    	pieStroke:4, 
            		pieDiameter:20, 
            		fx: 'simpleFade', 
	            	time: '5000'
    	        });
    	    }
            
            $("#nav li").hover(
                function(){ $("ul", this).fadeIn("fast"); }, 
                function() {} 
	    );

	    if (document.all) {
                $("#nav li").hoverClass ("sfHover");
            }
            
            //$('.gameSiegeMaster').nyroModal({bgColor: '#000', width: '800px', height:'500px'});
            
            $(".gameSiegeMaster").click(function () {
                if(pageTracker)pageTracker._trackPageview('/games/play/SiegeMaster');
            });
            $("ul.jthumbs li").each(function(i){
              var cimg = $(this).find("img");
              var isrc = cimg.attr("src");
              $(this).html($("<span/>").css({'background' : 'url(' + isrc + ') no-repeat center top'}));
              $(this).css({'background' : 'url(' + isrc + ') no-repeat center bottom'})
              cimg.remove();
            });

            $("ul.jthumbs li").hover(
                function() {$(this).find("span").stop().fadeTo('normal', 0 , function() {$(this).hide()});}, 
                function() {$(this).find("span").stop().fadeTo('normal', 1).show();
            });

	    $("ul.jthumbs li:first span").corner("round 5px tl bl").parent().corner("round 5px tl bl");
	    $("ul.jthumbs li:last span").corner('round 5px tr br').parent().corner('round 5px tr br');
        });
      
        $.fn.hoverClass = function(c) {
            return this.each(function(){
                $(this).hover( 
                    function() { $(this).addClass(c);  },
                    function() { $(this).removeClass(c); }
                );
            });
        };              

