var now = new Date();
	var dYear = now.getYear();
	if (dYear < 1900) {
			dYear += 1900;
	}

	
// Pop-up definition
var newWin = null;
function popUp(strURL, strType, strWidth, strHeight) {  
 if (newWin != null && !newWin.closed)    
  newWin.close();  
 var strOptions="";  
 
 if (strType=="fixednooptions")    
  strOptions="height="+strHeight+",width="+strWidth; 
 
 if (strType=="fixedscroll")    
 strOptions="scrollbars,"+"height="+strHeight+",width="+strWidth; 
 
 newWin = window.open(strURL, 'newWin', strOptions);  
 newWin.focus();
}
	
	
function show_globalMenu (){
		document.getElementById('globalMenuLink').style.display='none';	
		document.getElementById('globalMenu').style.display='block';
		window.clearTimeout (timeOut_gm);
	}
	
function hide_globalMenu (){
	document.getElementById('globalMenuLink').style.display='block';	
	document.getElementById('globalMenu').style.display='none';
}

var timeOut_gm;
function timeOut_globalMenu (){
	timeOut_gm=setTimeout ('hide_globalMenu();',1000);
}

function globalNavImgSwap (ID){
	if (document.getElementById(ID)){
		var allTags=document.getElementById(ID).getElementsByTagName('a');
		for (x=0;x<allTags.length;x++){
			allTags[x].onmouseover=function(){
				this.graphic1=''+this.firstChild.src;
				this.firstChild.src=this.graphic1.replace(/-0/,'-1');
				show_globalMenu();
				}
			allTags[x].onmouseout=function(){
				this.graphic0=''+this.firstChild.src;
				this.firstChild.src=this.graphic0.replace(/-1/,'-0');
				timeOut_globalMenu();
				}
		}
	}
}

function imgSwap (ID){
	if (document.getElementById(ID)){
		var allTags=document.getElementById(ID).getElementsByTagName('a');
		for (var x=0;x<allTags.length;x++){
			// Exceptions
			var thispage = 'index.html'; // This is just a dummy value to represent the index page. It doesn't matter if the live index is actually "index.php", "index.htm" or other.
			if (location.href.lastIndexOf('/') < location.href.lastIndexOf('.')) 
			{
				thispage = location.href.substring(location.href.lastIndexOf('/')+1,location.href.lastIndexOf('.'));
			}
			var thisvati = (thispage.indexOf('_') == -1)? thispage: thispage.substring(0,thispage.lastIndexOf('_'));
			if (allTags[x].href.indexOf(thisvati) == -1)
			{			
				allTags[x].onmouseover=function(){
					this.graphic1=''+this.firstChild.src;
					this.firstChild.src=this.graphic1.replace(/-0/,'-1');
					}
				allTags[x].onmouseout=function(){
					this.graphic0=''+this.firstChild.src;
					this.firstChild.src=this.graphic0.replace(/-1/,'-0');
					}
			}			
		}
	}
}

function loaded (){
	globalNavImgSwap('globalMenu');
	imgSwap('primaryNav');
}

/* ACTIONS
---------------------------------------------------- */
//Onload Event
if (document.getElementById){
	window.onload=loaded;
}
