function printDate() {
	var month = new Array()
	month[0]  = "January"
	month[1]  = "February"
	month[2]  = "March"
 	month[3]  = "April"
 	month[4]  = "May"
 	month[5]  = "June"
 	month[6]  = "July"
 	month[7]  = "August"
 	month[8]  = "September"
 	month[9]  = "October"
 	month[10] = "November"
 	month[11] = "December"
	var curDate = new Date()
	var curHour = curDate.getHours()
	var curMinutes = curDate.getMinutes()
	var curMonth = month[curDate.getMonth()]
	var curDay = curDate.getDate()
	var curYear = curDate.getYear()
	var AMPM = "a.m."
	if( curHour >=12 ) {
		curHour = curHour - 12
		AMPM = "p.m."
	}
	if( curHour == 0 ) {
		curHour = 12
	}
	if(curMinutes <10) {
		curMinutes = "0" + curMinutes
	}
	document.write( curMonth + " " + curDay + ", " + curYear + ", " + curHour + ":" + curMinutes + " " + AMPM )
}

function putAd() {
	
	var adLocation = new Array()
	adLocation[0] = "http://youtube.com/profile?user=thelanceonline"
	adLocation[1] = "http://www.uplace.ca"
	adLocation[2] = "/advertise.html"
	adLocation[3] = "http://www.santuarioglobal.com"
	adLocation[4] = "http://1price.ca/"

        	
	var adImage = new Array()
	adImage[0] = "/ads/youtube-ad.jpg"
	adImage[1] = "/ads/e-chug.jpg"
	adImage[2] = "/ads/ad2.gif"
	adImage[3] = "/ads/sg_ad.jpg"
	adImage[4] = "/ads/pssweb.jpg"


	var curAd = Math.floor(Math.random()*(adLocation.length+1))
	var curAdText = "" /*<a href=\"" + adLocation[curAd] + "\"><img src=\"" + adImage[curAd] + "\"></a>"*/
	
	if (curAd == curAd)
	{
		curAdText ="<iframe name=\"adgearExtIframe_4832\" id=\"adgearExtIframe_4832\" height=\"600\" width=\"160\" src=\"https://acs.adgear.com//adgear.js/current/iframes/iframe_placement.html?AG_PID=4832&amp;AG_SOURCE_CLICKTRACKER_EXPECTS_ENCODED=false&amp;AG_SOURCE_CLICKTRACKER_IS_ENCODED=false&amp;AG_SOURCE_CLICKTRACKER_IS_DOUBLE_ENCODED=false&amp;AG_R=%ZZRAND%&amp;AG_SOURCE_CLICKTRACKER=%ZZCLICK%\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"></iframe>"

	}

	document.write(curAdText)
}
	

function putMusic( fileDesc, filePath) {

	var musicBox =  "<table style='height:70px; width:170; background:#F6F7EE; margin:10px 0 0 1px;'>";
	musicBox     += "	<tr>";
	musicBox     += "		<td style='height:29px; width:170; background:#52534E;'>";
	musicBox     += "			<p style='font-size:12px;color:#FFFFFF;text-align:center'>" + fileDesc + "</p></td>";
	musicBox     += "	</tr>"
	musicBox     += "	<tr>"
	musicBox     += "		<td style='height:40px; width:170; padding:7px 0 0 10px;' class='content'>";
	musicBox     += "			<OBJECT width='160' height='42'>";
	musicBox     += "				<param name='SRC' value='" + filePath + "'>";
	musicBox     += "				<param name='AUTOPLAY' VALUE='false'>";
	musicBox     += "				<param name='CONTROLLER' VALUE='true'>";
	musicBox     += "				<param name='BGCOLOR' VALUE='#F6F7EE'>";
	musicBox     += "				<EMBED SRC='" + filePath + "' AUTOSTART='FALSE' LOOP='FALSE' WIDTH='160' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#F6F7EE'></EMBED>";
	musicBox     += "			</OBJECT>";
	musicBox     += "		</td>";
	musicBox     += "	</tr>";
	musicBox     += "</table>";
	
	document.write( musicBox );
}

var currentSongDesc;
var currentSongPath;

function changeSong( filePath, fileDesc, slot) {
	var player = document.getElementById( "musicBox");
	var changedLink = document.getElementById( "slot" + slot);
	
	player.innerHTML  = "<p>" +fileDesc+"</p>";
	player.innerHTML += "<EMBED SRC='" + filePath + "' AUTOSTART='FALSE' LOOP='FALSE' WIDTH='160' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#F6F7EE'></EMBED>";
	

	changedLink.href = "javascript:changeSong( \"" + currentSongPath + "\", \"" + currentSongDesc + "\", " + slot + ")";
	changedLink.innerHTML = "Play " + currentSongDesc;

	currentSongDesc = fileDesc;
	currentSongPath = filePath;
}

function putMusicChooser( file1Desc, file1Path, file2Desc, file2Path, file3Desc, file3Path) {

	var musicBox =  "<table style='height:70px; width:170; background:#F6F7EE; margin:10px 0 0 1px;'>";
	currentSongDesc = file1Desc;
	currentSongPath = file1Path;
	musicBox     += "	<tr>";
	musicBox     += "		<td style='height:29px; width:170; background:#52534E;'>";
	musicBox     += "			<p style='font-size:12px;color:#FFFFFF;text-align:center'>Lance Radio: Editor\'s Picks</p></td>";
	musicBox     += "	</tr>"
	musicBox     += "	<tr>"
	musicBox     += "		<td id='musicBox' style='height:40px; width:170; padding:7px 0 0 10px;' class='content'>";
	musicBox     += "			<p>" +file1Desc+"</p>";
	musicBox     += "			<OBJECT width='160' height='42'>";
	musicBox     += "				<param name='SRC' value='" + file1Path + "'>";
	musicBox     += "				<param name='AUTOPLAY' VALUE='false'>";
	musicBox     += "				<param name='CONTROLLER' VALUE='true'>";
	musicBox     += "				<param name='BGCOLOR' VALUE='#F6F7EE'>";
	musicBox     += "				<EMBED SRC='" + file1Path + "' AUTOSTART='FALSE' LOOP='FALSE' WIDTH='160' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#F6F7EE'></EMBED>";
	musicBox     += "			</OBJECT>";
	musicBox     += "		</td>";
	musicBox     += "	</tr>";
	musicBox     += "	<tr>";
	musicBox     += "		<td style='height:40px; width:170; padding:7px 0 0 10px;' class='content'>";
	musicBox     += "			<a href=\'javascript:changeSong(	\"" + escape(file2Path) +"\", \"" + escape(file2Desc) + "\", 1)\' id='slot1'>Play " + file2Desc +"</a>";
	musicBox     += "		</td>";
	musicBox     += "	</tr>";
	musicBox     += "	<tr>";
	musicBox     += "		<td style='height:40px; width:170; padding:7px 0 0 10px;' class='content'>";
	musicBox     += "			<a href=\'javascript:changeSong(	\"" + escape(file3Path) + "\", \"" + escape(file3Desc) + "\", 2)\' id='slot2'>Play " + file3Desc +"</a>";
	musicBox     += "		</td>";
	musicBox     += "	</tr>";
	musicBox     += "</table>";
	
	document.write( musicBox );
}


function putSports( fileDesc, filePath) {

	var musicBox =  "<table style='height:70px; width:170; background:#F6F7EE; margin:10px 0 0 1px;'>";
	musicBox     += "	<tr>";
	musicBox     += "		<td style='height:29px; width:170; background:#52534E;'>";
	musicBox     += "			<p style='font-size:12px;color:#FFFFFF;text-align:center'>" + fileDesc + "</p></td>";
	musicBox     += "	</tr>"
	musicBox     += "	<tr>"
	musicBox     += "		<td style='height:40px; width:170; padding:7px 0 0 10px;' class='content'>";
	musicBox     += "			<OBJECT width='160' height='42'>";
	musicBox     += "				<param name='SRC' value='" + filePath + "'>";
	musicBox     += "				<param name='AUTOPLAY' VALUE='false'>";
	musicBox     += "				<param name='CONTROLLER' VALUE='true'>";
	musicBox     += "				<param name='BGCOLOR' VALUE='#F6F7EE'>";
	musicBox     += "				<EMBED SRC='" + filePath + "' AUTOSTART='FALSE' LOOP='FALSE' WIDTH='160' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#F6F7EE'></EMBED>";
	musicBox     += "			</OBJECT>";
	musicBox     += "		</td>";
	musicBox     += "	</tr>";
	musicBox     += "</table>";
	
	document.write( musicBox );
}			

