var adimg="../AD/268.gif";
var visibility;
//visibility='show'; // hidden show
visibility='hidden'; // hidden show
var left_img='';


var right_img='';
//right_img=right_img+'<a href="#" onclick="javascript:alert(\'论坛讨论区发文及回文加积点 1 分.  可用于优惠价后最高扣抵订购金额 30 %.  并可于下载专区使用!!(积分可以经由会员专区自行转让给新人或朋友使用)\');return false;" target=_blank><img src=../ad/t1j.gif border=0></a>';
right_img=right_img+'<br><br><a href="http://www.tacol.com/tw/" target=_blank><img src=../ad/tacol.jpg border=0></a>'
right_img=right_img+'<br><br><a href="http://www.test104.com/tw/" target=_blank><img src=../ad/test10.gif border=0></a>'
right_img=right_img+'<br><br><a href="http://www.lineage02.com/vpn/" target=_blank><img src=../ad/line.gif border=0></a>'
right_img=right_img+'<br><br><a href="http://www.vschat.com.tw" target=_blank><img src=../ad/vschat.gif border=0></a>'

/*right_img=right_img+'<br><a href="#" onclick="javascript:return false;" target=_blank><img src=../ad/05_3_4B.gif border=0></a>'
right_img=right_img+'<br><a href="http://www.tacol.com/cn/" target=_blank><img src=../ad/tacol.gif border=0></a>'
right_img=right_img+'<br><a href="http://www.lineage02.com" target=_blank><img src=../ad/lineage.gif border=0></a>'
right_img=right_img+'<br><br><a href="http://www.test104.com" target=_blank><img src=../ad/m4.gif border=0></a>'
*/

var delta=0.15
var collection;


var theFloaters		= new floaters();
theFloaters.addItem('followDiv1','document.body.clientWidth-90',200,''+right_img+'');
theFloaters.addItem('followDiv2','20',50,''+left_img+'');
theFloaters.play();
var autohiddenname;

autohiddenname='flash1'
ShowFlash(autohiddenname,'../ad/zuixin.swf',480,550,400,200)
setTimeout(hiddenit,0);

var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
var _all = '';
var _style = '';
var wwidth, wheight;
var ydir = '++';
var xdir = '++';
var id1, id2, id3;
var x = 1;
var y = 1;
var x1, y1;


if(!isNS) {
	_all='all.';
	_style='.style';
}
function getwindowsize() {
	clearTimeout(id1);
	clearTimeout(id2);
	clearTimeout(id3);
	if (isNS) {
		wwidth = window.innerWidth - 55;
		wheight = window.innerHeight - 50;
	} else {
		wwidth = document.body.clientWidth - 55;
		wheight = document.body.clientHeight - 50;
	}
	id3 = setTimeout('randomdir()', 20000);
	animate();
}
function randomdir() {
	if (Math.floor(Math.random()*2)) {
		(Math.floor(Math.random()*2)) ? xdir='--': xdir='++';
	} else {
		(Math.floor(Math.random()*2)) ? ydir='--': ydir='++';
	}
	id2 = setTimeout('randomdir()', 20000);
}
function animate() {
	eval('x'+xdir);
	eval('y'+ydir);
	if (isNS) {
		pic1.moveTo((x+pageXOffset),(y+pageYOffset))
	} else {
		pic1.pixelLeft = x+document.body.scrollLeft;
		pic1.pixelTop = y+document.body.scrollTop;
		}
		if (isNS) {
			if (pic1.top <= 5+pageYOffset) ydir = '++';
			if (pic1.top >= wheight+pageYOffset) ydir = '--';
			if (pic1.left >= wwidth+pageXOffset) xdir = '--';
			if (pic1.left <= 5+pageXOffset) xdir = '++';
		} else {
			if (pic1.pixelTop <= 5+document.body.scrollTop) ydir = '++';
			if (pic1.pixelTop >= wheight+document.body.scrollTop) ydir = '--';
			if (pic1.pixelLeft >= wwidth+document.body.scrollLeft) xdir = '--';
			if (pic1.pixelLeft <= 5+document.body.scrollLeft) xdir = '++';
		}
		id1 = setTimeout('animate()', 30);
}





var pic1=eval('document.'+_all+'pic1'+_style);


getwindowsize()
window.OnResize=getwindowsize;

//左边
//左边

function floaters() {
	this.items	= [];
	this.addItem	= function(id,x,y,content)
	{
		document.write('<DIV id='+id+' align=right 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()
{
	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 ShowFlash(name,src,width,height,left,top)
{
	document.write('		<div  name="'+ name +'" style="position:absolute;  left:'+ left +'px; top:'+ top +'px; z-index:103"> ');
	document.write('		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" name="flash1" width="'+ width +'" height="'+ height +'"  > ');
	document.write('		 <param name="movie" value="'+ src +'"> ');
	document.write('		  <param name="wmode" value="transparent"> ');
	document.write('		  <param name="quality" value="high"> ');
	document.write('		 <embed wmode="transparent" src="'+ src +'" width="'+ width +'" height="'+ height +'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ></embed> ');
	document.write('		</object> ');
	document.write('		</div> ');
	
}



function hiddenit()
{
	document.all[autohiddenname].style.visibility='hidden';
	document.all[autohiddenname].style.display='none';
}
