$(document).ready(
	function()
	{
		tree = $('#myTree');
		$('li', tree.get(0)).each(
			function()
			{
				subbranch = $('ul', this);
				if (subbranch.size() > 0) {
					if (subbranch.eq(0).css('display') == 'none') {
						$(this).prepend('<img src="/images/icons/bullet_toggle_plus.gif" width="16" height="16" class="expandImage" />');
					} else {
						$(this).prepend('<img src="/images/icons/bullet_toggle_minus.gif" width="16" height="16" class="expandImage" />');
					}
				} else {
					$(this).prepend('<img src="/images/icons/spacer.gif" width="16" height="16" class="expandImage" />');
				}
				
			}
		);
		$('img.expandImage', tree.get(0)).click(
			function()
			{
				if (this.src.indexOf('spacer') == -1) {
					subbranch = $('ul', this.parentNode).eq(0);
					if (subbranch.css('display') == 'none') {
						subbranch.show();
						this.src = '/images/icons/bullet_toggle_minus.gif';
					} else {
						subbranch.hide();
						this.src = '/images/icons/bullet_toggle_plus.gif';
					}
				}
			}
		);
	}
);
