// Opens announcement details window
function ann_details(id, evt, comments) {
    if(!evt)
        evt = window.event;
/*    Event.stop(evt); */
    var url = '/lt/details/'+id;
    if(comments)
        url += '#comments';
    window.open(url, 'details_'+id, 'width=800,menubar=no,toolbar=no,location=no,scrollbars=yes');
}

function ann_subscribe(fid) {
    document.announcement_filter_f.action = '/lt/subscribe/announcements/'+fid;
    document.announcement_filter_f.submit();
}

function alist_item_over(o) {
    $('#'+o.id+' > .alist-body').css('backgroundColor', '#E5EAEE');
    
    /*
    var header = $('#'+o.id+' > .alist-body');
    if (header.size() > 0) {
        header.first().setStyle({backgroundColor: '#E5EAEE'});
    }
    */
}

function alist_item_out(o) {
    $('#'+o.id+' > .alist-body').css('backgroundColor', '#F1F0F5');
    
    /*
    var header = $('#'+o.id+' > .alist-body');
    if (header.size() > 0) {
        header.first().setStyle({backgroundColor: '#F1F0F5'});
    }
    */
}

function alist_select(o, id) {
    var checked = $(o).hasClass('checked');
    var url = '/lt/ajax/announcement/';
    if (checked) {
        $(o).toggleClass('checked');
        url += 'deselect/';
    }
    else {
        $(o).toggleClass('checked');
        url += 'select/';
    }
    
    /* new Ajax.Request(url + id); */
    $.post(url+id);
}

function alist_showhide_filetr() {
    if ('none' == $('#alist-filter-block').css('display')) {
        $('#alist-filter-block').css({display: 'block'});
    }
    else {
        $('#alist-filter-block').css({display: 'none'});
    }
}


$(document).ready(function() {
    /* if (Prototype.Browser.IE) { */
        var m = navigator.userAgent.match(/MSIE ([^;]*)/);
        if (m && m.length == 2 && parseFloat(m[1]) < 7) {
            $('input[type=button]', 'input[type=submit]').each(function(o) {
                o.addClass('noriu-button');
            });
        }
    /* } */
});


$(document).ready(function(){

    $('#alist-filter-block ul li').hover(
        function() {
            $(this).find('ul:first').show();
        },
        function(){
            $(this).find('ul:first').hide();
        }
    );

});


