﻿var dd=function(){
	var s,t,mt,st,sl,n; s=10; t=15; mt=-2; st=-1; sl=5;
	return{
		init:function(){
			var y,i,l; y=document.getElementsByTagName('dt'); i=0; l=y.length;
			for(i;i<l;i++){
				var c=y[i]; var e=c.id;
				if(e.indexOf('-head')!=-1){var n,s,p; n=e.replace('-head',''); s=document.getElementById(n+'-cont'); p=(c.parentNode.className=='dd')?true:false; this.tv(c,s,n,p)}}
		},
		tv:function(c,s,n,p){c.onmouseover=function(){dd.sl(n,1,p)}; s.onmouseover=function(){dd.cn(n,p)}; c.onmouseout=s.onmouseout=function(){dd.sl(n,-1)}},
		sl:function(i,d,p){
			var h=document.getElementById(i+'-head'); var c=document.getElementById(i+'-cont'); clearInterval(c.timer);
			if(d==1){
				n=i; clearTimeout(h.timer);
				if(!c.maxh){c.style.display='block'; c.maxh=c.offsetHeight; c.style.height='0px'; c.style.top=(h.offsetHeight+mt)+'px'}
				if(!p){
					var m=c.parentNode.parentNode.parentNode.parentNode; c.style.left=(h.offsetWidth+sl)+'px'; c.style.top=st+'px';
					m.style.width=m.style.height='auto'; m.style.width=(m.offsetWidth+c.offsetWidth+sl)+'px'; m.style.height=(m.maxh+c.maxh+st)+'px'}
				c.timer=setInterval(function(){dd.mv(c,1)},t)
			}else{h.timer=setTimeout(function(){dd.cl(c)},75)}
		},
		cl:function(c){c.timer=setInterval(function(){dd.mv(c,-1)},t)},
		cn:function(i,p){
			clearTimeout(document.getElementById(i+'-head').timer);
			if((i==n&&!p)||p){var c=document.getElementById(i+'-cont'); clearInterval(c.timer); c.timer=setInterval(function(){dd.mv(c,1)},t)}
		},
		mv:function(c,d){
			var m,h,f,n; m=c.maxh; h=c.offsetHeight;
			if((h<=0&&d!=1)||(h==m&&d==1)){clearInterval(c.timer)}else{f=(d==1)?Math.round((m-h)/s):Math.round(h/s); if(f<1){f=1}
			n=h+(f*d); c.style.height=Math.abs(n)+'px'; c.style.opacity=n/m; c.style.filter='alpha(opacity='+(n*100/m)+')'}
		}
	};
}();