// JavaScript Document
	
function validate_form ( ){
	var valid = true;
	var illegalChars = /[^A-Za-z0-9\s?!\.:,-]/;
	// KEYWORD validation
	if ( document.keyword_form.keywords.value == "ENTER KEYWORDS..." || document.keyword_form.keywords.value == "") {
		alert ( "Please enter one or more keywords to search." );
		document.keyword_form.keywords.focus();
		valid = false;
	} else if (illegalChars.test(document.keyword_form.keywords.value)) { 
		alert ("The 'keywords:' field contains illegal characters.");
		document.keyword_form.keywords.focus();
		valid = false;
	} 
	return valid;
}
var PRINT_URL = "/asp/print_popup.php?path=";
var PROFILE_URL = "/asp/profile_popup.asp?path=";
var popWin = null;

// Display pgNum, hide the rest and set menu
function DisplayPage(pgNum, nPages) {

	for (var i = 0; i < nPages; i++) {
		document.getElementById("d" + (i+1)).style.display = 'none';
	}
	document.getElementById("d" + pgNum).style.display = 'block';
}
function PrintIt() {
	PopUrl(PRINT_URL, 500, 800)
}
function PopProfile(personId) {
	//alert(PROFILE_URL + "&personId=" + personId);
	PopUrl(PROFILE_URL + "&personId=" + personId, 380, 550)
}
// Display image in same-sized popup
function PopUrl(url, height, width) {
	if (popWin && !popWin.closed) {
		popWin.close();
	} else {
		var leftSide = Math.round((window.screen.width-width)/2);
		popWin = window.open(url, "popWin",
				"scrollbars=yes,status=no,toolbar=yes,location=no,directories=no,menubar=yes,resizable=yes,copyhistory=no,width=" 
				+ width + ",height=" + height + ",left=" + leftSide + ",top=50");
	}
}