  var mySecs
  var myTimerID = null
  var myTimerRunning = false
  var myDelay = 1000
  var container
  var newdiv

  function loadXMLDoc(url)
  {
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
    } else {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.open("GET",url,false);
    xmlhttp.send(null);
    //document.getElementById("featured").display="none";
    //document.getElementById("featured").innerHTML=xmlhttp.responseText;
    //document.getElementById("featured").display="block";

    newdiv.innerHTML = xmlhttp.responseText;
  }

  function InitializeTimer()
  {
    // Set the length of the timer, in seconds
    mySecs = 10
    container = document.getElementById("featured");
    newdiv = document.createElement("div");
    container.appendChild(newdiv);
  }

  function StopTimer()
  {
    if(myTimerRunning)
        clearTimeout(myTimerID)
    myTimerRunning = false
  }

  function StartTimer()
  {
    if (mySecs==0)
    {
        StopTimer();
        loadXMLDoc("featured.php");
        mySecs = 10;
        StartTimer();
    }
    else
    {
        self.status = mySecs
        mySecs = mySecs - 1
        myTimerRunning = true
        myTimerID = self.setTimeout("StartTimer()", myDelay)
    }
  }


