function detect() {
	if (document.referrer.indexOf("index.htm") == -1) {
		alert('You may not access this page directly. Please use our navigation menu.');
		window.location.href="index.htm";
		}
	}

function sendMail(n2,d2,e2,s2,b2){
	if(s2 == '') s2 = ' ';
	var r2 = 'mailto:' + n2 + '@' + d2 + '.' + e2 + '?subject=' + s2 + '&body=' + b2;
	document.location.href = r2;
	}

function newWindow(linkURL,n,w,h,ext){
	LeftPosition = 0;
	TopPosition = 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes,directories=yes,toolbar=yes,menubar=yes,status=yes,location=yes';
	if (n != "FullScreen") {
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? ((screen.height-h)/2) - 40 : 0;
		if (n == "MinMax") {
			settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes,directories=no,toolbar=no,menubar=no,status=no,location=no';
			n = "";
			}
		else if (n == "NoScroll") {
			settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=no,directories=no,toolbar=no,menubar=no,status=no,location=no';
			n = "";
			}
		else {
			settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=no,directories=no,toolbar=no,menubar=no,status=no,location=no';
			n = "";
			}
		}
	else {
		var h = (screen.availHeight - 152).toString();
		var w = (screen.availWidth - 10).toString();
		settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes,directories=no,toolbar=yes,menubar=yes,status=yes,location=no';
	}
	var win = null;
	if (ext != "None") {
		linkURL = linkURL + '.htm';
		}
	win = window.open(linkURL,n,settings)
	if(win.window.focus){win.window.focus();}
		}

function makeArray(n){
    this.length = n;
    for (i=1;i<=n;i++){
        this[i]=0;
    }
    return this;
}

function displayDate(){
    var this_month = new makeArray(12);
    this_month[0]  = "January";
    this_month[1]  = "February";
    this_month[2]  = "March";
    this_month[3]  = "April";
    this_month[4]  = "May";
    this_month[5]  = "June";
    this_month[6]  = "July";
    this_month[7]  = "August";
    this_month[8]  = "September"; 
    this_month[9]  = "October";
    this_month[10] = "November";
    this_month[11] = "December";
    var today = new Date();
    var day   = today.getDate();
    var month = today.getMonth();
    var year  = today.getYear();
	var hours = today.getHours();
	var minutes = today.getMinutes();
	var seconds = today.getSeconds();
    if (year < 1900){
        year += 1900;
    }
	if (day < 10){
	    return(this_month[month]+" "+"0"+day+", "+year);
	}
	else {
	    return(this_month[month]+" "+day+", "+year);
	}
}

function clock() {
	if (!document.layers && !document.all) return;
		var digital = new Date();
		var hours = digital.getHours();
		var minutes = digital.getMinutes();
		var seconds = digital.getSeconds();
		var amOrPm = "AM";
	if (hours > 11) amOrPm = "PM";
	if (hours == 0) hours = 12;
	if (hours <= 9) hours = " " + hours;
	if (minutes <= 9) minutes = "0" + minutes;
	if (seconds <= 9) seconds = "0" + seconds;
		dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
	if (document.layers) {
		document.layers.pendule.document.write(dispTime);
		document.layers.pendule.document.close();
		}
	else
		if (document.all)
		pendule.innerHTML = dispTime;
		setTimeout("clock()", 1000);
	}

function goReport(form){
  rname = form.selOption.options[form.selOption.selectedIndex].value
    if(rname.indexOf("#")==0) {
		alert ('This report is not available.');
		var rname = 'mbrrpts.htm';
		document.location.href = rname;
		return false;
		}
	else {
		alert ('The report ' & rname & ' was selected.');
		var win = null;
		win = window.open(rname)
		if(win.window.focus){win.window.focus();};
		var rname = 'mbrrpts.htm';
		document.location.href = rname;
		return false;
	}
}

function callEvent(event,tld){
    var today = new Date();
    var year  = today.getYear();
	var yy = (year - 2000);
	if (yy < 10) {
		var eventURL = event + '0' + yy + '.' + tld;
	}
	else {
		var eventURL = event + yy + '.' + tld;
	}
	if (tld == 'htm'){
		document.location.href = eventURL;
	}
	else {
		var win = null;
		win = window.open(eventURL)
		if(win.window.focus){win.window.focus();}
	}
}

function showHide(childObj){
      var dom = document.all[childObj].style;
      if (dom.display == 'none') {
          dom.display = '';
      } else {
          dom.display = 'none';
      }
    }

