/* Refactored to be a jQuery plugin from: 
 * http://nettuts.com/tutorials/javascript-ajax/how-to-create-a-mootools-homepage-inspired-navigation-effect-using-jquery/ 
 * Created by: James Sapara 2009
 * Please leave this notice in place so we both get props.
 */
(function($){
	$.fn.menuSlide = function(options) {
		var defaults = {
			pad_out: 10, // hover slide out
			pad_in: 0, // hover return slide
			pad_time: 200, // hover time to slide
			time: 200, // inbound animation
			slide_in: 10, // inbound over shoot slide
			multiplier: 0.8 
		}
		var options = $.extend(defaults,options); // override the defaults when specified
		
		return this.each(function() {
			var timer = 0;
			$(this).children().each(function(li) {
				timer = (timer * options.multiplier + options.time);
				$(this).css("margin-left","-80px").animate({marginLeft: "0"},timer).animate({marginLeft: options.slide_in + "px"},timer).animate({marginLeft: "0"},timer);
				
			}).each(function(li){
				$(this).hover(
					function() {
						$(this).stop(true,true).animate({paddingLeft: options.pad_out }, options.pad_time);
					},
					function() {
						$(this).stop(true,true).animate({paddingLeft: options.pad_in }, options.pad_time);
					}
				);
			
			})
		});
	}
})(jQuery);
