function DocFileNameExtract(wholeurl)
{
   x = wholeurl.length;
   while((wholeurl.substring(x,x-1)) != "/"){ x--; } clipstart = x;
   return wholeurl.substring(wholeurl.length,clipstart);
}

function loadImage(thisImg) {
	if (fader) {
		clearInterval(fader);
	}
	isrc=DocFileNameExtract(thisImg.src);

	thisDIVName = eval("document.getElementById('newImageLayer')");
	thisDIVName.innerHTML='<table height="402" width="324" border="0"><tr><td bgcolor="#999999" valign="middle" align="center"><img id="newImage" src="Images/'+isrc+'"></td></tr></table>';
// alert(thisDIVName.innerHTML);
	viz=0;
	status="";
	fader=eval('setInterval("imgFade()",fadeSpeed)');
}
function imgFade() {
	if (viz<100) {
		viz+=5;
		if (thisDIVName.filters) {
			thisDIVName.filters.alpha.opacity=viz;
		}
		else if (thisDIVName.style.MozOpacity) {
			thisDIVName.style.MozOpacity=viz/100;
		}
		else {
			viz=100;
		}
	}
	else {
		newImg = eval("document.getElementById('newImage')");
		document.images.mainImg.src=newImg.src;
		viz=0;
		thisDIVName.innerHTML=null;
		if (thisDIVName.filters) {
			thisDIVName.filters.alpha.opacity=viz;
		}
		else if (thisDIVName.style.MozOpacity) {
			thisDIVName.style.MozOpacity=viz/100;
		}
		clearInterval(fader);
	}
}

