sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

spHover = function() {
	var spEls = document.getElementById("menuTop").getElementsByTagName("span");
	for (var i=0; i<spEls.length; i++) {
		spEls[i].onmouseover=function() {
			this.className+=" sphover";
		}
		spEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sphover\\b"), "");
		}
	}
}

seHover = function() {
	var seEls = document.getElementById("middle").getElementsByTagName("LI");
	for (var i=0; i<seEls.length; i++) {
		seEls[i].onmouseover=function() {
			this.className+=" sehover";
		}
		seEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sehover\\b"), "");
		}
	}
}

srHover = function() {
	var srEls = document.getElementById("accordion").getElementsByTagName("H3");
	for (var i=0; i<srEls.length; i++) {
		srEls[i].onmouseover=function() {
			this.className+=" srhover";
		}
		srEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" srhover\\b"), "");
		}
	}
}


function resized(){
	//window.alert(document.body.offsetWidth);
	var left = $('left');
	var footer = $('footer').getElements('p');
	
	if (document.body.offsetWidth >= 1068){
		left.setStyle('width', 229);
		footer.setStyle('width', 842);
	} else {
		var currentLeftWidth = 1068 - document.body.offsetWidth;
		var widthLeftValue = 229 - currentLeftWidth;
		
		var currentFooterWidth = 1068 - document.body.offsetWidth;
		var widthFooterValue = 842 - currentFooterWidth;
		
		left.setStyle('width', widthLeftValue);
		footer.setStyle('width', widthFooterValue);
	}
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(resized);
addLoadEvent(sfHover);
addLoadEvent(spHover);
addLoadEvent(srHover);
addLoadEvent(seHover);