<!--  网页两边的广告 -->
//左边
var left_img='<a href="reg_online2.asp?titleid=1" target="_blank"><IMG src="./adpic/11.gif" border=0></a>';

//右边
//var right_img='<DIV id=flagright style="Z-INDEX: 5; WIDTH: 110px; POSITION: absolute; HEIGHT: 250px"><DIV style="FILTER: progid:DXImageTransform.Microsoft.Alpha(opacity=70); LEFT: 1px; WIDTH: 66px; CURSOR: hand; POSITION: absolute; TOP: 352px; HEIGHT: 14px" onclick=hideFlag()><IMG height=14 src="http://www.taichikungfu.org/images/close.gif" width=14> close</DIV><IMG src="http://www.taichikungfu.org/images/jt-right-en.jpg" align=middle useMap=#Map border=0><MAP id=Map name=Map><AREA shape=RECT target=_blank coords=3,134,184,179 href="http://www.taichikungfu.org/html/classes/schedules.htm"><AREA shape=RECT target=_blank coords=3,189,184,237 href="http://www.taichikungfu.org/?S=Upcoming"><AREA shape=RECT target=_blank coords=3,245,184,292 href="http://www.taichikungfu.org/?S=Freetrial"><area shape="rect" coords="3,300,183,346" href="http://www.kungfudirect.com/" target="_blank" /></MAP></DIV>';

var right_img='<DIV id=flagright style="Z-INDEX: 5; WIDTH: 110px; POSITION: absolute; HEIGHT: 250px"><DIV style="FILTER: progid:DXImageTransform.Microsoft.Alpha(opacity=70); LEFT: 1px; WIDTH: 62px; CURSOR: hand; POSITION: absolute; TOP: 342px; HEIGHT: 14px" onclick=hideFlag()><IMG height=14 src="http://www.taichikungfu.org/images/close.gif" width=14> close</DIV><IMG src="http://www.taichikungfu.org/images/jt-right-en.jpg" align=middle useMap=#Map border=0><MAP id=Map name=Map><AREA shape=RECT target=_blank coords=3,123,184,168 href="http://www.taichikungfu.org/?S=Schedules"><AREA shape=RECT target=_blank coords=3,178,184,226 href="http://www.taichikungfu.org/?S=Upcoming"><AREA shape=RECT target=_blank coords=3,234,184,281 href="http://www.taichikungfu.org/?S=Freetrial"><area shape="rect" coords="3,289,183,335" href="http://www.kungfudirect.com/" target="_blank"/></MAP></DIV>';

	var delta=0.15
	var collection;
	function hideFlag(){
	//flagleft.style.display = "none";
	flagright.style.display = "none";
	}
	function floaters() {
		this.items	= [];
		this.addItem	= function(id,x,y,content)
				  {
					document.write('<DIV id='+id+' style="Z-INDEX: 1; POSITION: absolute;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!=(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	= '';
			}
		}	
	
	if (window.screen.width>800)
{
	var theFloaters	= new floaters();
	theFloaters.addItem('followDiv1','document.body.clientWidth-210',0,''+right_img+'');//此处为右边广告内容
	//theFloaters.addItem('followDiv2',0,200,''+left_img+'');//此处为左边广告内容
	//theFloaters.play();
}

