
CheckOtherWins = 'Y';
if(opener)
	{
	if(opener.opener)
		{
		CheckOtherWins = 'N';
		location='about:blank';
		opener.location='/scripts/CloseMe.htm';
		if(opener.opener)
			{
			opener.opener.location.replace('/scripts/noback.htm');
			}
		self.close();
		}
	else
		{
		if(CheckConditions())
			{
			CheckOtherWins = 'N';
			location='about:blank';
			opener.location='/scripts/CloseMe.htm';
			if(opener.opener)
				{
				opener.opener.location.replace('/scripts/noback.htm');
				}
			self.close();
			}
		}
	}

function CheckConditions()
	{
	ckthis = opener;
	if(ckthis.document.displayform) return true;
	if(ckthis.locid) return true;
	if(ckthis.pollspeed) return true;
	if(ckthis.numspeeds) return true;
	if(ckthis.speedid) return true;
	if(ckthis.polltime) return true;
	if(ckthis.passnumber) return true;
	if(ckthis.highestframe) return true;
	if(ckthis.highestframeopened) return true;
	if(ckthis.document.forms.length > 0)
		{
		for(var a=0; a < ckthis.document.forms.length; a++)
			{
			if(ckthis.document.forms[a].message) return true;
			if(ckthis.document.forms[a].gostop) return true;
			if(ckthis.document.forms[a].speed) return true;
			if(ckthis.document.forms[a].smge) return true;
			}
		}
	return false;
	}

if(CheckOtherWins=='Y')
	{
	var szName = 'BPVisit';
	function SetUpC()
		{
		WinAExists = 'N';
		if(document.cookie)
			{
			var arr = document.cookie.split((escape(szName) + '='));
			if(arr.length>=2)
				{
				if(arr[1].substr(0,1)=='Y')
					{
					WinAExists = 'Y';
					alert('You may only browse the Bhopal site in one window at a time.');
					if(opener)
						{
						self.close();
						}
					else
						{
						location.replace('/scripts/noback.htm');
						}
					}
				else
					{
					WriCToP();
					}
				}
			else
				{
				WriCToP();
				}
			}
		else
			{
			WriCToP();
			}
		}
	
	function WriCToP()
		{
		document.cookie = szName + "=Y; expires=Thu, 01-Jan-09 00:00:01 GMT";
		}
		
	function DelCFromP()
		{
		if(WinAExists=='N')
			{
			document.cookie = szName + "=N; expires=Thu, 01-Jan-70 00:00:01 GMT";
			}
		}
	}