var App = {
	config:function(){
		
		//Mainmenu
		jQuery('#mainmenu').superfish({
			autoArrows:    false, 
			speed:0,
			delay: 500,  
		});
		
		$("h1").click(function(){
			window.location = "home";
		});
		
		// Gold Left Rollover
		$(".GoldAdMiniLeft").mouseover(function(){
			$(".GoldAdMainLeft").attr("href",$(this).attr("href"));
			$(".GoldAdMainLeft .AdTitle").text($(this).children(".AdTitle").text());
			$(".GoldAdMainLeft .AdLink").text($(this).children(".AdLink").text());
			$(".GoldAdMainLeft .AdDescription").text($(this).children(".AdDescription").text());
			$(".GoldAdMainLeft .AdThumbnail img").attr("src",$(this).children(".AdThumbnail").children("img").attr("src"));
		});
		
		// Gold Right Rollover
		$(".GoldAdMiniRight").mouseover(function(){
			$(".GoldAdMainRight").attr("href",$(this).attr("href"));
			$(".GoldAdMainRight .AdTitle").text($(this).children(".AdTitle").text());
			$(".GoldAdMainRight .AdLink").text($(this).children(".AdLink").text());
			$(".GoldAdMainRight .AdDescription").text($(this).children(".AdDescription").text());
			$(".GoldAdMainRight .AdThumbnail img").attr("src",$(this).children(".AdThumbnail").children("img").attr("src"));
		});
		
		// Start Fanatics Ticker
		App.fanaticsTicker();
		
		// Tooltips
		$('.QTIP').each(function(){
			var title = $(this).metadata().title;
			var desc = $(this).metadata().desc;
			var info = '<span>' + title + '</span>' + desc;
			$(this).qtip({
					content: { text: info },
					position: {
						corner: {
							target: 'topMiddle',
							tooltip: 'bottomMiddle'
						}
					},// position
					style: {
						width: 200,
						padding: 5,
						background: '#fff',
						color: '#000',
						textAlign: 'left',
						'font-size':12,
						border: {
							width: 7,
							radius: 10,
							color: '#fff'
						},
						tip: 'bottomMiddle',
						name: 'dark' // Inherit the rest of the attributes from the preset dark style
					} // style
				}); // play
		});
	},
	removeCurrentTab:function(){
		$("#mainmenu li").removeClass("current");
	},
	selectCurrentTab:function(currentTab){
		$("#"+currentTab).addClass("current");	
	},
	fanaticsTicker:function(){
		$('#FanaticsTicker span:first').css('color','white');
        setTimeout(function(){
            $('#FanaticsTicker span:first').animate( {opacity: .4}, 200, function()
            {
                $(this).detach().appendTo('#FanaticsTicker').removeAttr('style');
				$('#FanaticsTicker span:first').css('color','white');
            });
            App.fanaticsTicker();
        }, 4000);
	}
}

$(App.config);
