/**
 * nav.js functions for Planksters
 * @requires - utilities.js
 * @author mitchell amihod
 *
 *	How To:
 *	Include this on the page. You should also have included the utilities.js file
 *	see nav.html for an example.
 *  Incomplete, but works for purposes of mockups.
 *
 **/
//console.formatted = true;
var $hoverNav = YAHOO.namespace('Plank.Base.HoverNav');

$hoverNav = function () {

	var $D = 	YAHOO.util.Dom;
	var $E = 	YAHOO.util.Event;
	
	//Collect object. We return it after the onContentReady
	var publicMethods = {

		init: function () {

			var navRoot = document.getElementById("nav");

			//Grabs all LIs from the menu, andattachs functions to onmouseover & out. Should rewrite this with the YUI.
			for (var i=0; i<navRoot.childNodes.length; i++) {
				var node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					//console.log(node.childNodes[2]);
					  node.onmouseover=function() {
						YAHOO.util.Dom.setStyle(this.childNodes[2], 'display', 'block');
		  			}

		  			node.onmouseout=function() {
						YAHOO.util.Dom.setStyle(this.childNodes[2], 'display', 'none');
		   			}
		   		}
		  	}
		}

	};	//End Closure Wrapper
	if(YAHOO.env.ua.ie > 0 ) {
		$E.onDOMReady(publicMethods.init);
	}
	
	return publicMethods;
	
} ();

