// Open the detail window
function openDetail(urlstring) {
	popup("detail.php?"+urlstring, 'harveyDetail', 700, 500); //700
}

// Open the email window
function openEmail(urlstring) {
	popup("email.php?"+urlstring, 'harveyEmail', 360, 400);
}

// Open the email window
function openEBook() {
	popup("http://webserver.maxum.co.nz/harveysebook/book.html", 'harveyEBook', 800, 600);
}

// Open the edit window
function openEdit(urlstring) {
	var url = "edit.php?"+urlstring;
	var name = 'harveyEdit';
	var popup_height = 400;
	var popup_width = 600;
	var popup_locX = (self.screen.availWidth - popup_width) / 2;
	var popup_locY = (self.screen.availHeight - popup_height) / 2;
	if (navigator.appName == "Microsoft Internet Explorer")
		theWin = window.open (url, name, "height=" + popup_height + ",width=" + popup_width + ",left=" + popup_locX + ",top=" + popup_locY + ",location=no,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no");
	else
		theWin = window.open (url, name, "height=" + popup_height + ",width=" + popup_width + ",screenX=" + popup_locX + ",screenY=" + popup_locY + ",location=no,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no");
	if (!((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) <= 3))) theWin.focus();
}

// Pop up a window, focused and centered on screen.
function popup(url,name,width,height) {
	var popup_height = height;
	var popup_width = width;
	var popup_locX = (self.screen.availWidth - popup_width) / 2;
	var popup_locY = (self.screen.availHeight - popup_height) / 2;
	if (navigator.appName == "Microsoft Internet Explorer")
		theWin = window.open (url, name, "height=" + popup_height + ",width=" + popup_width + ",left=" + popup_locX + ",top=" + popup_locY + ",location=no,status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
	else
		theWin = window.open (url, name, "height=" + popup_height + ",width=" + popup_width + ",screenX=" + popup_locX + ",screenY=" + popup_locY + ",location=no,status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
	if (!((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) <= 3))) theWin.focus();
}

function refreshClose() {
	window.opener.location.reload();
	window.close();
}