var images = [
"image1.jpg",
"image2.jpg",
"image3.jpg",
"image4.jpg",
"image5.jpg"
] ;
function rotator() {
    var index = Math.floor(21*Math.random() % images.length) ;
	var headingImage = "<img id='topImg' class='random_image' src='templates/simple_01/images/homepage/" + images[index] + "' alt='' />";
	document.write(headingImage);
	return index;
}

function get_feed(id, url) {
	var items = '';
	
	$.ajax({
		url: url,
		dataType: "xml",
		success: function(xml) {
			$(xml).find('item').each(function(i){
				if (i < 5) {
					var title = $(this).find('title').text();
					var link = $(this).find('link').text();
					
					items += '<li><a href="' +link+ '">' +title+ '</a></li>';
				}
			});
			if(items == "") items = '<li style="color: #fff;padding:10px;">Coming soon.</li>';
			$(id).html('<ul>' +items+ '</ul>');
		}
	});
}

$(document).ready(function(){
	// Athlete News
	get_feed("#athlete_news_feed","/systems/rss.aspx?pg=142&c=en-US");
	
	// Coaches' Corner
	get_feed("#coaches_corner_feed","/systems/rss.aspx?pg=114&c=en-US");
	
	$('#accordion>small').remove();
});

	$(function() {
		$("#tabs").tabs();
	});
	$(function() {
		$("#accordion").accordion({
			event: "mouseover",
			autoHeight: false
		});
	});

