// set minumum height for IE and Safari.

function onloadFunctions(lvl_1, lvl_2){ 


//adjust widths for Opera
if(navigator.userAgent.indexOf('Opera')!=-1) {
	document.getElementById('wrapperColumns').style.width=58 + 'em';
	document.getElementById('columnSidebar').style.width=17 + 'em';
		if (document.getElementById('one_column')) {
			document.getElementById('columnMain').style.width=58 + 'em';
		}else{
			document.getElementById('columnMain').style.width=38 + 'em';
		}
	document.getElementById('footer').style.width=58 + 'em';	
} 



// Left Menu
    if(document.getElementById('navGlobal')) {
		var navGlobal = document.getElementById('navGlobal'); 
		// asterisk pulls in all elements in this div - older versions of Safari do not support this so menu will stay expanded in those versions
		var eNode=navGlobal.getElementsByTagName('*');
		// ids in this function are converted to lowercase so there are not case-sensitive issues if some creates an id with Caps in the wrong spot
		var lvl_1 = lvl_1.toLowerCase();
		var lvl_2 = lvl_2.toLowerCase();
	
			for (i1=0; i1<eNode.length; i1++) { 
	
				// designate active link through match with DW parameter
				urlString=eNode[i1].getAttribute("href");
			
				if (urlString!=null && urlString.indexOf('?')!=-1) {
					var question=urlString.indexOf('?');
					var linkName=urlString.substring((question+1)).toLowerCase();
				
						var parent=eNode[i1].parentNode
						var grandparent = eNode[i1].parentNode.parentNode;
						var greatgrandparent = eNode[i1].parentNode.parentNode.parentNode;
						var greatgreatgrandparent = eNode[i1].parentNode.parentNode.parentNode.parentNode;
					//First Level
					if (linkName==lvl_1 && lvl_2=='none') {
						eNode[i1].className="active"
	
						
					}
					//Second Level
					if (linkName==lvl_1+'_'+lvl_2) {
						eNode[i1].className="active"
						
							if (grandparent.previousSibling.nodeName=='H2') {
								grandparent.previousSibling.firstChild.className='open';	
							}else if (grandparent.previousSibling.previousSibling.nodeName=='H2') {
								grandparent.previousSibling.previousSibling.firstChild.className='open';
							}	
						
	
					}				
					
			
	
					
				}
			}
			
		 }
	

		
/* ****************************************
	Below: Adapted from http://www.brucelawson.co.uk/index.php/2005/opening-links-in-new-windows-in-xhtml-strict/#comment-376
**************************************** */
if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("A");
	/* hide PDF note by default */
	
	if (document.getElementById('pdfNote')) {
	document.getElementById('pdfNote').className="hide"; 
		for (var i=0; i<anchors.length; i++) {
			var docLink = anchors[i];
			if (docLink.className=='externalDocument') {
				docLink.target = "_blank";
				docLink.innerHTML = docLink.innerHTML + "&nbsp;(opens in new window)";
				document.getElementById('pdfNote').className="show"; 
				}
			if (docLink.className=='externalDocumentNoNote') {
				docLink.target = "_blank";
			}				
		}	
	}
/* ****************************************
 Above: Adapted from http://www.brucelawson.co.uk/index.php/2005/opening-links-in-new-windows-in-xhtml-strict/#comment-376
**************************************** */		

/* END function */
}
	