function SwapImage(objImg, strPath)
{
	objImg.src = strPath;
}

function HighLight(objRow)
{
	objRow.className = "Hover";
}

function UnHighLight(objRow)
{
	objRow.className = "Inactive";
}

function ZoomImage(strTitle, strImagePath)
{
	var objImage = new Image();
	
	objImage.src = strImagePath;
	objImage.onload = function()
	{
		ShowImage(strTitle, objImage);
	}
	if (objImage.complete)
	{
		ShowImage(strTitle, objImage);
	}
}

function ShowImage(strTitle, objImage)
{
	if (objImage.width > 800)
	{
		objImage.height = objImage.height * 800 / objImage.width;
		objImage.width = 800;
	}

	if (objImage.height > 600)
	{
		objImage.width = objImage.width * 600 / objImage.height;
		objImage.height = 600;
	}
	
	var intLeft = (screen.availWidth / 2) - (objImage.width / 2);
	var intTop = (screen.availHeight / 2) - (objImage.height / 2);
	var strSettings = "toolbar=no,status=no,help=no,resizable=no,left=" + intLeft + ",top="+ intTop + ",width=" + objImage.width + ",height=" + objImage.height;
	var objWindow = window.open(objImage.src, "", strSettings);
	var strHtml = "<html><head><title>" + strTitle + "</title></head><body style='margin: 0 0 0 0'><img src='" +
		objImage.src + "' width=" + objImage.width + "height=" + objImage.height + "></body></html>";
		
	objWindow.document.write(strHtml);
	objWindow.resizeBy(objImage.width - objWindow.document.body.clientWidth, objImage.height - objWindow.document.body.clientHeight);
	objWindow.focus();
}

function OnClose()
{
	window.close();
}

function QueryString(strKey)
{
	var strQueryString = window.location.search.substring(1, window.location.search.length);
	var arrKeyValuePairs = strQueryString.split("&");
	
	for(var intIndex = 0; intIndex < arrKeyValuePairs.length; intIndex++)
	{
		if (arrKeyValuePairs[intIndex].split("=")[0] == strKey)
		{
			return unescape(arrKeyValuePairs[intIndex].split("=")[1]);
		}
	}
	
	return false;
}

