/// Author				: Chbeir Elias Brian
/// Creation Date		: 14 October 2005
/// Modified by			: Chbeir Elias Brian
/// Modification Date	: 23 October 2005
///
/// Summary :
/// 
/// Functionality in this file is to show radios in right column on 1 or more of ozonakid's websites


var linkToWebsiteContainingStreamFiles = "http://www.ozonakid.com/";

var Radios = new Array();			// Array that holds all Radios for ozonakid


// Function that defines what we need as info to display a radio

function Radio(name, image, description, broadcasterName, streamsFolder)
{
	this.Name = name;
	this.Image = image;
	this.Description = description;
	this.BroadcasterName = broadcasterName;
	this.StreamsFolder = streamsFolder;
}


//////////////////////////////////////////////////////////////


// SET Available Radios

var radiocount = 1;

// Example :
//
// Radios[radiocount++] = new Radio(name of radio, small image to use, few words description, ,name of folder containing the streams files);

// Lonely Radio is then identified by ID = 1
Radios[radiocount++] = new Radio("Lonely Radio", "lonelyradio.jpg", "Freeform; favorites from 30s to now", "ozonakid", "lonelyradio");

// Lonely Lounge Radio is then identified by ID = 2
Radios[radiocount++] = new Radio("The Lonely Lounge", "lonelylounge.jpg", "Sad and Lonely Easy Listening", "lrrocks", "lonelylounge");

// CineStar-80 Radio is then identified by ID = 3
Radios[radiocount++] = new Radio("CineStar-80", "cinestar80.jpg", "The Movie Music of your Life", "cinestar80", "cinestar80");

// Nature Song Radio is then identified by ID = 4
Radios[radiocount++] = new Radio("Nature Song", "naturesong.jpg", "Get Lost With the Sounds of Nature And Selected New Age Music", "naturesong", "naturesong");


//////////////////////////////////////////////////////////////


// radioBeforeMore is the radio that you will put above the "More Radios" image in the right column

// radioIDs is the set of radios that you will below the "More Radios" image in the right column

// For example, say you want "CineStar-80" as the first Radio to be placed above the "More Radios" image, and the rest below it,
// then you call the function CreateRadiosColumn as follows :
//
// <script>CreateRadiosColumn(3, "1,2,4")</script>
//
// On the other hand, if you don't want any radio above the "More Radios" image, then set the first value of the function to 0 (zero)
// as follows : 
//
// <script>CreateRadiosColumn(0, "1,3,4,2")</script>
//
// As you can see from the last example above, you can put the radios in any order you like in the right column; this allows you to
// have them in different order on each page if you prefer.

function CreateRadiosColumn(radioBeforeMore, radioIDs)
{
	var radiosColumn = "";
	var selectedRadios = radioIDs.split(",");

	// Start by displaying, if any, the radio above "More Radios" image
	if (radioBeforeMore > 0)
		radiosColumn += DisplayRadio(radioBeforeMore) + "<BR>";

	// Add the "More Radios" image
	radiosColumn += "<img src='images/MoreRadios.jpg' border='0' alt=''>";
	
	// Display the radios below the "More Radios" image
	for (var i = 0; i < selectedRadios.length; i++)
	{		
		var aSelectedRadio = selectedRadios[i];
	
		radiosColumn += DisplayRadio(aSelectedRadio);
	}

	document.write(radiosColumn);
}


//////////////////////////////////////////////////////////////


// Takes a Radio ID and use its info (name, image, description,....) to render in an HTML table

function DisplayRadio(aSelectedRadio)
{
		var radioToDisplay = "" +
		"<TABLE WIDTH=137 BORDER=0 CELLPADDING=0 CELLSPACING=0>" +
		"<TR>" +
		"<TD background='images/13-bis.jpg' WIDTH=137 HEIGHT=20>" +
		"<div style='padding-top:5px;padding-left:15px'>" +
		"<a class='redlink' href='http://www.ozonakid.com/listen.html'>" + Radios[aSelectedRadio].Name + "</a></div>" +
		"</TD>" +
		"</TR>" +
		"<TR>" +
		"<TD background='images/bak3-bis.jpg' WIDTH=137>" +
		"<div style='padding-top:5px;padding-left:15px;padding-right:15px'>" +
		Radios[aSelectedRadio].Description +
		"</div>" +
		"</TD>" +
		"</TR>" +
		"<TR>" +
		"<TD background='images/bak3-bis.jpg' WIDTH=137 HEIGHT=70>" +
		"<div style='padding-top:5px;padding-left:15px;padding-right:15px'>" +
		"<a href='http://www.ozonakid.com/listen.html'>" +
		"<img src='images/radios/" + Radios[aSelectedRadio].Image + "' width='107' border='0'></a>" +
		"</div>" +
		"</TD>" +
		"</TR>" +
		"<TR>" +
		"<TD background='images/bak3-bis.jpg' align='center'>" +
		"<div style='padding-top:2px;padding-left:15px;padding-right:15px'>" +
		"<a href='http://www.ozonakid.com/listen.html' class='yellowlink'><u>click here to listen</u></a>" +
		"</div>" +
		"</TD>" +
		"</TR>" +
		"<TR>" +
		"<TD background='images/14-bis.jpg' WIDTH=137 HEIGHT=10>" +
		"&nbsp;" +
		"</TD>" +
		"</TR>" +					
		"</TABLE>" +
		"<IMG SRC='images/spacer.gif' WIDTH=137 HEIGHT=5 ALT=''>";
		
		return radioToDisplay;
}