var infobox;
var file;

function dlFile(el, infoboxID, _file)
{
	var elFile = $(infoboxID).getElements("input[name='file']")[0];
	elFile.value = _file;
	infobox = showInfoBox(el, infoboxID);
	file = _file;
	return false;
}

function checkON2()
{
    //alert($(infobox).getElementsBySelector("input[name='file']"));
    var regID = $(infobox).getElements("input[name='regid']")[0].value;
    //var file = $(infobox).getElements("input[name='file']")[0].value;
    var locale = $(infobox).getElements("input[name='locale']")[0].value;

    var request = new Request(
    {
        url: "/community/dlFile.php",
        data: {'regid': regID, 'file':file,'locale':locale},
        method: 'get',
        encoding: 'ISO-8859-1',
        evalScripts: true,
        onComplete: function(response)
        {
            if (response != "false")
            {
                showMessage(response);

                $(infobox).getElements("div.regcheckhint")[0].setStyle("display", "block");
            }
            else
            {
                if (locale == "de")
                {

                    showMessage("Leider konnten wir Sie nicht als registrierter Nutzer identifizieren oder Sie haben nicht den benötigten Lizenztyp.");
                }
                else
                {
                    showMessage("We could not idenfity you as registered user or your licence type doesn't fit.");

                }
            }
        }
        ,
        onFailure: function(response)
        {
            //showMessage(response);
            showMessage("Couldn't check order number because of a system error...Please write us an e-mail.");
        }
    });
    request.send();

    showMessage($("msg_checking_ordernumber").innerHTML);

    // $("checkform").send();
}

function showMessage(msg)
{
    var el = $(infobox).getElements("div.regcheckresult")[0];
    el.set("html", msg);
}
