var openWin = null;

// method checks for whether the popup window exists or not
function common_popup_checkForNewWindow(win, pass, fail)
{
	openWin = win;
	
	if (openWin)
		common_popup_checkForNewWindowHelper(pass,fail);
	else
		common_popup_redirectWindow(fail);
}

// method checks for whether the popup window is closed or not
function common_popup_checkForNewWindowHelper(pass, fail)
{
	if (openWin.closed)
		common_popup_redirectWindow(fail);
	
}

// method redirects the current window to manual launcher page showing the text message for popup blocker
function common_popup_redirectWindow(url)
{
		window.top.location.replace(url);
}

function openNew(passURL,failURL) {
	//var failURL = "http://www.marine.usf.edu/outreach/GK12/delete_this/two.php"; 
	//var myRef = window.open(''+self.location,'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
	var myRef = window.open(passURL,'mywin','left=0,top=0,width=850,toolbar=0,resizable=1,status=yes,scrollbars=1');
	common_popup_checkForNewWindow(myRef, passURL, failURL);
}

