// JavaScript Document

function changepic(cnt)
{ 
    var xhr; 
    try { xhr = new XMLHttpRequest(); }                 
    catch(e) 
    {    
      xhr = new ActiveXObject("Microsoft.XMLHTTP");
    } 
 
    xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {
              document.getElementById('fppic').innerHTML = xhr.responseText;
         }
    }; 

   xhr.open('GET', "/cgi-bin/rotater?np=" + cnt,  true); 
   xhr.send(null); 
} 

var count = 1;

function dorotation() {
  changepic(count);
  count++;
  setTimeout("dorotation()", 8000);
}

function startrotation() {
  changepic(0);
  setTimeout("dorotation()", 8000);
}

