function checkActive() {
var und;
var a = document.getElementsByTagName("li");	
if (window.location.href.substr(location.href.length - 1, 1) == '/') {
var loc = window.location.href;
	}
	else {
		var loc = window.location.href;
	}
	if(!(loc.split("/_product_").length > 1)){
	//********************************************************************************************
		for(var i=0; i < a.length; i++) {
			
			if(a[i].getElementsByTagName("a")[0] != und){
			if (a[i].getElementsByTagName("a")[0].href == loc) {
			a[i].getElementsByTagName("a")[0].className="activated";
	
		if(a[i].id.length == 0){
		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";
		
		if((document.getElementById("sub_"+a[i].getElementsByTagName("a")[0].innerHTML) != null ))
			document.getElementById("sub_"+a[i].getElementsByTagName("a")[0].innerHTML).style.display="block";
		}
		
		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";

			a[i].parentNode.style.display = "block";

		}
			

			
			}
			}
		}
	//********************************************************************************************
	}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)
									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));
}
