jQuery.noConflict();

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

	jQuery("#gallery-slider-container ul li img").imgCenter({
		parentSteps: 0,
		scaleToFit: false
	}); 
});

jQuery(document).ready(function(){

	jQuery('.anythingSlider').anythingSlider({
        easing: "easeInOutQuint",       // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        delay: 5000,                    // How long between slide transitions in AutoPlay mode
        animationTime: 700,             // How long the slide transition takes
        hashTags: true,                 // Should links change the hashtag in the URL?
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        pauseOnHover: false,             // If true, and autoPlay is enabled, the show will pause on hover
        startText: "Start",             // Start text
        stopText: "Stop",               // Stop text
        navigationFormatter: null       // Details at the top of the file on this use (advanced use)
	});

	// 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("#thumbNav").fadeTo(0, 0);
	jQuery(".blog #content #featured-slider-container ul h2.entry-title").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(".featured-post-image-container img").hide().fadeIn(500);
	jQuery(".single #auto-slider").hide().fadeIn(500);

	jQuery(".blog #content .entry-content").css("margin-left", 0);
	jQuery(".blog #content .entry-meta").css("margin-left", 0);
	jQuery(".blog #content .entry-title").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.00);
	});

	// Hover animations for Sliders
	jQuery("#auto-slider .post").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("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("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);
	});
	
	// Hover animations for Slider Controls
	jQuery(".anythingSlider").hover(function(){
		jQuery(this).children("#thumbNav").stop(true).fadeTo("fast", 0.75);
	}, function(){
		jQuery(this).children("#thumbNav").stop(true).fadeTo("fast", 0);
	});
		
	// Hover animations for Large Image Shortcodes
	jQuery(".#content .entry-content div.large-image").hover(function(){
		jQuery(this).children("p").stop(true).fadeTo("fast", 1.0);
	}, function(){
		jQuery(this).children("p").stop(true).fadeTo("fast", 0);
	});

});