function findObjById(objName) {
	var obj = null;

	if ( document.getElementById ) {
		obj = document.getElementById(objName);
	} else if ( !(obj = document[objName]) && document.all ) {
		obj = document.all[objName];
	}
	return obj;
}

// preload the images
if (document.images) {
	// preload the hover images
	document.hoverimages = new Array();
	document.hoverimages[1] = new Image();
	document.hoverimages[1].src = '/images/action1-hover.gif';
	document.hoverimages[2] = new Image();
	document.hoverimages[2].src = '/images/action2-hover.gif';
	document.hoverimages[3] = new Image();
	document.hoverimages[3].src = '/images/action3-hover.gif';

	// preload the original image names
	document.normalimages = new Array();
	document.normalimages[1] = new Image();
	document.normalimages[1].src = '/images/action1.gif';
	document.normalimages[2] = new Image();
	document.normalimages[2].src = '/images/action2.gif';
	document.normalimages[3] = new Image();
	document.normalimages[3].src = '/images/action3.gif';
}

// the image rollover methods
function swapImage(imageObj, hover, srcIndex) {
	if (!document.images) return;

	if ( hover == 'on' ) {
		imageObj.src = document.hoverimages[srcIndex].src;
	} else {
		imageObj.src = document.normalimages[srcIndex].src;
	}
		
}
function swapAction1() {
	swapImage(document.action1Image, 'on', 1);
}
function restoreAction1() {
	swapImage(document.action1Image, 'off', 1);
}
function swapAction2() {
	swapImage(document.action2Image, 'on', 2);
}
function restoreAction2() {
	swapImage(document.action2Image, 'off', 2);
}
function swapAction3() {
	swapImage(document.action3Image, 'on', 3);
}
function restoreAction3() {
	swapImage(document.action3Image, 'off', 3);
}

// set the event handlers
var obj;
if ( obj = findObjById('action1Link') ) {
	obj.onmouseover = swapAction1;
	obj.onmouseout = restoreAction1;
	obj.onfocus = swapAction1;
	obj.onblur = restoreAction1;
}
if ( obj = findObjById('action2Link') ) {
	obj.onmouseover = swapAction2;
	obj.onmouseout = restoreAction2;
	obj.onfocus = swapAction2;
	obj.onblur = restoreAction2;
}
if ( obj = findObjById('action3Link') ) {
	obj.onmouseover = swapAction3;
	obj.onmouseout = restoreAction3;
	obj.onfocus = swapAction3;
	obj.onblur = restoreAction3;
}
