// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

$(document).ready(function (){
  $("#username").focus();
  $("#tos").hide();

  // login button is clicked
  $("input[type='radio']#login").click(function (){

    $("input[type='radio']#signup").attr("checked", false);
    $("#user_form").attr("action", "/sessions");
    $("#submit").attr("value", "Log in");
    $("#forgot_password").show();
    $("#tos").hide();
    $("#username").focus();

    return false;
  });

  // signup button is clicked
  $("input[type='radio']#signup").click(function (){

    $("input[type='radio']#login").attr("checked", false);
    $("#user_form").attr("action", "/users");
    $("#submit").attr("value", "Sign up!");
    $("#tos").show();
    $("#forgot_password").hide();
    $("#username").focus();

    return false;
  });

});
