/**
*   Common Javascript Commands
*
*   $Id: common.js,v 0.1 2007/10/22 10:23:00 asc Exp $
*/


/*ONLOAD EVENTS
==========================================================================================*/
addOnload(externalLink);
addOnload(startList);



/*ENABLES MULTIPLE ONLOAD EVENTS
==========================================================================================*/
function addOnload(newFunction) {
	var oldOnload = window.onload;
	
	if (typeof oldOnload == "function") {
		window.onload = function() {
			if (oldOnload) {
				oldOnload();
			}
		
			newFunction();
		}
	} else {
		window.onload = newFunction;
	}
}



/*REPLACES [target="_blank"] TO ALLOW FOR XHTML 1.0 STRICT DTD COMPATIBILITY
==========================================================================================*/
function externalLink() {
	if (document.getElementsByTagName)
	var anchors = document.getElementsByTagName("a");
		for (var i=0; i < anchors.length; i++) { 
 			var anchor = anchors[i];
 			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
 				anchor.target = "_blank";
 		}

}






/*ENABLES CSS ROLLOVERS ON INTERNET EXPLORER 6.0 AND BELOW
==========================================================================================*/
function startList() {
  if (document.all&&document.getElementById) {
    navRoot = document.getElementById("navigation");
    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", "");
        }
      }
    }
  }
}
