/*	PAX Menu tree demo
	
	The below javascript will render the tree menu, and setup a set of buttons that interact with the tree, such as searching, and opening / collapsing nodes.
*/
pax.load.onloaded( function() {
	//	Initialise the menu
	var menu = pax.$("pax.widget.menu.tree.example1");
	pax.widget.menu.tree.init( menu );
	
	//	Setup the button actions
	pax.event.bind( pax.$('treeOpenAll'), 'click', function() { pax.widget.menu.tree.openAll( menu ); } );
	pax.event.bind( pax.$('treeCloseAll'), 'click', function() { pax.widget.menu.tree.closeAll( menu ); } );
	pax.event.bind( pax.$('treeSearch'), 'click', function() { pax.widget.menu.tree.search( menu, pax.$('searchBox').value ); } );
	pax.event.bind( pax.$('treeClear'), 'click', function() { pax.widget.menu.tree.clearSearch( menu ); } );
} );
