var slidewid = 800;

var parts,els=[],wids=[],dest,ilen,curtot=0,curnum=0,j=0,pad=0;
var bimg;

function _clear(o) { while(o.firstChild) { o.removeChild(o.firstChild); } }

function loadslide(divid) {
  bimg = document.createElement('img'); bimg.src='/images/blank.gif';
  var A=document.getElementById(divid);if(!A)return;var B=A.firstChild.nodeValue+'   ';_clear(A);dest=
  document.createElement('div');A.appendChild(dest);dest.style.position='relative';parts=(B).
  split('');ilen=parts.length;for(var i=0;i<parts.length;i++){var C=parts[i];var D=document.
  createElement('span');if(C==' ')D.appendChild(document.createTextNode('\u00a0'));else D.
  appendChild(document.createTextNode(C));if(curtot<slidewid){dest.appendChild(D);curnum++;
  var wid=D.scrollWidth;wids.push(wid-1);curtot+=wid;}else{dest.appendChild(D);var wid=D.
  scrollWidth;wids.push(wid-1);dest.removeChild(D);}els.push(D);};if(curtot>=slidewid)slide();
}

function slide() {
  var A=els[j],B=(dest.style.left).split('px')[0]*1;if(pad){var C=pad.scrollWidth;if(C){pad.
  style.width=(C-1)+'px';if(B<0){dest.style.left=(B+1)+'px';pad.style.width=(C-2)+'px';}}else{
  dest.removeChild(pad);pad=0;dest.style.left=(B-1)+'px';}}else{var D=wids[j],E=bimg;E.style.
  width=D+'px';dest.replaceChild(E,A);curtot-=(D+1);while(curtot<slidewid){dest.appendChild(
  els[curnum]);curtot+=(wids[curnum]+1);curnum++;if(curnum>=ilen)curnum=0;}pad=E;j++;if(j>=
  ilen)j=0;}setTimeout(slide,30);
}