    var oldurl = "";
    var urlBase = "";
    var urlEnd = "";
    var thumbIndex = 0;
    var thumbLength = 0;
    var animateOn = false;
    var imageAnim;
    var animateTimer;
    function thumbAnimate(image) 
    {
       if(!animateOn) {
           oldurl = image.src;
           var ss = oldurl.split("/");
           urlBase="";
           for(var i=0;i<(ss.length-1);i++)
               urlBase = urlBase + ss[i] + "/";
           urlEnd = ss[ss.length-1];           
           imageAnim = image;
           thumbIndex = 0;
           thumbLength = image.getAttribute("thumblength");
           if(thumbLength>0) {
              animateOn = true;
              animateTimer = setTimeout("nextThumbAnimate();",100);
           }
       }
    }
    function nextThumbAnimate() 
    {
       if(animateOn) {
           imageAnim.src = urlBase + "Thumb"+thumbIndex+"_"+urlEnd;
           thumbIndex++;
           if(thumbIndex>=thumbLength)
              thumbIndex=0;
           animateTimer = setTimeout("nextThumbAnimate();",900);
       }
    }
    function stopThumbAnimate()
    {
       if(animateOn) {
          animateOn = false;
          clearTimeout(animateTimer);
          imageAnim.src = oldurl;
       }
    }

