var nav_bottommenu = new Object();

nav_bottommenu.tabCategory="square";
nav_bottommenu.holidayButton="Christmas_Ornaments";
nav_bottommenu.mouseoverEffect="true";
nav_bottommenu.mouseoverBold="false";
nav_bottommenu.modernButton="Basic_Black";
nav_bottommenu.textColor="#757375";
nav_bottommenu.mouseoverBgcolor="";
nav_bottommenu.accentType="none";
nav_bottommenu.hasLinks="true";
nav_bottommenu.bold="false";
nav_bottommenu.lineWidth="1";
nav_bottommenu.mouseoverTextcolor="#B91806";
nav_bottommenu.type="Navigation";
nav_bottommenu.accentColor="Cream";
nav_bottommenu.mouseoverUnderline="false";
nav_bottommenu.selectedEffect="false";
nav_bottommenu.basicTab="White";
nav_bottommenu.simpleButton="Autumn_Leaves";
nav_bottommenu.justification="center";
nav_bottommenu.localPreview="true";
nav_bottommenu.selectedUnderline="false";
nav_bottommenu.orientation="horizontal";
nav_bottommenu.lineColor="#B91806";
nav_bottommenu.imageHeight="31";
nav_bottommenu.buttonCategory="shiny";
nav_bottommenu.squareTab="Energetic";
nav_bottommenu.dirty="false";
nav_bottommenu.selectedItalic="false";
nav_bottommenu.navID="nav_bottommenu";
nav_bottommenu.texturedButton="Brick";
nav_bottommenu.background="";
nav_bottommenu.textFont="Helvetica";
nav_bottommenu.importedImageSelected="";
nav_bottommenu.imageWidth="114";
nav_bottommenu.selectedBold="false";
nav_bottommenu.accentStyle="Square";
nav_bottommenu.numLinks="5";
nav_bottommenu.underline="false";
nav_bottommenu.mouseoverItalic="false";
nav_bottommenu.verticalSpacing="10";
nav_bottommenu.horizontalWrap="5";
nav_bottommenu.funButton="Arts_and_Crafts";
nav_bottommenu.style="text";
nav_bottommenu.basicButton="Gray";
nav_bottommenu.selectedBgcolor="";
nav_bottommenu.importedImageMouseOver="";
nav_bottommenu.graphicSelected="true";
nav_bottommenu.border="";
nav_bottommenu.shinyButton="Shiny_Aqua";
nav_bottommenu.selectedTextcolor="#B91806";
nav_bottommenu.sophisticatedButton="Antique";
nav_bottommenu.version="5";
nav_bottommenu.horizontalSpacing="7";
nav_bottommenu.graphicMouseover="true";
nav_bottommenu.italic="false";
nav_bottommenu.importedImage="";
nav_bottommenu.darkButton="Basic_Black";
nav_bottommenu.brightButton="Chicky";
nav_bottommenu.textSize="9";
nav_bottommenu.width="311";
nav_bottommenu.height="15";

nav_bottommenu.navName = "bottommenu";
nav_bottommenu.imagePath = "null";
nav_bottommenu.selectedImagePath = "/~media/elements/LayoutClipart/";
nav_bottommenu.mouseOverImagePath = "/~media/elements/LayoutClipart/";
nav_bottommenu.imageWidth = "16";
nav_bottommenu.imageHeight = "16";
nav_bottommenu.fontClass = "size9 Helvetica9";
nav_bottommenu.fontFace = "Helvetica, Arial, sans-serif";


var baseHref = '';
// this will only work if getElementsByTagName works
if (document.getElementsByTagName)
{
    // this will only work if we can find a base tag
    var base = document.getElementsByTagName('base');
    // Verify that the base object exists
    if (base && base.length > 0)
    {
        // if you don't specify a base href, href comes back as undefined
        if (base[0].href != undefined)
        {
            // get the base href
            baseHref = base[0].href;
            // add a trailing slash if base href doesn't already have one
            if (baseHref != '' && baseHref.charAt(baseHref.length - 1) != '/')
            {
                baseHref += '/';
            }
        }
    }
}


nav_bottommenu.links=new Array(5);
var nav_bottommenu_Link1 = new Object();
nav_bottommenu_Link1.type = "existing";
nav_bottommenu_Link1.displayName = "home";
nav_bottommenu_Link1.linkWindow = "_self";
nav_bottommenu_Link1.linkValue = "index.html";
nav_bottommenu_Link1.linkIndex = "1";
nav_bottommenu.links[0] = nav_bottommenu_Link1;
var nav_bottommenu_Link2 = new Object();
nav_bottommenu_Link2.type = "existing";
nav_bottommenu_Link2.displayName = "sponsor-a-family";
nav_bottommenu_Link2.linkWindow = "_self";
nav_bottommenu_Link2.linkValue = "sponsorafamily_Abbotsford_Christmas_Bureau.html";
nav_bottommenu_Link2.linkIndex = "2";
nav_bottommenu.links[1] = nav_bottommenu_Link2;
var nav_bottommenu_Link3 = new Object();
nav_bottommenu_Link3.type = "existing";
nav_bottommenu_Link3.displayName = "get involved!";
nav_bottommenu_Link3.linkWindow = "_self";
nav_bottommenu_Link3.linkValue = "getinvolved_Abbotsford_Christmas_Bureau.html";
nav_bottommenu_Link3.linkIndex = "3";
nav_bottommenu.links[2] = nav_bottommenu_Link3;
var nav_bottommenu_Link4 = new Object();
nav_bottommenu_Link4.type = "existing";
nav_bottommenu_Link4.displayName = "donate";
nav_bottommenu_Link4.linkWindow = "_self";
nav_bottommenu_Link4.linkValue = "donate_Abbotsford_Christmas_Bureau.html";
nav_bottommenu_Link4.linkIndex = "4";
nav_bottommenu.links[3] = nav_bottommenu_Link4;
var nav_bottommenu_Link5 = new Object();
nav_bottommenu_Link5.type = "existing";
nav_bottommenu_Link5.displayName = "contactus";
nav_bottommenu_Link5.linkWindow = "_self";
nav_bottommenu_Link5.linkValue = "contactus_Abbotsford_Christmas_Bureau.html";
nav_bottommenu_Link5.linkIndex = "5";
nav_bottommenu.links[4] = nav_bottommenu_Link5;
function backgroundMouseOn(tdElement, newColor)
{
	if(tdElement != null) {
		tdElement.oldBGColor = tdElement.style.backgroundColor;
		tdElement.style.backgroundColor = newColor;
	}
}
function backgroundMouseOff(tdElement)
{
	if(tdElement != null) {
		tdElement.style.backgroundColor = tdElement.oldBGColor;
	}
} 

function doMouseChange(Navigation,tdElement,linkIndex,bisMouseOver) {
	if (Navigation.mouseoverEffect != 'true') {
		return;
	}	
	var link = Navigation.links[linkIndex-1];
	var bIsCurrentPage = isCurrentPage(link);
	var bShowMouseoverBg = !(bIsCurrentPage
			&& 'true' == Navigation.selectedEffect && Navigation.selectedBgcolor);
	var fontElement = getLinkFontElement(tdElement);
	if(fontElement != null) {
		doFontChange(Navigation,fontElement,bIsCurrentPage,bisMouseOver);
	}
	
	if (Navigation.mouseoverBgcolor && bShowMouseoverBg) {
		if(bisMouseOver) {
			backgroundMouseOn(tdElement,Navigation.mouseoverBgcolor);
		} else {
			backgroundMouseOff(tdElement);
		}
	}
}
function addStyle(Navigation, Link, tdElement,vNavTrElement) {
	if (tdElement == null) {
		return;
	}
	var strFontColor = Navigation.textColor;
	if ('true' == Navigation.selectedEffect) {
		if (Navigation.selectedTextcolor) {
			strFontColor = Navigation.selectedTextcolor;
		}
		if (Navigation.selectedBgcolor) {
			if (Navigation.orientation == 'horizontal') {
				tdElement.style.backgroundColor = Navigation.selectedBgcolor;
			} else {
				if (vNavTrElement != null) {
					vNavTrElement.style.backgroundColor = Navigation.selectedBgcolor;
				}
			}
		}
	}
	var fontElement = getLinkFontElement(tdElement);
	if (fontElement != null) {
		fontElement.style.color = strFontColor;
	}
	tdElement.style.color = strFontColor;
	if ('true' == Navigation.selectedEffect) {
		if ('true' == Navigation.selectedBold) {
			tdElement.style.fontWeight = "bold";
		}
		if ('true' == Navigation.selectedItalic) {
			tdElement.style.fontStyle = "italic";
		}
		if ('true' == Navigation.selectedUnderline) {
			tdElement.style.textDecoration = "underline";
		}
	}
}

// Combined escape html and javascript
function escapeHtmlInlineScript(s, escapeSingleQuotes, escapeDoubleQuotes){
	return htmlEncode(escapeScript(s, escapeSingleQuotes, escapeDoubleQuotes));
}

function htmlEncode(s){
	if (typeof(s) != "string") return "";
	
	var result = "";
	for (var i = 0; i < s.length; i++) {
		var ch = s.charAt(i);
		switch (ch) {
		case '<':
			result += "&lt;";
			break;
		case '>':
			result += "&gt;";
			break;
		case '&':
			result += "&amp;";
			break;
		case '"':
			result += "&quot;";
			break;
		case "'":
			result += "&#39;";
			break;
		default:
			result += ch;
		}
	}
	return result;
}

/* escapes slashes and quotes. the default is to escape quotes,
 * but this can be turned off.
 * this function is used for javascript and also for escaping urls
 * within background-image css.	 
 */
function escapeScript(s, escapeSingleQuotes, escapeDoubleQuotes){
	if (typeof(s) != "string") return "";
	
	var result = "";
	for (var i = 0; i < s.length; i++) {
		var ch = s.charAt(i);
		switch (ch) {
		case '\'':
			if (escapeSingleQuotes == null || escapeSingleQuotes)
				result += "\\\'";
			break;
		case '\"':
			if (escapeDoubleQuotes == null || escapeDoubleQuotes)
				result += "\\\"";
			break;
		case '\\':
			result += "\\\\";
			break;
		default:
			result += ch;
		}
	}
	return result;
}

//
// This .js file includes utility functions used by both graphical and text navs
// in their rendering.  User pages including a nav element will import this file, along
// with TextNavigation.js and GraphicNavigation.js.  The functions within will
// be called by the [navname].js file generated at publish time.

function fixLinkValue(Link)
{
	if(Link.type!='existing')
	{
		return Link.linkValue;
	}
	else
	{
		return baseHref + strRelativePathToRoot + Link.linkValue;
	}
}

function isCurrentPage(Link)
{
	if(Link.type!='existing')
	{
		return false;
	}
	var strLinkValue = Link.linkValue.toLowerCase();
	return (strRelativePagePath == strLinkValue);
}

function toggleOnMouseChange(fontElement,newColor, bold, underline, italic)
{
	if(fontElement == null) {
		return;
	}
	if(newColor)
	{
		fontElement.style.color=newColor;
	}
	fontElement.style.fontWeight = (bold=='true' ? 'bold' : 'normal');
	fontElement.style.textDecoration = (underline=='true' ? 'underline' : 'none');
	fontElement.style.fontStyle = (italic=='true' ? 'italic' : 'normal');

}

function doFontChange(Navigation,fontElement,bIsCurrentPage,bisMouseOver) {
	if(fontElement == null) {
		return;
	}
	var textColor;
	var baseTextColor = Navigation.textColor;
	var bold;
	var baseBold = Navigation.bold;
	var underline;
	var baseUnderline = Navigation.underline;
	var italic;
	var baseItalic = Navigation.italic;
	if (bIsCurrentPage && 'true' == Navigation.selectedEffect) {
		textColor = Navigation.selectedTextcolor ? Navigation.selectedTextcolor
				: (Navigation.mouseoverTextColor ? Navigation.mouseoverTextcolor
						: Navigation.textColor);
		baseTextColor = Navigation.selectedTextcolor ? Navigation.selectedTextcolor
				: Navigation.textColor;
		baseBold = bold = Navigation.selectedBold;
		baseUnderline = underline = Navigation.selectedUnderline;
		baseItalic = italic = Navigation.selectedItalic;
	} else {
		textColor = Navigation.mouseoverTextcolor ? Navigation.mouseoverTextcolor
				: Navigation.textColor;
		bold = Navigation.mouseoverBold;
		underline = Navigation.mouseoverUnderline;
		italic = Navigation.mouseoverItalic;
	}
	
	if(bisMouseOver) {
		toggleOnMouseChange(fontElement,textColor,bold,underline,italic);
	} else {
		toggleOnMouseChange(fontElement,baseTextColor,baseBold,baseUnderline,baseItalic);
	}
	

}

function addMouseAndStyleSupportbottommenu(Navigation,navTbId) {
	var startNode;

	if(typeof(nav_element_id) != 'undefined' && document.getElementById(nav_element_id) != null) {
		startNode = document.getElementById(nav_element_id);
			
	} else if(navTbId != null) {
		startNode = document.getElementById(navTbId);
			
	}
	
	if(startNode != null) {
	  searchForCurrentPageTd(Navigation,startNode);
	}
	

}

function searchForCurrentPageTd(Navigation,startNode) {
	
	if(startNode.childNodes != null) {
		for(var i=0;i<startNode.childNodes.length;i++){
			if(addStyleForCurrentPageTd(Navigation,startNode.childNodes[i])){
			   return;	
			} else {
			   searchForCurrentPageTd(Navigation,startNode.childNodes[i]);
			}
		}
	}

}

function addStyleForCurrentPageTd(Navigation,currentNode) {
	if(Navigation.orientation == 'horizontal') {
		if(currentNode.tagName == 'TD' && currentNode.id != '' && currentNode.id.indexOf(Navigation.navName+navTDLinkPart) != -1){
			var currentTDIdPrefix = Navigation.navName+navTDLinkPart;
			var linkId = currentNode.id.substring(currentTDIdPrefix.length,currentNode.id.length);
			if(isCurrentPage(Navigation.links[linkId-1]) == true) {
				addStyle(Navigation, Navigation.links[linkId-1],currentNode);
				return true;
			}
		}
	} else {
		if(currentNode.tagName == 'TR' && currentNode.id != '' && currentNode.id.indexOf(navTRLinkPrefix) != -1){	
			var currentTRIdPrefix = navTRLinkPrefix+Navigation.navName;
			var linkId = currentNode.id.substring(currentTRIdPrefix.length,currentNode.id.length);
			if(isCurrentPage(Navigation.links[linkId-1]) == true && currentNode.childNodes != null) {
				var currentPageTd;
				for(var i=0;currentNode.childNodes.length;i++) {
					if(typeof(currentNode.childNodes[i].tagName) != 'undefined' && currentNode.childNodes[i].tagName == 'TD' && currentNode.childNodes[i].id.indexOf(Navigation.navName+navTDLinkPart) != -1) {
						currentPageTd = currentNode.childNodes[i];
						addStyle(Navigation, Navigation.links[linkId - 1],currentPageTd,currentNode);
						return true;
					}
				}
			}
		}
	}
	return false;
}

function getChildElementFromTree(startNode,nodesToTraverse) {
	var currentChildNode = startNode;
	
	for(var n= 0;n<nodesToTraverse.length;n++) {
		currentChildNode = getMatchingChildByTag(currentChildNode.childNodes,nodesToTraverse[n]);
	}
	
	return currentChildNode;
}


function getMatchingChildByTag(childNodes,tagName) {
	var child;
	for(var i=0;childNodes.length;i++) {
		if(childNodes[i].tagName == tagName) {
			child = childNodes[i];
			break;
		}
	}
	return child;
}
function getLinkFontElement(tdElement){
	var fontElement;
	var aElement = getChildElementFromTree(tdElement,['A']);
	for(var i=0;i < aElement.childNodes.length;i++) {
		if(aElement.childNodes[i].tagName == 'DIV') {
		 	fontElement = getChildElementFromTree(aElement.childNodes[i],['FONT']);
		 	break;
		} else if(aElement.childNodes[i].tagName == 'FONT'){
		 	fontElement = 	aElement.childNodes[i];
		 	break;
		}
	
	}
	return fontElement;
}



	if(typeof(navTRLinkPrefix) == 'undefined') {
		navTRLinkPrefix = 'vNavTR_Link_';
	}
	if(typeof(navTDLinkPart) == 'undefined') {
		navTDLinkPart = '_Link';
	}
	if(document.getElementById('nav_version') == null) {
	if (typeof(navTBSuffix) == 'undefined') {
	navTBSuffix = 0;
	} else {navTBSuffix++;}
		document.write('<TABLE ID="ntb'+navTBSuffix+'"  CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\" ><TR ALIGN=\"CENTER\" VALIGN=\"MIDDLE\"><TD><TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\"><TR><TD ALIGN=\"center\" VALIGN=\"MIDDLE\" NOWRAP=\"NOWRAP\" id=\"bottommenu_Link1\" style=\"cursor: pointer;cursor: hand;color:#757375;\" onmouseover=\"doMouseChange(nav_bottommenu,this,\'1\',true);\" onmouseout=\"doMouseChange(nav_bottommenu,this,\'1\',false);\"><A HREF=\"\/index.html\" TARGET=\"_self\" STYLE=\"text-decoration:none;\" NAME=\"home\"><FONT ID=\"bottommenu_f1\" FACE=\"Helvetica, Arial, sans-serif\" CLASS=\"size9 Helvetica9\" STYLE=\"color:#757375\">home<\/FONT><IMG SRC=\"\/tp.gif\" WIDTH=\"4.0\" HEIGHT=\"1\" BORDER=\"0\"><\/A><\/TD><TD ALIGN=\"center\" VALIGN=\"MIDDLE\" NOWRAP=\"NOWRAP\" id=\"bottommenu_Link2\" style=\"cursor: pointer;cursor: hand;color:#757375;\" onmouseover=\"doMouseChange(nav_bottommenu,this,\'2\',true);\" onmouseout=\"doMouseChange(nav_bottommenu,this,\'2\',false);\"><A HREF=\"\/sponsorafamily_Abbotsford_Christmas_Bureau.html\" TARGET=\"_self\" STYLE=\"text-decoration:none;\" NAME=\"sponsor-a-family\"><IMG SRC=\"\/tp.gif\" WIDTH=\"3.0\" HEIGHT=\"1\" BORDER=\"0\"><FONT ID=\"bottommenu_f2\" FACE=\"Helvetica, Arial, sans-serif\" CLASS=\"size9 Helvetica9\" STYLE=\"color:#757375\">sponsor-a-family<\/FONT><IMG SRC=\"\/tp.gif\" WIDTH=\"4.0\" HEIGHT=\"1\" BORDER=\"0\"><\/A><\/TD><TD ALIGN=\"center\" VALIGN=\"MIDDLE\" NOWRAP=\"NOWRAP\" id=\"bottommenu_Link3\" style=\"cursor: pointer;cursor: hand;color:#757375;\" onmouseover=\"doMouseChange(nav_bottommenu,this,\'3\',true);\" onmouseout=\"doMouseChange(nav_bottommenu,this,\'3\',false);\"><A HREF=\"\/getinvolved_Abbotsford_Christmas_Bureau.html\" TARGET=\"_self\" STYLE=\"text-decoration:none;\" NAME=\"get involved!\"><IMG SRC=\"\/tp.gif\" WIDTH=\"3.0\" HEIGHT=\"1\" BORDER=\"0\"><FONT ID=\"bottommenu_f3\" FACE=\"Helvetica, Arial, sans-serif\" CLASS=\"size9 Helvetica9\" STYLE=\"color:#757375\">get&nbsp;involved!<\/FONT><IMG SRC=\"\/tp.gif\" WIDTH=\"4.0\" HEIGHT=\"1\" BORDER=\"0\"><\/A><\/TD><TD ALIGN=\"center\" VALIGN=\"MIDDLE\" NOWRAP=\"NOWRAP\" id=\"bottommenu_Link4\" style=\"cursor: pointer;cursor: hand;color:#757375;\" onmouseover=\"doMouseChange(nav_bottommenu,this,\'4\',true);\" onmouseout=\"doMouseChange(nav_bottommenu,this,\'4\',false);\"><A HREF=\"\/donate_Abbotsford_Christmas_Bureau.html\" TARGET=\"_self\" STYLE=\"text-decoration:none;\" NAME=\"donate\"><IMG SRC=\"\/tp.gif\" WIDTH=\"3.0\" HEIGHT=\"1\" BORDER=\"0\"><FONT ID=\"bottommenu_f4\" FACE=\"Helvetica, Arial, sans-serif\" CLASS=\"size9 Helvetica9\" STYLE=\"color:#757375\">donate<\/FONT><IMG SRC=\"\/tp.gif\" WIDTH=\"4.0\" HEIGHT=\"1\" BORDER=\"0\"><\/A><\/TD><TD ALIGN=\"center\" VALIGN=\"MIDDLE\" NOWRAP=\"NOWRAP\" id=\"bottommenu_Link5\" style=\"cursor: pointer;cursor: hand;color:#757375;\" onmouseover=\"doMouseChange(nav_bottommenu,this,\'5\',true);\" onmouseout=\"doMouseChange(nav_bottommenu,this,\'5\',false);\"><A HREF=\"\/contactus_Abbotsford_Christmas_Bureau.html\" TARGET=\"_self\" STYLE=\"text-decoration:none;\" NAME=\"contactus\"><IMG SRC=\"\/tp.gif\" WIDTH=\"3.0\" HEIGHT=\"1\" BORDER=\"0\"><FONT ID=\"bottommenu_f5\" FACE=\"Helvetica, Arial, sans-serif\" CLASS=\"size9 Helvetica9\" STYLE=\"color:#757375\">contactus<\/FONT><\/A><\/TD><\/TR><\/TABLE><\/TD><\/TR><\/TABLE><script type="text/javascript">addMouseAndStyleSupportbottommenu(nav_bottommenu,"ntb'+navTBSuffix+'");'+'</scri'+'pt>');
	}


