// JavaScript Document

YUI({combine: true, timeout: 10000}).use("node", "anim", function(Y) {
    var module = Y.get('#demo');

    // add fx plugin to module body
    var content = module.query('.yui-bd').plug(Y.Plugin.NodeFX, {
        to: { height: 0 },
        from: {
            height: function(node) { // dynamic in case of change
                return node.get('scrollHeight'); // get expanded height (offsetHeight may be zero)
            }
        },

        easing: Y.Easing.easeOut,
        duration: 0.5
    });

    var onClick = function(e) {
        module.toggleClass('yui-closed');

        content.fx.set('reverse', !content.fx.get('reverse')); // toggle reverse 
        content.fx.run();
		
    };

    // use dynamic control for dynamic behavior
    var control = Y.Node.create(
        '<a title="show/hide content" class="yui-toggle">' +
            '<em></em>' +
        '</a>'
    );

    // append dynamic control to header section
    module.query('.yui-hd').appendChild(control);
    control.on('click', onClick);
	//control.on('click', gettools());
;
});
YAHOO.namespace("example.container");

		function init() {
			// Instantiate a Panel from markup
			YAHOO.example.container.panel1 = new YAHOO.widget.Panel("mainnav", { width:"320px", visible:false, draggable:false, context:["floater_left","tl","bl", ["beforeShow", "windowResize"]], constraintoviewport:true } );
			YAHOO.example.container.panel1.render();

			// Instantiate a Panel from script
			
			YAHOO.util.Event.addListener("show", "click", YAHOO.example.container.panel1.show, YAHOO.example.container.panel1, true);
			YAHOO.util.Event.addListener("hide1", "click", YAHOO.example.container.panel1.hide, YAHOO.example.container.panel1, true);

			
		}

		YAHOO.util.Event.addListener(window, "load", init);



