function initPage(e)
{
    $('themes').childElements().each(function (c) {
        if (c.select('img')[0].identify().indexOf('current') == -1)
        {
            c.observe('mouseover', overTheme);
            c.observe('mouseout', outTheme);
        }
    });
    
    imgPreload('img/shared/themes/over/administration.gif',
               'img/shared/themes/over/tavannes-au-quotidien.gif',
               'img/shared/themes/over/habiter-entreprendre.gif',
               'img/shared/themes/over/culture-tourisme.gif',
               'img/shared/themes/over/sport-loisirs.gif');
}

function overTheme(e)
{
    var id = Event.element(e).identify();
    var num = id.substr(id.length - 1, 1);
    
    $('themes-' + num).src = $('themes-' + num).src.sub('out', 'over');
}

function outTheme(e)
{
    var id = Event.element(e).identify();
    var num = id.substr(id.length - 1, 1);
    
    $('themes-' + num).src = $('themes-' + num).src.sub('over', 'out');
}

function printPage()
{
    window.print();
}

function eventGoMonth()
{
    var date = $F('event-month').split('.');
    if(date.length != 2)
        return false;
    return goInternal('agenda.html?month=' + date[0] + '&year=' + date[1]);
}

Event.observe(window, 'load', initPage);