var pWindows;

function CheckPopUpWindow() {
	if (Compatible()) {
		if (pWindows != null && pWindows.closed == false) {
			pWindows.close();
		}
	}
}

function CheckWindow(obj) {

	if (obj != null && obj.closed == false) {
		obj.close();
	}
}

function PopUp_NoReturn(PageURL) {
	pWindows = PopUpSize(PageURL, 'popup', 600, 400);
}

function PopUp(PageURL) {
	return PopUpSize(PageURL, 'popup', 600, 400);
}

function PopUpSize(PageURL, strName, iwidth, iheight) {
	var strProperties;
	
	strProperties = 'width=' + iwidth + ',height=' + iheight;
	strProperties = strProperties + ',left=100,top=100,directories=0,hotkeys=1,location=0,menubar=0';
	strProperties = strProperties + ',resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0';
	return window.open(PageURL, strName, strProperties);
}

function PopUpResizable(PageURL, strName, iwidth, iheight) {
	var strProperties;
	
	strProperties = 'width=' + iwidth + ',height=' + iheight;
	strProperties = strProperties + ',left=100,top=100,directories=0,hotkeys=1,location=0,menubar=0';
	strProperties = strProperties + ',resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0';
	return window.open(PageURL, strName, strProperties);
}

function PopUpSizeToolbar(PageURL, strName, iwidth, iheight) {
	var strProperties;
	
	strProperties = 'width=' + iwidth + ',height=' + iheight;
	strProperties = strProperties + ',left=100,top=100,directories=0,hotkeys=1,location=0,menubar=0';
	strProperties = strProperties + ',resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=1';
	return window.open(PageURL, strName, strProperties);
}

function PopUpSizeMenubar(PageURL, strName, iwidth, iheight) {
	var strProperties;
	
	strProperties = 'width=' + iwidth + ',height=' + iheight;
	strProperties = strProperties + ',left=100,top=100,directories=0,hotkeys=1,location=0,menubar=1';
	strProperties = strProperties + ',resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0';
	return window.open(PageURL, strName, strProperties);
}

function PopUpSizeToolMenubar(PageURL, strName, iwidth, iheight) {
	var strProperties;
	
	strProperties = 'width=' + iwidth + ',height=' + iheight;
	strProperties = strProperties + ',left=100,top=100,directories=0,hotkeys=1,location=0,menubar=1';
	strProperties = strProperties + ',resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=1';
	return window.open(PageURL, strName, strProperties);
}

function Compatible() {
	if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 3) {return true}
	else {
		if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 3) {return true}
		else {return false}
	}
}

