// JavaScript Document

// Sliding Panel

//Move Element
function elementmove ( eId, pos) {
	document.getElementById(eId).style.top = ""+pos+"px";
}

//Move Up
function moveup(elem,pos,inne){
	var curr_top = parseInt(document.getElementById(elem).offsetTop);
	var height_to_move = Math.abs(pos-curr_top);
	var step_to_move = 5;
	var durat = 1000;
	var curr_time_ms = 0;
	var delay_offset = Math.round((durat/height_to_move)*step_to_move);
	/* round((durat/height_to_move)*step_to_move);*/
	while (curr_top >= pos)
	{
		curr_time_ms=curr_time_ms+delay_offset;
		curr_top=curr_top-step_to_move;
		window.setTimeout("elementmove('"+elem+"',"+curr_top+")",curr_time_ms);
	}
		//window.setTimeout("document.getElementById("+inne+").style.visibility='hidden'",curr_time_ms+10);
}

//Move Down
function movedown(elem,pos,inne){
	var curr_top = parseInt(document.getElementById(elem).offsetTop);
	var height_to_move = Math.abs(pos-curr_top);
	var step_to_move = 5;
	var durat = 1000;
	var curr_time_ms = 0;
	var delay_offset = Math.round((durat/height_to_move)*step_to_move);
	document.getElementById(inne).style.visibility="visible";
	while (curr_top<= pos)
	{
		curr_time_ms=curr_time_ms+delay_offset;
		curr_top=curr_top+step_to_move;
		window.setTimeout("elementmove('"+elem+"',"+curr_top+")",curr_time_ms);
	}
}
	