/*
[parameter]targeturl,imgsrc,imgwidth,imgheight[parameter]

imgsrc:图片地址
targeturl:图片连接地址
imgwidth:图片宽
imgheight:图片高

adid需要系统自动计算

*/

var adfd_sx=window.screen.width;
var adfd_top = 200;
var adfd_left_1=80;
var adfd_left_2=610;
if(adfd_sx>800)
{
	adfd_left_1=20;
	adfd_left_2=adfd_sx - 120;
}

	var delta=0.8;
	var collection;
	var closeB=false;
	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);
					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 || closeB)
			{
				for(var i=0;i<collection.length;i++)
				{
					collection[i].object.style.display	= 'none';
				}
				return;
			}
			for(var i=0;i<collection.length;i++)
			{
				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.body.scrollLeft+followObj_x)) {
					var dx=(document.body.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.body.scrollTop+followObj_y)) {
					var dy=(document.body.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	= '';
			}
		}	
		function closeBanner()
		{
			closeB=true;
			return;
		}
		

	var theFloaters		= new floaters();
	//
/*
[imgad]theFloaters.addItem('followDiv[adid]',adfd_left_[whichpo],adfd_top,'<a href=[targeturl] target=_blank><img src=[imgsrc] border=0 width=[imgwidth] height=[imgheight]></a><br><a style="cursor:hand;color:red;" onclick=closeBanner();><b>关闭</b></a>');[imgad]

[swfad]theFloaters.addItem('followDiv[adid]',adfd_left_[whichpo],adfd_top,'<a href="#"><embed src=[imgsrc] border=0 width=[imgwidth] height=[imgheight]></a><br><a style="cursor:hand;color:red;" onclick=closeBanner();><b>关闭</b></a>');[swfad]

[divid][adid].style.top=adfd_top+div_y;[divid]

*/

//注意：adid需要系统自动计算并进行替换，该广告不仅需要替换content部分，还需要替换dividcontent部分
	

theFloaters.addItem('followDivd1',adfd_left_1,adfd_top,'<a href=http://www.5z5p.com/epbase/eplist.aspx  target=_blank><img src=/ads/newpage/float/2009410171949955.gif border=0 width=80 height=230></a><br><a style="cursor:hand;color:red;" onclick=closeBanner();><b>关闭</b></a>');theFloaters.addItem('followDivd2',adfd_left_2,adfd_top,'<a href=http://www.5z5p.com/ModuleInfo/infolist.aspx?LabelId=91  target=_blank><img src=/ads/newpage/float/2009410171850986.gif border=0 width=80 height=230></a><br><a style="cursor:hand;color:red;" onclick=closeBanner();><b>关闭</b></a>');

	theFloaters.play();

