var sxmlHttp = null;
function topScore()
{
    sxmlHttp=getXmlHttpObject();
    if (sxmlHttp == null)
    {
        document.getElementById('score').innerHTML = "100";
    }
    else
    {
        sxmlHttp.onreadystatechange=displayScore;
        sxmlHttp.open("GET","php/topScore.php",true);
        sxmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        sxmlHttp.send(null);
   }
}
function displayScore()
{
  if (sxmlHttp.readyState == 4)
  {
      if (sxmlHttp.status == 200)
      {
          var xmlDoc=sxmlHttp.responseXML;
          if (xmlDoc.getElementsByTagName("SCORE")[0])
          {
              document.getElementById('score').innerHTML = xmlDoc.getElementsByTagName("SCORE")[0].childNodes[0].nodeValue
          }
          else
          {
              document.getElementById('score').innerHTML = "100";
          }
      }
   }
}

function openTerms()
{
   openWin("terms.html", 500, 500, "terms");
}

function openPrivacy()
{
   openWin("privacy.html", 500, 500, "privacy");
}

function setWins()
{
           try
           {
                document.getElementById('terms').addEventListener("click", openTerms, false);
           }
           catch (e)
           {
                document.getElementById('terms').attachEvent("onclick", openTerms);
           }
           try
           {
            document.getElementById('privacy').addEventListener("click", openPrivacy, false);
           }
           catch (e)
           {
             document.getElementById('privacy').attachEvent("onclick", openPrivacy);
           }
}