// 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
aObjs = oMainNav.getElementsByTagName('a');
for(i=0;i<aObjs.length;i++){
	oLink = aObjs[i];
	// work out the href
	sLinkURL = oLink.toString();
	// got to avoid the hashes...
	iHashPos = sLinkURL.indexOf('#');
	// check if it matches our current file name
	if (iHashPos < 0) {
		iInstancePos = sLinkURL.indexOf(sSectionName);
		if (iInstancePos > 0) {
			// change its class if it is.
			oLink.className  = 'navSelected';			
		}
	}
}


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17599997-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


