function processPopups() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("popup")) {
			//alert(i + ' : ' + links[i].href);
			//add onclick code
			links[i].onclick = function() {
				//alert('clicked');
				var sWidth = '';
				var sHeight = '';
				var sModal = '';
				if(this.getAttribute('w')) sWidth = ',width='+ this.getAttribute('w');
				if(this.getAttribute('h')) sHeight = ',height='+ this.getAttribute('h');
				if(this.getAttribute('modal')) sModal = ',modal=1,dependant=1,chrome=0,alwaysRaised=1';
				//alert('w='+w+' h='+h);
				window.open(this.href,'','toolbar=0,resizable=1,menubar=0,scrollbars=1'+sWidth+sHeight+sModal);
				return false;
			}//end func
		}//end if
	}//end if
}//end func


sfHover = function() {
	var sfEls = document.getElementById("sitemenu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		//alert(this.tagName);
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		//alert(this.tagName);
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);


var currentWindowOnload =(window.onload)?window.onload:function(){};
window.onload = function(){
	currentWindowOnload();
	processPopups();
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}




