/**
	Base JavaScript functions for all browsers on the site.
	
	Author:	Andrew Fisher (andrew.fisher@xmlinfinity.com)
	
**/

function SwitchTitle() {

	// this function gets the title and switches it out appropriately so that the *actual* title is a nice piece of real structured HTML.
	theobj = $(".titleswitch");
	
	theurl = theobj.attr("dir");

	newhtml = "<img src=\"" + basepath + theurl + "\">";
	theobj.html(newhtml);
	
}

function ChooseRandom() {
	// this function chooses a random image to add to the page if one hasn't been done already.
	theobj = $("img.randomimage");
	index = Math.round(Math.random()*(imagearray.length-1));
	
	theobj.attr("src" , basepath + imagearray[index]);
	theobj.attr("alt" , altarray[index]);


}




$(document).ready(function () {

	SwitchTitle();
	
	ChooseRandom();

});
