function popup(url, title, width, height, scroll) {
	var s = 'menubar=no,toolbar=no,location=yes,resizable=yes,status=yes'
	s += ',scrollbars=' + scroll
	s += ',width=' + width + ',height=' + height;
	s += ',top=' + (screen.availHeight - height) / 2 + ',left=' + (screen.availWidth - width) / 2;

	//close existing window
	if (navigator.newwindow) navigator.newwindow.close();
	
	//save new window object in navigator object and activate
	navigator.newwindow = self.open(url, title, s);
	navigator.newwindow.focus();
	
	return false;
}

function popupLogoInfo() {
	return popup('', 'LogoInfo', 500, 400, 'yes')
}

function popupMapImage() {
	return popup('', 'MapImage', 600, 440, 'no')
}

function popupImage() {
	return popup('', 'ViewImage', 600, 440, 'no')
}

function popupExplain() {
	return popup('', 'Explain', 400, 300, 'yes')
}

function popupExplainBig() {
	return popup('', 'Explain', 650, 450, 'yes')
}

function popupAirports() {
	return popup('', 'Airports', 500, 300, 'yes')
}

function CloseWindow() {
	window.close();
	if (window.opener)
		if (!window.opener.closed)
			window.opener.focus();
}

function addPopupEvents() {
	document.onkeydown = KeyDown;
}

function KeyDown(e) {
	if (e && e.which == 27) CloseWindow(); //Netscape
	else if (event && event.keyCode == 27) CloseWindow(); //IE
}
