function initLinks() {
  for (i in document.links) {
    link = document.links[i];
    if (link.rel && link.rel.indexOf('external')!=-1) {
      link.onclick = onExternalLinkActivate;
      link.onkeypress = onExternalLinkActivate;
    }
  }
}

function onExternalLinkActivate() {
  window.open(this.href);
  return false;
}

function setNav() {
	if (document.getElementById && document.getElementById("nav")) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.className == "collapse") {
			
				node.onmouseover = function() {
					this.className = 'expand';
				}
				
				node.onmouseout = function() {
					this.className = 'collapse';
				}
			}
			for (j=0; j<node.childNodes.length; j++) {
				if (node.childNodes[j].className == "dropdown") {
							menuElem = node.childNodes[j];
							for (q=0; q<menuElem.childNodes.length; q++) {
								if (menuElem.childNodes[q].className == "dropitem") {
									dropElem = menuElem.childNodes[q];
									dropElem.onmouseover = function() {
										this.className = 'dropitemHi';
									}
									dropElem.onmouseout = function() {
										this.className = 'dropitem';
									}
								}
							}
				}
			}
		}
	}
	
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


var addOnload = new Array();
window.onload = function(){
    if(addOnload.length>0) {
        for (m=0; m<addOnload.length; m++){
            eval(addOnload[m]);
        }
    }
	setNav();
    initLinks();
}