jQuery(document).ready(function() 
	{
	
  	// check for expand_options being clicked and show filter and sort options
  	$("a.expand_options").click(function() {
  		
  		$("div#options_panel").toggle("fast");
  		if ($("a.expand_options").html() == 'Hide Filter and Sort Options')
  		{
  			$("a.expand_options").html('Show Filter and Sort Options');
  		}
  		else
  		{
  			$("a.expand_options").html('Hide Filter and Sort Options');
  		}
  		return false;
  	});
  	
  	$("a#hide_vid").live("click", function(){
  		$("div#vid").hide();
  		
  		$(this).attr("id", "show_vid");
  		$(this).html("Video is hidden click to show");
  		
  		return false;
  	});
  	
  	$("a#show_vid").live("click", function(){
  		$("div#vid").show();
  		
  		$(this).attr("id", "hide_vid");
  		$(this).html("Hide Video");
  		
  		return false;
  	});
  	
  	
  	// Update the main page user info area with a list of story's which the user is at top of queue and needs to start typing!
  	update_floor_info();
  	setInterval("update_floor_info()",15000);
  	
  	// update the main page user info area with table of stories which user in queue and how long to wait
  	update_queue_info();
  	setInterval("update_queue_info()",15000);
  	
  	// if register is clicked, hide login_form and slide registration_form
  	$("a.register").click(function() {
  		$("#login_form").slideUp();
  		$("#registration_form").slideDown();
  		return false;
  	});
  	
  	$("#registration_form a.cancel_registration").click(function() {
  		$("#registration_form").slideUp();
  		$("#login_form").slideDown();
  		return false;
  	 });
  	/*
  	$("a.about").click(function() {
  		$("#about").slideDown(500);
  		return false;
  	});
  	*/
  	
  	$("p#small_thanks_link a").click(function() {
		$("#thanks_to").slideDown("slow");
		$(this).hide();
		return false;
  	});
  
});

function update_floor_info() {
	
	$("#user_floor_info").load(base_url + "story/floor_info", 'somethingtocleariecache!');
	 
}

function update_queue_info() {
	
	$("#user_queue_info").load(base_url + "story/user_queue_info", 'somethingtocleariecache!');
	
}

