var scroll_speed = 400;

function setNewIcon() {
    var disp_term = 10 * 24 * 60 * 60 * 1000;
    var now_utc   = (new Date()).getTime();
    var date_elem = $('#news .entry_list .date, #index .news .date');
    date_elem.each(function() {
        var entry_utc = Date.parse($(this).text());
        if (now_utc - entry_utc < disp_term) {
            $(this).append('<span class="new">NEW</span>');
        }
    });
}

function init() {
    setNewIcon();
    $('p.pagetop > a').attr('href', 'javascript:void(0);').click(function() {
        $(window).scrollTo('#contents', scroll_speed);
    });
}

$(document).ready(init);

