$.fn.delay = function(time, callback){
	// Empty function:
	jQuery.fx.step.delay = function(){};
	// Return meaningless animation, (will be added to queue)
	return this.animate({delay:1}, time, callback);
};

$().ready(function() {

	$('.kwicks').kwicks({
		max : 526,
		spacing : 0,
		spacing : 4,
		sticky: true,
		event : 'mouseover',
		duration: 800,
		defaultKwick: 0
	});
	
	
	$('.related-item').click(function (){
		window.location = $(this).find('A').attr('href');
	});
/*
	$('.sidebar-strong .related-item').hover(
		function(){	$(this).stop().animate({	color: "rgb(255, 255, 255)"	}, { duration: "fast" });	},
		function(){	$(this).stop().animate({	color: "rgb(color: rgb(241, 243, 244)"	}, { duration: "fast" });	}
	);
*/
	$('.landing-navigation').click(function (){
		window.location = $(this).find('A').attr('href');
	});
/*
	$('.landing-navigation').hover(
		function(){	$(this).stop().animate({	backgroundColor: "rgb(25, 33, 40)", color: "rgb(255, 255, 255)"	}, { duration: "fast" });	},
		function(){	$(this).stop().animate({	backgroundColor: "rgb(255, 255, 255)",	color: "rgb(51, 51, 51)"	}, { duration: "fast" });	}
	);
*/

	$('.list-event-item').click(function (){
		window.location = $(this).find('.list-event-item-actions').find('A').attr('href');
	});
	$('.list-event-item').hover(
		function(){	$(this).stop().animate({	backgroundColor: "rgb(25, 33, 40)", color: "rgb(255, 255, 255)"	}, { duration: "fast" });	},
		function(){	$(this).stop().animate({	backgroundColor: "rgb(255, 255, 255)",	color: "rgb(51, 51, 51)"	}, { duration: "fast" });	}
	);

	$('#switcher').switcher();
	$("#news-ticker-marquee").marquee({yScroll: "bottom"});

	$('#customisation').click(function (){
	if ( parseInt($('#content').css('margin-top')) == 2 )	{
		$("#customisation-panel").stop().animate({ 
			height: "80px",
			opacity: 1
		}, 250 );
		$("#customisation").stop().animate({ 
			height: "33px",
			opacity: 1
		}, 0 );
		$("#content").animate({ 
			marginTop: "94px"
		}, 250 );
	} else {
		$("#customisation-panel").stop().animate({ 
			height: "0px",
			opacity: 0
		}, 250 );
		$("#customisation").stop().delay(250).animate({ 
			height: "31px",
			opacity: 1
		}, 0 );
		$("#content").stop().animate({ 
			marginTop: "2px"
		}, 250 );
	}
	});

	$("UL.kwicks LI.active").live("mouseover", function()	{
		$(this).children("SPAN").stop().animate( { opacity:"1"}, 600 );

	});
	$("UL.kwicks LI.active").live("mouseout", function()	{
		$(this).children("SPAN").stop().animate( { opacity:"0"}, 600 );
	});
	$("UL.kwicks LI.active").live("click", function()	{
		window.location = $(this).find('A').attr('href');
	});

	$("UL.kwicks_navigation LI#kwick_nav_1").addClass("selected");

	$("UL.kwicks_navigation LI[id^=kwick_nav]").click(function()	{
		$('#whats-on-banner .kwicks').hide();
		$('#banner' + $(this).attr('banner')).show();
		$("UL.kwicks_navigation LI[id^=kwick_nav]").removeClass("selected");
		$(this).addClass("selected");
	});
	
	

});
 

