function wlLewyMargines(){
    var szerokosc = ($(window).width() - $("#wlBox").width())/2;
    $("#wlBox").css("left",szerokosc+"px");
}

function wlOtworz(){
    var stdOffset = 50;
    var scroll = $(document).scrollTop();
        
    var wysokosc = $(document).height()+scroll;
    
    
    $("#wlTlo").css("width", "100%");
    $("#wlTlo").css("height", wysokosc+"px");
    $("#wlTlo").css("opacity", "0.5").fadeIn();


    wlLewyMargines()
    $("#wlBox").css("top",(scroll+stdOffset)+"px");
    $("#wlBox").fadeIn();

//    $("#wlBox").draggable();
}

function wlZamknij(){
    $("#wlBox").fadeOut();
    $("#wlTlo").fadeOut();
}

function wlZamknijRef(){
    document.location = document.location;
}



function wlAjaxAkcje(module, action, par){
    $.ajax({
        type: "post",
        url: module+","+action+".html",
        data: par,
        success: function(e){
            $("#wlBoxInner").empty();
            $("#wlBoxInner").append(e);
            wlLewyMargines();
        }
    });
}
