// MediaSilo Lineup/Channel Display Javascript
// Version 0.1, June 1, 2009

// Loads the Channel JSON file and executes the returning function and data set
function loadChannel(url) {
	var headID = document.getElementsByTagName("head")[0];         
	var newScript = document.createElement('script');
	newScript.type = 'text/javascript';
	newScript.src = url;
	headID.appendChild(newScript);
}

// Dislay the channels using generic css
function processChannel(feed){
	var line = "";
	var line = "<ul id='nav'>";
 	for(i=0; i<feed.lineups.length; i++) {
		var line = line + "<li><a href=\"#\" onclick=\"mediasiloplayer.sendEvent('STOP');mediasiloplayer.sendEvent('LOAD','"+feed.lineups[i].url+"')\">" + feed.lineups[i].name + "</a></li>";
  	}
	var line = line + "</ul>";
	// Write the navigation
	document.getElementById("lineup-navigation").innerHTML = line;
}

