$(document).ready(function(){
	
/*** Full size menu bar ***/
	var $total_li_widths = 0;
	$('#menu > li' ).each( function(){
		$total_li_widths = $total_li_widths + $(this).outerWidth(true);
		$width = 0;
		$this = $(this);
		$this.children( 'ul' ).show();
		$( ' > ul > li > a', $this ).each( function(){
			if( $width < $(this).outerWidth() )
				$width = $(this).outerWidth();
		});
		$( ' > ul > li > a', $this ).width( $width );
		$( ' > ul > li', $this ).width( $width );
		$( ' > ul', $this ).width( $width );
		$this.children( 'ul' ).hide();
	});
	
	var $total_ul_width = $('#menu' ).width();
	$offset = Math.floor( ( $total_ul_width - $total_li_widths ) / $('#menu > li' ).size() );
	$li_width = 0;
	
	$('#menu > li' ).each( function(){
		$(this).width( $(this).width() + $offset );
		$li_width = $li_width + $(this).outerWidth();
	});
	
	$left_over = $('#menu').width() - $li_width;	
	$('#menu > li:last-child' ).width( $('#menu > li:last-child' ).width() + $left_over );
	
/*** Drop Menu ***/
	$('ul#menu>li').hover(			
		function () {
			
			if( $(this).children('ul').is( ':visible' ) )
			{}
			else
			{
				//$(this).children('ul').css({'width':$(this).width() }); /* IE6 Fix */
				$(this).children('ul').slideDown( 'fast' );	
			}
		}, 
		function () {
			$(this).children('ul').slideUp( 'fast' );
		}
	);

/*** Drop Menu hover color ***/
	$('ul#menu>li>ul').hover(	
		function () {
			$(this).parent('li').css({'background':'#6785A0'});	  
		}, 
		function () {
			$(this).parent('li').css({'background':'none'});	  
		}
	);		
	
/*** Envoke the slider ***/	
	$("#slider").easySlider({
		auto: true, 
		continuous: true,
		numeric: true,
		pause: 10000
	});

});
