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 email = $("input#email").val();
	if (email == "") {
		$("label#email_error").show();
		$("input#email").focus();
      return false;
    }
		//var dataString = 'title='+ title + '&lang=' + lang + '&comment=' + comment + '&howto=' + howto + '&code=' + code + '&userid=' + userid;
		//alert (dataString);return false;	
		$.ajax({
      type: "POST",
      url: "http://www.webcodebase.com/ajax/lostpw.php",
      data: {email:email},
      success: function() {
        $('#contact_form').html("<div id='message'></div>");
      // $('#message').load("http://www.webcodebase.com/ajax/submit.php?" + dataString);
	 $('#message').html("")
        .append("<h2>Password sent</h2><p>Please check your email to recover your password.</p>")
        .hide()
        .fadeIn(1500, function() {
          $('#message').append("");
        });
      }
     });
    return false;
	});
});
runOnLoad(function(){
  $("input#email").select().focus();
});