$(function() {
	
	
	/* -----------------------------------------------------------------
	Note: The code that exposes the menu by default should go in the
	actual HTML page instead of in here.
	----------------------------------------------------------------- */
	
	
    /* -----------------------------------------------------------------
    Menu (used everywhere)
    ----------------------------------------------------------------- */
    

    $("#menu_button").click(function() {
        
		$("#sub_menu").slideToggle("slow");
        
		$(this).parent().hover(
			
			function(){
				
			},
	        function(){
	            $("#menu_overlay").find("#sub_menu").slideUp('slow');
	        }
		);
    });



    //Fade menu items
    $(".fade").hover(
		function() {
        	$(this).stop().animate({
	            backgroundColor: "#e1e1e1"
	        },
	        1000);
    	},
    	function() {
	        $(this).stop().animate({
	            backgroundColor: "#88888"
	        },
	        500);

	    }
	);

	/* -----------------------------------------------------------------
	
	----------------------------------------------------------------- */
	


    //story index animation
	
    $("ul.stories li").hover(
		function() {
        	$(this).find("div").stop()
			.animate({
            left: "20",
            opacity: 1
        },
        "fast")
        .css("display", "block")

    },
    function() {
        $(this).find("div").stop()
        .animate({
            left: "0",
            opacity: 0
        },
        "fast")
    });


	/*

    // setup ul.tabs to work as tabs for each div directly under div.panes
    $("ul.tabs").tabs("div.panes > div");
	
	
	
    // enable tooltip for "download" element. use the "slide" effect
    $("#download_now").tooltip({
        effect: 'slide'
    });

    
	*/
	
	/* -----------------------------------------------------------------
	START -- > Page front scripts
	----------------------------------------------------------------- */
	
	if ( $.fn.superbgimage ){
		
		// Options for SuperBGImage
	    $.fn.superbgimage.options =

	    {
	        randomtransition: 0,
	        // 0-none, 1-use random transition (0-7)
	        slideshow: 1,
	        // 0-none, 1-autostart slideshow
	        slide_interval: 4000,
	        // interval for the slideshow
	        randomimage: 0,
	        // 0-none, 1-random image
	        speed: 'slow'
	        // animation speed
	    };

	    // initialize SuperBGImage
	    $('#thumbs').superbgimage().hide();
		
	}
	
	/* -----------------------------------------------------------------
	END -- > Page front scripts
	----------------------------------------------------------------- */
	
	





});

