jQuery.noConflict();

// Center images on page load - http://code.drewwilson.com/entry/imgcenter-jquery-plugin
jQuery(window).load(function(){
	jQuery(".blog #content a.post-image-container img").imgCenter({
		parentSteps: 1,
		scaleToFit: false
	}); 
});

jQuery(document).ready(function(){

	// Grid JS
	jQuery(document).bind("keydown", "Alt+Shift+g", function(){
		jQuery("body").toggleClass("gridsystem");
	});

	// Previous Hot Key 
    jQuery(document).bind('keydown', 'left', function(){
		var prevlink = jQuery("#nav-above .nav-previous a").attr("href");
		if (!prevlink == '') {
			window.location = prevlink;
		}
    });

	// Next Hot Key 
    jQuery(document).bind('keydown', 'right', function(){
		var nextlink = jQuery("#nav-above .nav-next a").attr("href");
		if (!nextlink == '') {
			window.location = nextlink;
		}
    });

	// Hide elements on page load
	jQuery(".blog h2.entry-title").fadeTo(0, 0);
	jQuery(".blog div.entry-content").fadeTo(0, 0);
	jQuery("#content .entry-content div.large-image p").fadeTo(0, 0);
	jQuery(".blog .hentry .hoverbg").fadeTo(0, 0);
	jQuery(".single .post-image-container .photo-credit").fadeTo(0, 0);

	jQuery(".blog .hentry .post-image-container").fadeTo(0, 1.0);
	jQuery(".blog .hentry .post-image-container img").hide().fadeIn(500);
	jQuery(".single .hentry .post-image-container img").hide().fadeIn(500);

	jQuery(".blog #content .entry-content").css("margin-left", 0);
	jQuery(".blog #content .hentry h2").css("margin-left", 0);
	
	// Hover animations for Home Pages
	jQuery(".blog .hentry").hover(function(){
		jQuery(this).children("h2.entry-title").stop(true).fadeTo("fast", 1.0);
		jQuery(this).children("div.entry-content").stop(true).fadeTo("fast", 1.0);
		jQuery(this).children(".post-image-container").stop(true).fadeTo("fast", 0.25);
		jQuery(this).children("div.entry-meta").stop(true).fadeTo("fast", 0);
	}, function(){
		jQuery(this).children("h2.entry-title").stop(true).fadeTo("fast", 0);
		jQuery(this).children("div.entry-content").stop(true).fadeTo("fast", 0);
		jQuery(this).children(".post-image-container").stop(true).fadeTo("fast", 1.0);
		jQuery(this).children("div.entry-meta").stop(true).fadeTo("fast", 1.0);
	});

	// Hover animations for Single Pages
	jQuery(".single .post-image-container").hover(function(){
		jQuery(this).children(".photo-credit").stop(true).fadeTo("fast", 1.0);
	}, function(){
		jQuery(this).children(".photo-credit").stop(true).fadeTo("fast", 0);
	});

});