/*
quickTree 0.4 - Simple jQuery plugin to create tree-structure navigation from an unordered list
http://scottdarby.com/

Copyright (c) 2009 Scott Darby

Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
*/
jQuery.fn.quickTree = function() {
    return this.each(function(){
	
		//set variables
        var $tree = $(this);
        var $link = $tree.find('a.tog');
        var $body = $tree.find('.textdiv');		

		//handle clicking on expand/contract control
        $link.toggle(
			//if it's clicked once, find all child lists and expand
            function(){
                $body.slideDown();
            },
			//if it's clicked again, find all child lists and contract
            function(){
                $body.slideUp();
            }
        );
    });
};
