//hash functions var found = false; toggles.each(function(h3, i){ var div = Element.find(h3, 'nextSibling'); //element.find is located in prototype.lite if (window.location.href.indexOf(h3.title) > 0) { myAccordion.showThisHideOpen(div); found = true; } }); if (!found) myAccordion.showThisHideOpen(stretchers[0]);