//****************************functions for the drop down menu ****************************
			// Determine browser and version.
			function Browser(){
			  var ua, s, i;
			  this.isIE    = false;  
			  this.isNS    = false;  
			  this.version = null;
			
			  ua = navigator.userAgent;
			
			  s = "MSIE";
			  if ((i = ua.indexOf(s)) >= 0){
			    this.isIE = true;
			    this.version = parseFloat(ua.substr(i + s.length));
			    return;
			  }
			
			  s = "Netscape6/";
			  if ((i = ua.indexOf(s)) >= 0){
			    this.isNS = true;
			    this.version = parseFloat(ua.substr(i + s.length));
			    return;
			  }
			
			  s = "Gecko";
			  if ((i = ua.indexOf(s)) >= 0){
			    this.isNS = true;
			    this.version = 6.1;
			    return;
			  }
			}
			
			var browser = new Browser();
			var currentButton = null;
			
			if (browser.isIE)
			  document.onmousedown = isMousedown; 	
			if (browser.isNS)
			  document.addEventListener("mousedown", isMousedown, true);
			 
			//find out if user clicked outside the menu or drop menu
			function isMousedown(event) {
				//this if kills open "triangle" menus in allview.htm if click is in the top(mainWindow) frame.	
				if(window.parent.content && window.parent.content.document.all.popMenu){
					window.parent.content.document.all.popMenu.style.visibility = "hidden";
					window.parent.content.document.all.topSixMenu.style.visibility = "hidden";
				}
			  var elmnt;
			  if (!currentButton){
			    return;
			  }
			  if (browser.isIE){
			    elmnt = window.event.srcElement;
			    //alert(elmnt.document.title)
			  }
			  else{
			    elmnt = (event.target.className ? event.target : event.target.parentNode);
			  }
			  if (elmnt == currentButton){
			    return;
			  }
			  if (elmnt.className != "menuButton" && elmnt.className != "menuItem" &&
			      elmnt.className != "menuItemSep" && elmnt.className != "menu"){
			    cleanButton(currentButton);
			    subClose(elmnt);
			  }
			
			}
			//click button to show menu and depress button
			function buttonClick(button, menuName) {
				button.blur();
			  if (!button.menu){
			    button.menu = document.getElementById(menuName);
				}
				  if (currentButton && currentButton != button){
				    cleanButton(currentButton);
					}
						if (button.isDepressed){
						 cleanButton(button);
						}
						else{
						 depressButton(button);
						}	
			  return false;
			}
			//add border
			function buttonMouseover(button, menuName) {
			  if (currentButton && currentButton != button) {
			    cleanButton(currentButton);
			    if (menuName){
			      buttonClick(button, menuName);
			    }
			  }
			}
			//make the button look depressed :-(
			function depressButton(button) {
			  var w, dw, x, y;
			  button.className = "menuButtonActive";
			  if (browser.isIE && !button.menu.firstChild.style.width) {
			    w = button.menu.firstChild.offsetWidth;
			    button.menu.firstChild.style.width = w + "px";
			    dw = button.menu.firstChild.offsetWidth - w;
			    w -= dw;
			    button.menu.firstChild.style.width = w + "px";
			  }
			
			  x = getPageOffsetLeft(button);
			  y = getPageOffsetTop(button) + button.offsetHeight;
			  if (browser.isIE) {
			    x += 2;
			    y += 2;
			  }
			  if (browser.isNS && browser.version < 6.1){
			    y--;
			  }
			  // Position/show.
			  button.menu.style.left = x + 'px';
			  button.menu.style.top  = y + 'px';
			  button.menu.style.visibility = 'visible';
			  button.isDepressed = true;
			  currentButton = button;
			}
			//reset button
			function cleanButton(button) {
			  button.className = "menuButton";
			  if (button.menu)
			    button.menu.style.visibility = "hidden";
			    subCloseOff();
			  
			  button.isDepressed = false;
			  currentButton = null;
			}
			
			function getPageOffsetLeft(elmnt) {
			  return elmnt.offsetLeft + (elmnt.offsetParent ? getPageOffsetLeft(elmnt.offsetParent) : 0);
			}
			
			function getPageOffsetTop(elmnt) {
			  return elmnt.offsetTop + (elmnt.offsetParent ? getPageOffsetTop(elmnt.offsetParent) : 0);
			}
			//sub menus 
			function menuRoll(which, choice, xPos, yPos){
				var x1 = xPos + "px";
				var y1 = yPos + "px";
				document.getElementById(choice).style.left = x1;
				document.getElementById(choice).style.top = y1
				document.getElementById(choice).style.visibility = "visible";
			}
			function menuOff(which,choice){
				document.getElementById(choice).style.visibility = "hidden";
			}
			// (for now)it only works with one sub menu per page named "subMenu"
			function subClose(elmnt){
				if(document.getElementById('subMenu')){
					if(elmnt.className != "menuButton"  && elmnt.className != "menuItem" && elmnt.className != "menu"){
						document.getElementById('subMenu').style.visibility = "hidden";
					}
				}	
			}
			function subCloseOff(){
				if(document.getElementById('subMenu')){
				document.getElementById('subMenu').style.visibility = "hidden";
				}
			}

function pageRefresh(name){
	document.location.href=name
}

function popArticle(num){
	var lLeft1 = Math.floor((screen.availWidth - 750) / 2);
	var lTop1 = Math.floor((screen.availHeight - 500) / 2);
	window.open("article.php?which="+ num,"Articles",'screenx=' + lLeft1 + ',screeny=' + lTop1 + ',left=' + lLeft1 + ',top=' + lTop1 + ',width=750,height=400,menubar=no,toolbar=no,location=no,status=no,directories=no,copyhistory=no,scrollbars=yes,resizable=no,modal=yes,alwaysRaised=yes');
}

function openPic(name){
	var lLeft1 = Math.floor((screen.availWidth - 750) / 2);
	var lTop1 = Math.floor((screen.availHeight - 500) / 2);
	window.open("pictures.asp?which="+ name,"Pictures",'screenx=' + lLeft1 + ',screeny=' + lTop1 + ',left=' + lLeft1 + ',top=' + lTop1 + ',width=750,height=500,menubar=no,toolbar=no,location=no,status=no,directories=no,copyhistory=no,scrollbars=yes,resizable=no,modal=yes,alwaysRaised=yes');
}

function openBrochure(name){
	var lLeft1 = Math.floor((screen.availWidth - 750) / 2);
	var lTop1 = Math.floor((screen.availHeight - 500) / 2);
	window.open("brochure.asp?which="+ name,"Brochure",'screenx=' + lLeft1 + ',screeny=' + lTop1 + ',left=' + lLeft1 + ',top=' + lTop1 + ',width=750,height=500,menubar=no,toolbar=no,location=no,status=no,directories=no,copyhistory=no,scrollbars=yes,resizable=no,modal=yes,alwaysRaised=yes');
}

function openStory(month){
	var lLeft1 = Math.floor((screen.availWidth - 750) / 2);
	var lTop1 = Math.floor((screen.availHeight - 500) / 2);
	window.open("story.php?which="+ month,"Articles",'screenx=' + lLeft1 + ',screeny=' + lTop1 + ',left=' + lLeft1 + ',top=' + lTop1 + ',width=750,height=400,menubar=no,toolbar=no,location=no,status=no,directories=no,copyhistory=no,scrollbars=yes,resizable=no,modal=yes,alwaysRaised=yes');
}

function openPresArchive(month){
	var lLeft1 = Math.floor((screen.availWidth - 750) / 2);
	var lTop1 = Math.floor((screen.availHeight - 500) / 2);
	window.open("presMonthly.php?which="+ month,"Articles",'screenx=' + lLeft1 + ',screeny=' + lTop1 + ',left=' + lLeft1 + ',top=' + lTop1 + ',width=750,height=400,menubar=no,toolbar=no,location=no,status=no,directories=no,copyhistory=no,scrollbars=yes,resizable=no,modal=yes,alwaysRaised=yes');
}


function submitIt(){
	firstName = document.emailForm.name.value;
	lastName = document.emailForm.last.value;
	emailName = document.emailForm.email.value;
		if(firstName == ""){
			alert("Required Field - Please Enter First Name.")
			return false;
		}
		if(lastName == ""){
			alert("Required Field - Please Enter Last Name.")
			return false;
		}
		if(emailName == ""){
			alert("Required Field - Please Enter Email Address.")
			return false;
		}
			return true;
}

function checkWho(list){
	for(i = 0; i < list.options.length; i++){
		if(list.options[i].selected){
			var value = list.options[i].value;
			displayText(value);					
		}
	}
}
