var delta=0.15
var collection;
function Couplet ()
{		
	this.items = [];
	this.additem = function(id,left,top,content,flag)
	{
		document.write('<DIV id='+id+' style="Z-INDEX:10;POSITION:absolute;left:'+(typeof(left)=='string'?eval(left):left)+';top:'+(typeof(top)=='string'?eval(top):top)+'">'+content+'</DIV>');					
		var newItem = {};
		newItem.object = document.getElementById(id);
		newItem.x = left;
		newItem.y = top;
		newItem.flag = flag;
		this.items[this.items.length] = newItem;		
	}
	this.play = function()
	{
		collection = this.items
		setInterval('play()',10);
	}
}
function play(flag)
{
	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);
		var followObj_flag = collection[i].flag;
		
		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_flag == "0")
		{
			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 swf_code (swf_width,swf_height,swf_src)
{
	return "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH="+swf_width+" HEIGHT="+swf_height+"><PARAM NAME=movie VALUE='"+swf_src+"'><EMBED src='"+swf_src+"' quality=autohigh TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED></OBJECT>";	        
}

function img_code (img_width,img_height,img_src,img_href)
{
	return "<a href='"+img_href+"' target=_blank><IMG SRC='"+img_src+"' WIDTH='"+img_width+"' HEIGHT='"+img_height+"' BORDER='0'></a>";
}

function iframe_code (iframe_width,iframe_height,iframe_src)
{
	return "<iframe style='FILTER: alpha(opacity=100)' scrolling=no frameborder=0 SRC='"+iframe_src+"' WIDTH='"+iframe_width+"' HEIGHT='"+iframe_height+"' BORDER='0'></iframe>";
}

//var floaters_r = swf_code(118,208,"/huitong.swf");

var floaters_r =  img_code(118,208,"/swf/mg.gif","http://www.8859348.com");
var floaters_r2 = swf_code(118,208,"/swf/czgy.swf");
var floaters_r3 = swf_code(118,208,"/swf/XXBMH.swf");
var floaters_r4 = swf_code(118,208,"/swf/xxbmx1.swf");
var floaters_r5 = swf_code(118,208,"/swf/ql.swf");
var floaters_r6 = swf_code(118,208,"/swf/xxbmw.swf");

//var floaters_r5 =  iframe_code(110,303,"/ad/google_adsense_120_600.asp");
//var floaters_l7 = swf_code(100,200,"/ad/images/财税100-200.swf");
//var floaters_r6 = swf_code(100,200,"/ad/images/提升企业凝聚力.swf");


var couplet = new Couplet();

couplet.additem('floaters_r',0,0,floaters_r,0);
couplet.additem('floaters_r2','document.body.clientWidth-118',0,floaters_r2,0);

couplet.additem('floaters_r3',0,210,floaters_r3,0);
couplet.additem('floaters_r4','document.body.clientWidth-118',210,floaters_r4,0);

couplet.additem('floaters_r5',0,420,floaters_r5,0);
couplet.additem('floaters_r6','document.body.clientWidth-118',420,floaters_r6,0);

couplet.play();
//首页弹出窗口
//window.open("/webst.htm","smexm","toolbar=no, status=no,menubar=yes, scrollbars=yes,resizable=yes,width=800,height=600,left=50,top=50");
