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


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



/*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";
 		}

}