/***********************************************************
/         PLUGIN IN DEVELOPMENT BY ARIC BEAGLEY            *
/                    RED OLIVE DESIGN                      *
/             http://www.redolivedesign.com                *
***********************************************************/

(function($) {		  
	
	$.fn.supafly = function(props) {
		
		// Default values for unspecified object
		var defaults = {
			aArrowImg: "",
			transition: "show",
			type: "horizontal"
		}
		// Extend the set properties if any
		var opts = $.extend(defaults, props);				
		// Hide our multiple layers
		$(this).find("ul").hide();
		
		$(this).find("*").not("a").not("ul").each(function(i, n) {
			if($(n).is(":has('ul')")){				
				$(n).addClass("MultiLevel");	
				
				$(n).hover(function() {
					$("#nav li > ul").hide();				
					$(n).find("ul:first").fadeIn(0);								  
				}, function() {
					$(n).find("ul:first").fadeOut(0);
				});
				
				var depth = $(n).parents("ul").length;
				var offsetX = 258;
				var offsetY = 0;
				
				if($(n).parents("ul").length > 1) { 
					$(n).children("ul:first").css("left", offsetX + "px").css("top", offsetY + "px");
				}
			} else {
				// Do nothing	
			}
		});	
	};		
	
})(jQuery);


