/*
 * rotate.js
 *
 * Updated for School of Music:  2:05pm 7/18/2006 <pk@northwestern.edu>
 *
 */
 
var homeimages = new Array();
 
function loadimageandcaption ()
{	
/*	insertinfo("images/homerotator/BSM_NSW2008.jpg", "Dean Toni-Marie Montgomery addresses the first class of the Henry and Leigh Bienen School of Music on the first day of Northwestern University's new student orientation program. The Bienen School adopted its new name on September 1. In the foreground are (from left) Ryan O'Mealey, Associate Director of Music Admission and Financial Aid, and Richard Van Kleeck, Director of Concert Activities. <i>Photo: Marck Bailey</i>"); 
	insertinfo("images/homerotator/pick-staiger_summer.jpg", "Pick-Staiger Concert Hall is recognized as one of the finest concert halls in the Midwest. <i>Photo: Marck Bailey</i>"); 
	insertinfo("images/homerotator/lutkinstainedglass.jpg", "A detail of two of the stained glass panels that decorate the lobby of the 400-seat Lutkin Hall. <i>Photo: Marck Bailey</i>"); 
	insertinfo("images/homerotator/strings.jpg", "Established in 1895, the Henry and Leigh Bienen School of Music is one of the oldest degree-conferring music schools in the United States and was one of the founding members of the National Association of Schools of Music."); 
	insertinfo("images/homerotator/lutkin_winter08.jpg", "The 400-seat Lutkin Hall, home of many recitals, concerts and lectures, in February 2008. <i>Photo:  Marck Bailey</i>");
	insertinfo("images/homerotator/mab_winter08.jpg", "The Music Administration Building in February 2008. <i>Photo:  Marck Bailey</i>");
	insertinfo("images/homerotator/kristin_figard.jpg", "Senior/violist Kristin Figard performs at the Kennedy Center's Terrace Theater in May 2007 as part of the Center's Conservatory Project. <i>Photo:  Margot I. Schulman</i>");
	insertinfo("images/homerotator/micaela_oeste.jpg", "Masters student/soprano Micaela Oeste performs at the Kennedy Center's Terrace Theater in May 2007 as part of the Center's Conservatory Project. <i>Photo:  Margot I. Schulman</i>");
	insertinfo("images/homerotator/michael_martin.jpg", "Senior Michael Martin performs at the Kennedy Center's Terrace Theater in May 2007 as part of the Center's Conservatory Project. <i>Photo:  Margot I. Schulman</i>");
	insertinfo("images/homerotator/sian_ricketts.jpg", "Senior Sian Ricketts performs at the Kennedy Center's Terrace Theater in May 2007 as part of the Center's Conservatory Project. <i>Photo:  Margot I. Schulman</i>");
*/	insertinfo("images/homerotator/kennedy_GeraldineOng.jpg", "Geraldine Ong performs at the Kennedy Center's Terrace Theater in May 2009 as part of the Center's Conservatory Project. <i>Photo:  Margot Schulman</i>");
	insertinfo("images/homerotator/kennedy_CharlainePrescott.jpg", "Charlaine Prescott performs at the Kennedy Center's Terrace Theater in May 2009 as part of the Center's Conservatory Project. <i>Photo:  Margot Schulman</i>");
	insertinfo("images/homerotator/kennedy_GrantKnox.jpg", "Grant Knox performs at the Kennedy Center's Terrace Theater in May 2009 as part of the Center's Conservatory Project. <i>Photo:  Margot Schulman</i>");
	insertinfo("images/homerotator/lutkin_fall.jpg", "Fall comes to Lutkin Hall, home of many recitals, concerts and lectures. <i>Photo:  Marck Bailey</i>");
	insertinfo("images/homerotator/regenstein_fall.jpg", "Fall colors creep across the ivy on the Regenstein Hall of Music. <i>Photo:  Marck Bailey</i>");
/*	insertinfo("images/homerotator/johnny_salinas.jpg", "Doctoral student Johnny Salinas performs at the Kennedy Center's Terrace Theater in May 2007 as part of the Center's Conservatory Project. <i>Photo:  Margot I. Schulman</i>");
	insertinfo("images/homerotator/marsalisconvo.jpg", "Musician Wynton Marsalis will speak at Northwestern University's 2009 commencement as well as the Henry and Leigh Bienen School of Music's convocation. (See link to press release in News section below.) <i>Photo: Arleen Ng/EPA</i>");
*/	var randomnumber = Math.floor(Math.random() * homeimages.length);
	document.getElementById("homepageimage").innerHTML = homeimages[randomnumber][0];
	document.getElementById("imagecaption").innerHTML = homeimages[randomnumber][1];
}

function addrotatingelement (rotatinginfoarray)
{
	homeimages[homeimages.length] = rotatinginfoarray;
}

function insertinfo (picture, caption)
{
	var rotatingelement = new Array();
	//RegEx example used from: http://zamov.online.fr/EXHTML/DHTML/DHTML_983246.html
	nohtmlcaption = caption.replace(/(<([^>]+)>)/ig," ");
	rotatingelement[0] = "<img src=\"" + picture + "\" alt=\"" + nohtmlcaption + "\" class=\"homepagelargeimage\" />";
	rotatingelement[1] = caption;
	
	addrotatingelement (rotatingelement);
}
