function getElementsByClassName(classname) {
    if (document.getElementsByTagName) {
         var els = document.getElementsByTagName("*");
         var c = new RegExp('/b^|' + classname + '|$/b');
         final = new Array();
         var n=0;
         for (var i=0; i < els.length; i++) {
              if (els[i].className) {
                   if(c.test(els[i].className)) {
                   final[n] = els[i];
                   n++;
                   }
              }
         }
         return final;
    } else return false;
}

function ieFix(){
	//browser detection
	var browserName=navigator.appName; 
	var browserVer=parseInt(navigator.appVersion); 
	if (browserName=="Microsoft Internet Explorer" && browserVer <= 7) {
		var navelements = getElementsByClassName('ulnav');
		for (j=0; j < navelements.length; j++) {
			navRoot = navelements[j];
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					 node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	} //end browser detection
}


onload = function(){	//do onload stuff here	
	ieFix();
}

/* Adds active class to navigation - -causing bug in IE7


function setActive() {
  aObj = document.getElementById('subnav').getElementsByTagName('a');
  for(i=0;i<aObj.length;i++) {
    if(document.location.href.indexOf(aObj[i].href)>=0) {
      aObj[i].className='active';
    }
  }
}

window.onload = setActive;

*/
