// topmenu
function init_topmenu(){
	o = document.getElementById("topmenu");
	ucol = o.getElementsByTagName("TD");
	for(i=0;i<ucol.length;i++){
		uo = ucol[i];
		if(uo.getElementsByTagName("UL").length>0){
			uo.chld = uo.getElementsByTagName("UL")[0];
			uo.chld.prt = uo;
			uo.chld.style.width = (parseInt(uo.offsetWidth) - 1) + 'px';
			if(document.all){
				acol = uo.chld.getElementsByTagName("A");
				for(j=0;j<acol.length;j++){
					acol[j].style.width = (parseInt(uo.offsetWidth) - 14) + 'px';
				}
			}
		}
		uo.mstr = o;
		o.curitm = o.tm = null;

		uo.onmouseover = uo.show = function(){
			if(this.mstr.curitm!=null){
				window.clearTimeout(this.mstr.tm);
				this.mstr.tm = null;
				if(this.mstr.curitm!=this){
					this.mstr.curitm.hide();
					this.mstr.curitm = null;
				}
				else
					return;
			}
			if(this.chld)
				this.chld.style.display = 'block';
			this.mstr.curitm = this;
		}
		
		uo.onmouseout = function(e){
			if(document.all){
				if(this.parentNode.contains(event.toElement))
					return;
			}
			else if(e){
				if(e.relatedTarget!=null){
					o = e.relatedTarget;
					while(o.tagName!="HTML"){
						if(o.parentNode==this.parentNode)
							return;
						o = o.parentNode;
					}
				}
			}
			if(this.mstr.curitm!=null){
				window.mstr = this.mstr;
				this.mstr.tm = window.setTimeout(function(){ this.mstr.curitm.hide(); this.mstr.curitm = null;}, 200);
			}
		}

		uo.hide = function(){
			if(this.chld)
				this.chld.style.display = 'none';
		}

	}
}