// Common javascript functions for the site

// function to set up images for preloading
function imageCreate(img_DOM_name, img_file_name_on, img_file_name_off) {
	eval(img_DOM_name + '_on = new Image()');
	eval(img_DOM_name + '_on.src = img_file_name_on');
	eval(img_DOM_name + '_off = new Image()');
	eval(img_DOM_name + '_off.src = img_file_name_off');
}

// function to swap images
// root (as well as name in <img src> tag) and state to correspond exactly with above
function imageSwap(root,state) {
	state = '_' + state;
	if (document.images) {
		theImage = eval(root + state + '.src');
		eval('document.' + root + '.src = theImage');
	}
}
