//<script>
//setTimeout("Rotate_start(ROTATE1, 'BestLayer', 200, 3000)", 3000);

function Rotate_start(id, height, time) {
	var obj = setInterval("Rotate_layer('"+id+"', "+height+")", time);
	return obj;
}

function Rotate_over(id)
{
	var Layer = document.all(id);
	if(Layer.length>1)	Layer[0].rotate = 1;
}

function Rotate_out(id)
{
	var Layer = document.all(id);
	if(Layer.length>1)	Layer[0].rotate = 0;
}

function Rotate_layer(id, height)
{
	var Layer = document.all(id);

	var i = Layer[0].Rotate_Count % Layer.length;
	var ii = (i+1)==Layer.length ? 0 : (i+1);

	if(Layer[0].rotate!=1 || Layer[ii].style.pixelTop<height)
	{
		if(Layer[ii].style.pixelTop > 20)				var H = 10;
		else if(Layer[ii].style.pixelTop > 10)		var H = 5;
		else														var H = 1;
	
		if(Layer[ii].style.pixelTop > 0) {
			Layer[i].style.pixelTop -= H;
			Layer[ii].style.pixelTop -= H;
			setTimeout("Rotate_layer('"+id+"', "+height+")", 10);
		} else {
			Layer[i].style.pixelTop = height;
			Layer[0].Rotate_Count++;
		}
	}
}

//</script>