﻿//admin
function dropMenuOneLine(){
	var Me = this
	var ULS = this.getElementsByTagName("UL")
	var ul_level_1 = ULS[0]
	var lis_level_1 = new Array()
	
	for(n in ul_level_1.childNodes){
		if( ul_level_1.childNodes[n].tagName == "LI"){
			lis_level_1[lis_level_1.length] = ul_level_1.childNodes[n]
		}
		
	}
	function firstLiBehave(){
		
		this.ancor = this.getElementsByTagName("A")[0]
		this.ancor.onclick = function(){
			//return false;
		}
		this.subList =  false
		var temp = this.getElementsByTagName("UL")
		if (temp.length ){
			this.subList = temp[0]
		}
		this.onclick = LI_click
		if (this.ancor.className.toLowerCase() == "selected"){
				if(this.subList)
					this.subList.style.visibility = "visible"
				this.ancor.className = "selected"
			}
		
		
	}
	
	function LI_click(){
		for(n=0; n<lis_level_1.length; n++){
			//alert(lis_level_1[n].subList)
			if(lis_level_1[n] == this){
				if(lis_level_1[n].subList)
					lis_level_1[n].subList.style.visibility = "visible"
				lis_level_1[n].ancor.className = "selected"
				
			}else{
				if(lis_level_1[n].subList)
					lis_level_1[n].subList.style.visibility = "hidden"
				lis_level_1[n].ancor.className = "unselected"
			}
		}
		
	}
	for (i=0 ; i<lis_level_1.length ; i++ ){
		lis_level_1[i].startMe = firstLiBehave
		lis_level_1[i].startMe()
	}
	
	
}
