startList = function() {
	//	setup vars
	var id1 = "subnav";
	var page = document.location.href;
	
	// get all child elements of the specified element
	var list = document.getElementById(id1);
	// if none exist then return false
  if (! list) { return; }
	// find all the nested LI tags
  var lis = list.getElementsByTagName("li");

// if LIs exist
	if(lis){
	 // iterate through them
     for (var i = 0; i < lis.length; i++) {
			// find all links within the LI tags
			var currentlink = lis[i].getElementsByTagName("a");
	     for (var j = 0; j < currentlink.length; j++) {
				var currenthref = currentlink[j].href;
				// if the  href matches the current location
				if (page == currenthref ) {
					// set the li class to on - this also displays the tertiary nav (set in css)
					lis[i].className = "on ";
				}
			}
	 	}
	}		
}

window.onload=startList;
