function p_windowclose(pID, bSetCookie, strURL) 
{
	//var iDiv;

	if (bSetCookie == "1")
	{
		SetCookie(pID, "1");
	}

	/*
	for (i = 0; i < nPopup; i++)
	{
		if (pID == arrPopup[i])
		{
			iDiv = arrPopup[i];
			break;
		}			
	}
	
	*/

	document.all[pID].style.display="none";
	if (strURL != "") document.location.href = strURL;
}

function p_windowopen(pID, pPopSrc, pWidth, pHeight, pTop, pLeft)
{
	strPopupScript = "<div id='" + pID + "' onclick='javascript:alert(\"d\")' style='border-width:0px;POSITION: absolute;TOP: " + pTop + "px; LEFT: " + pLeft + "px;z-index:199'>\
			<IFRAME src='" + pPopSrc + "' frameBorder=0 scrolling=no width=" + pWidth + " height=" + pHeight + "></IFRAME>\
	</div>";
	
	document.writeln(strPopupScript);
}

function GetCookie(name)
{
	var nameOfCookie = name + "=";
	var x = 0;
	
	while (x <= document.cookie.length)
	{
		var y = (x+nameOfCookie.length);

		if (document.cookie.substring( x, y ) == nameOfCookie)
		{
			if ((endOfCookie=document.cookie.indexOf( ";", y )) == -1)
			{
				endOfCookie = document.cookie.length;
			}
			return unescape(document.cookie.substring(y, endOfCookie));
		}
			
		x = document.cookie.indexOf(" ", x) + 1;
			
		if (x == 0) break;
	}
	return "";
}

function SetCookie(sName, sValue)
{
	document.cookie = sName + "=" + escape(sValue); 
}
