/**
 * Menu DropDown
 * 
 * @author: Thomaz Takashi Oda Toyama.
 * @retrun void
 */
 
(function($){
	$.fn.menuDropDown = function(options){
		var iSet 	= $.extend({},$.fn.menuDropDown.defaults,options);
		var parent	= $(this);
		
		parent.each(function(){
			var ul  		= $('> li > ul', this);
			var width 		= $(this).width();
			var parentPos	= $(this).offset();
			var ulPos		= ul.offset();
			var defaultPos	= (parentPos.left + width) - ul.width();
			var hoverPos	= (parentPos.left + width);
			
                        $('ul', parent).hide();
			
			$('li', this).hover(
				function(){
                                        $('>.bg-subcategoria > a',this).css('background','#530f0d');
					$(' > ul:first' , this ).show(0 , function(){
						/*$(this).stop(true,true).animate({
							left: hoverPos
							,opacity: 1
						},iSet.openSpeedy);*/
					});	
				}
				,function(){
                                    /*
					$(' > ul' , this ).stop(true,true).animate({
						left: defaultPos
						,opacity: 0
						},iSet.closeSpeedy, function(){ $(this).hide(); });	*/
                                    $('>.bg-subcategoria > a',this).css('background','#380b0a');
                                    $(' > ul:first' , this ).hide(0);
				}
			);
			
		});
		
	};
	$.fn.menuDropDown.defaults = {
		openSpeedy  : 500
		,closeSpeedy	: 500
	};
})(jQuery);
