// var timerID = 0;
// var maxheight = 80;
// var id = '';
// var height = 0;

// function Timer(param1) {
	// id = param1;
	// var v=document.getElementById(id);
	// if ( (maxheight-height)>1 ) {
		// height=Math.round((height+maxheight)/2);
		// v.style.height = height + 'px';
		// if( (maxheight-height)>1 ) {
      // timerID = setTimeout("Timer(id);", 50);
    // } else {
      // height = maxheight;
    // }
	// } else {
		// height = Math.round(height/2);
		// v.style.height = height + 'px';
		// if( height > 0 ) {
      // timerID = setTimeout("Timer(id);", 50);
    // } else {
      // height = 0;
    // }
	// }
// }

var targetheight = 0;
var id = 0;
var height = 0;
var working = false;

function Timer(param1) {
  if (working && id != param1) return;
	id = param1;
	var v=document.getElementById(id);
	if (!working) {
	  if (v.style.height == '0px') {
		  targetheight = v.childNodes[0].offsetHeight + 5;
			height = 0;
		} else {
		  targetheight = 0;
		  height = v.childNodes[0].offsetHeight + 5;
		}
		working = true;
	}
	if ( working ) {
	  if (targetheight - height == 1
		    || height - targetheight == 1) {
  		height = targetheight;
		} else {
		  height = Math.round((height+targetheight)/2);
	  }
		v.style.height=height + 'px';
		if (targetheight > height) {
		  if (targetheight - height >= 1) {
			  setTimeout("Timer(id);", 50);
		  } else {
			  working = false;
				height = targetheight;
			}
		} else {
		  if (height - targetheight >= 1) {
			  setTimeout("Timer(id);", 50);
		  } else {
			  working = false;
				height = targetheight;
			}
		}
	}
}