

try{

	// Behold the DED namespace!
	var DED = window.DED || {};
	DED.example = function() {
		var YUD = YAHOO.util.Dom;
		var YUE = YAHOO.util.Event;
		var YUA = YAHOO.util.Anim;
		var onMenuCollapse = new YAHOO.util.CustomEvent('menu collapse');
		var onMenuOpen = new YAHOO.util.CustomEvent('menu open');
		var last = [];
		var ua = navigator.userAgent.toLowerCase();
		var isOpera = (ua.indexOf('opera') != -1);
		var isIE = (ua.indexOf('msie') != -1 && !isOpera);
		return {
			init : function() {
				var oLi = YUD.getElementsByClassName('hd','li','leftnav_content');
				for ( var i=0, j=oLi.length; i<j; ++i ) {
					YUE.on(oLi[i], 'click', this.collapse, oLi[i].offsetHeight);
				}
				YUD.batch(oLi, function(oEl) {
						if ( YUD.hasClass(oEl, 'close') ) {
							oEl.getElementsByTagName('ul')[0].style.height = '0';
						}
					}
				);

				onMenuOpen.subscribe(this.closeLast);

			},
			collapse : function(e, iH) {
				last.push(this);
				if ( last.length > 3 ) {
					last.shift();
				}
				if ( YUD.hasClass(this, 'close') ) {
					YUD.removeClass(this, 'close');
					var oEl = this.getElementsByTagName('ul')[0];
					oEl.style.height = '0';
					var iHeight = (isIE ? parseInt(iH)-20 : parseInt(iH)-30); // Numeric represent IE height decremental bug. -60 there.
					var attributes = {
						height : {
							from : 0,
							to : iHeight
						}
					};
					var anim = new YAHOO.util.Anim(oEl, attributes, 0.4, YAHOO.util.Easing.easeOut);
					anim.animate();
					onMenuOpen.fire();
				}
				else {
					YUD.addClass(this, 'close');
					var oEl = this.getElementsByTagName('ul')[0];
					var attributes = {
						height : {
							to : 0
						}
					};
					var anim = new YUA(oEl, attributes, 0.4, YAHOO.util.Easing.easeIn);
					anim.animate();
					onMenuCollapse.fire();
				}
			},
			/*swapColor : function(type, args, me) {
				if ( YUD.hasClass(me, 'foo') ) {
					YUD.removeClass(me, 'foo');
				}
				else {
					YUD.addClass(me, 'foo');
				}
			},
			notify : function(type, args, b) {
				if ( b === true ) {
					YUD.get('open').innerHTML += '<p>Woot. We opened someone!<hr /></p>';
				}
				else {
					YUD.get('close').innerHTML += '<p>Woot. We collapsed \'em all!<hr /></p>';
				}
				YUD.get('action').innerHTML += '<p>Woot. We got action!<hr /></p>';
			},*/
			closeLast : function() {
				var oLast = last[(last.length)-2];
				if ( last.length === 1) {
					return;
				}
				else if ( oLast === last[(last.length)-1] ) {
					return;
				}
				if ( !YUD.hasClass(oLast, 'close') ) {
					YUD.addClass(oLast, 'close');
					var oEl = oLast.getElementsByTagName('ul')[0];
					var attributes = {
						height : {
							to : 0
						}
					};
					var anim = new YUA(oEl, attributes, 0.4, YAHOO.util.Easing.easeIn);
					anim.animate();
				}
			}
		};
	}();
	YAHOO.util.Event.onAvailable('leftnav_content',DED.example.init, DED.example, true);
	
	}catch(err){}
	




























