	// constants/configuration
	var fltImgSrcFade = 0.2;
	var arrImgSrcObjs = new Array();

	// Caches all versions of the image URL, belonging to the Id, with the last digit substituted by the arguments.
	// for example: 'myimage_0.gif' and 'myimage_1.gif'
	function cacheImgSrcSuffix(strId){
		if(typeof(document.getElementById)!='undefined'){
			var intA, intB, intImgSrcObj;
			// get the picture source name
			strImgUrl = document.getElementById(strId).src;
			// split the url
			arrImgUrl		= strImgUrl.split('.');
			strImgUrlSuffix = '.' + arrImgUrl[arrImgUrl.length-1];
			strImgUrlPrefix = strImgUrl.substr(0,strImgUrl.length-(strImgUrlSuffix.length)-1);
			intImgUrlDigit	= parseInt(strImgUrl.substr(strImgUrlPrefix.length,1));
			// for all desired suffixes
			for(var intA=1; intA<arguments.length; intA++){
				// if the image has no numeric suffix
				if(isNaN(intImgUrlDigit)){
					// use the existing image
					eval(	""
							+ "obj" + strId + arguments[intA] + " = new Image();"
							+ "obj" + strId + arguments[intA] + ".src = '" + strImgUrl + "';"
					);
				// if it doesn't exist yet
				}else{	
					// make a new image obj and store it in 'arrImgSrcObjs' for later reference
					eval(	""
							+ "obj" + strId + arguments[intA] + " = new Image();"
							+ "obj" + strId + arguments[intA] + ".src = '" + strImgUrlPrefix + arguments[intA] + strImgUrlSuffix + "';"
					);
				}
			}
		}
	}

	// swaps the pre-loaded images around on events
	function setImgSrcSuffix(strId,intState){
		if(typeof(document.getElementById)!='undefined'){
			// construct the name of the image-object from the ID
			strObj = 'obj' + strId + intState;
			// check if the image-object actually exists
			chkObj = eval('typeof('+strObj+')');
			if(chkObj!='undefined'){
				// retrieve the image-object
				imgObj = eval(strObj);
				// put is back where you found it
				if(fltImgSrcFade>0 && typeof(document.getElementById(strId).style.filter)!='undefined'){
					// with fading
					document.getElementById(strId).style.filter="blendTrans(duration="+fltImgSrcFade+")";
					document.getElementById(strId).filters.blendTrans.Apply();
					document.getElementById(strId).src = imgObj.src;
					document.getElementById(strId).filters.blendTrans.Play();
				}else{
					// without fading
					document.getElementById(strId).src = imgObj.src;
				}
			}else{
				// cache uncached image
				cacheImgSrcSuffix(strId,intState);
				// then try again
				setImgSrcSuffix(strId,intState);
			}
		}
	}
