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

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

		//hash function
		
		function checkHash(){
			var found = false;
			toggles.each(function(h3, i){
				if (window.location.href.indexOf(h3.title) > 0) {
					myAccordion.showThisHideOpen(stretchers[i]);
					found = true;
				}
			});
			return found;
		}
		if (!checkHash()) ;
		
		
	//add background colour on click down	
	sideNavigation = function() 
	{
	  if (!document.getElementById("snMain"))
			return;
			
		var sfEls = document.getElementById("snMain").getElementsByTagName("li");
		for (var i=0; i<sfEls.length; i++) {
		
			sfEls[i].onclick=function() {
				
				for (var i=0; i<sfEls.length; i++) {
				sfEls[i].className=" ";
				}
				this.className+=" active";
				
			}

		}
	}
	if (window.attachEvent) window.attachEvent("onload", sideNavigation);
	if (window.addEventListener) window.addEventListener("load",sideNavigation,false);
	}
function doPopups() {
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
      links[i].onclick = function() {
        window.open(this.getAttribute("href"),"mywindow","location=1,resizable=yes,toolbar=yes,status=1,scrollbars=1,width=800,height=400"); 
        return false;
      }
    }
	
  }
}
if (window.attachEvent) window.attachEvent("onload", doPopups);
if (window.addEventListener) window.addEventListener("load",doPopups,false);
