var TINY={};

function T$(i){return document.getElementById(i)}
function T$$(e,p){return p.getElementsByTagName(e)} 

TINY.dropdown=function(){
	function menu(n){this.n=n; this.h=[]; this.c=[]; this.z=99}
	menu.prototype.init=function(p,c,f){
		this.m=c; var w=T$(p), s=T$$('ul',w), l=s.length, i=0;
		for(i;i<l;i++){
			var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i];
			h.onmouseover=new Function(this.n+'.st('+i+',1)');
			h.onmouseout=new Function(this.n+'.st('+i+')')
		}
	};
	menu.prototype.st=function(x,z){
		var c=this.c[x], h=this.h[x], p=T$$('a',h)[0];
		clearInterval(c.t); c.style.overflow='hidden';
		if(z){
			p.className+=' '+this.m; c.style.display='block';
			if(!c.mh){c.mh=parseInt(TINY.style.value(c,'height')); c.style.height='0px';}
			if(c.mh==parseInt(c.style.height)){c.style.overflow='visible'}
			else{c.style.zIndex=this.z; this.z++; c.t=setInterval(function(){sl(c,c.mh)},30)}
		}else{
			p.className=p.className.replace(this.m,''); c.t=setInterval(function(){sl(c,0)},30)
		}
	};
	function sl(c,t){
		var h=parseInt(c.style.height);
		if(h==t){
			clearInterval(c.t); if(!t){c.style.display='none'}
		}else{
			var n=h+((t-h)*.5); n=t?Math.ceil(n):Math.floor(n); var o=n/c.mh; c.style.height=n+'px';
			c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')'
		}
	};
	return{menu:menu}
}();

TINY.style=function(){
	return{
		value:function(e,p){
			var val;
			if(e.currentStyle) {
				val = e.currentStyle[p];
			} else {
				val = window.getComputedStyle(e,null).getPropertyValue(p);
			}
			return val;
		}
	}
}();

