function adRotator() {};
adRotator.initialize=function(o)
{
	this._p = new Array();	//Í¼Æ¬Â·¾¶
	this._n = new Array();	//Í¼Æ¬ÐòºÅ
	this._t = new Array();	//Í¼Æ¬ËµÃ÷£¨±êÌâ£©
	this._l = new Array();	//Í¼Æ¬³¬Á¬½Ó

	this._i = new Image();	//Í¼Æ¬ÈÝÆ÷
	this._c = 0;			//Í¼Æ¬×ÜÊý
	this._f = false;		//¼ÓÔØÍê±Ï±êÖ¾
	this._o = o;			//±£´æ²ãÃû
	this._timeout = null;	//
	this._html = "";		//²ãµÄHTML´úÂë
	this._w = 190;			//Í¼Æ¬¿í¶È
	this._h = 260;			//Í¼Æ¬¸ß¶È
	this._s = 5;			//¼ä¸ôÊ±¼ä
	this._x = 23;			//»ÃµÆÆ¬ÑùÊ½
	this._y = 2;			//»ÃµÆÆ¬Ê±¼ä
	return this;
};
adRotator.add=function(p,n,t,l)	//Í¼Æ¬£¬ÐòºÅ£¬±êÌâ£¬³¬Á¬½Ó
{ with (this)
	{
		_p.push(p);
		_n.push(n);
		_t.push(t);
		_l.push(l);
	}
};
adRotator.load=function()
{ with (adRotator)
	{
		if( _i.readyState=='complete' )
		{
			if(_p.length-1==_c)
			{
				_f = true;
				_c = 0;
				window.clearTimeout(_timeout);
				adRotator.play();
			}
			else
			{
				_c++;
				_timeout=window.setTimeout(adRotator.load,100);
			}
		}
		else
		{
			_timeout=window.setTimeout(adRotator.load,100);
		}
	}
};
adRotator.play=function()
{ with (adRotator)
	{
		if( _f )
		{
			getHtml();
			getRef(_o).innerHTML = _html;
			getRef("new_pic").filters[0].Apply();
			getRef("new_pic").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.getHtml=function()
{ with (adRotator)
	{
		//_p,_n,_t,_l
		//Í¼Æ¬£¬ÐòºÅ£¬±êÌâ£¬³¬Á¬½Ó
		_html = "";
		_html += '<TABLE style="table-layout:fixed" cellSpacing=8 cellPadding=0 width=495 border=0 height="280">';
		_html += '  <TBODY> ';
		_html += '  <TR> ';
		_html += '    <TD> ';
		_html += '      <table cellspacing=1 cellpadding=4 bgcolor=#cccccc border=0 align="center">';
		_html += '        <tbody> ';
		_html += '        <tr> ';
		_html += '          <td bgcolor=#ffffff><a href="'+ _l[_c] +'" title="'+ _t[_c] +'"><img id="new_pic" src="'+ _p[_c] +'" width="'+ _w +'" height="'+ _h +'" border="0" style="FILTER:revealTrans(Transition='+ _x +',Duration='+ _y +')"></a></td>';
		_html += '        </tr>';
		_html += '        </tbody>';
		_html += '      </table>';
		_html += '    </TD>';
		_html += '    <TD width="270">';
		_html += '      <table cellspacing=0 cellpadding=1 width=270 border=0 height="100%">';
		_html += '        <tbody> ';
		_html += '		  <tr> ';
		_html += '          <td style="white-space:nowrap"><font color="#FF0000">¡¤</font><a href="'+ _l[0] +'" title="'+ _t[0] +'"><font color="'+ ((_c==0)?"#FF0000":"") +'">'+ _t[0] +'</font></a></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td colspan=2 height="5" background="image/line.gif"></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td style="white-space:nowrap"><font color="#FF0000">¡¤</font><a href="'+ _l[1] +'" title="'+ _t[1] +'"><font color="'+ ((_c==1)?"#FF0000":"") +'">'+ ((typeof(_t[1])=="undefined")?"":_t[1]) +'</font></a></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td colspan=2 height="5" background="image/line.gif"></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td style="white-space:nowrap"><font color="#FF0000">¡¤</font><a href="'+ _l[2] +'" title="'+ _t[2] +'"><font color="'+ ((_c==2)?"#FF0000":"") +'">'+ ((typeof(_t[2])=="undefined")?"":_t[2]) +'</font></a></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td colspan=2 height="5" background="image/line.gif"></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td style="white-space:nowrap"><font color="#FF0000">¡¤</font><a href="'+ _l[3] +'" title="'+ _t[3] +'"><font color="'+ ((_c==3)?"#FF0000":"") +'">'+ ((typeof(_t[3])=="undefined")?"":_t[3]) +'</font></a></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td colspan=2 height="5" background="image/line.gif"></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td style="white-space:nowrap"><font color="#FF0000">¡¤</font><a href="'+ _l[4] +'" title="'+ _t[4] +'"><font color="'+ ((_c==4)?"#FF0000":"") +'">'+ ((typeof(_t[4])=="undefined")?"":_t[4]) +'</font></a></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td colspan=2 height="5" background="image/line.gif"></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td style="white-space:nowrap"><font color="#FF0000">¡¤</font><a href="'+ _l[5] +'" title="'+ _t[5] +'"><font color="'+ ((_c==5)?"#FF0000":"") +'">'+ ((typeof(_t[5])=="undefined")?"":_t[5]) +'</font></a></td>';
		_html += '        </tr> ';
		_html += '        <tr> ';
		_html += '          <td colspan=2 height="5" background="image/line.gif"></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td style="white-space:nowrap"><font color="#FF0000">¡¤</font><a href="'+ _l[6] +'" title="'+ _t[6] +'"><font color="'+ ((_c==6)?"#FF0000":"") +'">'+ ((typeof(_t[6])=="undefined")?"":_t[6]) +'</font></a></td>';
		_html += '        </tr> ';
		_html += '        <tr> ';
		_html += '          <td colspan=2 height="5" background="image/line.gif"></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td style="white-space:nowrap"><font color="#FF0000">¡¤</font><a href="'+ _l[7] +'" title="'+ _t[7] +'"><font color="'+ ((_c==7)?"#FF0000":"") +'">'+ ((typeof(_t[7])=="undefined")?"":_t[7]) +'</font></a></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td colspan=2 height="5" background="image/line.gif"></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td style="white-space:nowrap"><font color="#FF0000">¡¤</font><a href="'+ _l[8] +'" title="'+ _t[8] +'"><font color="'+ ((_c==8)?"#FF0000":"") +'">'+ ((typeof(_t[8])=="undefined")?"":_t[8]) +'</font></a></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td colspan=2 height="5" background="image/line.gif"></td>';
		_html += '        </tr>';
		_html += '        <tr> ';
		_html += '          <td style="white-space:nowrap"><font color="#FF0000">¡¤</font><a href="'+ _l[9] +'" title="'+ _t[9] +'"><font color="'+ ((_c==9)?"#FF0000":"") +'">'+ ((typeof(_t[9])=="undefined")?"":_t[9]) +'</font></a></td>';
		_html += '        </tr>';
		_html += '		  <tr> ';
		_html += '          <td colspan=2 height="5" background="image/line.gif"></td>';
		_html += '        </tr>';
		_html += '        </tbody> ';
		_html += '      </table>';
		_html += '    </TD>';
		_html += '  </TR>';
		_html += '  </TBODY>';
		_html += '</TABLE>';
	}
};
function getRef(_id)
{
	return (document.all?document.all(_id):document.getElementById(_id));
}
