window.onscroll= moveFloatDIV; 
function getPageXOffset()//返回页面被卷去的尺寸
{
	  
	   DocTyed=!(document.body.parentNode.parentNode.firstChild.nodeValue==null);//html文档顶部是否声明DOCTYPE
    //alert( DocTyed);
  var pageXOffset;
  if (window.pageXOffset)
  {
 
	  pageXOffset=window.pageXOffset;
	 
  }
  else if (DocTyed)
  {
	 
	  pageXOffset=document.documentElement.scrollLeft; 
	 
  }
  else
  {
	  pageXOffset=document.body.scrollLeft; 
	
   }
   return pageXOffset;
}
function getPageYOffset()//返回页面被卷去的尺寸
{
	  
	   DocTyed=!(document.body.parentNode.parentNode.firstChild.nodeValue==null);//html文档顶部是否声明DOCTYPE
    //alert( DocTyed);
  var pageYOffset;
  if (window.pageYOffset)
  {
	  pageYOffset=window.pageYOffset;
	 
  }
  else if (DocTyed)
  {
	 
	  pageYOffset=document.documentElement.scrollTop; 
	 
  }
  else
  {
	  pageYOffset=document.body.scrollTop; 
	
   }
   return pageYOffset;
}
function moveElementTo(object, x,y)//将指定对象移到指定位置(相对于用户可见区域) 
  { 
    if (object==null)return;
	if (typeof(object)=="string")
	{
		object=document.getElementById(object);
		}
	if (object==null)return;
  //object.style.display='inline';
  object.style.position='absolute';
  object.style.left=getPageXOffset()+x+'px';
  object.style.top=getPageYOffset()+y+'px';
  }  
function moveFloatDIV()//将FloatDIV指定对象移到指定位置(相对于用户可见区域) 
{
	  
	   var floatDIV=document.getElementById('floatDIV');
	   if (floatDIV==null)return;
	   moveElementTo('floatDIV', document.body.scrollWidth-floatDIV.offsetWidth,0);
	   }

function showFloatDIV(object)//隐藏FloatDIV 
{
	   if (object==null)return;
	if (typeof(object)=="string")
	{
		object=document.getElementById(object);
		}
	if (object==null)return;
    object.style.display='inline';
	   }
function hideFloatDIV(object)//显示FloatDIV 
{
	  if (object==null)return;
	if (typeof(object)=="string")
	{
		object=document.getElementById(object);
		}
		//alert(object);
	if (object==null)return;
    object.style.display='none';
}