if (!com) var com = {};
if (!com.taxsaleprograms) com.taxsaleprograms = {};

jQuery.extend(jQuery.expr[':'], {
    like : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0"
}); 

com.taxsaleprograms.page = {

	ready: function() {
		var self = this;

		var button = $("<a/>").text(this.makeLabel("Show Table of Contents"));
		var div = $('<div class="toc-control"/>').append(button);

		$("table.data td.Description .toc").before(div);

		$("td.Description a").toggle(function(){
			var $this = $(this);
			$this.parents("td.Description").find(".toc").slideDown();
			$this.text(self.makeLabel("Hide Table of Contents"));
		},function(){
			var $this = $(this);
			$this.parents("td.Description").find(".toc").slideUp();
			$this.text(self.makeLabel("Show Table of Contents"));
		});

		$("table.data td.Description .toc .chapter").wrapInner('<span class="inner"/>');
		$("table.data td.Description .toc li").prepend('<span class="indent"/>');

		$(".toc").hide();
	},

	makeLabel: function(text) {
		return text + "...";
	}

};
$(document).ready(function(){com.taxsaleprograms.page.ready();});
