$(document).ready(function() { 
	$('.port_item_link').css({opacity: "0"});
	$("#portfolio_list li").mouseenter(
	  function () {
		$(this).find('.attachment-post-thumbnail').animate({opacity: "0.50"}, 200);
		$(this).find('.port_item_link').animate({opacity: "1.0"}, 300);
	  });
	  
	$("#portfolio_list li").mouseleave(
	  function () {
		$(this).find('.attachment-post-thumbnail').animate({opacity: "1.0"}, 300);
		$(this).find('.port_item_link').animate({opacity: "0"}, 200);
	});
	function checkWidth () {
    if ($(window).width() > 480) {
			$('.web_slider').cycle({
			fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			speed: '500',
			});
        } else {
			$('.web_slider').cycle('destroy');
			$('#home_feature').cycle('destroy');
		}
	}
    // check the window size when page loads
    checkWidth();

    // check on resize
    $(window).resize(function() {
        checkWidth();
    });
	
	// Instantiate FitVid to make YouTube videos responsive
	$(".entry, .primary").fitVids();
	
});
