// Adaptive Image JScript - WSC set sub nav link style for current page

//get current page filename compare to subnav links and set this page style
function SetLinkThisPage() {

	if (!(document.getElementById && document.getElementsByTagName)) return; //not supported
	var subnav = document.getElementById("section_nav");
	if(subnav) { //div element found
		var alinks = subnav.getElementsByTagName("a"); //collection of subnav links
		var thisurl = new String(document.location); //current page
		if(thisurl) { //found url
			for (var i=0; i<alinks.length; i++) {
				var alink = alinks[i];
				if(alink.href==thisurl) { //link match
					var par = alink.parentNode; //up to LI
					if(par.nodeName == "LI" || par.nodeName == "li") { //is LI node (IE uppercase / W3 lowercase)
						par.className = "lst_subnav_this_page"; //set this page class for list item
					}
					else {
						if(par.nodeName == "H1" || par.nodeName == "h1") { //is H1 node (IE uppercase / W3 lowercase)
							par.className = "hdg_subnav_this_page"; //set this page class for heading
						}	
					}
				}
			}
		}
	} //end if
	
} //end function

SetLinkThisPage(); //above
