function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}






<!-- // opens and closes menu and content blocks 	
	
	var persistmenu="no" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span");
		if(el.style.display != "block"){
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") 
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function SwitchMenu1(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("subdiv").getElementsByTagName("span");
		if(el.style.display != "block"){
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") 
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}


function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate
	// -->







<!-- // opens alert window when leaving site

function offsite(wwwsite) {
	choice = window.confirm("You are leaving The Royal Canadian Legion, Dominion Command website. Dominion Command is not responsible for the content presented at independently maintained websites.");
	if (choice==true) { 
		window.open(wwwsite,"Site");
	}
}
	
	


<!-- // opens alert window when leaving site FRENCH

function offsiteF(wwwsite) {
	choice = window.confirm("Vous quittez le site web de la Direction nationale de la L\u00E9gion royale canadienne. La Direction nationale n'est pas responsable pour le contenu des sites ind\u00E9pendants.");
	if (choice==true) { 
		window.open(wwwsite,"Site");
	}
}


	
	


<!-- // Redirects from English to French page

	var redirect = ""

	function getRedirect() {
		fullurl = "" + window.location;
		fullurlLength = fullurl.length;
		currentPagePosn = fullurl.lastIndexOf("/") + 1;
		currentPath = fullurl.substring(0, (currentPagePosn - 1));
		currentPathLength = currentPath.length;
		currentPathPosn = currentPath.lastIndexOf("/") + 1;
		currentDir = fullurl.substring(currentPathPosn, currentPathLength);
		currentPage = fullurl.substring(currentPagePosn, fullurlLength);
		underscorePos = currentPage.lastIndexOf("_e.cfm") + 1;
		noLangPage = currentPage.substring(0, underscorePos);
		redirect = "../" + currentDir + "/" + noLangPage + "f.cfm";
	}

	function altLang() { 
		getRedirect(); 
		document.location = redirect; 
}

	// -->
	
	
	
<!-- // Redirects from French to English page
var redirectF = ""

	function getRedirectF() {
		fullurl = "" + window.location;
		fullurlLength = fullurl.length;
		currentPagePosn = fullurl.lastIndexOf("/") + 1;
		currentPath = fullurl.substring(0, (currentPagePosn - 1));
		currentPathLength = currentPath.length;
		currentPathPosn = currentPath.lastIndexOf("/") + 1;
		currentDir = fullurl.substring(currentPathPosn, currentPathLength);
		currentPage = fullurl.substring(currentPagePosn, fullurlLength);
		underscorePos = currentPage.lastIndexOf("_f.cfm") + 1;
		noLangPage = currentPage.substring(0, underscorePos);
		redirectF = "../" + currentDir + "/" + noLangPage + "e.cfm";
	}

	function altLangF() { 
		getRedirectF(); 
		document.location = redirectF; 
	}


	// -->
	
	
	
<!-- // Shows local computer date 	
	
	 function showDate()  {
					var mydate=new Date()
					var year=mydate.getYear()
					if (year < 1000)
					year+=1900
					var day=mydate.getDay()
					var month=mydate.getMonth()
					var daym=mydate.getDate()
					if (daym<10)
					daym="0"+daym
					var dayarray=new Array("sunday","monday","tuesday","wednesday","thursday","friday","saturday")
					var montharray=new Array("january","february","march","april","may","june","july","august","september","october","november","december")
					document.write(" "+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" ")
	 }
                         
	// -->


<!-- // Shows French local computer date 	
	
	 function showDateF()  {
					var mydate=new Date()
					var year=mydate.getYear()
					if (year < 1000)
					year+=1900
					var day=mydate.getDay()
					var month=mydate.getMonth()
					var daym=mydate.getDate()
					if (daym<10)
					daym="0"+daym
					var dayarray=new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi")
					var montharray=new Array("janvier","f\u00E9vrier","mars","avril","mai","juin","juillet","ao\u00FBt","septembre","octobre","novembre","d\u00E9cembre")
					document.write(" "+dayarray[day]+", "+daym+"  "+montharray[month]+"  "+year+" ")
	 }
                         
	// -->





function breadcrumbs(){
  sURL = new String;
  bits = new Object;
  var x = 0;
  var stop = 0;
  var output = "<a class=\"crumb\" href=%22/%22>Legion.ca</a> <span class=\"crumbdivider\"> ►  </span>";
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);
    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a class=\"crumb\" href=\"";
    for(y=1;y<x-i;y++){
      output += "../";
    }
    output += bits[i] + "/\">" + bits[i] + "</a> <span class=\"crumbdivider\"> ►  </span> ";
  }
  document.write(output + '<span class=\"crumbdivider\">'+document.title+'</span>');
}


<!--opens closes clamshell

function toggleMenu(currMenu1) {
	if (document.getElementById) {
		thisMenu = document.getElementById(currMenu1).style
		
		if (thisMenu.display == "block") {
			thisMenu.display = "none"
			
		}
		else {
			thisMenu.display = "block"
			
		}
		return false
	}
	else {
		return true
	}
}


/* Globals */
var arc90_isIE = document.all? true: false;

function arc90_altrows() {
	var parts = ['TABLE', 'THEAD', 'TFOOT', 'TBODY'];

	for (var t = 0, r = parts.length; t < r; t++) {
		var T = document.getElementsByTagName(parts[t]);

		// create the alterNation
		for (var i = 0, l = T.length, c = 0; i < l; i++) {
			var tc = T[i].className;
			var a = tc.indexOf('altrows');
			var n = tc.indexOf('norows');
			if (n >= 0) {
				T[i].className = 'arc90_norows';
				var R = T[i].getElementsByTagName('TR');
					for (var j = 0, m = R.length; j < m; j++) {
						R[j].style.background = '';
						R[j].className = 'arc90_norows';
					}
			} else if (a >= 0 ) {
				var c = T[i].className.slice(a), s = c.indexOf(' '), x = null, z = '', cn = '';
				c = T[i].className.slice(a, s > 0? s: T[i].className.length).split('-');
				if (c.length == 2) { // theme
					cn = c[1];
				} else if (c.length > 2) { // rotating colours
					cn = c.slice(1);
					x = c.length - 1;
					z = -1;
				}

				// now go through every sub row and assign alternating row colours
				R = T[i].getElementsByTagName('TR');
				for (var j = 0, m = R.length; j < m; j++) {
					n = R[j].className.indexOf('norows');
					if (n >= 0)
						continue;
					z = (x != null && z+1 < x? z+1: x != null? 0: j % 2); // either the rotating row number or theme alternation
					if (x == null) R[j].className = 'arc90_altrows'+cn+''+z;
						else R[j].style.backgroundColor = '#'+ cn[z];
				}
			}
		}
	}
}

/* Events */
function arc90_isString(o) { return (typeof(o) == "string"); }

function arc90_isNumeric(o) { return (typeof(parseFloat(o).toString() == 'NaN'? 'xxx': parseFloat(o)) == "number" && parseFloat(o) != ''); }

function arc90_addEvent(e, meth, func, cap) {
	if (arc90_isString(e))	e = document.getElementById(e);

	if (e.addEventListener){
		e.addEventListener(meth, func, cap);
    	return true;
	}	else if (e.attachEvent)
		return e.attachEvent("on"+ meth, func);
	return false;
}

/* Nodes */
function arc90_newNode(t, i, s, x, c) {
	var node = document.createElement(t);
	if (x != null && x != '') {
		var n = document.createTextNode(x);
		node.appendChild(n);
	}
	if (i != null && i != '')
		node.id = i;
	if (s != null && s != '')
		node.className = s;
	if (c != null && c != '')
		node.appendChild(c);
	return node;
}

/* Onload */
arc90_addEvent(window, 'load', arc90_altrows);



//-->






//Animated Collapsible DIV- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated Aug 1st, 07'. Fixed bug with "block" parameter not working when persist is enabled
//Updated June 27th, 07'. Added ability for a DIV to be initially expanded.

var uniquepageid=window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, "") //get current page path and name, used to uniquely identify this page for persistence feature

function animatedcollapse(divId, animatetime, persistexpand, initstate){
	this.divId=divId
	this.divObj=document.getElementById(divId)
	this.divObj.style.overflow="hidden"
	this.timelength=animatetime
	this.initstate=(typeof initstate!="undefined" && initstate=="block")? "block" : "contract"
	this.isExpanded=animatedcollapse.getCookie(uniquepageid+"-"+divId) //"yes" or "no", based on cookie value
	this.contentheight=parseInt(this.divObj.style.height)
	var thisobj=this
	if (isNaN(this.contentheight)){ //if no CSS "height" attribute explicitly defined, get DIV's height on window.load
		animatedcollapse.dotask(window, function(){thisobj._getheight(persistexpand)}, "load")
		if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
			this.divObj.style.visibility="hidden" //hide content (versus collapse) until we can get its height
	}
	else if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
		this.divObj.style.height=0 //just collapse content if CSS "height" attribute available
	if (persistexpand)
		animatedcollapse.dotask(window, function(){animatedcollapse.setCookie(uniquepageid+"-"+thisobj.divId, thisobj.isExpanded)}, "unload")
}

animatedcollapse.prototype._getheight=function(persistexpand){
	this.contentheight=this.divObj.offsetHeight
	if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes"){ //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
		this.divObj.style.height=0 //collapse content
		this.divObj.style.visibility="visible"
	}
	else //else if persistence is enabled AND this content should be expanded, define its CSS height value so slideup() has something to work with
		this.divObj.style.height=this.contentheight+"px"
}


animatedcollapse.prototype._slideengine=function(direction){
	var elapsed=new Date().getTime()-this.startTime //get time animation has run
	var thisobj=this
	if (elapsed<this.timelength){ //if time run is less than specified length
		var distancepercent=(direction=="down")? animatedcollapse.curveincrement(elapsed/this.timelength) : 1-animatedcollapse.curveincrement(elapsed/this.timelength)
	this.divObj.style.height=distancepercent * this.contentheight +"px"
	this.runtimer=setTimeout(function(){thisobj._slideengine(direction)}, 10)
	}
	else{ //if animation finished
		this.divObj.style.height=(direction=="down")? this.contentheight+"px" : 0
		this.isExpanded=(direction=="down")? "yes" : "no" //remember whether content is expanded or not
		this.runtimer=null
	}
}


animatedcollapse.prototype.slidedown=function(){
	if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
		if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
			alert("Please wait until document has fully loaded then click again")
		else if (parseInt(this.divObj.style.height)==0){ //if content is collapsed
			this.startTime=new Date().getTime() //Set animation start time
			this._slideengine("down")
		}
	}
}

animatedcollapse.prototype.slideup=function(){
	if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
		if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
			alert("Please wait until document has fully loaded then click again")
		else if (parseInt(this.divObj.style.height)==this.contentheight){ //if content is expanded
			this.startTime=new Date().getTime()
			this._slideengine("up")
		}
	}
}

animatedcollapse.prototype.slideit=function(){
	if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
		alert("Please wait until document has fully loaded then click again")
	else if (parseInt(this.divObj.style.height)==0)
		this.slidedown()
	else if (parseInt(this.divObj.style.height)==this.contentheight)
		this.slideup()
}

// -------------------------------------------------------------------
// A few utility functions below:
// -------------------------------------------------------------------

animatedcollapse.curveincrement=function(percent){
	return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
}


animatedcollapse.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
	var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false)
	else if (target.attachEvent)
		target.attachEvent(tasktype, functionref)
}

animatedcollapse.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}

animatedcollapse.setCookie=function(name, value){
		document.cookie = name+"="+value
}
