// JavaScript
var doclocA = document.location.toString();
var docloc=doclocA.substr(25,doclocA.length-25)

nav =  document.getElementById("divNavigation");
function pageLoad()
{
	//cycle through each of the links in divNavigation.
	secflag=false;
	var pageName = document.location.toString();
	var slashes = countInstances("/",pageName);
	
	var secflag=false;
	var nav = document.getElementById("divNavigation");
	//loop through each of the ULs
	for (ul=0; ul<nav.childNodes.length;ul++)
	{
		var aSection = nav.childNodes[ul];
		//loop through each of the sub sections		
		for(li=0; li<aSection.childNodes.length;li++)
		{
			if(li==0)
			{//Major Section always display;				
				
								
				if(pageName.indexOf(aSection.id.toString()) > -1)
				{
					//alert("MAJOR SECTION "+li);
					secFlag=true;
					aSection.childNodes[0].childNodes[0].style.color="#ff0000";
				}
				
				else
				{
					secFlag= false;
					
				}
			}
			else
			{//Minor Section
			 
				if(secFlag==true)
				{
					if(pageName==aSection.childNodes[li].childNodes[0].href.toString())
					{
						aSection.childNodes[li].childNodes[0].style.color="#ff0000"; //changes the color of the link
					}
					aSection.childNodes[li].style.visibility="visible";
					aSection.childNodes[li].style.display="block";
				}	
				
				else
				{
					if(secFlag==false)
					{
					aSection.childNodes[li].style.display="none";
					}
				}
				
			}
		}



	}
	
	
}

function countInstances(string, word) {
  var substrings = string.split(word);
  return substrings.length - 1;
}

function getNodeType(obj)
{///Returns the node type;
	if(obj.nodeName!=null)
	{
		return obj.nodeName;
	}
}

function checkString(str)
{
	

	var check = str.indexOf(docloc)	
	if(check==-1)
	{
		return false;
	}
	else
	{
		
		return true;
	}
}