// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
                                                                                            
function openHelp() {
  $(".pull .close").slideUp("fast", function() {
    $("#help").slideDown("slow"); 
  });
}           

function closeHelp() {
  $("#help").slideUp("fast", function() {
    $(".pull .close").slideDown("slow"); 
  });
}

function showDefinition() {
  $('#definition_show').hide();
  $('#definition_hide').show();
  $('#definition').slideDown("slow");
}

function hideDefinition() {
  $('#definition_show').show();
  $('#definition_hide').hide();
  $('#definition').slideUp("slow");
}

function showUserListing(list) {
  $('#monthly_score').hide();
  $('#all_time_score').hide();
  $('#average_score').hide();
  $('#win_count').hide();
  $('#' + list).show();
}

function showRanking() {
  $('#score').hide();
  $('#ranking').show();
}
function showScore() {
  $('#score').show();
  $('#ranking').hide();
}

function showBestTweetEver() {
  $("#best_tweet_ever").show();
  $("#best_tweet_this_month").hide();
}

function showBestTweetThisMonth() {
  $("#best_tweet_ever").hide();
  $("#best_tweet_this_month").show();
}

$(document).ready(function() {
   // put all your jQuery goodness in here.
   // $('.inlinesparkline').sparkline('html', {spotRadius: '0', lineColor: '#323D3F', fillColor: '#72C9C5', height: '20px'});
   
   $("#find_profile_box").focus(function() { $(this).attr("value",""); });

	$("#address_box").focus(function() { $(this).attr("value",""); });
   
   $(".select_on_click").click(function(e) {
		this.focus();
		this.select();
   })

   $("input.calendar").datepicker({showOn: 'both', buttonImage: '/images/calendar.png', buttonImageOnly: true, dateFormat: 'dd M yy', showAnim: 'slideDown'});


 });

jQuery.ajaxSetup({ 
  'beforeSend': function(xhr) {xhr.setRequestHeader("Accept","text/javascript")} 
})



