$(document).ready(function() {
    //$('fieldset.jcalendar').jcalendar({ firstDayOfWeek: 1});

    // Проверка в WebStorage
    $('.childrens-smiles-vote').each(function(index, value) {
        if (window.localStorage) {
            var child_id = $(value).attr('child_id');
            var d = window.localStorage.getItem('Child' + child_id);
            if (d != null) {
                $(value).hide();
                $('.childrens-smiles-has-vote').show();
            }
        }
    });

    // Сохранение в WebStorage
    $('.childrens-smiles-vote').click(function() {
        if (window.localStorage) {
            var child_id = $(this).attr('child_id');
            window.localStorage.setItem('Child' + child_id, child_id);
        }
    });

    $("a[rel^='prettyPhoto']").prettyPhoto({ deeplinking: false, social_tools: false });

    $.ws({
        url: "ChatService.asmx/IsManagerAvailable",
        success: function(ok) {
            if (ok.toString() == "true") {
                var cl = $("#chat-link");
                //                cl.parent().css("padding-top", "15px");
                cl.css("display", "");
                cl.click(function() {
                    window.open("/Chat.htm", "popUp", "width=400,height=400,top=" + ((screen.height - 400) / 2) + ",left=" + ((screen.width - 400) / 2));
                });
            }
        }
    });    
});
