// JavaScript Document

function slide(navigation_id, pad_out, pad_in, time, multiplier)
{
	// creates the target paths
	var list_elements = navigation_id + " li.sliding-element";
	var link_elements = list_elements + " a";
	
	// initiates the timer used for the sliding animation
	var timer = 0;
	
	// creates the slide animation for all list elements 
	/*
	$(list_elements).each(function(i)
	{
		// margin left = - ([width of element] + [total vertical padding of element])
		$(this).css("margin-left","-180px");
		// updates timer
		timer = (timer*multiplier + time);
		$(this).animate({ marginLeft: "0" }, timer);
		$(this).animate({ marginLeft: pad_out }, timer);
		$(this).animate({ marginLeft: "0" }, timer+500, 'easeOutBounce');
	});
	*/
	
	// creates the hover-slide effect for all link elements 		
	$(link_elements).each(function(i)
	{
		$(this).hover(
		function()
		{
			$(this).stop(true).animate({
				paddingLeft: pad_out,
//				backgroundColor: "#8c2655",
				backgroundColor: "#5c0025",
				color: "#ff0066",
				borderBottomColor: "#f4d9ae",
				borderLeftColor: "#f4d9ae",
				borderRightColor: "#f4d9ae",
				borderTopColor: "#f4d9ae"
			}, 150, 'easeOutCubic');
			// ".stop()" added to stop queued animations before animating. Prevents queued-up animations if user rapidly mousees-over the buttons
//			$(this).animate({ backgroundColor: "#8c2655" }, { queue: false, duration: 150 }, 'easeOutBack');
//			$(this).animate({ color: "#ff0066" }, { queue: false, duration: 150 }, 'easeOutBack');
//			$(this).animate({ borderBottomColor: "#ffffff" }, { queue: false, duration: 150 }, 'easeOutBack');
		},		
		function()
		{
			$(this).stop(true).animate({ paddingLeft: pad_in }, 500, 'easeOutBounce');
			// ".stop()" added to stop queued animations before animating. Prevents queued-up animations if user rapidly mousees-over the buttons
			$(this).animate({ 
				backgroundColor: "#7c1645",
				color: "#f4d9ae",
				borderBottomColor: "#1a1a1a",
				borderLeftColor: "#1a1a1a",
				borderRightColor: "#1a1a1a",
				borderTopColor: "#1a1a1a"
			 }, { queue: false, duration: 1000 }, 'easeOutCirc');
//			$(this).animate({ backgroundColor: "#7c1645" }, { queue: false, duration: 1000 }, 'easeOutCirc');
//			$(this).animate({ color: "#f4d9ae" }, { queue: false, duration: 1000 }, 'easeOutCirc');
//			$(this).animate({ borderBottomColor: "#1a1a1a" }, { queue: false, duration: 1000 }, 'easeOutCirc');
			
			
		});
	});
}

