$(document).ready(function() {
    $("div.link a.pw").click(function() {
        id = $(this).attr('id');
        //alert(id);
        password = prompt("Geben Sie das Passwort fuer den Download ein!", "");
        //alert(password);

        $.get("index.php?do=checkfile&id=" + id + "&pw=" + password, function(data){
            if(data.substr(0,4) == 'true') {
                window.location.href = "index.php?do=download&id=" + id + "&pw=" + password;
            } else {
                alert("Das Passwort ist falsch!");
                return false;
            }
        });
    });
});

