function setupNav() {
	if (document.getElementById) {
		// get the LH nav:
		var nav = document.getElementById('navigation');
		// get the current location:
		var loc = String(window.self.location);
		loc = loc.toLowerCase();
		// this returns the full url, so we need to get the text between the last '/' and '.html'
		// split on '/'
		locArr = loc.split('/');
		// this will give us the html filename:
		loc = locArr[locArr.length -1];
		
		// Quick win: if we're at a url with no filename, it MUST be index.shtml - ie www.madeinearnest.com
		if ((loc == '')||(loc == 'test.html')) {
			// in which case make the Homepage link the selected link
			document.getElementById('homeLink').className = 'selected';
		} else if (loc == 'recentwork.html') {
			// can also be done for Recent Work
			document.getElementById('recentLink').className = 'selected';
		} else {
			// if that's not the case... loop through all the links till we find the correct one:
			var linksArr = nav.getElementsByTagName('a');
			var currLink = '';
			for (var i=0; i<linksArr.length; i++) {
				currLink = linksArr[i].getAttribute('href');
				currLink = currLink.toLowerCase();
				/******************************************************************************************************/
				/* Moz difference... SEARCH for '/' character to see if a full link is returned, or a relative one... */
				/******************************************************************************************************/
				if (currLink.search(/\//) != -1) {
					// split on '/'
					linkArr = currLink.split('/');
					currLink = linkArr[linkArr.length -1];
				}
				// currLink ends up as a lowercase string filename - ie 'this.shtml'
				
				/* when a match is found against loc, test for appropriate classnames */
				if (loc == currLink) {
					// does our current list have a parent <li> ? If so the path would be: here <a> --> parent <li> --> parent <ul> --> parent <li>
					var parEl = linksArr[i].parentNode.parentNode.parentNode;
					if (parEl.nodeName == 'LI') {
						// case 1: parents exist, we're in a child page
						// set the parEl first <a>:
						parEl.firstChild.className = 'selected';
						// set the link itself
						linksArr[i].className = 'subselected';
						// make sure the child <ul> is shown:
						linksArr[i].parentNode.parentNode.style.display = 'block';
						break;
					} else {
						// case 2: no parents, we're in a top-level page
						linksArr[i].className = 'selected';
						// make sure any child <ul> is shown
						var childEls = linksArr[i].parentNode.getElementsByTagName('ul');
						if (childEls.length == 1) {
							childEls[0].style.display = 'block';
						}
						break;
					}
				}
			}
		}
	}
}