// work out the file name
sLocation = window.location.href;
aLocationParts = sLocation.split("/");
sFullFileName = aLocationParts[aLocationParts.length-1]; // Last element
aFileNameParts = sFullFileName.split(".");
sFileName = aFileNameParts[0]; // First element

aSectionNameParts = sFileName.split("_");
sSectionName = aSectionNameParts[0]; // First element

// get to the man navigation div
oMainNav = document.getElementById('cellNavigation');

// loop through all the links in the main navigation div
aLIs = oMainNav.getElementsByTagName('li');
for(j=0;j<aLIs.length;j++){
	oLI = aLIs[j];
	aAs = oLI.getElementsByTagName('a');	
	for(i=0;i<aAs.length;i++){
		oLink = aAs[i];
		// work out the href
		sLinkURL = oLink.toString();
		// check if it matches our current file name
		iInstancePos = sLinkURL.indexOf(sSectionName);
		
		if (iInstancePos > 0) {
			// change its class if it is.
			oLI.className  = 'navSelected ' + oLink.className;			
		}
	}
}

