// JavaScript Document

var jquerycssmenu=
{
  fadesettings: 
	{
		overduration: 350, outduration: 100
	}, 
	
	buildmenu:function(menuid)
	{
	  jQuery(document).ready(function($)
		{
		  var $headers = $('.menu_btn');
		  
		  $headers.each(function(i)
			{
			  var $curobj = $(this);
				var $submenu = $(this).find('.sub_menu:eq(0)');
				
				this._dimensions = 
				{
				    w:this.offsetWidth, 
				    h:this.offsetHeight, 
				    submenuw:$submenu.outerWidth(), 
				    submenuh:$submenu.outerHeight()
				}
				
				$submenu.css({top: this._dimensions.h + "px"})
				
				$curobj.hover(
				  function(e)
					{
					  var $target = $(this).children(".sub_menu:eq(0)");
					  $target.css({left:0}).fadeIn(jquerycssmenu.fadesettings.overduration);
					},
					
					function(e)
					{
					  $(this).children(".sub_menu:eq(0)").fadeOut(jquerycssmenu.fadesettings.outduration);
					}
				)
			})
		})
	}
}

jquerycssmenu.buildmenu("menu_line");


