/**
 *Autoryzacja ajax
 */
function signIn(){
    var url = "./authorization.php?action=signIn";
    var data = new Object();
    data["email"] = $("form#autho input#email").val();
    data["password"] = $("form#autho input#password").val();
    $.post(url, data,
    function(ret){
        if(ret) $("form").submit();
        else $("div#message").html("<b class='marked'>B\u0142\u0119dny email lub hasło.</b>");
    }, "json");
}
/**
 * Sprawdzenie wyboru opcji dla koleinych kroków w koszyku i odblokowanie przycicku "Dalej"
 */
function checkStepPermission(value){
    var allow1 = false;
    var allow2 = false;
    if($("input#regulations").length != 0){

        allow1 = $("input#regulations").attr("checked");
    }
    else{
        allow1 = true;
    }
    if($("table.checkboxes").length != 0){
        var amount = $("table.checkboxes input").length;
        for(var i=0; i<amount; i++){
            if($("table.checkboxes input").eq(i).attr("checked") == true & value != 'paczkomat') allow2 = true;
        }
    }
    else{
        allow2 = true;
    }
    if(allow1 & allow2) $("input#submit").attr("disabled", false);
    else $("input#submit").attr("disabled", true);

}
