﻿function logout() {
    j$.ajax({
        type: "POST",
        url: "ajax_door.aspx/logout",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(msg) {
            j$.cookie('electric-hair', null, { path: '/', domain: '' });
            if (msg.d) {
                window.location = msg.d;
            }
        }
    });
}
function login_status() {
    j$("#ctl00_header_ajLogin").click(function() {
                    logout();
                });
}

function init_auth() {
    if (typeof jQuery != 'undefined') {
        var j$ = jQuery.noConflict();
        j$(document).ready(login_status);
    }
}