function showTopTen()
{   
    var aj = new Ajax.Request("../img/top10.php", { method:'get', onComplete: writeTop } );
}

function writeTop(oReq)
{
    var response = oReq.responseXML;
    var top = response.documentElement.getElementsByTagName('top10')[0].childNodes;
    for (i=0;i<top.length;i++)
    {
        if (top.item(i).nodeType==1)
        {   
            var pos = top.item(i).getAttribute('pos');
            var name = top.item(i).getElementsByTagName("name")[0].firstChild.nodeValue;
            var times = top.item(i).getElementsByTagName("times")[0].firstChild.nodeValue;
            times = times+" points";
            document.getElementById("top10-track"+pos).innerHTML=name;
            document.getElementById("top10-times"+pos).innerHTML=times;
        }
    }
}
