function urlencode(str) {
return str;
//return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
}

$(function() {
  $('.error').hide();
  $('input.text-input').css({backgroundColor:"#FFFFFF"});
  $('input.text-input').focus(function(){
    $(this).css({backgroundColor:"#FFDDAA"});
  });
  $('input.text-input').blur(function(){
    $(this).css({backgroundColor:"#FFFFFF"});
  });

  $(".button").click(function() {
		// validate and process form
		// first hide any error messages
    $('.error').hide();
	var name = $("input#name").val();
	
	if (name == "") {
		$("label#name_error").show();
		$("input#name").focus();
      return false;
    }
    
    var text = $("textarea#text").val();
	if (text == "") {
		$("label#text_error").show();
		$("textarea#text").focus();
      return false;
    }
    
	});
});
runOnLoad(function(){
  $("input#email").select().focus();
});