function  validatePopup(newUrl) 
{	
	if(typeof(window.opener)!="undefined") 
	{ 
		if(!window.opener.closed && window.opener != null)
			opener.location.href = newUrl
		else
			self.location.href = newUrl
	} 
	else 
	{ 
        window.location.href=newUrl; 
	}
}

function  validatePopupX(newUrl) 
{	
	alert(window.opener)
	
	if(!window.opener.closed && window.opener != null)
		opener.location.href = newUrl
	else if (window.opener = undefined)
		self.location.href = newUrl
	else
		self.location.href = newUrl
}

function to_old_win(url)
{
	if(!window.opener.closed && window.opener != null)
		opener.location.href = url;
	else
		self.location.href = url;
}
			
			
function some()
{
	alert(newUrl)

if(!window.opener.closed && window.opener != null)
	{
		alert("Hello")
		opener.location = newUrl
		alert(opener.location)
	}
	else
	{
		alert("Hello!")
		window.location = newUrl
		alert(window.location)
	}






if ((top.location == self.location) &&!(window.opener)) 
{ 
top.location.href = 'my main page' 
} 


alert("Hello")	
	var link = '"' + newUrl + '"'
	alert(newUrl)
    if ((top.location == self.location) &&!(window.opener)) 
	{ 
		top.location.href = link 
	} 		
}
