$(function() {
  $('.error').hide();
  $('input.text-input').css({backgroundColor:"#ffffff"});
  $('input.text-input').focus(function(){
    $(this).css({backgroundColor:"#CE2626"});
  });
  $('input.text-input').blur(function(){
    $(this).css({backgroundColor:"#ffffff"});
  });

// Added live so it will work in reloaded div

  $(".button").live("click",function() {
		// validate and process form
		// first hide any error messages
    $('.error').hide();
		
	  var username = $("input#username").val();
		if (username == "") {
      $("label#usernameerror").show();
      $("input#username").focus();
      return false;
    }
		var password = $("input#password").val();
		if (password == "") {
      $("label#passworderror").show();
      $("input#password").focus();
      return false;
    }
	
	
	
    return true;
	});
});

