
/**
 * The contents of this JavaScript, which preloads images and displays 
 * alternate images on a mouseover, has been adapted from open source 
 * appearing at http://www.starwars.com/
 * ttnSwapBackground has been adapted from examples courtesy of
 * http://forums.devarticles.com and http://www.webdeveloper.com/forum/
 **/

function WM_preloadImages() {
	if (document.images) {
		if (typeof(document.WM) == 'undefined') document.WM = new Object();
		if (typeof(document.WM.loadedImages) == 'undefined') document.WM.loadedImages = new Array();
		var args = WM_preloadImages.arguments.length;
		for (var i=0;i<args;i++) {
			var load = 0;
			document.WM.loadedImages[load = document.WM.loadedImages.length] = new Image();
			document.WM.loadedImages[load].src = WM_preloadImages.arguments[i]; }}
	return true; }

function WM_imageSwap(daImage,daSrc) {
	var objStr, obj;
	if (document.images) {
		if (typeof(daImage) == 'string') {
			// objStr is here to gain compatability with ie3 for the mac.
			objStr = 'document.' + daImage;
			obj = eval(objStr);
			obj.src = daSrc; }
		else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
			daImage.src = daSrc; }}
	return true; }

function ttnSwapBackground(ttnid,ttnbg) {
	if (!document.getElementById) {
		return false; }
	document.getElementById(ttnid).style.backgroundImage = "url('"+ttnbg+"')";
	return true; }

