
/**
 * Preload image function
 * pi_imgsrc	: url of image
 * return a new set image
 **/
function preloadImage(pi_imgurl) {
	if (document.images) {
		new_img = new Image();
		new_img.src = pi_imgurl;
		return new_img;
		}
	}

/**
 * Swap Image function
 * pi_imgname	: name of IMG tag inside html page
 * pi_imgkey	: key of preloaded image
 **/
function swapImages(pi_imgname, pi_imgkey) {
	if (document.images) {
		document[pi_imgname].src = eval(pi_imgkey+".src");
    	}
	}

