// JavaScript Document<!-- <!--Thanks to Bates College's radio station, WRBC and webmaster Kyle Curtist for this model --!>var days =		["Sunday",			"Monday",			"Tuesday",			"Wednesday",			"Thursday",			"Friday",			"Saturday"];var times =		["midnight-1am",			"1am-2am", 			"2am-3am",			"3am-4am",			"4am-5am",			"5am-6am",			"6am-7am",			"7am-8am",			"8am-9am",			"9am-10am",			"10am-11am",			"11am-noon",			"noon-1pm",			"1pm-2pm",			"2pm-3pm",			"3pm-4pm",			"4pm-5pm",			"5pm-6pm",			"6pm-7pm",			"7pm-8pm",			"8pm-9pm",			"9pm-10pm",			"10pm-11pm",			"11pm-midnight"];//Sundayvar shows =		 [[["Off the Air", "", ""],			["Off the Air", "", ""], 			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Ben Sven", "", "DJs Krystle+Bev"],			["Ben Sven", "", "DJs Krystle+Bev"],			["Are you sure Hank done it this way?", "", "Matt Wibbenmeyer"],			["Are you sure Hank done it this way?", "", "Matt Wibbenmeyer"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Artist in Review", "", "Various"],			["Off the Air", "", ""],			["The Spanish Hour", "", "Mary Carmen+the Spanish TAs"],			["Hurricane Apocalypse Fury", "", "DJ Poi Yay"],			["Hurricane Apocalypse Fury", "", "DJ Poi Yay"]],			//Monday			[["Tepid Chocolate City", "", "DJ Petra"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Democracy Now!", "", "on WCFM"],			["The El Show", "", "Elissa Brown"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["The Hour", "", "Nathan Friend"],			["Off the Air", "", ""],			["PiJean Show", "", "Dj PiJ"],			["PiJean Show", "", "Dj PiJ"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Back to the Pile", "", "DJ R-Madd"],			["Back to the Pile", "", "DJ R-Madd"]],							//Tuesday			[["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["The Spin Cycle", "", "Virginia Cotton"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Democracy Now!", "", "on WCFM"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Zack's Rockin' Tracks", "", "DJ Zack"],			["Zack's Rockin' Tracks", "", "DJ Zack"],			["The Joys of Edinburgh Rock", "", "DJ Myron"],			["The Joys of Edinburgh Rock", "", "DJ Myron"],				["The Quick Fix", "", "DJ Mitch"],				["The Baltimore Club Hour", "", "Matty P"]],			//Wednesday			[["Flesh-Eating Zombie Radio", "", "Peter Nunns"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Democracy Now!", "", "on WCFM"],			["Just Jazz", "", "DJ Natalie Jay"],			["Just Jazz", "", "DJ Natalie Jay"],			["Joy, Glad Joy", "", "DJ Min"],			["Off the Air", "", ""],			["Ed Walker Fan Club", "", "Apprentice Brent"],			["Let the Music Speak", "", "D.L. Smith"],			["Let the Music Speak", "", "D.L. Smith"],			["Igbinedion", "", "DJ Veda"],			["Igbinedion", "", "DJ Veda"],			["Bumpin' Contraption", "", "DJ Consequence"],			["H Show", "", "DJ Elliot"]],			//Thursday			[["H Show", "", "DJ Elliot"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],           		["the spin cycle", "", "DJ Virginia Cotton"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Democracy Now!", "", "on WCFM"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["::Dreamstate::", "", "Narcoleptic Bunny"],			["Transatlanticism", "", "DJ Carter"],			["Current EPHvents", "", "Jeff+Andy"],			["Somebody Call A Medic", "", "DJ Jessica"],				["Somebody Call A Medic", "", "DJ Jessica"],			["Whatev", "", "Laura Specker"],			["The Show", "", "Seulghee+Rob"],			["The Show", "", "Seulghee+Rob"]],			//Friday			[["Off the Air", "", ""],					["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],       		    	["Good Morning Williams", "", "Hallock Svensk"],        	        ["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Democracy Now!", "", "on WCFM"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],     		        ["Decomposing Composers", "", "Ronit"],      		        ["Decomposing Composers", "", "Ronit"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""]],						//Saturday			[["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Williams Football", "", "on WCFM"],			["Williams Football", "", "on WCFM"],			["What steps has the Prime Minister taken?", "", "DJ Ex Machina"],			["What steps has the Prime Minister taken?", "", "DJ Ex Machina"],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""],			["Off the Air", "", ""]]];function loadsched(myday) {	var schedstuff = "";	prevday = myday - 1;	if (prevday == -1) {			prevday = 6;	}	nextday = myday + 1;	if (nextday == 7) {			nextday = 0;	}	windowheader = "<html><head><title>Schedule for " + days[myday] + " on RBC</title><body bgColor='#333333' text='#000000'>";	schedstuff = "<table width='100%' align='center' border='0' cellpadding='0' cellspacing='1'><tr><td bgcolor='#FFAC00'><a href='javascript:opener.loadsched(" + prevday + ");'>&lt;&lt;" + days[prevday] + "</a></td><td align='center' bgcolor='#FFAC00'>" + days[myday] + "</td><td bgcolor='#FFAC00' width='20%' align='right'><a href='javascript:opener.loadsched(" + nextday + ");'>" + days[nextday] + "&gt;&gt;</a></td></tr>";	for(y=0; y<shows[myday].length; y++){		schedstuff += "<tr><td bgcolor='#FFAC00' width='20%'>" + times[y] + "</td><td colspan='2' align='center' bgcolor='#FFAC00'>";		schedstuff += shows[myday][y][0] ;		schedstuff += "<br>" + shows[myday][y][1];		schedstuff += "<br>" + shows[myday][y][2];		schedstuff += "</td></tr>";	}	schedstuff += "</table>";		windowfooter = "</body></html>";	schedwindow = window.open("", "schedwindow", "width=400,height=500,scrollbars");	schedwindow.document.write(windowheader + schedstuff + windowfooter);	schedwindow.document.close();}function onnow() {var day = new Date();var time = day.getHours();var currentshow = time;day = day.getDay();var theHTML = "<b>Show:</b> " +  shows[day][currentshow][0] + "<br>";theHTML += "<b>DJ:</b> " + shows[day][currentshow][2] + "<br>";theHTML += "<b>Genre:</b> " + shows[day][currentshow][1];document.write(theHTML);}function newwindowformat() {	windowheader = "<html><head><title>Format Letter Codes</title><body bgColor='#333333' text='#000000'>";	windowbody = rbcformatletters();	windowfooter = "</body></html>";	allHTML = windowheader + windowbody + windowfooter;	formatwindow = window.open("", "formatwindow", "width=255,height=500,scrollbars");	formatwindow.document.write(allHTML);	formatwindow.document.close();}function parsesearch() {	if(document.rbcsearch.searchtype[0].checked) {		typeofsearch = 0;	} else {		typeofsearch = 2;	}	whattosearch = document.rbcsearch.searchvalue.value;	search(typeofsearch, whattosearch);}function search(searchtype, searchquery) {	searchquery = searchquery.toLowerCase();	var resultlist = "", checkedone = "", checkedtwo = "";	if(searchtype == 0) {		checkedone = " CHECKED";	} else {		checkedtwo = " CHECKED";	}	var numberofhits = 0, match=-1;	//alert("Searching for<br>" + searchtype + "<br>" + searchquery);	for(searchday=0; searchday<shows.length; searchday++){		for(searchtime=0; searchtime<shows[searchday].length; searchtime++) {			currentshow = shows[searchday][searchtime][searchtype].toLowerCase();			match = currentshow.indexOf(searchquery)			if(match == -1) {			} else {					resultlist += "<b>" + days[searchday] + " at " + times[searchtime] + ":</b><br>" + shows[searchday][searchtime][0] + "<br>" + shows[searchday][searchtime][2] + "<p>";				numberofhits++;			}		}	}			windowheader = "<html><head><title>WRBC Search: " + searchquery + "</title><link rel='stylesheet' href='http://abacus.bates.edu/wrbc/newpage.css' type='text/css'><link rel='stylesheet' href='http://abacus.bates.edu/wrbc/thisisit.css' type='text/css'><style>p {color:#FFFFFF;}</style><script language='Javascript'>function parsesearch() {	if(document.rbcsearch.searchtype[0].checked) {	typeofsearch = 0; 	} else { typeofsearch = 2; 	} whattosearch = document.rbcsearch.searchvalue.value; opener.search(typeofsearch, whattosearch);}</script><body bgColor='#333333' text='#000000'>";	windowbody = "<p>Your search for <i>" + searchquery + "</i> matched " + numberofhits + " results.";		if(numberofhits != 0) {		displayresults = "<p>Here are the shows matched:<p>"		displayresults += resultlist;	} else {		displayresults = "<p>Are you sure you were thinking of WRBC?";	}	windowfooter = "<br>Search again:<form name='rbcsearch' onSubmit='javascript:parsesearch(); return false;'><input type='text' name='searchvalue' value='" + searchquery + "'><input type='button' value='Find the Show!' onClick='parsesearch();'><br><input type='radio' name='searchtype' value='0'" + checkedone + ">Search a show name<input type='radio' name='searchtype' value='1'" + checkedtwo + ">Search a DJ name</form></body></html>";		allHTML = windowheader + windowbody + displayresults + windowfooter;	searchresults = window.open("", "searchresults", "width=400,height=500,scrollbars");	searchresults.document.write(allHTML);	searchresults.document.close();}