$(function()
{
  $("#frmEmail").validate()
    .addField("txtName", ["required", "maxlength=100"], "Name")
    .addField("txtEmail", ["required", "email", "maxlength=100"], "E-mail")
    .addField("txtSubject", ["required", "maxlength=100"], "Subject")
    .addField("txtMessage", ["required", "maxlength=1000"], "Message")
    .addField("txtCaptcha", ["required", "maxlength=6"], "Captcha");
  
  $('<div><small><a href="#" title="New Captcha">Can\'t see the characters?</a></small></div>').insertAfter("#txtCaptchaError").find("a").click(function()
  {
    $("#captcha").attr("src", "/includes/asp/captcha.asp?path=" + location.pathname + "&amp;rand=" + Math.random());
    return false;
  });
});
