// JavaScript Document


// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
// START : CSS NAVIGATION : ut:2006-07-28

// using dojo framework for navigation FX. See http://www.dojotoolkit.org/
// requires included dojo.js file in main-document BEFORE calling this functions

	dojo.require("dojo.lfx.*"); // include library
	dojo.require("dojo.html.style"); // include library

	// define runtime variables
	var wipeTimeIn = 400; // fade-in time in milliseconds 
	var wipeTimeOut = 400; // fade-out time in milliseconds 
	var activeSubMenus = 7; // number of sliding subMenus. Subject to change if menu number changes
	var prefixSubnav = "subNav"; // prefix of the id's used as sliding-UL
	var prefixSubnavTrigger = "subNavTrigger"; // prefix of the id's used as sliding-A-Trigger

	// function to close all inactive sliding menus and coloring of the trigger LI
	function woall(active,ownNode) {
		for(var i=1;i<activeSubMenus+1;i++) {
			var thisSubName = prefixSubnav+i;
			var thisSubTriggerName = prefixSubnavTrigger+i;
			var trigId = dojo.byId(thisSubTriggerName);
			if(active != thisSubName) {
				var subId = dojo.byId(thisSubName);
//				var dispVal = dojo.style.getStyle(subId, "display"); // changed by dojo upgrade from 0.3.1 to 0.4.1
				var dispVal = dojo.html.getStyle(subId, "display");
				if(dispVal == "block") {
					// we now wpie too in the IE. Since dojo 0.4.1
					dojo.lfx.wipeOut(subId,wipeTimeOut).play();
/*
					if(!document.all) {
						dojo.lfx.wipeOut(subId,wipeTimeOut).play();
					} else {
						// for the not DOM capable browser (IE, ...)
//						subId.style.display = "none"; // changed by dojo upgrade from 0.3.1 to 0.4.1
						subId.html.display = "none";
					} // end if
*/
				} // end if
				// trigId.style.color = "white";
			} else {
				// trigId.style.color = "#2F3538";
			} // end if
		} // end for
	} // end func

	// function to fade-in the clicked sliding menu. Calls function to close the rest
	function wowi(wipeNode,ownNode) {
		woall(wipeNode,ownNode); // call function to clear previous clicked menus
		var nodeId = dojo.byId(wipeNode);
//		var dispVal = dojo.style.getStyle(nodeId, "display"); // changed by dojo upgrade from 0.3.1 to 0.4.1
		var dispVal = dojo.html.getStyle(nodeId, "display");
		if(dispVal == "none") {

			// we now wpie too in the IE. Since dojo 0.4.1
			dojo.lfx.wipeIn(nodeId,wipeTimeIn).play();
/*
			if(!document.all) {
				dojo.lfx.wipeIn(nodeId,wipeTimeIn).play();
			} else {
				// for the not DOM capable browser (IE, ...)
//				nodeId.style.display = "block"; // changed by dojo upgrade from 0.3.1 to 0.4.1
				nodeId.html.display = "block";
			} // end if
*/
		} else {
			// wipe out because it is already shown

			// we now wpie too in the IE. Since dojo 0.4.1
			dojo.lfx.wipeOut(nodeId,wipeTimeIn).play();
/*
			if(!document.all) {
				dojo.lfx.wipeOut(nodeId,wipeTimeIn).play();
			} else {
				// for the not DOM capable browser (IE, ...)
//				nodeId.style.display = "none"; // changed by dojo upgrade from 0.3.1 to 0.4.1
				nodeId.html.display = "none";
			} // end if
*/		
		} // end if
		ownNode.blur(); // blur clicked Trigger to remove the border
	} // end func


	function makeActiveMainNav(makeActiveFoldername) {
		var thisSubTriggerName = prefixSubnavTrigger+makeActiveFoldername;
		
		var trigId = dojo.byId(thisSubTriggerName);
		
			trigId.style.color = "#2F3538"; // changed by dojo upgrade from 0.3.1 to 0.4.1
			//trigId.html.color = "#2F3538";
		
		//var thisSubName = prefixSubnav+makeActiveFoldername.substring(1,makeActiveFoldername.length);
		var thisSubName = prefixSubnav+makeActiveFoldername;
		var trigId = dojo.byId(thisSubName);
			trigId.style.display = "block"; // changed by dojo upgrade from 0.3.1 to 0.4.1
			//trigId.html.display = "block";
	} // end func


	// function for the rollover menus. From "Suckerfish Dropdown".
	// http://www.htmldog.com/articles/suckerfish/dropdowns/
	sfHover = function() {
		// roll thru the submenus
		for(var j=1;j<activeSubMenus+1;j++) { // "activeSubMenus" defined in dojo block
			var thisSubName = prefixSubnav+j; // prefix defined in dojo block
			// get the LI-Elements to fold out
			//alert(thisSubName);
			if (j >= 7){
			} else {
				if (isNaN(document.getElementById(thisSubName))){
				var sfEls = document.getElementById(thisSubName).getElementsByTagName("LI");
				// roll thru the LI-Items
				for (var k=0; k<sfEls.length; k++) {
					sfEls[k].onmouseover=function() {this.className+=" sfhover";}
					sfEls[k].onmouseout=function() {this.className=this.className.replace(new RegExp(" sfhover\\b"), "");}
				} // end for
				}
			}
		} // end for
	} // end func
	if (window.attachEvent) window.attachEvent("onload", sfHover);


// END : CSS NAVIGATION : ut:2006-07-28
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 