$(function(){
  $('textarea#tweet-text').focus(function(){
    var val = $('#tweet-text').val();
    if (val == "Type or paste the full text to tweet here.") {
      $('#tweet-text').val("").css("color","#282827");
    }
  }).blur(function(){
    var val = $('#tweet-text').val();
    if (val.length == 0)
      $('#tweet-text').val("Type or paste the full text to tweet here.").css("color","#999999");
  });
  
  $('input#source-url').focus(function(){
    var val = $('#source-url').val();
    if (val == "recommended.") {
      $('#source-url').val("").css("color","#282827").css("text-align", "left");
    }
  }).blur(function(){
    var val = $('#source-url').val();
    if (val.length == 0)
      $('#source-url').css("text-align", "right").val("recommended.").css("color","#999999");
  });
  
  $('#tweet-this-text-form').submit(function(){
    return $('#tweet-text').val() != "Type or paste the full text to tweet here.";
  });
  
/*
  var navSpacerWidth = $('#navigation ul li:first-child').offset().left + $('#navigation ul li:first-child').width();
  var navLastSpacerWidth = $('#navigation').width() - $('#navigation ul li:last-child').offset().left;
  $('#navigation ul').css("margin","").css("width","100%");
  $('#navigation ul li:first-child').width(navSpacerWidth);
  $('#navigation ul li:last-child').width(navLastSpacerWidth);
*/
  
  // set to #282827 in css and "grayed" out here (and back to black in focus method above)
  // so clients w/out javascript will see it clearly
  $('#tweet-text').css("color","#999");
});