// JavaScript Document
//easing
jQuery.easing['swingOld'] = jQuery.easing['swing']; //rename the swing function
jQuery.extend(jQuery.easing,{
	easingFunc: function (x, t, b, c, d) {
	return -c *(t/=d)*(t-2) + b;
}
});
// timeout
jQuery.fn.idle = function(time){
	return this.each(function(){
		var i = $(this);
		i.queue(function(){
			setTimeout(function(){
				i.dequeue();
			}, time);
		});
	});
};
	
//Preload Images
jQuery.preloadImages = function(){
	for(var i = 0; i<arguments.length; i++){
		jQuery("<img>").attr("src", arguments[i]);
	}
};
function BuildHeaderNav()
{
	jQuery.fn.slideDownFade = function(speed, easing) {
		return this.animate({height: 'show'}, speed, easing);	
	};
	$('.gMenu > li').each(function(){
		var $currentTab = $(this).children('.gLnkDetails');
		$(this).hover(function(){
			$('.gMenu .gLnkDetails').hide().stop(true, true);
			$($currentTab).slideDownFade(250, 'swing');
		}, function() {
			$($currentTab).idle(250).slideUp('fast');
		});
		$('.gMenu > li > a').click(function(){
			return false;									
		});
	});
	$(document).click(function(){
		$('.gMenu .gLnkDetails').slideUp('fast');
	});
}
