$(document).ready(function(){ 
			
			//var showing = 4;

			$('#speakertable tr:even').addClass("even");
			
			$('#speakertable td.company').each(function(){
				$(this).parent().find("td:eq(3)").append(" <strong>"+ $(this).text() +"</strong>");
			});

			$('.expand')
				.hide()
				.parent()
				.find('p.name')
				.css({
					cursor:"pointer",
					textDecoration:"underline"				
				})
				.click(function(){
					$(this).parent('td.name').find('div.expand').toggle();
					if( $(this).parent('td.name').find('div.expand').is(":visible") ){
						height = $(this).parent().find('.expand').outerHeight() + 58;
						$(this).parent('td.name').css("height", height+"px" );
					} else {
						$(this).parent('td.name').css("height", "58px" );
					}
				});
				
			$('.expand:lt('+showing+')').each(function(){
				$(this).show();
				height = $(this).outerHeight() + 58;
				$(this).parent('td.name').css("height", height + "px" );
			});

			$('.secondPosition').each(function(){
				$(this).parent("tr").find("td:eq(3)").append( "<br />" + $(this).html() );
			});
			
			$("#speakertable").tablesorter();
			
			$(".header").unbind('click');
			
			$('#hideall').click(function(){
				$('.expand').hide();
				$('td.name').css("height","58px");
				return false;
			});
			
			$('#showall').click(function(){
				$('.expand').each(function(){
					$(this).show();
					height = $(this).parent().find('.expand').outerHeight() + 58;
					$(this).parent('td.name').css("height", height + "px" );
				});
				return false;
			});

			$('a#orig').click(function(){
				var sorting = [[0,0]];
				//console.log(sorting);
				$("#speakertable").trigger("sorton",[sorting]);
				return false;
			});
			
			$('a#compsort').click(function(){
				var sorting = [[4,0]];
				//console.log(sorting);
				$("#speakertable").trigger("sorton",[sorting]);
				return false;
			});
			
			$('a#namesort').click(function(){
				var sorting = [[1,0]];
				//console.log(sorting);
				$("#speakertable").trigger("sorton",[sorting]);
				return false;
			});

		});
