var saveImgWidthLarge = [];
var saveImgWidthSmall = [];


function enlargerScaleImg(imageId, displayWidth, callSource)
{
	currentImg = document.images[imageId];
	
	if (callSource == 1)
	{
		saveImgWidthLarge[currentImg.id]=(currentImg.width);
		saveImgWidthSmall[currentImg.id]=(displayWidth);
	}

	if (currentImg.width>(saveImgWidthSmall[currentImg.id]))
	{
		currentImg.width=(saveImgWidthSmall[currentImg.id]);
	}
	else
	{
		currentImg.width=(saveImgWidthLarge[currentImg.id]);
	}

	if (callSource == 1)
	{
		saveImgWidthSmall[currentImg.id]=(currentImg.width);
	}

	enlargerInitImage(imageId); 
	currentImg.style.cursor = "pointer";
	//currentImg.style.visibility = "visible";
}



function enlargerInitImage(imageId) 
{
//	imageId = 'fxphoto';
	image = document.getElementById(imageId);
//	setOpacity(image, 0);
	image.style.visibility = "visible";
//	enlargerFadeIn(imageId,0);
}

function enlargerFadeIn(objId,opacity) 
{
	if (document.getElementById)
	{
		obj = document.getElementById(objId);
		if (opacity <= 100) 
		{
			setOpacity(obj, opacity);
			opacity += 10;
			window.setTimeout("enlargerFadeIn('"+objId+"',"+opacity+")", 20);
		}
	}
}

function setOpacity(obj, opacity) 
{
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}

