var targetheight = 0;
var id = 0;
var height = 0;
var working = false;
var html_tag_open = 0;

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;
				if(id!=html_tag_open){setTimeout("Timer(html_tag_open);", 50);}
			}
		} else {
		  if (height - targetheight >= 1) {
			  setTimeout("Timer(id);", 50);
		  } else {
			  working = false;
				height = targetheight;
				if(id!=html_tag_open){setTimeout("Timer(html_tag_open);", 50);}
			}
		}
	}
}

function TimerKombinalt(open_param,close_param1,close_param2) {
	if(document.getElementById(close_param1).offsetHeight>0){
		Timer(close_param1);
	}
	
	if(document.getElementById(close_param2).offsetHeight>0){
		Timer(close_param2);
	}
	
	html_tag_open = open_param;
	if( !working ){Timer(open_param);}
}

function osszetevok_over(p_id){
	document.getElementById(p_id).style.color="#000000";
}

function osszetevok_out(p_id){
	document.getElementById(p_id).style.color="#a90b0c";
}
