var move_obj=document.getElementById("div_move");    //getElementById("")引号里面写要控制对象的id
var I_width=0;        //对象的left属性
var I_height=0;      //对象的top属性
var to_width=0;      //若此值为0，则I_width++; 若为1，则I_width--;
var to_height=0;     //若此值为0，则I_height++; 若为1，则I_height--;
var move_timer;

Start_move_timer()
function Start_move()
{  
    var width=document.documentElement.clientWidth-move_obj.scrollWidth;       //
	var height=document.documentElement.scrollTop+document.documentElement.offsetHeight-move_obj.clientHeight;
	if(to_width==0)
	{
	    I_width++;
	}
	else
	{
	    I_width--;
	}
	if(to_height==0)
	{
	    I_height++;
	}
	else
	{
	    I_height--;
	}
    if(I_width>=width)
	{
	    I_width=width;
	    to_width=1;
	}
	if(I_width<=document.documentElement.scrollLeft)
	{
	     I_width=document.documentElement.scrollLeft;
	     to_width=0;
	}
	if(I_height>=height)
	{
	    I_height=height;
	    to_height=1;
	}
	if(I_height<=document.documentElement.scrollTop)
	{
	     I_height=document.documentElement.scrollTop;
	     to_height=0;
	}
    move_obj.style.left=I_width;
	move_obj.style.top=I_height;
}

function Start_move_timer()
{
    move_timer= setInterval("Start_move()",1);
}
function Stop_move_timer()
{
    clearInterval(move_timer);
}
function Close_move_div()
{
    move_obj.style.visibility="hidden";
}