/*
 * rotate.js
 *
 * Updated for UCS:  3:03pm 8/18/20006 <pk "at" northwestern.edu>
 *
 */
 
var homeimages = new Array();

function rotateimage ()
{	
	/////////rotating images definitions.../////////////////////////////////////////
	insertinfo("images/rotating/homepagephoto1.jpg", "University Career Services");
	/////////end of rotating images definitions...//////////////////////////////////
	
	var randomnumber = Math.floor(Math.random() * homeimages.length);
	document.getElementById("homepageimage").innerHTML = homeimages[randomnumber][0];
}

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 + "\" height=\"127\" width=\"544\" name=\"homepagephoto\" alt=\"" + nohtmlcaption + "\" vspace=\"0\" hspace=\"0\" />";
	rotatingelement[1] = caption;
	
	addrotatingelement (rotatingelement);
}