function ValidateContactForm (form) { // Used in Give us your feedback page (pageid=5&ctype=bm)
  var fname = form.fullname.value;   
  if (!fname)	{
    alert("You must enter first name.");
    return false;
	} else {
		return true;
	}
}
function showMap() {
	w_width = 640;
	w_height = 400;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=no,scrollbars=no';

	fparam = 'showmap.html';
  window.showMapWindow = open(fparam, 'showMapWindow', theWindowParam);
	setTimeout('if(showMapWindow&&!showMapWindow.closed)showMapWindow.focus()',100);
}
function showContact() {
	w_width = 640;
	w_height = 400;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=no,scrollbars=no';

	fparam = 'showcontact.html';
  window.showContactWindow = open(fparam, 'showContactWindow', theWindowParam);
	setTimeout('if(showContactWindow&&!showContactWindow.closed)showContactWindow.focus()',100);
}
function printPage() {
  lochref = '' + this.location;
	if (lochref.indexOf('?') > 0) {
		lochref = '?' + lochref.substring((lochref.indexOf('?')) + 1);
	} else {
		lochref = '';
	}

	w_width = 595;
	w_height = 500;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=no,scrollbars=yes';

	fparam = 'print.php'+lochref;
  window.showPrintWindow = open(fparam, 'showPrintWindow', theWindowParam);
	setTimeout('if(showPrintWindow&&!showPrintWindow.closed)showPrintWindow.focus()',100);
}
function emailPage() {
  lochref = '' + this.location;
	if (lochref.indexOf('?') > 0) {
		lochref = '?' + lochref.substring((lochref.indexOf('?')) + 1);
	} else {
		lochref = '';
	}

	w_width = 420;
	w_height = 300;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=no,scrollbars=yes';

	fparam = 'tools/emailpage/index.php'+lochref;
  window.showEmailWindow = open(fparam, 'showEmailWindow', theWindowParam);
	setTimeout('if(showEmailWindow&&!showEmailWindow.closed)showEmailWindow.focus()',100);
}
function popupWindow (theWindow, theParam) {

//	newLeft = screen.width
//	newTop = screen.height
	switch (theWindow)
	{
		case 'newmenu':
			window.open('menuform.php?'+theParam, 'NewMenu', 'toolbar=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=no,directories=no,width=500,height=500,left=50,top=50');
		break
		case 'editmenu':
			window.open('menuform.php?'+theParam, 'EditMenu', 'toolbar=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=no,directories=no,width=500,height=500,left=50,top=50');
		break
		default:
			return;
	}
}
function changeLangAlert(theLang) {
	alert('The '+theLang+' language is not published yet. Please check back soon.');
}
function changeLang(theLang) {
  lochref = '' + this.location;
	if (lochref.match('lang=') != null) {
		langPos = lochref.indexOf('lang=');
		lochref = lochref.substring(0,(langPos-1))+lochref.substring((langPos-1)+8);
	}
	// Check all parameters that 'index.php' files handles
	if ( (lochref.match("pageid=") == null) && (lochref.match("smpageid=") == null) ) {
		lochref = 'index.php?lang=' + theLang;
	} else {
		if (lochref.match("smpageid=") != null) {
			lochref = 'index.php?'+lochref.substring(lochref.indexOf('smpageid='))+'&lang=' + theLang;
		} else {
			lochref = 'index.php?'+lochref.substring(lochref.indexOf('pageid='))+'&lang=' + theLang;
		}
	}
//alert ('Location= '+lochref);
	location = lochref;
}
function goToSearch(theform) {
  var theSearchQuery = theform.searchquery.value;
	
  lochref = 'index.php?pageaction=search&searchquery=' + theSearchQuery;
	
	location = lochref;
}
function goToSitemap() {

  lochref = 'index.php?pageaction=sitemap';

	location = lochref;
}
