//Functions for highligthing menu items

	function setTMButton(name, image){
		//reset all buttons	
		SetTrainMenuDefaults();
		return MM_swapImage(name.name,'',image,1);
	}
	
	function SetTrainMenuDefaults() {
		MM_swapImage('o_b','','../../images/training/o_b.gif',1);
		MM_swapImage('p_b','','../../images/training/p_b.gif',1);
		MM_swapImage('d1_b','','../../images/training/d1_b.gif',1);
		MM_swapImage('d2_b','','../../images/training/d2_b.gif',1);
		MM_swapImage('s_b','','../../images/training/s_b.gif',1);
	}

	function mouseOver(name, image){
		var a = name.src;
		if (a.substring((a.length- 7), a.length-4) != 'act'){
			return MM_swapImage(name.name,'',image,1);
			//alert(name.src)
			}
	}

	function mouseOut(name){
		var a = name.src;
		if (a.substring((a.length- 7), a.length-4) != 'act'){
			return MM_swapImgRestore()
		}
	}

	function SetDefaults() {
		MM_swapImage('h_b','','../../images/menu/h_b.gif',1);
		MM_swapImage('wn_b','','../../images/menu/wn_b.gif',1);
		MM_swapImage('hv_b','','../../images/menu/hv_b.gif',1);
		MM_swapImage('dv_b','','../../images/menu/dv_b.gif',1);
		MM_swapImage('dbv_b','','../../images/menu/dbv_b.gif',1);
		MM_swapImage('us_b','','../../images/menu/us_b.gif',1);
		MM_swapImage('la_b','','../../images/menu/la_b.gif',1);
		MM_swapImage('pa_b','','../../images/menu/pa_b.gif',1);
		MM_swapImage('mp_b','','../../images/menu/mp_b.gif',1);
		MM_swapImage('pe_b','','../../images/menu/pe_b.gif',1);
		MM_swapImage('s_b','','../../images/menu/s_b.gif',1);
		MM_swapImage('t_b','','../../images/menu/t_b.gif',1);
		MM_swapImage('turboarch','','../../images/menu/turboarch.gif',1);		
		MM_swapImage('g_b','','../../images/menu/g_b.gif',1);
		MM_swapImage('ac_b','','../../images/menu/ac_b.gif',1);
		MM_swapImage('order_b','','../../images/menu/order_b.gif',1);
		MM_swapImage('cu_b','','../../images/menu/cu_b.gif',1);
	}
	function MM_swapImgRestore() { 
  		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_preloadImages() { 
		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_findObj(n, d) { 
		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); 
		return x;
	}
		
	function MM_swapImage() { 
		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 loadglossary(path, term, level){
		// this is how you write a document
		document.open();
		document.writeln("<HTML>");
		document.writeln("		<HEAD>");
		document.writeln("			<META NAME='Author' Content='Chuck Gendry'>");
		document.writeln("			<TITLE>National ITS Architecture Key Terms</TITLE>");
		document.writeln("		</HEAD>");
		document.writeln("		<FRAMESET cols='100%' >");
		document.writeln("    		<FRAMESET cols='182,100%' border='0' framespacing='0' frameborder='NO'>");
		document.writeln("               			<FRAME src='" + level + "../menu/g_menufram.htm' name='Menu' scrolling='AUTO' marginwidth='0' marginheight='0' noresize>");
		document.writeln("               			<FRAMESET cols='100%' >");
		document.writeln("                    			<FRAMESET rows='100,100%'   BORDER='0' FRAMESPACING='0'>");
		document.writeln("                         				<FRAMESET cols='50%, 50%' FRAMEBORDER='0'>");
		document.writeln("                              					<FRAME src='" + path + "gtitle.htm' name='glossarytitle' scrolling='AUTO' MARGINWIDTH='0' MARGINHEIGHT='0' NORESIZE FRAMEBORDER='0'>");
		document.writeln("                              					<FRAME src='" + path + "gmenu.htm' name='glossarymenu' scrolling='AUTO' MARGINWIDTH='0' MARGINHEIGHT='0' NORESIZE FRAMEBORDER='0'>");
		document.writeln("                         				</FRAMESET>");
		document.writeln("                         				<FRAME src='" + term + "' name='glossarycontent' noresize frameborder='0'>");
		document.writeln("                    			</FRAMESET>");
		document.writeln("				</FRAMESET>");
		document.writeln("			</FRAMESET>");
		document.writeln("		</FRAMESET>");
		document.writeln("		<NOFRAMES>");
		document.writeln("			<BODY>");
		document.writeln("				<P><BR><FONT FACE='Arial, Helvetica'>");
		document.writeln("				<STRONG>This website uses frames and your web browser does not support the use of frames."); 
		document.writeln("				You will need to update your browser to view the contents of this website.</STRONG>");
		document.writeln("				</FONT></P>");
		document.writeln("			</BODY>");
		document.writeln("     	</NOFRAMES>");
		document.writeln("</HTML>");
		document.close();
	}

	
	function myloadanchor(menu, myanchor, level)
	{
		alert(menu);
		alert(myanchor);
		alert(level);
	}
	
	 function loadanchor(menu, myanchor, level){
		document.open();
		document.writeln("<HTML>");
		document.writeln("		<HEAD>");
		document.writeln("			<META NAME='Author' Content='Chuck Gendry'>");
		document.writeln("			<TITLE>National ITS Architecture Key Terms</TITLE>");
/*		document.writeln("			<SCRIPT language='JavaScript' src='"+ level + "menu/functions.js'></SCRIPT>");  */
		document.writeln("     	</HEAD>");
		document.writeln("	    <FRAMESET cols='100%'>");
		document.writeln("    		<FRAMESET cols='182,100%' border='0' framespacing='0' frameborder='NO'>");
		document.writeln("				<FRAME src='" + menu + ".htm' name='Menu' scrolling='AUTO' marginwidth='0' marginheight='0' noresize>");
		document.writeln("				<FRAME src='" + myanchor + "' name='content' noresize>");
		document.writeln("			</FRAMESET>");
		document.writeln("		</FRAMESET>");
		document.writeln("		<NOFRAMES>");
		document.writeln("			<BODY>");
		document.writeln("				<P><BR><FONT FACE='Arial, Helvetica'>");
		document.writeln("				<STRONG>This website uses frames and your web browser does not support the use of frames."); 
		document.writeln("				You will need to update your browser to view the contents of this website.</STRONG>");
		document.writeln("				</FONT></P>");
		document.writeln("			</BODY>");
		document.writeln("     	</NOFRAMES>");
		document.writeln("</HTML>");
		document.close();
	}
