function _SetCookie(strName, strValue, dtExpire)
{
	document.cookie = strName + '=' + escape(strValue) + '; expires=' + dtExpire.toGMTString() + '; path=/';
}
function _GetCookie(strName)
{
	var nStart = document.cookie.indexOf(strName + '=');
	if (nStart != -1)
	{
		nStart = nStart + strName.length + 1;
		var nEnd = document.cookie.indexOf(';', nStart);
		if (nEnd == -1)
			nEnd = document.cookie.length;
		return unescape(document.cookie.substring(nStart, nEnd))
	}
	return null;
}
function _ClearCookie(strName)
{
	var dtExpire = new Date();
	dtExpire.setDate(dtExpire.getDate() - 1);
	document.cookie = strName + '=' + '; expires=' + dtExpire.toGMTString() + '; path=/';
}
function TogglePopupCookie1Day(strCookieName, bOn)
{
	if (bOn)
	{
		var dtExpire = new Date();
		dtExpire.setDate(dtExpire.getDate() + 1);
		_SetCookie(strCookieName, 'true', dtExpire);
	}
	else
		_ClearCookie(strCookieName);
}
function PopupByCookie(strCookieName, strUrl, strWindowName, nWidth, nHeight, nLeft, nTop)
{
	var bValue = _GetCookie(strCookieName);
	if (!bValue)
		window.open(strUrl, strWindowName, 'status=yes,width=' + nWidth + ',height=' + nHeight + ',left=' + nLeft + ',top=' + nTop);
}
