var delta=0.8;
var collection;
var WDSZ = new Array(0,0);

function floaters() 
{
  this.items	= [];
  this.addItem = function(id,x,y,content)
  {
     document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute;  width:80px; height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');
     var newItem = {};
     newItem.object = document.getElementById(id);
     document.documentElement 
     newItem.x = x;
     newItem.y = y;
     this.items[this.items.length]	 = newItem;
  }
  this.play	= function()
  {
     collection = this.items
     setInterval('play()',30);
  }
}



function play()
{

   if(screen.width<=800 || WDSZ[0]==1 || WDSZ[1]==1)
   {
     if (WDSZ[0]==1)
       {collection[0].object.style.display = 'none'; }
     if (WDSZ[1]==1)
       {collection[1].object.style.display = 'none'; }
   }


   for(var i=0; i<2; i++)
   {

     if (WDSZ[i]==0)
     {
        var followObj = collection[i].object;
        var followObj_x = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
        var followObj_y = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);

        if(followObj.offsetLeft!=(document.documentElement.scrollLeft+followObj_x))
        {
           var dx=(document.documentElement.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
	   dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
	   followObj.style.left=followObj.offsetLeft+dx;
        }

        if(followObj.offsetTop!=(document.documentElement.scrollTop+followObj_y))
        {
           var dy=(document.documentElement.scrollTop+followObj_y-followObj.offsetTop)*delta;
           dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
           followObj.style.top=followObj.offsetTop+dy;
        }
        followObj.style.display	= '';
     }
   }
   return;
}



function closeAAA()
{
//  WDSZ[0]=1;
//  return;
}

function closeBBB()
{
  WDSZ[0]=1;
  WDSZ[1]=1;
  return;
}


var online= new Array();
var theFloaters = new floaters();

theFloaters.addItem('followDiv2',6,210,'<div align="left"> <img ID="QQ22" src="image/KB.gif" border="0" />  </div>');
theFloaters.addItem('followDiv1','document.documentElement.clientWidth-138',210,'<div ID="YYZZ" style="POSITION: absolute; TOP: 0px; left: 0px" align="left"><img src=Image/msgClose.gif alt="关闭对联广告" onClick="closeBBB();" style="POSITION: absolute; TOP: -5px; left: 5px; cursor: hand"> <a href="WebForm2.aspx" target="_blank" ><img ID="QQ2" src="image/ZH.gif" border="0" alt="免费征婚登记" style="cursor: hand; width:100px; height:92px; " /></a></div>');

theFloaters.play();
