	//code written by Dan Ledrick for the purposes on www.hoptosignaroo.com.

	//Use of this code on your website is prohibited without authorization from Nancy Hanauer nancy@hoptosignaroo.com 

	//or Dan Ledrick dan@ledrick.com.

	

	//THIS FILE SHOULD NOT NEED EDITING. 

	

	//initial variables set. 

	var childNavDisplayed = null; //contains id object reference of child nav that is currently showing

	var activeParent = null; //contains id object reference of active parent (last clicked or loaded)

	var activeChild = null; //contains id object reference of active child (last clicked or loaded)

	

	//toggleParentNav: No params

	//log currently clicked object, test to see if it is the current parent. If not, then open up the parent's childnav

	//and set the childNavDisplayed style to none and new childnavDisplayed style to block. Update activeParent.

	function toggleParentNav(){

	    var parentClicked = this;

	    

	    //test to see if the user clicked on what was already displayed.

	    if (activeParent != null) {

	        if (parentClicked.id == activeParent.id)

	            return;

	    }

		var navToBeDisplayed = getObj(parentClicked.id + 'Children');

		

		if (navToBeDisplayed != null) {

	    	//hide previously displayed nav if new nav is to be displayed.

				if (childNavDisplayed != null) {

					childNavDisplayed.style.display ='none';

				}

		

				navToBeDisplayed.style.display='block';

				childNavDisplayed = navToBeDisplayed;

		}

		

		if (activeParent != null) {

		    activeParent.className='parent';

		}

		

	    parentClicked.className='parentover';

	    activeParent = parentClicked;

	}

	

	//initNavBehavior: <id of parent object>,<id of child object>

	//initialization of navigation to initial state. Parent Id is highlighted with child id highlighted.

	//set active variables. Register behaviors for all parents and children.

	function initNavBehavior(parent,child) {	    

	   

	  if(parent != '' && child != '') {

	    activeParent = getObj(parent);

	 	  activeChild = getObj(child);	

	    

	    activeParent.className='parentover';

	    activeChild.className='childover';

		

	    childNavDisplayed = getObj(activeParent.id+'Children');

	    childNavDisplayed.style.display='block';

	  }

	   

	    var navs = document.getElementsByTagName('div');

	    for (var i=0;i<navs.length;i++)

	    {

		    if (navs[i].className == 'parent' | navs[i].className == 'parentover') {

		        navs[i].onclick = toggleParentNav;

				navs[i].onmouseout = toggleParentNav;

		        navs[i].onmouseover = toggleParentNav;

		        //navs[i].onmouseout = toggleParentMouseout;

		        //navs[i].onmouseover = toggleParentMouseover;

		     }

		    if (navs[i].className == 'child' | navs[i].className == 'childover') {

		        navs[i].onmouseout = toggleChildMouseout;

		        navs[i].onmouseover = toggleChildMouseover;

		     }

	    }

	}

	

	//toggleParentMouseout: no params

	//behavior handler for mouseout events on parents

	function toggleParentMouseout() {

	    if (activeParent != null) {

	       if (this.id == activeParent.id) 

	            return;

	    }

	    this.className = 'parent';

	}

	//toggleParentMouseover: no params

	//behavior handler for mouseover events on parents

	function toggleParentMouseover() {

	   	if (activeParent != null) {

	       if (this.id == activeParent.id) 

	            return;

	    }

	    this.className = 'parentover';

	}

	//toggleChildMouseout: no params

	//behavior handler for mouseout events on children

	function toggleChildMouseout() {

		if (activeChild != null) {

	       if (this.id == activeChild.id) 

	            return;

	    }

	    this.className = 'child';

		

	}

	//toggleChildMouseover: no params

	//behavior handler for mouseover events on children

	function toggleChildMouseover() {

	    if (activeChild != null) {

	       if (this.id == activeChild.id) 

	            return;

	    }

	    this.className = 'childover';

	}

	//getObj: <id of object>

	//returns object refernce from passed in id. If/else all browser doms. 

	function getObj(name) {

      if (document.getElementById)

      {

        return document.getElementById(name);

      }

      else if (document.all)

      {

        return document.all[name];

      }

      else if (document.layers)

      {

        return document.layers[name];

      }

     }



