jQuery(document).ready(function(){function mainmenu(){jQuery("ul.sf-menu ul ").css({display:"none"});jQuery("ul.sf-menu > li").hover(function(){jQuery(this).find('ul:first').slideDown()},function(){jQuery(this).find('ul:first').slideToggle('normal')})}jQuery(document).ready(function(){mainmenu()})});

jQuery(document).ready(function() {
	jQuery("ul.sf-menu > li:last").css({background: 'none'}); jQuery("ul.sf-menu li ul li:last a").addClass('noborder');
	var footerWidth = jQuery('#footer div').outerWidth(); var footerPadding; footerPadding = parseInt((957 - footerWidth)/2); jQuery('#footer div').css({'margin-left': footerPadding + 'px'}).fadeIn(1400);
})

jQuery(document).ready(function() {
	jQuery("a.anchorlink").anchorAnimate();
	jQuery("li.anchorlink a").anchorAnimate();
});

jQuery.fn.anchorAnimate = function(settings) {

 	settings = jQuery.extend({
		speed : 1100
	}, settings);	
	
	return this.each(function(){
		var caller = this
		jQuery(caller).click(function (event) {	
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = jQuery(caller).attr("href")
			
			var destination = jQuery(elementClick).offset().top;
			jQuery("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick
			});
		  	return false;
		})
	})
}

jQuery(document).ready(function(){
	jQuery('#sidebar .promo-availability').click(function(e) {
		if (jQuery(this).hasClass('inactive')) {
			jQuery('#availability').fadeIn();
			jQuery(this).removeClass('inactive').addClass('active');
			e.stopPropagation();
		} else {
			jQuery('#availability').fadeOut();
			jQuery(this).removeClass('active').addClass('inactive');
			e.stopPropagation();			
		}
	})
	
	jQuery('#availability').click(function(e) {
		e.stopPropagation();
	})

	jQuery(document).click(function(e){
		if (jQuery('#sidebar .promo-availability').hasClass('active')) {
				jQuery('#sidebar .promo-availability').removeClass('active').addClass('inactive');
				jQuery('#availability').fadeOut();
				e.stopPropagation();			
		}
	});
});
