var step = 1;
var sp = '';
var strobj = '';
var height = '';
function init(str)
{
	strobj = str;
	step = 0;
	height = '';
	height = document.getElementById(strobj).offsetHeight;
	document.getElementById(strobj).style.height = '285px';
	document.getElementById(strobj).style.top = '0px';
}
function startMove(time,face,psp)
{

	sp = psp;
	if(face == 1)
		timestap = setInterval('up()',time);
	else
		timestap = setInterval('down()',time);
	
}
function clearMove()
{
	clearInterval(timestap);
}
function up()
{
	var obj=document.getElementById(strobj);
	if(obj.style.height)
	{
		if(parseFloat(obj.style.height)>=height)
			clearInterval(timestap);
		else
		{
			if(obj.style.top)
				obj.style.top =  (parseFloat(obj.style.top) - sp)+'px';
			if(obj.style.height)
				obj.style.height = (parseFloat(obj.style.height) + sp)+'px';
			step = step + sp;
			var tmp = step + 'px';
			var sValue = "rect(" + tmp + " auto auto auto)";
			obj.style.clip = sValue;
			}
	}
}
function down()
{
	var obj=document.getElementById(strobj);
	if(obj.style.height)
	{
		if(parseFloat(obj.style.top)>=0)
		{
			clearInterval(timestap);
		}
		else
		{
			step = step - sp ;
			var tmp = step + 'px';
			var sValue = "rect(" + tmp + " auto auto auto)";
			obj.style.clip = sValue;
			obj.style.height = (parseFloat(obj.style.height) - sp) +'px';
			obj.style.top =  (parseFloat(obj.style.top) + sp) + 'px';
		}
	}
}


