function adRotator() {};
adRotator.initialize=function(o)
{
	// script by blueDestiny

	this._t = new Array();
	this._l = new Array();
	this._p = new Array();
	this._i = new Image();
	this._c = 0;
	this._f = false;
	this._o = o;

	this._timeout = null;
	this._html = "";

	// configration.
	// @ image width
	// @ image height
	// @ rotator speed
	// @ filter type

	this._w = 200;
	this._h = 140;
	this._s = 4;
	this._x = 20;

	return this;
};
adRotator.add=function(p,t,l) { with (this)
{
	_p.push(p);
	_t.push(t);
	_l.push(l);
}};

adRotator.load=function() { with (adRotator)
{
	if( _i.readyState=='complete' | _i.complete==1)
	{
		if(_p.length-1==_c)
		{
			_f = true;
			_c = 0;
			window.clearTimeout(_timeout);
			//getRef("AdRotator").innerHTML="complete";
			adRotator.play();
		}
		else
		{
			_c++;
			getRef(_o).innerHTML="总计图片数量 " + _p.length + ",图片加载中: " + _c + ' ' + _i.readyState + "...";
			_timeout=window.setTimeout(adRotator.load,10)
		}
	}
	else
	{
		getRef(_o).innerHTML="总计图片数量 " + _p.length + ",图片加载中: " + _c + ' ' + _i.readyState + "...";
		_timeout=window.setTimeout(adRotator.load,10)
	}
}};

adRotator.play=function() { with (adRotator)
{
	if( _f )
	{
	_html = "";
	_html += '<table style="border:0px solid #ff6600;background-color:#D8EAF2" cellpadding=0 cellspacing =0 ><tr><td style="font-size:9pt;font-family:tahoma;font-weight:normal;">'
	_html += '<div id="rotatorPlayer"'
			+ ' style="text-align:right;width:' + _w + ''
			+ ';height:"' + _h + '"'
			+ '>'
	_html += '<a href="' + ( _l[_c] ? _l[_c] : "javascript:void(0);" ) + '" class=MENUURL target=_blank>';
	_html += '<img id="rotatorPic" border=0px src="' + _p[_c] + '"'
			+ ' width="' + _w + '"'
			+ ' height="' + _h + '"'
			+ (_t[_c]?' title="' + _t[_c] + '"':'')
			+ ' style="border-right:0px solid #ff6600;border-top:0px solid #ff6600;width:200px;border-left:0px solid #ff6600;FILTER:revealTrans(transition=' + _x + ',duration=1);"'
			+ ' ><div style="border-left:0px solid #ff6600;border-right:0px solid #ff6600;width:200px">';

for(var i=0; i<_p.length; i++)
		_html += ' <span'
					+ ' style="border:0px solid #ff6600;padding:0px 0px 0px 0px;height:15px;text-align:center;color:#fff;background-color:#000;width:16px;cursor:'
					+ (_c==i ? ('default;background-color:#ff6600;"') : 'hand;" onclick="adRotator.select(' + i + ')"')
					+ '>'
					+ (i>8?(i+1):((i+1)))+ '</span> ';
   _html+='</div>';

	_html += (_t[_c]?('<div align="center" style="border-top:1px solid #B1D6E6">' +  _t[_c] + '</div>'):'<p></p>');
	_html += '</a>';
	_html += "</div>";
	_html += '<div align="right">';

	

	_html += "</div></td></tr></table>";
	getRef(_o).innerHTML = _html;

	getRef("rotatorPic").filters[0].Apply();
	getRef("rotatorPic").filters[0].Play();

	next();
	}
	else
	{
		_i.src = _p[_c];
		adRotator.load();
	}
}};
adRotator.next=function() { with (this)
{
	(_p.length-1==_c) ? _c=0 : _c++;
	_timeout=window.setTimeout(adRotator.play,_s*1000);
}};
adRotator.select=function(i) { with (this)
{
	window.clearTimeout(_timeout);
	_c=i;
	adRotator.play();
}};
adRotator.set=function(second) { with (this)
{
	window.clearTimeout(_timeout);
	if((/\d+/).test(second)==true)
	{
		_s=second;
		adRotator.play();
	}
	else
	{
		alert("must be digit!")
		adRotator.play();
	}
}};
function getRef(id)
{
	return (document.all?document.all(id):document.getElementById(id));
}

//-->

