	
	
// initialize the tree

	function treeInit() {
		
		//Hand off ot a method that randomly generates tree nodes:
		buildTree();

		YAHOO.util.Event.on("expand", "click", function(e) {
			tree.expandAll();
			YAHOO.util.Event.preventDefault(e);
		});

		//handler for collapsing all nodes
		YAHOO.util.Event.on("collapse", "click", function(e) {
			tree.collapseAll();
			YAHOO.util.Event.preventDefault(e);
		});
	}// end treeinit function




// Build the tree
	function buildTree() {
				var root = tree.getRoot(); 
	//			var mylink = { label: "Home", link: "http://www.widernet.org/digitallibrary/portals/PortalViewercurrent2.asp?PortalPageID=721" }; 
	//			var links = new YAHOO.widget.MenuNode(mylink, root, true);
		//			var mylink = { label: "Google", link: "http://www.google.com" }; 
		//			var tmpNode = new YAHOO.widget.TextNode(mylink, root); 
		mydraw();
		makelinks();
	}// end buildtree function
	



//draw the tree
function mydraw(){
		tree.draw();

		}// end mydraw function


//add onclick event handlers to the links
function makelinks(){




tree.subscribe('clickEvent',function() {
return false;
});
//		tree.subscribe('labelClick', function (node) {
//			if (node.label="Home" || !node.hasChildren())
//			{
			//alert (node.href);
//			top.main.location = node.href;
//		}
//		}
//		);
} //end makelinks function




