$(document).ready(function() {
 $.easing.custom = function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	}
  	//When mouse rolls over
	 $('#menu .toplevel').mouseover(function(){
		$(this).stop().animate({height:'34px'},{queue:false, duration:200, easing: 'custom'})
	});
	
	//When mouse is removed
	 $('#menu .toplevel').mouseout(function(){
		$(this).stop().animate({height:'28px'},{queue:false, duration:200})
	});



var site = function() {
	this.navLi = $('#menu li').children('ul').hide().end();
	this.init();
};

site.prototype = {
 	
 	init : function() {
 		this.setMenu();
 	},
 	
 	// Enables the slidedown menu, and adds support for IE6
 	
 	setMenu : function() {
 	
 	$.each($('#menu .toplevel_sub'), function() {
 		if ( $(this).children('ul')[0] ) {
 			$(this)
 				.append('<span />')
 				.children('span')
 					.addClass('hasChildren')
 		}
 	});
 	
 		this.navLi.hover(function() {
 			// mouseover
 			$(this).find('> ul').stop(true, true).slideDown(400);
 		}, function() {
 			// mouseout
 			$(this).find('> ul').stop(true, true).hide(); 		});
 		
 	}
 
}


new site();
});
