function checkActive() {
	
	
var und;
// li array
var a = document.getElementsByTagName("li");

// warren bug-fix 6/2
// remove unnecessary condition
// href ends with a '/'

/*
if (window.location.href.substr(location.href.length - 1, 1) == '/') {
	var loc = window.location.href;
}
else{
	var loc = window.location.href;
}
*/


var loc = window.location.href;

//if location.href does NOT contain '/_product_'
if(!(loc.split("/_product_").length > 1)){
	
	//********************************************************************************************
	//traverse all lis with <a> child defined
	for(var i=0; i < a.length; i++) {
		// <li> <a> </a>	</li>
		// if <a> child is defined
		if(a[i].getElementsByTagName("a")[0] != und){
			// <li> <a href=VALUE></a></li>
			//if href matches document.location.href
			if (a[i].getElementsByTagName("a")[0].href == loc) {
				a[i].getElementsByTagName("a")[0].className="activated";
		
		
				//alert("href: " + a[i].getElementsByTagName("a")[0].href +"\n loc: " + loc);
				
				//<li id="VALUE"><a></a></li>
				//if li id is empty or undef
				//if(a[i].id.length == 0){
				//alert("a[i] id: " + a[i].id);
				if(a[i].getAttribute("id") == null || a[i].getAttribute("id").length == 0){
					//if <ul parent> id contains "sib_"
					if((document.getElementById(a[i].parentNode.id.split("sib_")[1]) != null))
						document.getElementById(a[i].parentNode.id.split("sib_")[1]).getElementsByTagName("a")[0].className = "activated";
					
					// warren bug-fix 06/02 
					// add firstContainer parentnode check condition
					//if element with id: "sub_[a innerhtml]" exists and it's a child of firstContainer
					if(document.getElementById("sub_"+a[i].getElementsByTagName("a")[0].innerHTML) && a[i].parentNode.parentNode.getAttribute("id") == "firstContainer"){
					
						//alert("line 54: " + "sub_" + a[i].getElementsByTagName("a")[0].innerHTML);
						document.getElementById("sub_"+a[i].getElementsByTagName("a")[0].innerHTML).style.display="block";
					}

				}
			    //<ul style="display: block;" id="sub_BABY"><li><a></a></li></ul>
				if(a[i].parentNode.id.split("sub_").length > 1){
					if(document.getElementById(a[i].parentNode.id.split("sub_")[1]) != null)
						document.getElementById(a[i].parentNode.id.split("sub_")[1]).className = "activated";
					//alert("line 63:" + a[i].parentNode.id);
					a[i].parentNode.style.display = "block";
				}
				
	
			}
		}
	}
	//********************************************************************************************
	// if href CONTAINS '_product_
	}else{
		var found;
		var fid = delineate(loc);
		for(var i=0; i < a.length; i++) {
			if(a[i].getElementsByTagName("a")[0] != und){
				if (a[i].getElementsByTagName("a")[0].href.split(fid).length > 1) {
					found = a[i];
					a[i].getElementsByTagName("a")[0].className="activated";
					if(a[i].parentNode.id.split("sub_").length > 1){
						if(document.getElementById(a[i].parentNode.id.split("sub_")[1]) != null)
 	                       // Menard bug-fix 05/28 (cancelled product pages won't highlight)
                           // menu items and subs that are not included are activated
						   //document.getElementById(a[i].parentNode.id.split("sub_")[1]).className = "";
						   //a[i].parentNode.style.display = "none";

	  	                   document.getElementById(a[i].parentNode.id.split("sub_")[1]).className = "activated";
						   a[i].parentNode.style.display = "block";
					}
				}
			}
		}
	}
}

//***********************************************
function delineate(str)
{
theleft = str.indexOf("_product_") + 9;
theright = str.lastIndexOf("/");
return(str.substring(theleft, theright));
}