/*
* Author: Marco Kuiper (http://www.marcofolio.net/)
*
* *** NOTE: '$' replaced to 'jQuery' for noConflict ***
*/

jQuery(document).ready(function()
{
	// Set the nescesarry data
	jQuery("#jquerynav li a").each(function(){
		var backgroundPositions = jQuery(this).css('background-position').split(" "); // Returns "##px" and "##px"
		jQuery(this).data("originalXpos", backgroundPositions[0].slice(0, -2)); // Retrieve the original X position
		jQuery(this).data("newYpos", 0); // Set the new Y position to 0
	});
	
	// Capture the "hover" events
	jQuery("#jquerynav li a").hover(function(){
		jQuery(this)
			.data("newYpos", jQuery(this).data("newYpos") + 1)
			.stop()
			.animate({
				backgroundPosition: jQuery(this).data("originalXpos") + "px " + jQuery(this).data("newYpos") * 30 + "px"
			}, 420, "easeOutCirc");
	}, function(){
		jQuery(this)
			.data("newYpos", jQuery(this).data("newYpos") + 1)
			.stop()
			.animate({
				backgroundPosition: jQuery(this).data("originalXpos") + "px " + jQuery(this).data("newYpos") * 30 + "px"
			}, 210, "easeInCirc");
	});
});

