/**
* Call the disableReturnOnAllInputs function when document has been loaded
*/
(window.attachEvent) ? window.attachEvent('onload',init) : window.addEventListener('load', init, false);

/**
* array of years which are handles as ids here
* values will be set in embedding document
*/
var years = new Array();

/**
* initialize
*
*/
function init() {
    resetAll();
    show();
    // show the navigation
    Element.removeClassName('navigation', 'off');
    Element.hide('navigation');
    new Effect.Appear('navigation', {duration: 2});
}


/**
* show an element identified by id
*
*/
function show(id) {
    id = !id ? years[0] : id;
    resetAll();
    var obj = $('chronicle-'+id);
    new Effect.Appear(obj);
    var obj = $('navi-'+id).firstChild;
    Element.addClassName(obj, 'on');
    
}


/**
* reset element identified by id
*
*/
function reset(id) {
    var obj = $('chronicle-'+id);
    Element.removeClassName(obj, 'off');
    Element.hide(obj);
    var obj = $('navi-'+id).firstChild;
    Element.removeClassName(obj, 'on');
}


/**
* reset all elements
*
*/
function resetAll() {
    for(i=0; i<years.length;i++) {
        reset(years[i]);
    }
}
