/* ================================================================ 
This copyright notice must be untouched at all times.

The original version of this script and the associated (x)html
is available at http://www.stunicholls.com/menu/tree_frog_vertical.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This script and the associated (x)html may be modified in any 
way to fit your requirements.
=================================================================== */


clickMenu = function(menu) {
	var getEls = document.getElementById(menu).getElementsByTagName("LI");
	var getAgn = getEls;

	for (var i=0; i<getEls.length; i++) {
                if (getEls[i].className.match(/\bsub\b/))
		getEls[i].onclick=function() {
			$(this).css("overflow","hidden").children().slideDown(600,
				function(){$(this).parent().css("overflow","visible");}
			);
			for (var x=0; x<getAgn.length; x++) {
				getAgn[x].className=getAgn[x].className.replace("unclick", "");
				getAgn[x].className=getAgn[x].className.replace("click", "unclick");
				if (getAgn[x].className.match(/unclick/))
					$(getAgn[x]).css("overflow","hidden").children().slideUp(600,
						function(){$(this).parent().css("overflow","visible");}
					);
			}
			if ((this.className.indexOf('unclick'))!=-1) {
				this.className=this.className.replace("unclick", "");;
				}
				else {
				this.className+=" click";
				}
			}
			getEls[i].onmouseover=function() {
				this.className+=" flyout";
			}
			getEls[i].onmouseout=function() {
				this.className=this.className.replace("flyout", "");
			}
		}
	}

