
window.onload=function()
{
	nsidcLinkStyles();
	aboutLinkStyles();
	// add other functions to be called onload below
}

function aboutLinkStyles()
{
	var url = document.location.href;

// conditions for About section navigation

// About --> Expertise
	
	if(url.match(/overview.html/))
	{
		document.getElementById("aboutNavOverview").className = "activeNav1";
		document.getElementById('aboutNavOverview').innerHTML = 'Overview';	
	}
	
	else if(url.match(/people.html/))
	{
		document.getElementById("aboutNavPeople").className = "activeNav1";
		document.getElementById('aboutNavPeople').innerHTML = 'People at NSIDC';	
	}
	
	else if(url.match(/history.html/))
	{
		document.getElementById("aboutNavHistory").className = "activeNav1";
		document.getElementById('aboutNavHistory').innerHTML = 'NSIDC History';	
	}

// About --> Expertise subnav
	
	else if(url.match(/director/))
	{
		document.getElementById("aboutNavPeople").className = "activeNav1";
		document.getElementById('aboutNavPeople').innerHTML = '<a href="/about/expertise/people.html">People at NSIDC</a>';
		document.getElementById("aboutSubnavDirector").className = "activeNav2";
		document.getElementById('aboutSubnavDirector').innerHTML = 'Director';	
	}
	
	else if(url.match(/management/))
	{
		document.getElementById("aboutNavPeople").className = "activeNav1";
		document.getElementById('aboutNavPeople').innerHTML = '<a href="/about/expertise/people.html">People at NSIDC</a>';
		document.getElementById("aboutSubnavManagement").className = "activeNav2Last";
		document.getElementById('aboutSubnavManagement').innerHTML = 'Management';
	}
		
	else if(url.match(/bios/))
	{
		document.getElementById("aboutNavPeople").className = "activeNav1";
		document.getElementById('aboutNavPeople').innerHTML = '<a href="/about/expertise/people.html">People at NSIDC</a>';
		document.getElementById("aboutSubnavManagement").className = "activeNav2Last";
		document.getElementById('aboutSubnavManagement').innerHTML = '<a href="/about/expertise/management.html">Management</a>';
	}
		
	else if(url.match(/scientists/))
	{
		document.getElementById("aboutNavPeople").className = "activeNav1";
		document.getElementById('aboutNavPeople').innerHTML = '<a href="/about/expertise/people.html">People at NSIDC</a>';
		document.getElementById("aboutSubnavScientists").className = "activeNav2";
		document.getElementById('aboutSubnavScientists').innerHTML = 'Scientists';	
	}
	
	else if(url.match(/nsidc_staff/))
	{
		document.getElementById("aboutNavPeople").className = "activeNav1";
		document.getElementById('aboutNavPeople').innerHTML = '<a href="/about/expertise/people.html">People at NSIDC</a>';
		document.getElementById("aboutSubnavStaff").className = "activeNav2";
		document.getElementById('aboutSubnavStaff').innerHTML = 'Staff';	
	}
	
// About --> Data & Services
	
	else if(url.match(/data_docs/))
	{
		document.getElementById("aboutServicesNavDataDocs").className = "activeNav1";
		document.getElementById('aboutServicesNavDataDocs').innerHTML = 'Data Sets &amp; Documentation';	
	}
	
	else if(url.match(/technologies/))
	{
		document.getElementById("aboutServicesNavTechnologies").className = "activeNav1";
		document.getElementById('aboutServicesNavTechnologies').innerHTML = 'Data Technologies';	
	}
	
	else if(url.match(/support/))
	{
		document.getElementById("aboutServicesNavSupport").className = "activeNav1";
		document.getElementById('aboutServicesNavSupport').innerHTML = 'Data User Support';	
	}
	
	else if(url.match(/information/))
	{
		document.getElementById("aboutServicesNavInfo").className = "activeNav1";
		document.getElementById('aboutServicesNavInfo').innerHTML = 'Information Center and Analog Archives';	
	}
	
	else if(url.match(/education/))
	{
		document.getElementById("aboutServicesNavEducation").className = "activeNav1";
		document.getElementById('aboutServicesNavEducation').innerHTML = 'Education &amp; Outreach';	
	}
	
// About --> Contacts
	
	else if(url.match(/contacts/))
	{
		document.getElementById("aboutContactsNavHowTo").className = "activeNav1";
		document.getElementById('aboutContactsNavHowTo').innerHTML = 'How to contact NSIDC';	
		
		if(url.match(/directions.html/))
		{
				document.getElementById("aboutContactsNavHowTo").className = "nav1";
				document.getElementById('aboutContactsNavHowTo').innerHTML = '<a href="/about/contacts/">How to contact NSIDC</a>';
				document.getElementById("aboutContactsNavDirections").className = "activeNav1";
				document.getElementById('aboutContactsNavDirections').innerHTML = 'Directions';	
		}
		
		else if(url.match(/staff.html/))
		{
				document.getElementById("aboutContactsNavHowTo").className = "nav1";
				document.getElementById('aboutContactsNavHowTo').innerHTML = '<a href="/about/contacts/">How to contact NSIDC</a>';
				document.getElementById('aboutContactsNavStaffDirectory').className = 'activeNav1';
				document.getElementById('aboutContactsNavStaffDirectory').innerHTML = 'Staff Directory';
		}
		
		else {}
		
	}
	
	
	
// if none of these conditions, do nothing
	
	else {}
	
}