
function ExplorerFix() { 
  for (a in document.links) document.links[a].onfocus =
    document.links[a].blur; 
  } 
  if (document.all) { 
    document.onmousedown = ExplorerFix; 
}

/*************************************************************************************
* Variable: popupWindow=null  &    Variable: popupWindowHelp=null
* Function: popup             &    Function: popupHelp
*
* Opens a new centered window to show web page links and Help 
*                         
*************************************************************************************/

var popupWindow=null;

function popup(mypage,myname,pos,infocus){
  if(false == "eurypopup.closed") {eurypopup.close ()}
  
  if(screen.width >= 900) {
    w = 800
    h = 450 
  }
  else {
    w = 700
    h = 450 
  }

  LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;

  settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=yes,directories=yes,scrollbars=yes,=,status=yes,menubar=yes,resizable=yes,toolbar=yes';popupWindow=window.open('',myname,settings);

  popupWindow.focus();popupWindow.location=mypage;
}

var popupWindowHelp=null;

function popupHelp(mypageHelp,mynameHelp,posHelp,infocusHelp){
  if(false == "eurypopuphelp.closed") {eurypopuphelp.close ()}
  
if(screen.width >= 900) {
    wHelp = 600
    hHelp = 450 
  }
  else {
    wHelp = 500
    hHelp = 450 
  }

  LeftPositionHelp=(screen.width)?(screen.width-wHelp)/2:100;TopPositionHelp=(screen.height)?(screen.height-hHelp)/2:100;

  settingsHelp='width='+ wHelp + ',height='+ hHelp + ',top=' + TopPositionHelp + ',left=' + LeftPositionHelp + ',scrollbars=yes,location=no,status=no,resizable=yes';popupWindowHelp=window.open('',mynameHelp,settingsHelp);

  popupWindowHelp.focus();popupWindowHelp.location=mypageHelp;
}

function initEuryWeB() {

  /**********************************************************
  * The line of code below resets the background
  * color of a cell on the navigation menu bar to show
  * what primary section the page is part of 
  *
  * Enables the user keep track of where they are in 
  * the web site
  ***********************************************************/
        
  document.getElementById(whatSection).style.backgroundColor='#DCEDFC';
  
  /***********************************************************************
  if(screen.width <= 1024) {
     document.getElementById('mainBody').style.backgroundImage = 'none'; 
     document.getElementById('mainBody').style.backgroundColor = 'white';
     document.getElementById('mainHolder').style.borderColor = 'white';
  }
  ************************************************************************/
}

/********************************************************
* Script for: Highslide Picture Viewer  
********************************************************/

  hs.Expander.prototype.onInit = function() { 
      if (this.isHtml) this.numberPosition = null; 
   }

	hs.graphicsDir = 'highslide/graphics/';
	hs.outlineType = 'drop-shadow';
  //hs.outlineType = 'rounded-white';
	hs.showCredits = false;
  hs.creditsPosition = 'bottom center';
	hs.headingEval = 'this.a.title';
	hs.preserveContent = false; /* was in*/	
  //hs.numberPosition ='caption'
  hs.allowMultipleInstances = false
	hs.align = 'center';
  hs.anchor = 'center'; /*added*/
  //hs.transitions = ['expand', 'crossfade'];
	hs.fadeInOut = true;
	//hs.numberPosition = 'null'

	hs.easing = 'easeOutBack';
  hs.expandDuration = Math.max(1, 500);
  hs.restoreDuration = Math.max(1, 500);
  hs.expandSteps = 20;
  hs.restoreSteps = 20;   

  hs.headingOverlay.fade = false;

  if (screen.width >= 1024) {
    hs.maxWidth = 740
    hs.minWidth = 740
  }
  else {
    hs.maxWidth = 740
    hs.minWidth = 740
   }               

  hs.lang = {
  restoreTitle :    'Click to close image, click and drag to move.'
  }
  
	hs.registerOverlay({
		html: '<div class="highslide-resize" title="Click and drag to resize"></div>',
		position: 'bottom right',
		fade: 2 // fading the semi-transparent overlay looks bad in IE
	});
  	
  // Add the controlbar
	if (hs.addSlideshow) hs.addSlideshow({
    slideshowGroup: ['page-group', 'banner-group', 'header-group', 'crests-group'],
	  interval: 5000,
	  repeat: true,
	  useControls: true,
	  useOnHtml: false,
	  fixedControls: 'true',
	  numberPosition: 'heading',
	  overlayOptions: {
      className: 'controls-in-heading',
	    opacity: '1.00',
	    position: 'top right',
	    offsetX: '60',
      offsetY: '22', 
	    hideOnMouseOut: true
	  }
	});	
	
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'popups',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
  
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'topofpagehelp',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
  
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'helppictureviewing',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
  
	// Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'helppictureviewing0',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
  
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'helppictureviewing1',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
  
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'helppictureviewing2',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
  
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'helppictureviewing3',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });

  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'helppictureviewing4',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
  
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'helpmemberindex',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
  
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'helpsortablecolumns',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
   
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'helpbestviewed',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
   
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'pagestylerhelp',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
   
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'helpnojavascript',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
   
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'quicktips',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });
   
  // Add the close button
	hs.registerOverlay({
	overlayId: 'closebutton',
	thumbnailId: 'obituaries',
	position: 'top right',
	fade: 2, 
	useOnHtml: true
  });   
   
/********************************************************
* Highslide override settings  
********************************************************/

// Add the close button
   hs.registerOverlay({
   slideshowGroup: 'credit',
	 overlayId: 'closebutton',
	 position: 'top right',
	 fade: 2, 
	 useOnHtml: true
});

/***********************************************
* Close expander with second click on thumbnail
***********************************************/

function closeFromThumb(thumb) {
   var exp = hs.getExpander(thumb);
   if (exp) exp.close();
}

/***********************************************
* Toggles hide/show of the infoBox divs. These 
* divs are used to display the Copyright and 
* Ownership unknown text displayed from the 
8 expanded image in the header 
***********************************************/

function toggleDiv(id) {
	var e = document.getElementById(id);
	if(e.style.display == 'block')
		e.style.display = 'none';
	else
		e.style.display = 'block';
};   
		
/********************************************************
* Script for: Sounds  
********************************************************/

// Preload and play audio files with event handler (Select sound from select box )
// designed by JavaScript Archive, (c)1999
// Get more free javascripts at http://jsarchive.8m.com

var soundPlaying   // soundPlaying added to enable checkSound function to work
var whatSound = 0      // whatSound added to enable checkSound function to work

var whSound = " ";
var aySound = new Array();

// Below: source for sound files to be preloaded
aySound[0] = "music/Euryalus 1803 March.wma";
aySound[1] = "music/27 Regimental March (A Life on the Ocean Wave).wma";
aySound[2] = "music/06 Quick March (Heart of Oak).wma";
aySound[3] = "music/08 Evening Hymn and Sunset.wma";
aySound[4] = "music/10 Traditional air (Rule Brittania).wma";
aySound[5] = "music/25 Evening Hymn and Last Post (Nightfall in Camp).wma";
aySound[6] = "music/gettysburg-theme.mp2";
aySound[7] = "music/summer.wma";

function checkSound() {                                // function checkSound: enables sound to be toggled 
  if (soundPlaying == "yes") {                         // on/off depending whether soundPlaying is yes or no
     stopSound(whSound) }
  else playSound(whatSound)
}

// DO NOT edit below this line
document.write('<BGSOUND ID="auIEContainer" LOOP=1>')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;

//onload=auPreload;                                    // Commented out auPreload not required to run
                                        
function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
document.Onemusicform.soundOnoff.disabled = true;
}
var Str = '';
for (i=0;i<aySound.length;i++)

//Str += "<EMBED SRC='"+aySound[i]+"' LOOP='FALSE' AUTOSTART='FALSE' HIDDEN='TRUE'>"

Str += "<EMBED SRC='"+aySound[i]+"' type='application/x-mplayer2' autostart='0' playcount='0' height='0' width='0'>"

if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}

function playSound(whSound) {                        
 auPreload() 
 if (window.auCon) auCon.control(whSound,true); 
 whatSound = whSound;                                  // whatSound = whSound added to enable checkSound function to work
 soundPlaying = "yes";                                 // soundPlaying added to enable checkSound function to work
 document.Onemusicform.soundOnoff.disabled = false;
 document.Onemusicform.soundOnoff.value = "  Stop  ";
}

function stopSound(whSound) { 
 if (window.auCon) auCon.control(whSound,false); 
 soundPlaying = "no" 
 document.Onemusicform.soundOnoff.value = "  Play  ";
}

function changeBackground(value) {
  var NN4 = document.layers? true : false;
  var IE4 = document.all? true : false;
  var DOM = document.getElementById? true : false;

  if (DOM) {
     document.body.style.backgroundImage = value;
  }
  else if(NN4) {
     document.body.style.backgroundImage = value;
  }
  else if(IE4) {
     document.body.style.backgroundImage = value;
  }
}

/****************************************************************
* Browser Detect
*
* From QuirksMode.org the personal site of Peter-Paul Koch
* 
* The function queries three properties of the BrowserDetect object
*
*  -  Browser name:    BrowserDetect.browser 
*  -  Browser version: BrowserDetect.version 
*  -  OS name:         BrowserDetect.OS 
*
*****************************************************************/

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Internet Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

