               function adRotator() {};
                    //展示初始化
                    adRotator.initialize=function(o)
                    {
	                    // script by vikey

	                    this._t = new Array(); //照片标题
	                    this._l = new Array(); //照片链接地址
	                    this._p = new Array(); //照片路径
	                    this._d = new Array(); //照片描述
	                    this._h = new Array(); //照片被访问记录
	                    this._width = new Array(); //照片宽度
	                    this._height = new Array(); //照片高度
	                    this._i = new Image(); //用于load照片用的对象
	                    this._c = 0;           //照片的展示序列
	                    this._f = false;       //是否最后一张照片加载完毕
	                    this._o = o;           //当前的对象
	                    this._Continue=1;      //是否继续展示下一张  0－不是 1－是

	                    this._timeout = null;  //清空时间刷新参数
	                    this._html = "";
	                    this.d=0;

	                    // configration.
	                    // @ image width
	                    // @ image height
	                    // @ rotator speed
	                    // @ filter type

	                   
	                    this._s = 4;
	                    this._x = 6;

	                    return this;
                    };
                    //添加照片信息
                    adRotator.add=function(p,t,l,d,h,width,height)
                    { 
                        with (this)
                        {
	                        _p.push(p);
	                        _t.push(t);
	                        _l.push(l);
	                        _d.push(d);
	                        _h.push(h);
	                        _width.push(width);
	                        _height.push(height);
                        }
                    };

                    //照片加载到本地
                    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++;
		                            getRef(_o).innerHTML="共有照片 " + _p.length + "张, 正在加载第 " + _c + '张 ' + _p[_c]  + _i.readyState + "...";
		                            _timeout=window.setTimeout(adRotator.load,10);
	                            }
                            }
                            else
                            {
	                          getRef(_o).innerHTML="共有照片 " + _p.length + "张,正在加载第 " + _c + '张 ' + _p[_c] + _i.readyState + "...";
	                          _timeout=window.setTimeout(adRotator.load,10);
                            }
                        }
                    };

                    //幻灯展示
                    adRotator.play=function() 
                    { 
                        with (adRotator)
                        {
	                        if( _f )
	                        {
	                            _html = '<a href="' +  _l[_c]  + '">';
	                            _html += '<img id="rotatorPic" border=0 src="' + _p[_c] + '"'
	                                    + ' width="' + _width[_c] + '"'
			                            + ' height="' + _height[_c] + '"'
			                            + (_t[_c]?' title="' + _t[_c] + '"':'')
			                            + ' style="FILTER: alpha(opacity=0)"'
			                            + ' />';
	                            _html += '</a>';
//FILTER:revealTrans(transition=' + _x + ',duration=1);

                                getRef('spPicName').innerHTML=_t[_c];
                               // getRef('spHits').innerHTML=_h[_c];
                                if (_d[_c]!='')
                                 getRef('spAbstract').innerHTML=' <strong class="stylesn">相册说明：</strong><br />' + _d[_c];
       
                                //spAbstract
                                getRef(_o).innerHTML=_html;
                                

                               _html='';
                                var j,m,n,plength,mod;
                                plength=_p.length;
                                n=6;
                                mod=_c % n;
                                if (mod==0)
                                    j=_c;
                                else
                                    j=_c-mod;   
                                //j=_c\n;
                                if ((j+n)<=plength)
                                    m=j+n;
                                else
                                     m=plength;
	                            for(var i=j; i<m; i++)
	                                 _html += '<span'
				                    + ' style="padding:1px 5px 1px 5px;height:20px;text-align:center;cursor:'
				                    + (_c==i ? ('default;background-image: url(images/boty.jpg)"') : 'hand;;background-image: url(images/bot22.jpg);" onclick="adRotator.select(' + i + ')"')
				                    + '>'
				                    + (i>8?(i+1):('0'+(i+1)))+ '</span> ';
	                                
		                
	                            getRef('tdPage').innerHTML = _html;
	                            
	                            

	                          //  getRef("rotatorPic").filters[0].Apply();
	                          //  getRef("rotatorPic").filters[0].Play();

                                adRotator.JM_fade();
	                        }
	                        else
	                        {
		                        _i.src = _p[_c];
		                        adRotator.load();
	                        }
                        }
                    };
                    
                    adRotator.JM_fade=function(){
                    
                
                            var ob;
                            ob=getRef("rotatorPic");
                            if (adRotator.d==0)
                                {
                                    ob.filters.alpha.opacity+=1;
                                } 
                            else 
                                {
                                    ob.filters.alpha.opacity-=1;
                                }
                            if (ob.filters.alpha.opacity>0 && ob.filters.alpha.opacity<100)
                            {
                                // setInterval("adRotator.JM_fade()",10);
                                 _timeout=window.setTimeout(adRotator.JM_fade,10);
                            }    
                            if (ob.filters.alpha.opacity==100)
                                {
                                    adRotator.d=1;
                                    if (adRotator._Continue==1)
    	                                adRotator.next();
                                } 
                            else if (ob.filters.alpha.opacity==0)
                                {
                                    adRotator.d=0;
    	                                (adRotator._p.length-1==adRotator._c) ? adRotator._c=0 : adRotator._c++;
    	                                adRotator.play();
                                 }
                    

                       
                    };
                    
                    adRotator.ReSet=function() 
                    { 
                        with (this)
                        {
	                    //    setInterval(adRotator.JM_fade(),10);
	                        _timeout=window.setTimeout("adRotator.JM_fade()",10);
                        }
                    };
                    
                     //展示下一张
                    adRotator.next=function() 
                    { 
                        with (this)
                        {
	                        
	                        _timeout=window.setTimeout("adRotator.JM_fade()",_s*1000);
                        }
                    };
                    
                    //选择展示照片
                    adRotator.select=function(i) 
                    { 
                        with (this)
                        {
	                        window.clearTimeout(_timeout);
	                        _c=i;
	                       getRef('imgStart').style.display='';
                           getRef('imgStop').style.display='none';
                           adRotator._Continue=0;
	                        adRotator.play();
                        }
                    };
                    
                    //通过Go选择展示照片
                   function go() 
                    { 

	                     if((/\d+/).test(getRef('txtPhotoNo').value)==true)
	                        {
		                       adRotator.select(getRef('txtPhotoNo').value-1);
	                        }
	                        else
	                        {
		                        alert("请输入数字!")
	                        }

                    }
                    
                    
                    //设置照片切换间隔时间
                    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));
                    }


                    //展示画面切换
                function Start()
                {
                      getRef('imgStart').style.display='none';
                      getRef('imgStop').style.display='';
                      adRotator._Continue=1;
                      adRotator.play();
                }
                function Stop()
                {
                     getRef('imgStart').style.display='';
                     getRef('imgStop').style.display='none';
                     adRotator._Continue=0;
                     adRotator._c=adRotator._c-1;
                     adRotator.play();
                }
