$(document).ready(function(){
  var fullpostcodevalue = "Full Postcode";
  var searchkeywordvalue = "Optional Keyword (e.g GTi)";
  jQuery.fn.extend({
    doClear:function(){
      var defaultvalue = eval($(this).attr("name") + "value");
      $(this).focus(function(){
        if ($(this).val() == defaultvalue) {
          $(this).val("");
        }
      });
      $(this).blur(function(){
        if ($(this).val() == "") {
          $(this).val(defaultvalue);
        }
      });
    }
  })
  $("#fullpostcode").doClear();
  $("input[name=searchkeyword]").doClear();

  $("#droplist").submit(function() {
    if ($("#fullpostcode").val() == fullpostcodevalue) {
      alert("Please enter your FULL postcode");
      $("#fullpostcode").focus();
      return false;
    }

    if ($("input[name=searchkeyword]").val() == searchkeywordvalue) {
      $("input[name=searchkeyword]").val("");
    }
  });
});
