
	var openSub = null;
	var openSubColor = "#fff";
	var openSubTimer = 0; 
	
	function closeSub()
	{
		if(openSub)
		{
			openSub.parent().find("ul").hide();
			openSub.removeClass("topicOver");
			openSub.css({ color:"#453d11" });
			openSub.css({ color:"#453d11" });
			openSub.parent().next().css({ background:"url('http://seriousrequest.3fm.nl/static/images/nav_splitter.gif') no-repeat" });
			openSub = null;
		}
	}

	$(document).ready(function()
	{
		
		/** SET innerMain BACKGROUND **/
		$("#innerMain").backgrounds();
		$("#innerMainToppers").fonts();
		
		/** SCREEN SETTINGS **/
		var 	setScreen = function()
		{
			$("#wrapper").css( { margin:"0px 0px 0px "+(((($("body").offset().width)-1103)/2)-20)+"px" } );
		}
	
		/** NAVIGATION **/
		$("a[@href*=openSub]").click(function()
		{
			openSub = $(this);
			openSub.parent().find("ul").show();
			
			return false;
		});

		$(".sub").hover
		(
			function()	{ clearTimeout(openSubTimer); },
			function()	{ openSubTimer = setTimeout("closeSub()", 1000); }
		);

		$(".topic").hover
		(
			function()	
			{
				if(openSub && $(this).html() != openSub.html())
					closeSub();
				else
					clearTimeout(openSubTimer);
					
				openSubColor = $(this).css("color");

				if($(this).attr("class") != "topic highlight")
					$(this).css({ color:"#FFF" });

				$(this).addClass("topicOver");
				$(this).parent().next().css({ background:"url('http://seriousrequest.3fm.nl/static/images/nav_option_bg.gif') no-repeat" });
			},
			
			function()
			{	
				if(!openSub || $(this).html() != openSub.html())
				{
					$(this).removeClass("topicOver");
					$(this).css({ color:openSubColor });
					$(this).parent().next().css({ background:"url('http://seriousrequest.3fm.nl/static/images/nav_splitter.gif') no-repeat" });
				}
				else
				{
					openSubTimer = setTimeout("closeSub()", 1000);
				}
			}
		);
		
		/** LIVE PLAYER **/
		$("a[@href*=livePlayer]").click(function()
		{
			window.open("http://www.3fm.nl/page/3fm_liveplayer/3fm", "blank","toolbar=no,width=800,height=600");
			return false;
		});
		
		/** MASH UP **/
		$("a[@href*=mashUp]").click(function()
		{
			window.open("http://live.3fm.nl/seriousrequest07/mashup/", "blank","toolbar=no,width=1024,height=768");
			return false;
		});
		
		setScreen();
	});