(function($){

	$.fn.fgxNavSlider = function(options){
	
		var opts = $.fn.extend({},$.fn.fgxNavSlider.defaults, options);
		
		return this.each(function(){
				$this = $(this);
				$("#mainButt1 a").mouseover(function(){
					$.fn.fgxNavSlider.showNav("#phatNavOne",opts.speedIn,opts.speedOut);
				});
				$("#mainButt2 a").mouseover(function(){
					$.fn.fgxNavSlider.hideNav(opts.speedOut);
				});
				$("#mainButt3 a").mouseover(function(){
					$.fn.fgxNavSlider.hideNav(opts.speedOut);
				});
				$("#mainButt4 a").mouseover(function(){
					$.fn.fgxNavSlider.hideNav(opts.speedOut);
				});
				
				/*
				$("#mainButt1 a").mouseout(function(){
					$("#phatNavOne").animate({top:-400},opts.speedOut);
				});
				*/
				
		});
	
	};//fgxNavSlider
	
	$.fn.fgxNavSlider.showNav = function(subNavItem, speedIn, speedOut){	
		
		//if($(subNavItem).is("div.phatNav")){
			
			$("div.open").animate({top:-250},speedOut);
			$("div.open").removeClass("open");
			
	/*	$("#subNav div").each(function(){
			
			var id = "#" + $(subNavItem).attr("id");
			var showNav = true;
			if($(subNavItem).css("top") == "18px" && subNavItem != id ){
				//alert($(subNavItem).css("top")); 
				$(subNavItem).animate({top:-400},speedOut);
				
			}	
			
			
		});*/
		
			$(subNavItem).animate({top:18},speedIn);
			$(subNavItem).addClass("open");
			$(subNavItem).mouseleave(function(){
				$(this).animate({top:-250},speedOut);
				$(this).removeClass("open");
			});
	//	}//if
		
	};
	
	$.fn.fgxNavSlider.hideNav = function(speedOut){	
		$("#subNav div").each(function(){
			$(this).animate({top:-250},speedOut);
			$(this).removeClass("open");
		});
	};	
 $.fn.fgxNavSlider.defaults = {
		 speedIn: 600,
		 speedOut: 400
  };//defaults
 
	
})(jQuery);

