var baseImgDir = "/i/";

var imageSuffix = ".gif";
var path = baseImgDir + "xw4/";
var currentImg = "";
var list = new Array();

function preload(name, statusText, ifHi, path, imageSuffix) {
	if (document.images) {
		list[name] = new Object();
		list[name].message = statusText;
		list[name].off = new Image();
		list[name].off.src = path + name + "-off" + imageSuffix;
		if (ifHi == 1) {
			list[name].hi = new Image();
			list[name].hi.src = path + name + "-hi" + imageSuffix;
		}
	}
}

function imgHi(whichImg) {
	if (document.images && list[whichImg].hi) {
		document.images[whichImg].src = list[whichImg].hi.src;
	}
	window.status = list[whichImg].message;
}

function imgOff(whichImg) {
	if (document.images && list[whichImg].off) {
		document.images[whichImg].src = list[whichImg].off.src;
	}
	currentImg = "";
	window.status = "";
}

function emailLink() {
	window.location = 'mailto:frank@c' + 'acophony.com';
}

function openWin(url,name,width,height) {
	var offH = 0;

	if (navigator.appVersion.indexOf("Mac") != -1) {
		offH = 20;
	} else if (navigator.appVersion.indexOf("Win") != -1) {
		offH = 30;
	}

	xwWin = window.open(url,'XW' + name,'width=' + width + ',height=' + height + ',location=0,titlebar=0,toolbar=0,menubar=0,directories=0,personalbar=0,status=1,resizable=1,scrollbars=1');
}
