var Navigation = {
	version:1.6,
	by:"Michael Markie",
	developing:false,
	
	init: function(S){
		var m = document.getElementById(S.ID).children, t2='';
		for(var i in m){
			if(typeof m[i] == 'object' && m[i].children[1]){
				m[i].id='Cache_'+i;
				var t1 = document.getElementById('Cache_'+i).children[1];
				t1.style.height='auto';
				t2 = ComputedStyle(t1,'height');
				t1.style.height = t2;
				t2 = (t2 == 'auto')?t1.offsetHeight:parseInt(t2.replace('px',''));
				
				t1.cache=t2;
				if(S.closeAll)
					el(t1).css('height','0px').css('display','none');
				
				document.getElementById('Cache_'+i).children[0].onclick = function(){
					var list=this.parentNode.children[1];
					el(list).animate({property:'height',to:(list.style.height=='0px')?list.cache:0,jump:10});
					S.fn(this.parentNode);
				}
			}
		}
		if(S.closeAll){
			for(var c in S.Collapsed){
				if(typeof S.Collapsed[c] == 'string'){
					t=S.Collapsed[c].split(':');
					if(m[t[0]]){
						m[t[0]].children[1].style.height=m[t[0]].children[1].cache+'px';
						m[t[0]].children[1].style.display='block';
						if(t[1])
							m[t[0]].children[0].className=t[1];
					}
				}
			}
		}
	}
};