window.onload = function() { var myDivs = document.getElementsByClassName('items'); var myLinks = document.getElementsByClassName('itemhead'); var myAccordion = new fx.Accordion(myLinks, myDivs, {opacity: true, duration: 900}); myAccordion.showThisHideOpen(myDivs[0]); myAbout = new fx.Height('about', {duration: 1700}); myAccordion.showThisHideOpen = function(toShow){ this.elements.each(function(el, i){ if (el.offsetHeight > 0 && el != toShow) this.clearAndToggle(el); }.bind(this)); setTimeout(function(){this.clearAndToggle(toShow) ;}.bind(this), this.options.delay); }; }