	//-----------------------------------------------------------------------------------------------------------------------------------------
	// PROVIDE JAVASCRIPT PAGE NAVIGATION IN THE SITE
	//
	//	NOTES:
	//		1.  The subdirectory name of the target page must have the same name as the target page name itself (minus the HTML file type ext).
	//		2.  There is a literal constant 'ZeekConstants.baseHref' that must be set.  It is set in the ZeekConstants.js module.
	//-----------------------------------------------------------------------------------------------------------------------------------------
	function doPageNav(navParamItem) {
		var curURL; 
		var curURI;
		var curURLPath;
		var NavTarget; 
		
		try {
			if (isDNE(navParamItem)) { throw -1; }
			var navId = navParamItem.id;
			if (isDNE(navId)) { throw -2; }
					
			curURL = window.location.href;
			var URLParts = zeURLUtils.parseURI(curURL);
			if (URLParts===null || ""===URLParts) { throw -3; }
			curURLPath = URLParts.path;
			curURI = URLParts.uri;
			
			if (curURI.indexOf(curURLPath)<0) { throw -4; }
			
			var cutPt = curURI.lastIndexOf(curURLPath);
			var curBase = curURI.substring(0,cutPt);
			if ("home"==navId || "logotext"==navId) {
				NavTarget = curBase+"/index.shtml";			
			} else {
				NavTarget = curBase+"/"+navId+"/"+navId+".shtml";
			}
			
			window.location.href = NavTarget;
		} catch(errNbr) {
		 	switch(errNbr) {
		 		case -1: alert("(-1): doPageNav():\n The navParamItem arg DNE.  Can not construct Struts target for button click."); break;
		 		case -2: alert("(-2): doPageNav():\n The navParamItem arg does NOT have an id property."); break;
		 		case -3: alert("(-3): doPageNav():\n Unable to parse URL:["+curURL+"] in zeURLUtils.js"); break;
		 		case -4: alert("(-4): doPageNav():\n URL parse error.  Full URI:["+curURI+"] does not contain URL_path:["+curURLPath+"]"); break;
				default: alert("(DfltErr): doPageNav(): \n" + errNbr); break;
		 	}
	    }
	}
	 
	 
	//-----------------------------------------------------------------------------------------------------------------------------------------
	// PROVIDE JAVASCRIPT PAGE NAVIGATION BACK TO HOME UNDER VARIETY OF CONTEXTS
	//	Finding "HOME" can be a different logic path depending on user and context.  Therefore, this separate function handles that.
	//
	//	NOTES:
	//		1. 	There is a literal constant 'ZeekConstants.baseHref' that must be set.  It is set in the ZeekConstants.js module.
	//-----------------------------------------------------------------------------------------------------------------------------------------
	function findHome() {
		try {
			if (isDNE(ZeekConstants)) { throw -1; }
			var baseHrefLen = ZeekConstants.baseHref.length;
			var curHREF =  document.URL;
			var lastIdx = (curHREF.lastIndexOf(ZeekConstants.baseHref))+baseHrefLen;
			var swapHREF = curHREF.substring(0,lastIdx);	
					
			var NavTarget = swapHREF + "index.shtml";
			window.location.href = NavTarget;
		} catch(errNbr) {
		 	switch(errNbr) {
		 		case -1: alert("(-1): findHome():\n ZeekConstants has not been set.  Ensure that code instantiates FIRST."); break;
				default: alert("(DfltErr): findHome(): \n" + errNbr); break;
		 	}
	    }
	} 
	
	
	 
	 
	//---------------------------------------------------------------------------------------------------------------------------------
	// CREATE STANDARD LEFT NAV MENU FOR CASTLE ZEEK SITE
	//   This function generates the dd list of 'leftNavItem' items.  It expects there to be a DIV element called 'leftnav' within
	//   which this construction can be populated using innerHTML assignment.
	//   NOTES:
	//		1. 	Be mindful of the execution order.  These menu items must be constructed and present in the DOM before subsequent actions
	//		   	can begin to assign event handlers to them.  See the execution order of the initPageJS() function of the index.html page
	//		   	for a working example.
	//		2. 	If you change the id of a menu item, be SURE that is actually the same name (case sensitive!) of the HTML subdirectory
	//			containing the target .html file --- AND --- that the .html file is ALSO named exactly the same.
	//---------------------------------------------------------------------------------------------------------------------------------
	 function genLeftNav() {
	 	try {
	 		var leftNavRef = $('leftnav');
	 		if (isDNE(leftNavRef)) { throw -1; }
	 		
	 		var leftNavMarkup  = "<dl><dt class='navtitle'>Services</dt>";
	 			leftNavMarkup += "<dd class='leftNavItem' id='webapplications'>Web Applications</dd>";
	 			leftNavMarkup += "<dd class='leftNavItem' id='consulting'>Consulting</dd>";
 	 			leftNavMarkup += "<dd class='leftNavItem' id='zeekwidgets'>ZeekWidgets</dd>";
 	 			leftNavMarkup += "<dd class='leftNavItem' id='ecommerce'>E-Commerce</dd>";
		  		leftNavMarkup += "<dd>&nbsp;</dd>";
		  		leftNavMarkup += "<dt class='navtitle'>Business Model</dt>";
	 			leftNavMarkup += "<dd class='leftNavItem' id='engagements'>Engagements</dd>";
	 			leftNavMarkup += "<dd class='leftNavItem' id='pricing'>Pricing</dd>";
	 			leftNavMarkup += "<dd class='leftNavItem' id='smbfocus'>SMB Focus</dd>";
	 			leftNavMarkup += "<dd class='leftNavItem' id='supportlevels'>Support Levels</dd>";
	 			leftNavMarkup += "<dd class='leftNavItem' id='experience'>Experience</dd>";
		  		leftNavMarkup += "<dd>&nbsp;</dd>";
		  		leftNavMarkup += "<dt class='navtitle'>Technical</dt>";
	 			leftNavMarkup += "<dd class='leftNavItem' id='methodology'>Methodology</dd>";
	 			leftNavMarkup += "<dd class='leftNavItem' id='architecture'>Architecture</dd>";
	 			leftNavMarkup += "<dd class='leftNavItem' id='developercorner'>Developer Corner</dd>";
		  		leftNavMarkup += "</dl>";
		  		
		  	leftNavRef.innerHTML = leftNavMarkup;	
	 	} catch(errNbr) {
		 	switch(errNbr) {
		 		case -1: alert("(-1): genLeftNav():\n The $('leftnav') Prototype method did NOT find its target DIV."); break;
				default: alert("(DfltErr): genLeftNav(): \n" + errNbr); break;
		 	}
	    }
	 }
	 
	 
	//---------------------------------------------------------------------------------------------------------------------------------
	// CREATE STANDARD MINI NAV MENU FOR CASTLE ZEEK SITE
	//   This function generates the set of top/header area utility navigation items like "faq", "home", "login" etc.
	//   
	//   NOTES:
	//		1. This is broken-out functionality than normal left navigation since it involves server interaction in many cases.
	//---------------------------------------------------------------------------------------------------------------------------------
	 function genMiniNav() {
	 	try {
	 		var miniNavRef = $('mininav');
	 		if (isDNE(miniNavRef)) { throw -1; }
	 		
	 		var miniNavMarkup  = "<span class='miniNavItem' onclick='doPageNav(this)' id='home'>HOME</span>";
	 			miniNavMarkup += "<span class='miniNavItem' onclick='doPageNav(this)' id='faq'>FAQ</span>";
 	 			miniNavMarkup += "<span class='miniNavItem' onclick='doPageNav(this)' id='tos'>TOS</span>";
 	 			miniNavMarkup += "<span class='miniNavItem' onclick='doPageNav(this)' id='contact'>CONTACT</span>"; 	 			
 	 	//		miniNavMarkup += "<span class='miniNavItem' onclick='doLogin()' id='login'>LOGIN</span>"; 	 			
 	 			
		  		
		  	miniNavRef.innerHTML = miniNavMarkup;	
	 	} catch(errNbr) {
		 	switch(errNbr) {
		 		case -1: alert("(-1): genMiniNav():\n The $('mininav') Prototype method did NOT find its target DIV."); break;
				default: alert("(DfltErr): genMiniNav(): \n" + errNbr); break;
		 	}
	    }
	 }
	 
	 
	 //---------------------------------------------------------------------------------------------------------------------------------
	 // ASSIGN EVENT HANDLERS FOR THE STANDARD LEFT NAVIGATION MENU ITEMS
	 // 	Note that there is a an execution order dependency on the genLeftNav() to fire before this.  This is because the left nav
	 //		menu items must first be created into the DOM before this function can assign event handlers.
	 //---------------------------------------------------------------------------------------------------------------------------------
	 function assignLeftNavEvents() {
	 	try {
	 		var leftNavItemArray = $$('dd.leftNavItem');
	 		if (isDNE(leftNavItemArray)) { throw -1; }
	 		
	 		for (var n=0;n<leftNavItemArray.length;n++) {
	 			var curLeftNavItem = leftNavItemArray[n];
	 			var curLeftNavItemId = curLeftNavItem.id;
	 			curLeftNavItem.onmouseover = function() { setLeftNavColors(this.id,'in'); };
	 			curLeftNavItem.onmouseout = function() { setLeftNavColors(this.id,'out'); };
	 			curLeftNavItem.onclick = function() { doPageNav(this); };
	 		}
	 	
	 	} catch(errNbr) {
		 	switch(errNbr) {
		 		case -1: alert("(-1): assignLeftNavEvents():\n The $$('dd.leftNavItem') Prototype method did NOT find its target elements."); break;
				default: alert("(DfltErr): assignLeftNavEvents(): \n" + errNbr); break;
		 	}
	    }
	 }
	 
	 
	 //---------------------------------------------------------------------------------------------------------------------------------
	 // ASSIGN EVENT HANDLERS FOR THE TOP/MINI NAVIGATION MENU ITEMS
	 // 	Note that there is a an execution order dependency on the genMiniNav() to fire before this.  This is because the top/mini nav
	 //		menu items must first be created into the DOM before this function can assign event handlers.
	 //---------------------------------------------------------------------------------------------------------------------------------
	 function assignMiniNavEvents() {
	 	try {
	 		var miniNavItemArray = $$('span.miniNavItem');
	 		if (isDNE(miniNavItemArray)) { throw -1; }
	 		
	 		for (var n=0;n<miniNavItemArray.length;n++) {
	 			var curMiniNavItem = miniNavItemArray[n];
	 			var curMiniNavItemId = curMiniNavItem.id;
	 			curMiniNavItem.onmouseover = function() { setMiniNavColors(this.id,'in'); };
	 			curMiniNavItem.onmouseout = function() { setMiniNavColors(this.id,'out'); };
	 		}
	 	
	 	} catch(errNbr) {
		 	switch(errNbr) {
		 		case -1: alert("(-1): assignMiniNavEvents():\n The $$('span.miniNavItem') Prototype method did NOT find its target elements."); break;
				default: alert("(DfltErr): assignMiniNavEvents(): \n" + errNbr); break;
		 	}
	    }
	 }
	 
	 
	 
	 
	 
	 //---------------------------------------------------------------------------------------------------------------------------------
	 // RESET THE MAIN NAVIGATION BUTTONS TO THEIR MOUSE-IN/OUT COLORS
	 //		NOTES:
	 //			1. The font and background colors for the menu items are kept in the global variables section at the top of this script.
	 //---------------------------------------------------------------------------------------------------------------------------------
	 function setLeftNavColors(menuItemId,mode) {
	 	try {
	 		if (isDNE(menuItemId)) { throw -1; }
	 		if (isDNE(mode)) { throw -2; }
	 		if (mode!="in" && mode!="out") { throw -3; }
	 		
			var menuItemRef = $(menuItemId);
			if (isDNE(menuItemRef)) { throw -4; }
			
			var newFontColor = null;
			var newBackgroundColor = null;
			
			if (mode=="in") {
				newFontColor = ZeekConstants.lNavItemFontColorHover;
				newBackgroundColor = ZeekConstants.lNavItemBGColorHover;
			} else {
				newFontColor = ZeekConstants.lNavItemFontColor;
				newBackgroundColor = ZeekConstants.lNavItemBGColor;
			}
			
			menuItemRef.style.backgroundColor = newBackgroundColor;
			menuItemRef.style.color = newFontColor;   
		} catch(errNbr) {
		 	switch(errNbr) {
		 		case -1: alert("(-1): setLeftNavColors(): \n The input arg 'menuItemId' DNE in function call."); break;
		 		case -2: alert("(-2): setLeftNavColors(): \n The input arg 'mode' DNE in function call."); break;
		 		case -3: alert("(-3): setLeftNavColors(): \n The input arg 'mode' must be either 'in' or 'out'.  It was: " + mode); break;
		 		case -4: alert("(-4): setLeftNavColors():\n The $('menuItemId') Prototype method did NOT find its target menu item reference."); break;
				default: alert("(DfltErr): setLeftNavColors(): \n" + errNbr); break;
		 	}
	    }
	 }		   
		
		
	//---------------------------------------------------------------------------------------------------------------------------------
	// RESET THE TOP/MINI NAVIGATION BUTTONS TO THEIR MOUSE-IN/OUT COLORS
	//		NOTES:
	//			1. Font and background colors for menu items are kept in the global variables in the ZeekConstants namespace object.
	//---------------------------------------------------------------------------------------------------------------------------------
	function setMiniNavColors(menuItemId,mode) {
	 	try {
	 		if (isDNE(menuItemId)) { throw -1; }
	 		if (isDNE(mode)) { throw -2; }
	 		if (mode!="in" && mode!="out") { throw -3; }
	 		
			var menuItemRef = $(menuItemId);
			if (isDNE(menuItemRef)) { throw -4; }
			
			var newFontColor = null;
			var newBackgroundColor = null;
			
			if (mode=="in") {
				newFontColor = ZeekConstants.miniNavItemFontColorHover;
				newBackgroundColor = ZeekConstants.miniNavItemBGColorHover;
			} else {
				newFontColor = ZeekConstants.miniNavItemFontColor;
				newBackgroundColor = ZeekConstants.miniNavItemBGColor;
			}
			
			menuItemRef.style.backgroundColor = newBackgroundColor;
			menuItemRef.style.color = newFontColor;   
		} catch(errNbr) {
		 	switch(errNbr) {
		 		case -1: alert("(-1): setMiniNavColors(): \n The input arg 'menuItemId' DNE in function call."); break;
		 		case -2: alert("(-2): setMiniNavColors(): \n The input arg 'mode' DNE in function call."); break;
		 		case -3: alert("(-3): setMiniNavColors(): \n The input arg 'mode' must be either 'in' or 'out'.  It was: " + mode); break;
		 		case -4: alert("(-4): setMiniNavColors():\n The $('menuItemId') Prototype method did NOT find its target menu item reference."); break;
				default: alert("(DfltErr): setMiniNavColors(): \n" + errNbr); break;
		 	}
	    }
	 }		
				
				
	//----------------------------------------------------
	// CONSTRUCT CONTACT INFO MODAL
	//
	//	DEPENDENCIES:
	//		1. ZeekConstants.js
	//		2. Prototype.js
	//		3. ControlModal.js	(Prototype plugin utils)
	//		4. ZeekMailer.js
	//----------------------------------------------------
	function setupContactModal() {
		try {
			var modalContactInfoContent = ZeekConstants.busPhone + "<br/>";
			   modalContactInfoContent += "<a href='" + ZeekMailer.getEmail() + "'>" + ZeekConstants.busEmail + "</a><p/>";
			   modalContactInfoContent += "Copy our phone number or else use the active email link to reach us.&nbsp We look forward to hearing from you.<p/>";
			   modalContactInfoContent += "<span style='font-size:10px;'>To close this modal window, just click on the dimmed page outside this popup.</span>";
			
			new Control.Modal('contact',{
				contents: modalContactInfoContent,
				//opacity: 0.5,		// Not a Windows friendly line...
				position: 'relative',
				width: 250,
				height:150
			});	
				
		} catch(errNbr) {
			switch (errNbr) {
				case -1: alert("(-1): setupContactModal(): The tabRef arg is null."); break;
				default: alert("(DfltErr): setupContactModal(): \n" + errNbr); break;
			}
    	}
	}			
	 