
function initFloatTips() {
  tips = document.getElementById('QQFloat');
  moveTips();
};
function moveTips() {
  var tt=50;
  if (window.innerHeight) {
    pos = window.pageYOffset
  }
  else if (document.documentElement && document.documentElement.scrollTop) {
    pos = document.documentElement.scrollTop
  }
  else if (document.body) {
    pos = document.body.scrollTop;
  }
  pos=pos-tips.offsetTop+theTop;
  pos=tips.offsetTop+pos/10;
 
  if (pos < theTop) pos = theTop;
  if (pos != old) {
    tips.style.top = pos+"px";
    tt=10;
  } 
  old = pos;
  Ym=setTimeout(moveTips,tt);
}

//QQ自由移动层控制
var index=10000;
function MDown(objid,e)
{

	var obj=getId(objid);
	if (Ym)clearTimeout(Ym);
	
	if(document.all)
	{
		obj.setCapture();
		px=obj.offsetLeft-event.x;
		py=obj.offsetTop-event.y;
	}
	else
	{
		px=obj.offsetLeft-e.pageX;
		py=obj.offsetTop-e.pageY;
	}
	
	obj.onmousemove=function(e)
	{
		if(document.all)
		{
			obj.style.left=event.x+px;
			obj.style.top=event.y+py;	
		}
		else
		{
			//if(obj){
//				obj.style.left=(e.pageX+px)+"px";
//				obj.style.top=(e.pageY+py)+"px";	
//			} 
		}
		
	}
	obj.onmouseup=function()
	{
		if(!document.all)
		{
			p = window.pageYOffset;
			theTop=obj.offsetTop-p;
			initFloatTips();
			obj=null;
			return;
		}
		if (obj)
		{
			var p;
			if (window.innerHeight)p = window.pageYOffset;
			else if (document.documentElement && document.documentElement.scrollTop)p = document.documentElement.scrollTop;
			else if (document.body)p = document.body.scrollTop;
			theTop=obj.offsetTop-p;
			theTop=theTop<0?0:theTop;
			obj.releaseCapture();
			obj=null;
			initFloatTips();			
		}

	}
}


//控制层移动MDown2(obj)
var Obj2=''
var index2=10000;
document.onmouseup=MUp2
document.onmousemove=MMove2
function MDown2(Object){
Obj2=Object.id
document.all(Obj2).setCapture()
pX=event.x-document.all(Obj2).style.pixelLeft;
pY=event.y-document.all(Obj2).style.pixelTop;
}
function MMove2(){
if(Obj2!=''){
 document.all(Obj2).style.left=event.x-pX;
 document.all(Obj2).style.top=event.y-pY;
 }
}
function MUp2(){
if(Obj2!=''){
 document.all(Obj2).releaseCapture();
 Obj2='';
 }
}