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;
				};
			}
		}		
	}
}
}


var n = (document.layers) ? 1:0; 
var ie = (document.all) ? 1:0;
var safari = (navigator.userAgent.indexOf("Safari") > -1) ? 1:0;
var mac = (navigator.userAgent.indexOf('Mac')>-1) ? 1:0;
function openWin( html, name, wval, hval ) {
	
	// set general size vars
	var w_val = wval;
	var h_val = hval;


	// if browser is ie mac
	if (ie && mac) {
		w_val -= 16;
		h_val -= 16;
	}
	
	// if browser is safari mac
	if (safari && mac) {
		w_val -= 2;
		h_val += 15;
	}
	
	// open the browser
	var nw=window.open( html, name, 'width='+w_val+',height='+h_val+',status=yes,menubar=no,scrollable=no,resizable=no');
	nw.focus();
	
	// move it to the upper lefthand corner
	nw.moveTo(((screen.width/2)-(wval/2)),((screen.height/2)-(hval/2)));
		
}


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("."));
}


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