// JavaScript Document
var timerOut;

function test(t, maxheight)
{
    if (t.slider) window.clearInterval(t.slider);
	
	t.style.display = "block";
	var a=t.ch;
	var tmp = 0;
	var speed = 10;
	t.slider = window.setInterval(
	function () {
//		t.ch += Math.ceil((maxheight - t.ch) / 5);
		t.ch = easeInOut(a, maxheight, 5, tmp, 0.5);
		t.style.height = t.ch + "px";
		tmp ++;
		if (tmp > 5) {
			if (t.ch <= 5) t.style.display = "none";
			window.clearInterval(t.slider);
		}
	}
	, 5);
}

function easeInOut(minValue,maxValue,totalSteps,actualStep,powr) { 
//Generic Animation Step Value Generator By www.hesido.com 
    var delta = maxValue - minValue; 
    var stepp = minValue+(Math.pow(((1 / totalSteps) * actualStep), powr) * delta); 
    return Math.ceil(stepp) 

} 

function DropDown(elem, mymh) {
	var t = document.getElementById(elem);	
	t.ch = 0;	
//	t.style.height = "auto";
//	t.style.display = "block";
	clearInterval(t.slider);
	clearTimeout(timerOut);
	test(t, mymh);
}

function PullUp(elem, mymh) {
	var t = document.getElementById(elem);	
	t.ch = mymh;
	t.style.fontsize = "1px";
	timerOut = setTimeout("test(document.getElementById('" + elem + "'), 0)", 250);
}

function CancelPullUp(elem, mymh)
{
	var t = document.getElementById(elem);
	t.style.height = mymh + "px";
	window.clearInterval(t.slider);
	clearTimeout(timerOut);
	test(t, mymh);
}
