﻿	var delta=0.15
	var collection;
	var islefton;
	islefton=false;//开启左边广告  true为开启false为关闭
	var isrighton;
	isrighton=false;//开启右边广告  true为开启false为关闭
	var isxhtml;
	isxhtml=true;//DOCTYPE 为XHTML 1.0 为true  否则为false
	var documentobj;
	if(isxhtml==true)
	{
		documentobj=document.documentElement
	}
	else
	{
		documentobj=document.body
	}
	var widthl,widthr,heightl,heightr,leftl,leftr,topl,topr,typel,typer,imgurll,imgurlr,imgtargetl,imgtargetr,imgopenurll,imgopenurlr,imgtitlel,imgtitler,flashurll,flashurlr;
	widthl=110;//左边宽度
	widthr=110;//右边宽度
	heightl=348;//左边高度
	heightr=348;//右边高度
	leftl=1;//左边距离左窗口距离
	leftr=1;//右边距离右窗口距离
	topl=95;//左边距离顶部窗口距离
	topr=95;//右边距离顶部窗口距离
	typel='flash';//左边浮动类型  flash为flash动画 img为图片
	typer='img';//右边浮动类型  flash为flash动画 img为图片
	imgurll='';//左边图片地址
	imgurlr='upfile/20091121101922r.jpg';//右边图片地址
	imgtargetl='_blank';//左边打开目标  _blank弹出 _self本页
	imgtargetr='_blank';//右边边打开目标  _blank弹出 _self本页
	imgopenurll='http://www.diaoke2008.com/new.asp?id=296203';//左边打开地址  譬如http://www.baidu.com 或者/index.asp  如果不打开任何地址为javascript:
	imgopenurlr='http://www.diaoke2008.com/new.asp?id=256588';//右边打开地址  譬如http://www.baidu.com 或者/index.asp  如果不打开任何地址为javascript:
	imgtitlel='对联广告左部';//左边 title 和alt
	imgtitler='对联广告右部';//右边 title 和alt
	flashurll='upfile/20100613080724l.jpg';//左边 flash地址
	flashurlr='';//右边 flash地址
	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()',10);
				  }
		}
		function play()
		{
			if(screen.width<=800)
			{
				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!=(documentobj.scrollLeft+followObj_x)) {
					var dx=(documentobj.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
					dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
					followObj.style.left=followObj.offsetLeft+dx+'px';
					}

				if(followObj.offsetTop!=(documentobj.scrollTop+followObj_y)) {
					var dy=(documentobj.scrollTop+followObj_y-followObj.offsetTop)*delta;
					dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
					followObj.style.top=followObj.offsetTop+dy+'px';
					}
				followObj.style.display	= '';
			}
		}	
		
	var theFloaters		= new floaters();
	if(isrighton==true)
	{
		if(typer=='flash')
		{
		theFloaters.addItem('followDiv1','documentobj.clientWidth-widthr-leftr',topr,'<embed src="'+flashurlr+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+widthr+'" height="'+heightr+'"></embed>');
		}
		else
		{
		theFloaters.addItem('followDiv1','documentobj.clientWidth-widthr-leftr',topr,'<a href="'+imgopenurlr+'" target="'+imgtargetr+'" title="'+imgtitler+'"><img src="'+imgurlr+'"  width="'+widthr+'" height="'+heightr+'" border="0" alt="'+imgtitler+'"></a>');
		}
	}
	if(islefton==true)
	{
		if(typel=='flash')
		{
		theFloaters.addItem('followDiv2',leftl,topl,'<embed src="'+flashurll+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+widthl+'" height="'+heightl+'"></embed>');
		}
		else
		{
		theFloaters.addItem('followDiv2',leftl,topl,'<a href="'+imgopenurll+'" target="'+imgtargetl+'" title="'+imgtitlel+'"><img src="'+imgurll+'"  width="'+widthl+'" height="'+heightl+'" border="0" alt="'+imgtitlel+'"></a>');
		}
	}
	theFloaters.play();

