//taken from http://www.dhtmlkitchen.com/ used for gallery
// Remember, the image's name will be the same as the
// file name except without the extension (.gif/.jpg/.png)
  
function loadimages() {

 for (var i = 0; i < arguments.length; i++) {
	 var temp = makeId(arguments[i]);
	 eval(temp +"= new Image()");
	 eval(temp+".src ='"+ arguments[i] +"'");

 }
}

//used above
function makeId(path) {
	return path.substring(path.lastIndexOf("/")+1, path.lastIndexOf("."));
}

//swap used for gallery

function swap(id, newimg) {
	var me = document.getElementById(id);	
	me.src = newimg.src;
}

function changetext(thetext) {
	document.getElementById('artistcaption').innerHTML = thetext;
}


function preprollovers() {
	var rollfound=0;

	if (document.getElementsByTagName) {

// grab all the images on a page

	for (z=0;z<document.getElementsByTagName("img").length;z++) {
		thisImg = document.getElementsByTagName("img")[z];

// check that its got the proper class
		if (thisImg.className !=null) { /* safari seems to break when these two tests are combined */
			if (thisImg.className.indexOf("roll") != -1) {
				rollfound++;

// define states, preload the image and attach the event handlers
				thisImg.out = new Image(); thisImg.out.src = thisImg.src;

//hacked by essl to use with gifs and jpegs not sure if this is the best way
				if(thisImg.src.toString().indexOf(".gif")!=-1) {
					thisImg.over = new Image(); thisImg.over.src = thisImg.src.toString().replace(/.gif/i,"_o.gif");
				 }
				if(thisImg.src.toString().indexOf(".jpg")!=-1) {
					thisImg.over = new Image(); thisImg.over.src = thisImg.src.toString().replace(/.jpg/i,"_o.jpg");
				 }					
				thisImg.parentNode.onmouseover = function () {
					this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].over.src;
				};
				thisImg.parentNode.onmouseout = function () {
					this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].out.src;
				};
			}
		}		
	}
}
}