function get(a) {
    return document.getElementById(a);
}

function dymek(a) {
    get('dymek').style.display = 'block';
    get('dymek_in').innerHTML = a;
}

function hide() {
    get('dymek').style.display = 'none';
}
var sz = 30;
var news = new Array();
for (var a = 0; a <= sz; a++) news[a] = false;
news[0] = true;

function news_hide(a) {
    if (news[a] == true) {
        news[a] = false;
        get('news_' + a).style.display = 'none';
        get('news_hd_' + a).style.display = 'block';
    }
}

function news_show(b) {
    if (news[b] == false) {
        for (var a = 0; a <= sz; a++) {
            if (news[a] == true) {
                get('news_' + a).style.display = 'none';
                get('news_hd_' + a).style.display = 'block';
                news[a] = false
            }
        }
        news[b] = true;
        get('news_hd_' + b).style.display = 'none';
        get('news_' + b).style.display = 'block'
    }
}
var apop = null;

function hide_pop() {
    if (apop != null) {
        get(apop).style.display = 'none';
        apop = null;
    }
}

function show_pop(a, b) {
    hide_pop();
    get(a).style.display = 'block';
    apop = a;
    var c = 110 + b.offsetTop;
    get(a).style.top = "" + c + "px";
}
$('.change_password').live('click', function (e) {
    var curr_obj = $('.ajax_content');
    e.preventDefault();
    $.get('/ajax/chpass.php', {}, function (receivedData) {
        curr_obj.fadeTo(500, 0, function () {
            curr_obj.html(receivedData).fadeTo(500, 1);
        });
    }, 'html');
});
$('.chpass_sendform').live('submit', function (e) {
    var curr_obj = $(this);
    e.preventDefault();
    postdata = {};
    $('input:text, input:password, input:hidden', curr_obj).each(function (idx, obj) {
        curr_obj2 = $(obj);
        postdata[curr_obj2.attr('name')] = curr_obj2.val();
    });
    $.post('/ajax/chpass.php', postdata, function (receivedData) {
        $('.ajax_content').fadeTo(500, 0, function () {
            $('.ajax_content').html(receivedData).fadeTo(500, 1);
        });
    }, 'html');
});
