function tableExpand(){
	this.init();
}

tableExpand.prototype = {
	init: function(){
		$('table a.expand').live('click', function(){
			$(this).addClass('collapse').removeClass('expand');
			if ($(this).parents('table').find('tr.expand').length > 0){
				$(this).parents('tr').next().addClass('shown');
				
				//Use the rel attribute to gather the name of the index that can be passed into the javascript function that grabs latest chart info
				var indexName = $(this).attr('rel');
				//insert AJAX here to get chart info keyed off the indexName variable
				draw_small_index_data(indexName, indexName, 'q');
			}
			else{
				$(this).parents('tr').find('p.more').show();
			}
			return false;
		});
		
		$('table a.collapse').live('click', function(){
			$(this).addClass('expand').removeClass('collapse');
			if ($(this).parents('table').find('tr.expand').length > 0){
				$(this).parents('tr').next().removeClass('shown');
			}
			else{
				$(this).parents('tr').find('p.more').hide();
			}
			return false;
		});
	}
}

$(function(){
	var tableExpandObj = new tableExpand();
});
