var popWin = false;
var changeMe = true;

function PopWindow(strURL){
	var win = window.open(strURL, "PopWin", "statusbar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=620,height=500");
}

//Takes two parameters, a url and window name.  Should use this instead of PopWindow function.
function PopWindowName(strURL,winName){
	var win = window.open(strURL, winName, "statusbar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=620,height=500");
}

function changeContent (strUrl) {
	changeMe = false;
	location = strUrl;
}

function start(page) {
	popWin = window.open(page, "myPopWin", "status=yes,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=662,height=580");
}

function handleContentUnload() {
	if (changeMe) {
		if (popWin && popWin.window) {
			popWin.window.close();
			popWin = false;
		}
	}
	else {
		changeMe = true;
	}
}

function handlePopUnload() {
	popWin = false;
}

function connect(page) {
	Ctrl2aWindow = window.open(page, "Ctrl2Window", "statusbar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=620,height=500");
	Ctrl2aWindow.creator=self;
}

function form(page) {
	Ctrl2aWindow = window.open(page, "Ctrl2Window", "statusbar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=620,height=500");
}

function pay(page) {
	Ctrl3aWindow = window.open(page, "Ctrl3Window", "statusbar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=630,height=450");
	Ctrl3aWindow.creator=self;
}

function change(URL) {
	creator.location=(URL);			
}
