

window.onload=function(){
    Nifty("div.subMenu","big");
    //Nifty("div.box","big");
    
    var legendArray = $$('.lenyilo legend');
    var lenyiloArray = $$('.lenyilo div.list');
    var collapsibles = new Array();
    lenyiloArray.each( function(lenyilo, i) {
        //for each element create a slide effect
        /*var collapsible = new Fx.Slide(lenyilo, {
                duration: 500,
                transition: Fx.Transitions.linear
        });*/

        //and store it in the array
        //collapsibles[i] = collapsible;

        //add event listener
        legendArray[i].onclick = function(){
                //collapsible.toggle();
                //alert(this.getParent().getParent().offsetHeight);
                lenyilo.setStyle('display', '');
                return false;
        }
        //legendArray[i].getParent().setStyle('position', 'relative');
        lenyilo.setStyles('position: absolute; top: '+legendArray[i].getParent().getTop()+'px; left: '+(legendArray[i].getParent().getLeft()+80)+'px; z-index: 20000; display: none');
        //collapse all of the list items
        //collapsible.hide();

    });
    
    
    var accordion = new Accordion('h3.atStart', 'div.atStart', {
        opacity: false,
        onActive: function(toggler, element){
            toggler.setStyle('color', '#ff3300');
        },
     
        onBackground: function(toggler, element){
            toggler.setStyle('color', '#0A4E6E');
        }
    }, $('accordion'));
}




