window.onload = function() { var myDivs = document.getElementsByClassName('items'); var myLinks = document.getElementsByClassName('itemhead'); var myAccordion = new fx.Accordion(myLinks, myDivs, {opacity: true, duration: 700}); 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); }; } function activateSearch() { if ($('searchform')) { $('s').value = 'Search...'; // Default text in the search box var o = document.createElement('div'); // Old search results div var n = document.createElement('div'); // New search results div $('searchform').onsubmit = function() { doSearch();return false; }; $('s').onfocus = focusS; // Function to clear the default search box text on focus var s = $('search-results'); var f = $('searchform'); o.id = 'old-search-results'; n.id = 'current-search-results'; s.appendChild(n); s.appendChild(o); o.style.height = '0'; o.style.overflow = 'hidden'; n.style.height = '0'; n.style.overflow = 'hidden'; is_searching = false; } } function focusS() { if ($F('s') == 'Search...') $('s').value = ''; } Event.observe(window, 'load', activateSearch, false);