var popupsEnabled = true;
var popped = false;

function popWin() {
	var url				= arguments[0]; // required - url
	var name			= arguments[1]; // required - window name
	var winProperties	= arguments[2];	// required - window properties
	var isBlockable		= arguments[3]; // required - is the popup blockable ?
	var under			= arguments[4]; // optional - boolean for popunder
	var form			= arguments[5]; // optional - form object

	// only do it if popups are enabled
	if (!popupsEnabled && isBlockable) {
		return null;
	}

	// get form variables
	if (form) {
		url += (url.indexOf("?")==-1) ? "?" : "&";
		url += getFormValueQueryString(form);
	}

	// open the window
	var win = window.open(
		url,
		name,
		winProperties
	);

	// is it a popunder?
	if (under) {
		try { win.blur(); } catch(ex) {}
		self.focus();
	} else {
	  win.focus();
	}

	// return
	return win;
}

function open_win(url) {
	popWin(url,"wLgInfoPopup","width=450,height=550,screenX=0,screenY=0,left=0,top=0,scrollbars=yes,alwaysRaised,resizable=yes,dependent",false);
}

function popup(next,step,popped)
{
  stepb = step - 1;
  if ((!next) && (popped == "false")) 
	{
	  popwin = window.open('pop.php?step='+step,'popup','width=490,height=650,screenX=0,screenY=0,left=0,top=0,AlwaysRaised,scrollbars=yes,resizable=yes');
    popwin.focus();
    if (popwin.opener == null) popwin.opener = self;
	}
}