	function whatIsCurDir()
	{
		// extract sub directory name
		// 
		
		var dir = document.location.pathname;
		var spos = dir.lastIndexOf("/");
		dir = dir.substr(0, spos);
		spos = dir.lastIndexOf("/");
		dir = dir.substr(spos+1, dir.length);
		return dir;
	}
	
	function whatIsCurPath()
	{
		var path = document.location.href;
		var spos = path.lastIndexOf("/");
		path = path.substr(0, spos);
		
		return path;
	}
	
	function whatIsParentPath(path)
	{
		if ( !path ) path = whatIsCurPath();
		var spos = path.lastIndexOf("/");
		path = path.substr(0, spos);
		
		return path;
	}
	
	function whatIsCurFile()
	{
		return fileFromPath(document.location.pathname);
	}
	
	function fileFromPath(pth)
	{
		var path = pth.split("/");
		var file = path[path.length-1];
		//alert("file=" + file );
		if ( !file ) file = "***NO FILE***";
			
		return file;
	}
	
	function autoSyncNavDownState()
	{
		var ni = $("ni_" + whatIsCurDir() );
		if ( ni ) {
			ni.setAttribute('style', 'font-weight: bolder; color: #66cc00; ');			
		}
		
		autoSyncSubNav();
		
		
	}
	
	function autoSyncSubNav()
	{
		// down links
		
		var anx = $$("a.autodown_l3");
		var ilen = anx.length;
		var curPag = whatIsCurFile();
		for ( var i = 0; i < ilen; i++ )
		{
			//alert("anx.=" + anx[i].href );
			if (fileFromPath(anx[i].href).indexOf(curPag) >= 0 )
			{
				anx[i].setStyle({ color: '#66cc00' });
			}
		}
		
		// down sections
		var grps = $$("div.autodown_l2");
		ilen = grps.length;
		for ( var i = 0; i < ilen; i++ )
		{
			//alert("anx.=" + anx[i].href );
			if (grps[i].innerHTML.indexOf(curPag) >= 0 )
			{
				
				var nm = grps[i].id;
				
				nm = nm.replace(new RegExp(subPref, "i"), "" );
				expandNav2Block(nm, false);
				g_down = nm;
			}
		}
		
		
	}
	
	var g_exp = null;
	var g_down = null;
	var subPref = "sn3_";
	var cPref = "sn2_";
	
	var simpleExpanded = false;
	function onOverNav2(nm)
	{
		
		if ( g_exp != null && g_exp != nm  && g_down != g_exp )
		{
		//	$(subPref + g_exp).setAttribute('style', 'display: none');
		//	$("sn2_" + g_exp + "_arrow").setAttribute('src', '../images/rightnavarrow_down.gif');	
		}
		g_exp = nm;
		//alert('$(subPref + nm)='+$(subPref + nm));
	
		expandNav2Block(nm, true);
	
	}
	
	function onClickNav2Arrow(nm)
	{
		
		if (simpleExpanded)
		{
			collapseNav2Block(nm, true);
		//	$(subPref + nm).isDown = false;
		}
		else
		{
			expandNav2Block(nm, true);
		//	$(subPref + nm).isDown = true;
		}//*/
	//	collapseNav2Block(nm, true);
	}
	
	function expandNav2Block(nm, bUseTween)
	{

		if ( !simpleExpanded )
		{
			if ( !bUseTween )
			{
				//$(subPref + nm).setAttribute('style', 'display: none');	
				$(subPref + nm).style.display = '';
			}
			
			if ( bUseTween )
			{
				//alert("nm=" + nm );
	//			$(subPref + nm).blindDown({ duration: .4 });
	//			$(subPref + nm).slideDown({ duration: .4 });
				Effect.Appear($(subPref + nm),{ duration: .4 });
				
			}
		}
		
		// TEST ,disable
		//$(subPref + nm).isDown = true;
		simpleExpanded = true;
		
		$(cPref + nm + "_arrow").setAttribute('src', '../images/rightnavarrow_up.gif');	
	}
	
	function collapseNav2Block(nm, bUseTween)
	{

		if ( simpleExpanded )
		{
			if ( !bUseTween )
			{
				$(subPref + nm).setAttribute('style', 'display: none');	
				//$(subPref + nm).style.display = '';
			}
			
			if ( bUseTween )//&& $(subPref + nm).isDown)
			{
				$(subPref + nm).blindUp({ duration: .4 });
				
			}
		}
		
		//$(subPref + nm).isDown = false;
		simpleExpanded = false;
		
		$(cPref + nm + "_arrow").setAttribute('src', '../images/rightnavarrow_down.gif');	
	}
	



	
	function onOverFSButton(id){ $(id).setStyle({backgroundImage:'url(../images/cta_black.gif)'});}
	function onOutFSButton(id){ $(id).setStyle({backgroundImage:'url(../images/cta_green.gif)'});}
	function onClickFSubmit(fid){$(fid).submit()};
	
	//function onLoadThisPage(){}  // override this.