		function navlink_over(e) {						
			
			if (e.target) { 
				var thetarget = e.target;
			} else {
				var thetarget = e.srcElement;
			}																							
			
			if (thetarget.parentNode.className=="off") {
				thetarget.parentNode.className = "over";
			}
		}


		function navlink_go(e) {														//alert('navlink_go');	

			stopIt(e);
			
			if (e.target) { 
				var thetarget = e.target;														
			} else {
				var thetarget = e.srcElement;													
			}																																		
																							
			if (thetarget.className=="jsnavlink") {										//alert('jsnavlink');
				var navObj	= thetarget;
				var pgurl		= "";
				var thehref		= thetarget.href;																				
				var href_pts	= thehref.split("&");
				
				if (href_pts.length>=2) {									//thetarget.href only exists for links - these are ALL links
					
					for (i=0; i<href_pts.length; i++) {
						
						if (href_pts[i].substring(0,5)=="name=") {
							getpg	= href_pts[i].substring(5);							
						}
					}
					
					if (getpg) {
						var objid	= 'nav_'+ getpg.substring(3);					//alert("objid is "+ objid);
						set_nav($(objid));											//alert("after set_nav");
						pgurl		= "includes/"+ getpg +".php";
						a_call(pgurl,'',nav_return,true,false);
					} else {
						return;
					}
				} else {
					return;
				}

			} else {																	//alert('no jsnavlink');												
				var navObj	= thetarget.parentNode;										
//				var jslink	= false;
				nav(navObj,'go');
				
			}


/*			
			if (navObj.className=="off" || navObj.className=="over" || navObj.className=="jsnavlink") {									
				var getpg		= false;
				var pgurl		= "";
				var thehref		= thetarget.href;																				
				var href_pts	= thehref.split("&");
				
				if (href_pts.length>=2) {									//thetarget.href only exists for links - these are ALL links
					
					for (i=0; i<href_pts.length; i++) {
						
						if (href_pts[i].substring(0,5)=="name=") {
							getpg	= href_pts[i].substring(5);							
						}
					}
					
					if (getpg) {
						
						if (jslink) {													//alert("jslink");
							var objid	= 'nav_'+ getpg.substring(3);					//alert("objid is "+ objid);
							set_nav($(objid));											//alert("after set_nav");
						} else {
							set_nav(navObj);
						}
						pgurl	= "includes/"+ getpg +".php";
						a_call(pgurl,'',nav_return,true,false);
					} else {
						return;
					}
				} else {
					return;
				}
			} else {
																							
			}
*/
		}


		function set_nav(li_obj) {
		
			var thelines	= li_obj.parentNode.getElementsByTagName("LI");		
			
			for (i=0; i<thelines.length; i++) {
				thelines[i].className = "off";
				thelines[i].firstChild.setAttribute('style','color:#3399FF');			//WHY IS THIS NECESSARY?  THIS SHOULD BE COVERED BY THE STYLE OF THE PARENT AND THE CSS FILE
			}
			li_obj.className = "on";
			li_obj.firstChild.setAttribute('style','color:#FFFFFF');					//WHY IS THIS NECESSARY?  THIS SHOULD BE COVERED BY THE STYLE OF THE PARENT AND THE CSS FILE
		}
		

		function nav_over(e) {															//alert("nav_over");		
			
			if (e.target) { 
				var thetarget = e.target;
			} else {
				var thetarget = e.srcElement;
			}																							
			
			nav(thetarget,'over');
		}
	

		function nav_out(e) {						
			
			if (e.target) { 
				var thetarget = e.target;
			} else {
				var thetarget = e.srcElement;
			}																							
			
			nav(thetarget,'out');
		}
	

		function nav_go(e) {															//alert("nav_go");				
			
			if (e.target) { 
				var thetarget = e.target;
			} else {
				var thetarget = e.srcElement;
			}																							
			
			nav(thetarget,'go');
		}

		
		function nav(navObj,navop) {													//alert("nav");				

			if (navObj.className=="on" || navop==null) { return; }
			
			if (navop=="over") {
				navObj.className = "over";
			} else if (navop=="out") {
				navObj.className = "off";
			} else {																	//alert("navop is go");
				var pgid	= navObj.id.substring(4);									//alert("pgid is "+ pgid);
				
				if (pgid=="join") {														//alert("join");
					var container		= $('tb_doc_content');
					var newfr			= document.createElement('IFRAME');				//alert("after createElement");
	//				newfr.style.display	= "none";
					newfr.style.border	= "0px";
					newfr.style.margin	= "0px";
					newfr.style.padding	= "3px";
					newfr.style.width	= "655px";
					newfr.style.height	= "480px";
					newfr.style.backgroundColor	= "transparent";
					newfr.allowtransparency		= "true";
					
					if (ie) { newfr.style.height="520px"; }
					newfr.style.position	= "relative";
					newfr.style.overflow	= "hidden";
					newfr.scrollbars	= "no";
	//				newfr.style.display	= "block";
					newfr.src			= "includes/tb_"+ pgid +".php";					//alert("after newfr.src");
					container.innerHTML	= "";
					container.appendChild(newfr);										//alert("after appendchild");
				} else {																//alert("b4");
					var pgurl	= "includes/tb_"+ pgid +".php";
					theObj	= navObj;
					a_call(pgurl,'',nav_return,true,false);
				}
				roundem();
				set_nav(navObj);
			}
		}


		function nav_return(xhr_data) {					
		
			$('tb_doc_content').innerHTML = xhr_data;	
			roundem();
//			set_nav(navObj);
		}

		
		function addSiteDocEvent(elObj,type,listener,useCapture) {
		
			if(!ie) {																					// use ie boolean set in index.php
				
				if(!useCapture) {useCapture = false;} else {useCapture = true;}
				elObj.addEventListener(type,listener,useCapture);
			} else {																					// MS implementation - used by Internet Explorer
				elObj.attachEvent("on"+type, listener);
			}
		}
		
		
		function pageBox(tgt_id,aTitle,aWidth,aHeight,a_query) {										//alert("tgt_id is "+ tgt_id);
		
//			new Event(e).stop();
			new MochaUI.Window({
				id: tgt_id + '_box',
				title: aTitle,
				loadMethod: 'xhr',
				contentURL: 'includes/pageboxes.php?tgt=' + tgt_id + a_query,						 //////////////////NOTE THIS IS HARD-CODED TO EXPECT TO BE IN THE ROOT DIRECTORY...			
				minimizable: false,
				maximizable: false,
				resizable: false,
				width: aWidth,
				height: aHeight
			});
		}
		
		
		function init_nav() {
		
			var listitems	= document.getElementsByTagName("LI");
			
			for (i=0; i<listitems.length; i++) {
			
				if (listitems[i].getAttribute("rel") && listitems[i].getAttribute("rel")=="sidenav") {
					addSiteDocEvent(listitems[i],"mouseover",nav_over,false);	
					addSiteDocEvent(listitems[i],"mouseout",nav_out,false);	
					addSiteDocEvent(listitems[i],"click",nav_go,false);
					addSiteDocEvent(listitems[i].firstChild,"mouseover",navlink_over,false);
					addSiteDocEvent(listitems[i].firstChild,"click",navlink_go,false);
				}											
			}												
		}		
		
		roundem();
		init_nav();
