function prepare()
{
var xhttp = getXMLHttp();
try {
    xhttp.onreadystatechange = function()
    {
        if (xhttp.readyState==4) 
        {
            if (xhttp.status==200)
            {
                xmlDoc = xhttp.responseXML;
                var x = xmlDoc.documentElement.childNodes;
                for (var i=0;i<x.length;i++)
                { 
                    if (x[i].nodeType==1)
                    {
                        if (x[i].nodeName == 'version')
                        {
                            document.getElementById('download').href = "./binaries/orsiso."+x[i].childNodes[0].nodeValue+".air";
                            break;
                        }
                    } 
                }
            }
            return false;
        }
    }
    xhttp.open("GET","./binaries/currentversion.xml",true);
    xhttp.send(null);
} catch (e) {
    //document.write("Error(2):"+e+"<br>");
}
}

function getXMLHttp()
{
    var xhttp;
    if (window.XMLHttpRequest)
    {
        try {
            xhttp = new XMLHttpRequest();
        } catch (e) {
            xhttp=false;
        }
    }
    else
    {
        xhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    return xhttp;
}