$(function($){
$.easing.custom = function (x, t, b, c, d) { 
	    var s = 1.70158;  
	    if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 
	    return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 
	}
	
	$('#secondaryNav ul li:not(#backTo)').click( function() {
			
			var selMenu = $(this).find("a").attr('childid');
			var thisHref = $(this).find("a").attr("href");
			var thisTitle = $(this).find("a").attr("title");
			
			if (selMenu.length) {
				$("#childOf_" + selMenu).toggle(200, function(){
					$('#secondaryNavSlideContainer').animate({
						marginLeft: "-220px"
					}, 700, 'custom', function(){
						//$('#secondaryNavTitle').html(thisTitle);
						$("#secondaryNavSlideContainer").animate({height: $("#childOf_" + selMenu).height()+20},700, 'custom', function(){
							return true;
							//window.location = thisHref;
						});
					});
				});
			} else {
				return true;
				//window.location = thisHref;
			}
			return true;
		});
});



//$.DatePicker.setDefaults({minDate: new Date()});
