var openWin = null;

// method checks for whether the popup window exists or not
function common_popup_checkForNewWindow(win, pass, fail)
{
	openWin = win;
	
	if (openWin)
		setTimeout("common_popup_checkForNewWindowHelper('" + pass + "','" + fail + "')", 2000);
	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);
	else
	{
		if ((pass != '') && (pass != null) && (pass != 'undefined') && (pass != new String(this.window.location)))
			common_popup_redirectWindow(pass);	
	}
}

// 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);
}