function startTop() {

	// -----------------
	// Top News Script
	// -----------------
	var animationTime = 1500;
	var animationDelay = 8000;
	var i = 0;
	var t = 0;
	var j = 0;
	var s = 0;
	// Hide all news and apply links
	$("div#topNews").find("table.topNewsItem").each(function(){
		
		$(this).attr("index", i);
		
		var newsLink = $(this).attr("href");
		
		$(this).click(function(e){
			if (newsLink)
				window.location.href = newsLink;
		});
		
		$(this).css("top", "75px");
		$(this).css("opacity", "0");
		
		i++;
	});
	
	t = i;
	i = 0;
	
	// Hide all videos and apply links
	$("div#topVideos").find("table.topVideosItem").each(function(){
		
		$(this).attr("index", j);
		$(this).css("top", "75px");
		$(this).css("opacity", "0");
		
		j++;
	});
	
	s = j;
	j = 0;
	
	$("table.topVideosItem").find("img").each(function(){		
		if ($(this).height() > 45) {
			$(this).height(45);
		}
		
		if ($(this).width() > 60) {
			$(this).width(60);
		}
	});
	
	$("table.topVideosItem").find("p").each(function(){
		if ($(this).text().length > 13) {
			$(this).text($(this).text().substring(0,10) + "...");
		}
	});
	
	function animationNews (checker)
	{
		if (checker >= 0)
		{
			$("div#topNews").find("table[index=" + i + "]").animate({
				top: "-60px",
				opacity: 0
			}, animationTime);
			
			if (++i >= t)
				i = 0;
			
			$("div#topNews").find("table[index=" + i + "]").css("top", "75px");
			$("div#topNews").find("table[index=" + i + "]").animate({
				top: "6px",
				opacity: 1
			}, animationTime);
		}
		else
		{
			$("div#topNews").find("table[index=" + i + "]").animate({
				top: "75px",
				opacity: 0
			}, animationTime);
			
			if (--i < 0)
				i = t - 1;
			
			$("div#topNews").find("table[index=" + i + "]").css("top", "-60px");
			$("div#topNews").find("table[index=" + i + "]").animate({
				top: "6px",
				opacity: 1
			}, animationTime);
		}
	}
	
	function animationVideos (checker)
	{
		if (checker >= 0)
		{
			$("div#topVideos").find("table[index=" + j + "]").animate({
				top: "-60px",
				opacity: 0
			}, animationTime);
			
			if (++j >= s)
				j = 0;
			
			$("div#topVideos").find("table[index=" + j + "]").css("top", "75px");
			$("div#topVideos").find("table[index=" + j + "]").animate({
				top: "2px",
				opacity: 1
			}, animationTime);
		}
		else
		{
			$("div#topVideos").find("table[index=" + j + "]").animate({
				top: "75px",
				opacity: 0
			}, animationTime);
			
			if (--j < 0)
				j = s - 1;
			
			$("div#topVideos").find("table[index=" + j + "]").css("top", "-60px");
			$("div#topVideos").find("table[index=" + j + "]").animate({
				top: "2px",
				opacity: 1
			}, animationTime);
		}
	}
	
	$("div#topNews > a#arrowUp").click(function(e){
		e.preventDefault();
		$("div#topNews").stopTime("timerNews");
		animationNews(0);
		$("div#topNews").everyTime(animationDelay, "timerNews", animationNews);
	});
	
	$("div#topNews > a#arrowDown").click(function(e){
		e.preventDefault();
		$("div#topNews").stopTime("timerNews");
		animationNews(-1);
		$("div#topNews").everyTime(animationDelay, "timerNews", animationNews);
	});
	
	$("div#topVideos > a#arrowUp").click(function(e){
		e.preventDefault();
		//$("div#topVideos").stopTime("timerVideos");
		animationVideos(0);
		//$("div#topVideos").everyTime(animationDelay, "timerVideos", animationVideos);
	});
	
	$("div#topVideos > a#arrowDown").click(function(e){
		e.preventDefault();
		//$("div#topVideos").stopTime("timerVideos");
		animationVideos(-1);
		//$("div#topVideos").everyTime(animationDelay, "timerVideos", animationVideos);
	});
	
	// Show the first news
	$("div#topNews").find("table:first").animate({
		top: "6px",
		opacity: 1
	}, animationTime);
	
	function startVideos () {
		$("div#topVideos").stopTime("startVideos");
		//$("div#topVideos").everyTime(animationDelay, "timerVideos", animationVideos);
		// Show the first videos
		$("div#topVideos").find("table:first").animate({
			top: "2px",
			opacity: 1
		}, animationTime);
	}
	
	// Apply the timer event
	$("div#topNews").everyTime(animationDelay, "timerNews", animationNews);
	$("div#topVideos").everyTime(1000, "startVideos", startVideos);
}

