<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
  document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


<!--для выпадающего меню -->
var menuids=["cattree"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
		if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
			ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
		else //else if this is a sub level submenu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
		for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
		ultags[t].style.visibility="visible"
		ultags[t].style.display="none"
		}
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)


<!--для флэшек под меню-->
function fl(src)
{
 document.write(src);
}

<!--для меню-дерева-->
	onload = function(){
		makeMenu(document.getElementById('treeMenu'));
		// Find the selected node and open all the parent menus
		if(document.getElementById('treeMenuSelect')){
			openParentNode(document.getElementById('treeMenuSelect'));
		}		
	}
	
	/**
	 * Save the last state so we can show the current state the next time
	 */
	onunload = function(){
		saveState();
	}

	var aTreeMenu = new Array();
	var makeMenuParentsOpenMenu = true;
	
	/**
	 * Save the last state in a cookie with the format "i-i-i"
	 * Where i is an integer which matches the number of the submenu that is currently open
	 */
	function saveState(){
		var aCookie = new Array();
		for(var i = 0; i < aTreeMenu.length; i++){
			if(aTreeMenu[i].className.indexOf("itemOpen") != -1)
				aCookie[aCookie.length] = i;
		}
		var sCookie = "treeMenuState="+escape(aCookie.join("-"));
		
        document.cookie = sCookie;	
	}
	
	/**
	 * Run through the given list and check if a li node contains a ul node. 
	 * If this is true, create a clickable node to expand the ul
	 * @param object oTree
	 */
	function makeMenu(oTree){
		var oChilds = oTree.childNodes;
		var bLast = false;
		var aLastState = getCookie("treeMenuState").split("-");

		// Iterate through every child
		for(var i=oChilds.length-1; i >= 0; i--){
			
			// Create a new submenu when the li element contains a ul element
			if(oChilds[i].nodeName == "LI" && hasSubmenu(oChilds[i])){
				// If this is the last node, give it a different class
				var sClassName = (arrayContains(aLastState, aTreeMenu.length))? " itemOpen" : " itemClose";
				if(!bLast){
					oChilds[i].className += sClassName + "End";
					bLast = true;
				} else
					oChilds[i].className += sClassName;
				
				aTreeMenu[aTreeMenu.length] = oChilds[i];
					
				// If the boolean is set and the href of the firstChild A is '#'
				// the item opens and closes the menu
				if(makeMenuParentsOpenMenu && oChilds[i].firstChild.nodeName == "A"){
					if(oChilds[i].firstChild.href == location.href.replace("#","")+"#"){
						oChilds[i].firstChild.href="javascript:void(0);";
						oChilds[i].firstChild.onclick = function(event){
							if(!event){
								event = window.event;
								oObj = event.srcElement.parentNode;
							} else
								oObj = event.target.parentNode;
								
							event.cancelBubble = true;
							switchClassname(oObj);
						};
					}
				}
				
				// Register the event handler for this node
				oChilds[i].onclick = function(event){ 
					if(!event){
						event = window.event;
						oObj = event.srcElement;
					} else
						oObj = event.target;
						
					event.cancelBubble = true;
					switchClassname(oObj);
				};
			} else if(oChilds[i].nodeName == "LI") {
						
				oChilds[i].className = "item " + oChilds[i].className;
				// If this is the last node, give it an extra class
				if(!bLast){
					oChilds[i].className += " endItem";
					bLast = true;
				}
			}
		}
		

	}
	
	/**
	 * Switch the classname of an object
	 * @param object oObj
	 */
	function switchClassname(oObj){
		if(oObj.className.indexOf("itemOpen") != -1){
			oObj.className = oObj.className.replace("itemOpen", "itemClose");
		} else if(oObj.className.indexOf("itemClose") != -1) {
			oObj.className = oObj.className.replace("itemClose", "itemOpen");
		}			
	}
	
	/**
	 * Checks if a list object contains a ul object
	 * @param object oList
	 * @return boolean
	 */
	function hasSubmenu(oList){
		var oMenuChilds = oList.childNodes;
		var bHasList = false;
		
		// Iterate through all the child nodes and search for a ul tag
		for(var j = 0; j < oMenuChilds.length; j++){
			if(oMenuChilds[j].nodeName == "UL") {
				makeMenu(oMenuChilds[j]);
				bHasList = true;
			}
		}
		return bHasList;
	}
	
	/**
	 * Finds the parent menu in which this item is placed and opens the menu
	 * @param object oItem
	 */
	function openParentNode(oItem){
		if(oItem.parentNode.nodeName == "UL" && oItem.parentNode.parentNode.nodeName == "LI"){
			oMenu = oItem.parentNode.parentNode;
			oMenu.className = oMenu.className.replace("itemClose", "itemOpen");
			openParentNode(oMenu);
		}
	}
	
	/**
	 * Returns the value of the cookie with the given name
	 * @param string name
	 * @return string
	 */
	function getCookie(name) {
        var cookies = document.cookie.split(";");
        for (var i = 0; i < cookies.length; i++) {
            var a = cookies[i].split("=");
            if (a.length == 2) {
                if (a[0] == name) {
                    return unescape(a[1]);
                }
            }
        }
        return "";
    }	
    
    /**
     * Checks if the needle exists in the haystack
     * @param array aSrc
     * @param string sNeedle
     * @return boolean
     */
    function arrayContains(aHayStack, sNeedle){
        for (var i = 0; i < aHayStack.length; i++) {
            if (aHayStack[i] == sNeedle)
            	return true;
        }
        return false;    	
    }


