$(window).load(function(){	
	VideoJS.setupAllWhenReady();
	$(".favorites_thumbnails a, #popularposts ul li a, #subscribe a, #footer-subscription a").tooltip({showURL: false});
	
	$(".postteaser").hover(function(){
	    $(this).find(".postexcerpt").fadeIn("normal");
	}, function(){
	    $(this).find(".postexcerpt").fadeOut("normal");
	})
	
	$("#blogroll header").toggle(function(){
	    $("#blogroll .module_body").slideDown("fast");
	}, function(){
	    $("#blogroll .module_body").slideUp("fast");
	})
	
	$("article.mini_post").hover(
	    function(){
	        $(this).find("img").fadeTo("fast", 0.5);
	    },
	    function(){
	        $(this).find("img").fadeTo("fast", 1);
	    }
	);
	
	Shadowbox.init({       
	    overlayColor: '#000000',
	    overlayOpacity: 0.7
	});
	
	Shadowbox.setup("a img");
	
});

$(document).ready(function(){   
    
    $("#blogroll .module_body").hide();    
    
    $("#mainposts > .slider").easySlider({
        auto: false,
        prevId: 'mainposts_prevBtn',
        nextId: 'mainposts_nextBtn',
        prevText: '&laquo; Newer Posts',
        nextText: 'Recent Posts &raquo;'
        
    })
    
    $("#cheftalkposts > .slider").easySlider({
        auto: false,
        prevId: 'cheftalkposts_prevBtn',
        nextId: 'cheftalkposts_nextBtn',
        prevText: '&laquo; Newer Posts',
        nextText: 'Older Posts &raquo;'       
    })
    
    $("#reviewposts > .slider").easySlider({
        auto: false,
        prevId: 'reviewposts_prevBtn',
        nextId: 'reviewposts_nextBtn',
        prevText: '&laquo; Newer Posts',
        nextText: 'Older Posts &raquo;'       
    })   
    
    $("#dd_post > .slider ul, #latina_post > .slider ul, #travels_post > .slider ul, header.main > h1 ").cycle({
        fx: 'fade'
    });
    
    $(".mini_post_section .slider").fadeIn("normal");   
    
    
    $("#bitestips_slider").easySlider({
        auto:true,
        pause:8000,
        continuous: true,
        controlsShow: false
    })
    
    $("#swotd_slider").easySlider({
    	auto:true,
    	pause:10000,
    	continuous: true,
    	controlsShow: true,
    	prevId: "wordPrev",
    	nextId: "wordNext"
    })
    
    if($(".recipe_style").length != 0){
        $(".recipe_style").append("<a id='downloadlink' href='?article2pdf=1'>Download Recipe<img src='http://www.flanboyanteats.com/wp-content/themes/flanboyanteats_v4/images/download_icon.png' alt='download icon' /></a>");
    }    
    
});

