function get_rss_feed(url, feedContentId, max_entries) {
	//clear the content in the div for the next feed.
	$("#" + feedContentId).empty();
	var html = "<div class='box_content_with_padding'>Loading...</div><br><br><br>";
	$("#" + feedContentId).append($(html));
 
	html = "<table id='utc-leaderboard-results' cellpadding=0 cellspacing=0>";
	html += "<tr><th width='5%'>&nbsp;</th><th width='15%'>Rank</th><th width='50%'>Name</th><th width='30%'>Speed</th></tr>";
	
	//use the JQuery get to grab the URL from the selected item, put the results in to an argument for parsing in the inline function called when the feed retrieval is complete
	$.get('/rss_proxy.php?url='+url, function(d) {
 
		var i = 0;
		var j = 0;
		var there_is_more = false;
		//find each 'item' in the file and parse it
		$(d).find('item').each(function() {
			if (j < max_entries) { 
				//name the current found item this for this particular loop run
				var $item = $(this);
				var name = $item.find('name').text();
				var speed = $item.find('speed').text();
				var rank = $item.find('rank').text();
				var unit = $item.find('unit').text();
	 
				// now create a var 'html' to store the markup we're using to output the feed to the browser window
				var style = (i == 0 ? "background:#eceff6;" : "padding:8px 0 8px 0;");
				html += "<tr><td width='5%' style='"+style+"'>&nbsp;</td><td width='15%' style='"+style+"'>"+rank+".</td>";
				html += "<td width='50%' style='"+style+"'>"+name;
				html += "</td><td width='30%' style='"+style+"'>"+speed+ " " + unit + "</td></tr>";
				i = (i == 0 ? 1 : 0);
				j++;
			} else {
				there_is_more = true;
			}
		});
		html += "<!-- <tr><td>&nbsp;</td><td align=right valign=bottom><br><a href='http://app.typrx.com/results-utc-rss-custom.jsp'><img src='/images/rss.gif' border=0></img></a></td><td style='font-size: 11px;padding-top:12px;'><i>updated every 10 minutes</i></td><td align=right style='padding-top:10px;'>";
		if (there_is_more)
		  html += "<div style='float: right;'><a href='/leaderboard/'>more <img src='/images/arrow1.gif' border=0 style='margin-bottom:-1px;'></img></a></div>";
		html += "</td></tr> -->"
	    html += "</table>";
		$("#" + feedContentId).empty();
		$("#" + feedContentId).append($(html));
	});
 
};

function clickVideoTab(tabNumber) {
	if (tabNumber == 1) {
		document.getElementById("video").style.background = "url('/images/video-what-is-utc-bg2.gif') no-repeat";
		document.getElementById("how-to-play-link").className = "";
		document.getElementById("how-to-play-video").className = "video-hidden";
		document.getElementById("what-is-utc-link").className = "video-link-selected";
		document.getElementById("what-is-utc-video").className = "video-shown";
	} else {
		document.getElementById("video").style.background = "url('/images/video-how-to-play-bg2.gif') no-repeat";
		document.getElementById("what-is-utc-link").className = "";
		document.getElementById("what-is-utc-video").className = "video-hidden";
		document.getElementById("how-to-play-link").className = "video-link-selected";
		document.getElementById("how-to-play-video").className = "video-shown";
	}
}

// preload images
preload_image_object = new Image();
preload_image_object.src = "/images/home.gif";
preload_image_object.src = "/images/home-selected.gif";
preload_image_object.src = "/images/faq.gif";
preload_image_object.src = "/images/faq-selected.gif";
preload_image_object.src = "/images/calendar-prizes.gif";
preload_image_object.src = "/images/calendar-prizes-selected.gif";
preload_image_object.src = "/images/video-what-is-utc-bg2.gif";
preload_image_object.src = "/images/bg3.jpg";
