// JavaScript Document


function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
  {
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}

function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}

function checkCookie(currentvalue)
{
var current=getCookie("current");
if (curent!=null && current!="")
  {
  alert("Current Level " + current);
  }
else 
  {
  current=prompt("Please enter your name:","");
  if (current!=null && current!="")
    {
    setCookie("current",currentvalue,365);
    }
  }
}

function showCurrentSection(navcurrentsection)
{		
	var objCurrentSection = document.getElementById(navcurrentsection);
			
	if (objCurrentSection != null)
	{
		//objCurrentSection.style.display = "block";			
		//objCurrentSection.parentNode.childNodes[0].className = "current";
		//if (objCurrentSection.parentNode.parentNode.nodeName == "UL"){
		if (objCurrentSection.parentNode.parentNode.nodeName == "LI"){
			showSection(objCurrentSection.parentNode.parentNode,objCurrentSection.parentNode);
		}else{
			tempChk=document.getElementById(navcurrentsection);
			if(tempChk){tempChk.className="current"}
		}
	}
}	


function showSection(objSection,objSectionUL)
{	
	// objSection.style.display = "block";
	// objSection.parentNode.childNodes[0].className = "open";
	
	// if (objSection.parentNode.parentNode != null && objSection.parentNode.parentNode.nodeName == "UL")
	//	showSection(objSection.parentNode.parentNode);
	
	//objSection.style.display = "block";
//	objSection.parentNode.childNodes[0].className = "current";
//	objSection.parentNode.childNodes[0].className = "current";
//	if (objSection.parentNode.parentNode != null && objSection.parentNode.parentNode.nodeName == "LI")
//	showSection(objSection.parentNode.parentNode);
	
	objSectionUL.parentNode.className = "current";
	if (objSectionUL.parentNode.parentNode != null && objSectionUL.parentNode.parentNode.nodeName == "LI")
	showSection(objSectionUL.parentNode.parentNode);

}

