var menu=function(){
	var tdrop=15,zdrop=50,sdrop=6,a;
	function dd(n){this.n=n; this.h=[]; this.c=[]}
	dd.prototype.init=function(p,c){
		a=c; var w=document.getElementById(p), sdrop=w.getElementsByTagName('ul'), ldrop=sdrop.length, idrop=0;
		for(idrop;idrop<ldrop;idrop++){
			var h=sdrop[idrop].parentNode; this.h[idrop]=h; this.c[idrop]=sdrop[idrop];
			h.onmouseover=new Function(this.n+'.st('+idrop+',true)');
			h.onmouseout=new Function(this.n+'.st('+idrop+')');
		}
	}
	dd.prototype.st=function(x,fdrop){
		var c=this.c[x], h=this.h[x], p=h.getElementsByTagName('a')[0];
		clearInterval(c.tdrop); c.style.overflow='hidden';
		if(fdrop){
			p.className+=' '+a;
			if(!c.mh){c.style.display='block'; c.style.height=''; c.mh=c.offsetHeight; c.style.height=0}
			if(c.mh==c.offsetHeight){c.style.overflow='visible'}
			else{c.style.zIndex=zdrop; zdrop++; c.tdrop=setInterval(function(){sl(c,1)},tdrop)}
		}else{p.className=p.className.replace(a,''); c.tdrop=setInterval(function(){sl(c,-1)},tdrop)}
	}
	function sl(c,fdrop){
		var h=c.offsetHeight;
		if((h<=0&&fdrop!=1)||(h>=c.mh&&fdrop==1)){
			if(fdrop==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'}
			clearInterval(c.tdrop); return
		}
		var d=(fdrop==1)?Math.ceil((c.mh-h)/sdrop):Math.ceil(h/sdrop), o=h/c.mh;
		c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')';
		c.style.height=h+(d*fdrop)+'px'
	}
	return{dd:dd}
}();
