/*! jQuery HTML5 Form - v1.5.0 - 2013-02-19 * http://www.matiasmancini.com.ar/jquery-plugin-ajax-form-validation-html5.html * Copyright (c) 2013 Matias Mancini; Licensed MIT */ (function(e){e.fn.html5form=function(t){e(this).each(function(){function s(e){e.attr("placeholder")&&"password"!=e.attr("type")?(e.val(e.attr("placeholder")),e.css("color",a.colorOff)):(e.data("value")?e.val(e.data("value")):""!=e.val()&&e.data("value",e.val()),e.css("color",a.colorOn))}var i={async:!0,method:e(this).attr("method"),responseDiv:null,labels:"show",colorOn:"#000000",colorOff:"#a1a1a1",action:e(this).attr("action"),messages:!1,emptyMessage:!1,emailMessage:!1,allBrowsers:!0},a=e.extend({},i,t);if(!a.allBrowsers){if(e.browser.webkit&&parseInt(e.browser.version)>=533)return!1;if(e.browser.mozilla&&parseInt(e.browser.version)>=2)return!1;if(e.browser.opera&&parseInt(e.browser.version)>=11)return!1}var r=e(this),l=[],o=[];"hide"==a.labels&&e(this).find("label").hide(),e.each(e("select",this),function(){e(this).css("color",a.colorOff),e(this).change(function(){e(this).css("color",a.colorOn)})}),e.each(e(":input:visible:not(:button, :submit, :radio, :checkbox, select)",r),function(t){s(e(this)),null!=this.getAttribute("required")&&(l[t]=e(this)),"email"==this.getAttribute("type")&&(o[t]=e(this)),e(this).bind("focus",function(t){t.preventDefault(),this.value==e(this).attr("placeholder")&&"url"!=this.getAttribute("type")&&e(this).attr("value",""),e(this).css("color",a.colorOn)}),e(this).bind("blur",function(t){t.preventDefault(),""==this.value?s(e(this)):"url"==this.getAttribute("type")&&e(this).val()==e(this).attr("placeholder")&&s(e(this))}),e("textarea").filter(this).each(function(){e(this).attr("maxlength")>0&&e(this).keypress(function(t){var s=t.charCode||t.keyCode;return 37==s||39==s?!0:8==s||46==s?!0:this.value.length>=e(this).attr("maxlength")?!1:!0})})}),e.each(e("input:submit, input:image, input:button",this),function(){e(this).bind("click",function(){var t=null,i=null,n=e(":input:visible:not(:button, :submit, :radio, :checkbox, select)",r);if(e(l).each(function(s,i){return void 0==i?!0:e(this).val()==e(this).attr("placeholder")||""==e(this).val()?(t=e(this),a.emptyMessage?e(a.responseDiv).html("

"+a.emptyMessage+"

"):"es"==a.messages?e(a.responseDiv).html("

El campo "+e(this).attr("title")+" es requerido.

"):"en"==a.messages?e(a.responseDiv).html("

The "+e(this).attr("title")+" field is required.

"):"it"==a.messages?e(a.responseDiv).html("

Il campo "+e(this).attr("title")+" é richiesto.

"):"de"==a.messages?e(a.responseDiv).html("

"+e(this).attr("title")+" ist ein Pflichtfeld.

"):"fr"==a.messages?e(a.responseDiv).html("

Le champ "+e(this).attr("title")+" est requis.

"):"nl"==a.messages||"be"==a.messages?e(a.responseDiv).html("

"+e(this).attr("title")+" is een verplicht veld.

"):"br"==a.messages?e(a.responseDiv).html("

O campo "+e(this).attr("title")+" é obrigatório.

"):"br"==a.messages&&e(a.responseDiv).html("

Insira um email válido por favor.

"),!1):t}),e(o).each(function(t,s){return void 0==s?!0:e(this).val().search(/[\w-\.]{3,}@([\w-]{2,}\.)*([\w-]{2,}\.)[\w-]{2,4}/i)?(i=e(this),!1):i}),t||i)t?e(t).focus().select():i?(a.emailMessage?e(a.responseDiv).html("

"+a.emailMessage+"

"):"es"==a.messages?e(a.responseDiv).html("

Ingrese una dirección de correo válida por favor.

"):"en"==a.messages?e(a.responseDiv).html("

Please type a valid email address.

"):"it"==a.messages?e(a.responseDiv).html("

L'indirizzo e-mail non é valido.

"):"de"==a.messages?e(a.responseDiv).html("

Bitte eine gültige E-Mail-Adresse eintragen.

"):"fr"==a.messages?e(a.responseDiv).html("

Entrez une adresse email valide s’il vous plait.

"):("nl"==a.messages||"be"==a.messages)&&e(a.responseDiv).html("

Voert u alstublieft een geldig email adres in.

"),e(i).select()):alert("Unknown Error");else if(e(n).each(function(){e(this).val()==e(this).attr("placeholder")&&e(this).val("")}),a.async){var h=e(r).serialize();e.ajax({url:a.action,type:a.method,data:h,success:function(t){a.responseDiv&&e(a.responseDiv).html(t),e(n).val(""),e.each(r[0],function(){s(e(this).not(":hidden, :button, :submit, :radio, :checkbox, select")),e("select",r).each(function(){e(this).css("color",a.colorOff),e(this).children("option:eq(0)").attr("selected","selected")}),e(":radio, :checkbox",r).removeAttr("checked")})}})}else e(r).submit();return!1})})})}})(jQuery);