function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

//the main function, call to the effect object
function init(){

	var stretchers = document.getElementsByClassName('stretcher'); //div that stretches
	var toggles = document.getElementsByClassName('display'); //h6s where I click on

	//accordion effect
	var myAccordion = new fx.Accordion(
		toggles, stretchers, {opacity: true, duration: 400}
	);

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

addLoadEvent(init);