/*** Javascript ***/
function slide3(id,ims,s) {
  if(!this.id){var O=document.getElementById(id);if(!O)return null;O.ims=ims,O.s=s||5000;return slide3.apply(O,[]);}
  var e=document.createElement,B=this,img=new Array(),index=0,num=0,dn=0;
  this.A=C("div","display:block;width:100%;height:80%;background:#eee;overflow:hidden","screen",B);
  this.B=C("nobr","display:block;width:100%;height:20%;overflow:hidden","bar",B);
  this.R=C("div","height:100%;width:20px;float:right;z-index:10;cursor:hand","btR",this.B);
  this.L=C("div","height:100%;width:20px;float:left;z-index:10;cursor:hand","btL",this.B);
  this.IMG=C("div","height:60px;width:"+(this.B.offsetWidth-this.R.offsetWidth-this.L.offsetWidth-2)+"px;overflow:hidden;float:left;z-index:0","IMG",this.B);
  for(num=0;num<this.ims.length;num++){var I=C('img','width:100px;height:90%;margin-left:1px;margin-right:1px',"",this.IMG);I.src=this.ims[num]['pic'];I.i=num;I.onclick=function(){this.box.show(this.i);};I.onmouseover=function(){this.box.stop()};I.onmouseout=function(){this.box.start()};I.link=this.ims[num].link;I.title=this.ims[num].title;img.push(I);}
  this.clickR=this.R.onclick=function (f) {
    if(dn==0)dn++;
    else if(dn<num)B.IMG.scrollLeft+=img[dn++].offsetWidth+2;
    img[index++].className="";
    if(index>=num){index=0;dn=0;B.IMG.scrollLeft=0;}
    S(img[index],f)
  }
  this.clickL=this.L.onclick=function (f) {
    if(dn==num-1)dn--;
    else if(dn>0)B.IMG.scrollLeft-=img[dn--].offsetWidth;
    img[index--].className="";
    if(index<0){index+=num;dn=num-1;B.IMG.scrollLeft=B.IMG.scrollWidth;}
    S(img[index],f)
  }
  this.start=function(i){
    index=i||index;S(img[index]);
  }
   this.show=function(i){
    if(i>index)setTimeout(function(){B.clickR(1);B.show(i)},50);
    else if(i<index)setTimeout(function(){B.clickL(1);B.show(i)},50);
  }
  this.stop=function(){if(this.time){clearTimeout(this.time);this.time=0;}}
  function S(I,f){
    if(B.time)clearTimeout(B.time);
    I.className="sel";
    var mover="onmouseover='this.parentNode.box.stop()' onmouseout='this.parentNode.box.start()'";
    if(I.link)B.A.innerHTML="<a href='"+I.link+"' target='_blank' "+mover+"><img src='"+I.src+"' height='100%' width='100%' alt="+I.title+"></a>";
    else B.A.innerHTML="<img src='"+I.src+"' "+mover+" height='100%' width='100%' alt="+I.title+">";
    if(f!=1)B.time=setTimeout(function(){B.clickR();B.start();},B.s);
  }
  function C(a,b,c,d) { var o=e(a);o.style.cssText=b+";position:relative";o.className=c;o.box=B;d.appendChild(o);return o;}
  return this;
}