window.onscroll=setmove;
window.onresize=setmove;
function setmove()
{
	setfloat(0)
}
function setfloat(flag){
	var divs = document.getElementsByTagName("div");
	for(var i =0; i<divs.length;i++){
		var divId = divs[i].id;
	  if(divs[i].className == "float01"&&divId.indexOf("lk_wcms_edit_float")!=-1){
		  sc1(divId) 
	  }else if(divs[i].className == "float02"&&divId.indexOf("lk_wcms_edit_float")!=-1){
		  sc2(divId)
	  }else if(divs[i].className == "float03"&&divId.indexOf("lk_wcms_edit_float")!=-1){
		  sc3(divId)
	  }else if(divs[i].className == "float04"&&divId.indexOf("lk_wcms_edit_float")!=-1){
		  sc4(divId)
	  }else if(divs[i].className == "float05"&&divId.indexOf("lk_wcms_edit_float")!=-1){
		  sc5(divId)
	  }else if(divs[i].className == "float06"&&divId.indexOf("lk_wcms_edit_float")!=-1){
		  sc6(divId)
	  }else if(divs[i].className == "float07"&&divId.indexOf("lk_wcms_edit_float")!=-1&&flag==1){
		  sc7(divId)
	  }
	}		
}
/**
 * 右中浮动
 */
function sc1(divId){
	 document.getElementById(divId).style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById(divId).offsetHeight)/2)+"px";
	 document.getElementById(divId).style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById(divId).offsetWidth)+"px";
	}
/**
 * 左中浮动
 */
function sc2(divId){
	 document.getElementById(divId).style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById(divId).offsetHeight)/2)+"px";
	 document.getElementById(divId).style.left=(document.documentElement.scrollLeft)+"px";
	}
/**
 * 右上浮动
 */
function sc3(divId){
	document.getElementById(divId).style.top=(document.documentElement.scrollTop)+"px";
	 document.getElementById(divId).style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById(divId).offsetWidth)+"px";
}
/**
 * 左上浮动
 */
function sc4(divId)
{
	document.getElementById(divId).style.top=(document.documentElement.scrollTop)+"px";
	document.getElementById(divId).style.left=(document.documentElement.scrollLeft)+"px";
}
/**
 * 右下浮动
 */
function sc5(divId)
{
	document.getElementById(divId).style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementById(divId).offsetHeight)+"px";
	document.getElementById(divId).style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById(divId).offsetWidth)+"px";
}
/**
 * 左下浮动
 */
function sc6(divId)
{
	document.getElementById(divId).style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementById(divId).offsetHeight)+"px";
	document.getElementById(divId).style.left=(document.documentElement.scrollLeft)+"px";
}
/**
 * 随即浮动
 */
var c;
function sc7(divId){
    //c=new popfloat()
    //c.go(divId)
}
function popfloat(){
    this.x=100
	this.y=100
	this._speed=5
	this.tx=1
	this.ty=1
	this.o=null
	this.timer=null
	this.sx=document.documentElement.clientWidth
	this.sy=document.documentElement.clientHeight
	var _this=this
	this.play=function(){
	  this.x=this.x+this.tx
	  this.y=this.y+this.ty
	  if(this.x<0) this.tx=1
	  if(this.x>this.sx-this.w) this.tx=-1
	  if(this.y<document.documentElement.scrollTop) this.ty=1
	  if(this.y>this.sy-this.h+document.documentElement.scrollTop) this.ty=-1
	  this.o.style.left=this.x+"px"
	  this.o.style.top=this.y+"px"
	}
	this.stop=function(){
	  this.tx = 0;
	  this.ty = 0;
	  window.clearInterval(this.timer);
	}
	var callback=function(){
		_this.play();
		}
	  this.go=function(id){
	  this.tx = 1;
	  this.ty = 1;
	  this.o=document.getElementById(id)
	  this.w=this.o.offsetWidth
	  this.h=this.o.offsetHeight
	  this.timer=setInterval(callback,30)
	}
  }


  function _popfloat(){
    this.x=Math.floor(Math.random()*800)
	this.y=Math.floor(Math.random()*600)
	this._speed=1
	this.tx=Math.random()>0.5?1:-1
	this.ty=Math.random()>0.5?1:-1
	this.o=null
	this.timer=null
	this.sx=document.documentElement.clientWidth
	this.sy=document.documentElement.clientHeight
	var _this=this
	this.play=function(){
	  this.x=this.x+this.tx
	  this.y=this.y+this.ty
	  if(this.x<0) this.tx=_this._speed
	  if(this.x>=this.sx-this.w) this.tx=-_this._speed
	  if(this.y<document.documentElement.scrollTop) this.ty=_this._speed
	  if(this.y>this.sy-this.h+document.documentElement.scrollTop) this.ty=-1*_this._speed
	  this.o.style.left=this.x+"px"
	  this.o.style.top=this.y+"px"
	}
	var callback=function(){_this.play()}
	this.go=function(id){
	  _this.o=document.getElementById(id)
	  var _a=document.createElement("a")
	  _a.style.cssText='position:absolute; top:0px; right:0px;display:block;height:16px;font:12px/120% "宋体";color:#333333;cursor:pointer'
	  _a.innerHTML='<img src="images/close2.gif" />'
	  _this.o.appendChild(_a)
	  _a.onclick=function(){clearInterval(_this.timer);_this.o.style.display="none"}
	  _this.o.style.position="absolute"
	  _this.o.style.left=this.x+"px"
	  _this.o.style.top=this.y+"px"
	  _this.o.onmouseover=function(){clearInterval(_this.timer)}
	  _this.o.onmouseout=function(){_this.timer=setInterval(callback,10)}
	  _this.w=_this.o.offsetWidth
	  _this.h=_this.o.offsetHeight
	  _this.timer=setInterval(callback,10)
	}
  }
  function popfloat(id){
    var a=new _popfloat() 
    a.go(id)
  }