var strImageFile;
var longWidth;
var longHeight;

function strURLDecode(strInput, strKey)
{
	var strReturn;
	var longUpperHEXCode;
	var longLowerHEXCode;
	var charDecode;
	var longCol;
	var longACharCode = "A".charCodeAt(0);
	var long0CharCode = "0".charCodeAt(0);

	strReturn = strInput;

	if(strReturn.indexOf("&" + strKey + "=") != -1)
		strReturn = strReturn.substring(strReturn.indexOf("&" + strKey + "=") + ("&" + strKey+ "=").length, strReturn.length);

	if(strReturn.indexOf("&") != -1)
		strReturn = strReturn.substring(0, strReturn.indexOf("&"));

	longCol = strReturn.indexOf("%");
	while(longCol != -1)
	{
		longUpperHEXCode = strReturn.toUpperCase().charCodeAt(longCol + 1);
		if(longUpperHEXCode >= longACharCode)
			longUpperHEXCode = longUpperHEXCode - long0CharCode - (longACharCode - (long0CharCode + 10));
		else
			longUpperHEXCode = longUpperHEXCode - long0CharCode;

		longLowerHEXCode = strReturn.toUpperCase().charCodeAt(longCol + 2);
		if(longLowerHEXCode >= longACharCode)
			longLowerHEXCode = longLowerHEXCode - long0CharCode - (longACharCode - (long0CharCode + 10));
		else
			longLowerHEXCode = longLowerHEXCode - long0CharCode;

		charDecode = String.fromCharCode(longUpperHEXCode * 16 + longLowerHEXCode);

		strReturn = strReturn.substr(0, longCol) + charDecode + strReturn.substring(longCol + 3, strReturn.length);

		longCol = strReturn.indexOf("%");
	}

	return strReturn;
}

function ResizeFit(intImageWidth, intImageHeight)
{
	var intDiffWidth;
	var intFDiffHeight;

	if(navigator.appName=="Netscape")
	{
		intDiffWidth = intImageWidth - window.innerWidth;
		intDiffHeight = intImageHeight - window.innerHeight;
	}
	else
	{
		intDiffWidth = intImageWidth - window.document.body.clientWidth;
		intDiffHeight = intImageHeight - window.document.body.clientHeight;
	}

	window.resizeBy(intDiffWidth, intDiffHeight);
}

function ShowImage()
{
	var strQueryString = window.location.search;
//	var imgImage = document.images[0];
	var loadedImage;

	if(strQueryString.length > 0)
		if(strQueryString.indexOf('?') != -1)
		{
			strQueryString = "&" + strQueryString.substring(strQueryString.indexOf('?') + 1, strQueryString.length) + "&"

			strImageFile = strURLDecode(strQueryString, "Image");
			longWidth = parseInt(strURLDecode(strQueryString, "Width"));
			longHeight = parseInt(strURLDecode(strQueryString, "Height"));

//	 		imgImage.src = new Image(longWidth, longHeight);
//			imgImage.src = strURLDecode(strImageFile);

			ResizeFit(longWidth, longHeight);
		}

	return true;
}
