jQuery.noConflict();

// Animated Image Preload Effect
// Courtesy of Sean Corey at http://5-squared.com
jQuery(document).ready(function(){	
	jQuery('.imgfade').hide();//hide all the images on the page
});

var i = 0;//initialize
var int=0;//Internet Explorer Fix
jQuery(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
	int = setInterval("doThis(i)",500);
});

function doThis() {
	var images = jQuery('.imgfade').length;//count the number of images on the page
	if (i >= images) {// Loop the images
		clearInterval(int);//When it reaches the last image the loop ends
		delete int;
	}
	jQuery('.imgfade:hidden').eq(0).fadeIn(500);//fades in the hidden images one by one
	i++;//add 1 to the count
}

//Core Functions
jQuery(document).ready(function(){
	
	jQuery("a[rel^='prettyPhoto']").prettyPhoto();
	
	jQuery("aside.portfolio:nth-child(3n+4)").addClass("last");
	jQuery(".widget.home:nth-child(3n+3)").addClass("last");
	jQuery(".widget.footer:nth-child(3n+3)").addClass("last");
	jQuery("ul.tweet_list li:last-child").addClass("item-last");
	
	jQuery(".snipe").css({ opacity: 1.0 });
	
	jQuery('.imgwrapmd a').hover( function () {
		jQuery(this).find('.overlay').stop().animate({ opacity: 1 }, 200);
		jQuery(this).find('img').animate({ opacity: 0.3 }, 200);	
	}, function () {
		jQuery(this).find('.overlay').stop().animate({ opacity: 0 }, 200);
		jQuery(this).find('img').animate({ opacity: 1 }, 200);
	});
	jQuery('ul.sub-menu').closest('li').addClass('drop');
});
