
function PPViewImg(p_sImgUrl, p_sImgSize, p_sImgDescr, p_sCssFileUrl)
{
	nImgWidth = p_sImgSize.substr(0, p_sImgSize.indexOf('x'));
	nImgHeight = p_sImgSize.substr(p_sImgSize.indexOf('x')+1);
	nWndWidth = nImgWidth + 15;
	nWndHeight = nImgHeight + 15;

	//sBaseUrl = p_sImgUrl.substring(0, p_sImgUrl.lastIndexOf('/'));

	sHtml =  "<HEAD><TITLE>Image View</TITLE></HEAD>";
	sHtml += "<link href='"+p_sCssFileUrl+"' rel='stylesheet' type='text/css' />";
	sHtml += "<body>";
	sHtml += "<center><img src='"+p_sImgUrl+"' width='"+nImgWidth+"' height='"+nImgHeight+"'>";
	if (p_sImgDescr != "")
	{
		sHtml += "<br>"+p_sImgDescr;
		nWndHeight = nWndHeight+30;
	}
	if (nWndHeight>600) nWndHeight=600;
	if (nWndWidth>800) nWndWidth=800;
	
	sHtml += "</center></body>";
	
	ViewWnd = window.open("", "ViewImage", "menubar=no, resizable=yes, scrollbars=yes, width="+nWndWidth+", height="+nWndHeight);
	ViewWnd.document.open('text/html');
	ViewWnd.document.write(sHtml);
	ViewWnd.document.close();
}

