(!Modernizr.formvalidation||jQuery.webshims.bugs.bustedValidity)&&jQuery.webshims.register("form-extend",function(b,c,w,m){c.inputTypes=c.inputTypes||{};var s=c.cfg.forms,q,r=c.inputTypes,x={radio:1,checkbox:1};c.addInputType=function(a,b){r[a]=b};var t={customError:!1,typeMismatch:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,tooLong:!1,patternMismatch:!1,valueMissing:!1,valid:!0},u={valueMissing:function(a,f,d){if(!a.prop("required"))return!1;var n=!1;if(!("type"in d))d.type=(a[0].getAttribute("type")||
a[0].type||"").toLowerCase();if("select"==d.nodeName){if(f=!f)if(!(f=0>a[0].selectedIndex))a=a[0],f="select-one"==a.type&&2>a.size?!!b("> option:first-child",a).prop("selected"):!1;a=f}else a=x[d.type]?"checkbox"==d.type?!a.is(":checked"):!c.modules["form-core"].getGroupElements(a).filter(":checked")[0]:!f;return a},tooLong:function(){return!1},typeMismatch:function(a,b,d){if(""===b||"select"==d.nodeName)return!1;var c=!1;if(!("type"in d))d.type=(a[0].getAttribute("type")||a[0].type||"").toLowerCase();
r[d.type]&&r[d.type].mismatch&&(c=r[d.type].mismatch(b,a));return c},patternMismatch:function(a,b,d){if(""===b||"select"==d.nodeName)return!1;a=a.attr("pattern");if(!a)return!1;try{a=RegExp("^(?:"+a+")$")}catch(n){c.error('invalid pattern value: "'+a+'" | '+n),a=!1}return!a?!1:!a.test(b)}};c.addValidityRule=function(a,b){u[a]=b};b.event.special.invalid={add:function(){b.event.special.invalid.setup.call(this.form||this)},setup:function(){var a=this.form||this;if(!b.data(a,"invalidEventShim")&&(b(a).data("invalidEventShim",
!0).bind("submit",b.event.special.invalid.handler),c.moveToFirstEvent(a,"submit"),c.bugs.bustedValidity&&b.nodeName(a,"form"))){var f=a.getAttribute("novalidate");a.setAttribute("novalidate","novalidate");c.data(a,"bustedNoValidate",null==f?null:f)}},teardown:b.noop,handler:function(a){if(!("submit"!=a.type||a.testedValidity||!a.originalEvent||!b.nodeName(a.target,"form")||b.prop(a.target,"noValidate"))){q=!0;a.testedValidity=!0;if(!b(a.target).checkValidity())return a.stopImmediatePropagation(),
q=!1;q=!1}}};b(m).bind("invalid",b.noop);b.event.special.submit=b.event.special.submit||{setup:function(){return!1}};var y=b.event.special.submit.setup;b.extend(b.event.special.submit,{setup:function(){b.nodeName(this,"form")?b(this).bind("invalid",b.noop):b("form",this).bind("invalid",b.noop);return y.apply(this,arguments)}});c.addInputType("email",{mismatch:function(){var a=s.emailReg||/^[a-zA-Z0-9.!#$%&'*+-\/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;return function(b){return!a.test(b)}}()});
c.addInputType("url",{mismatch:function(){var a=s.urlReg||/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;
return function(b){return!a.test(b)}}()});c.defineNodeNameProperty("input","type",{prop:{get:function(){var a=(this.getAttribute("type")||"").toLowerCase();return c.inputTypes[a]?a:this.type}}});c.defineNodeNamesProperties(["button","fieldset","output"],{checkValidity:{value:function(){return!0}},willValidate:{value:!1},setCustomValidity:{value:b.noop},validity:{writeable:!1,get:function(){return b.extend({},t)}}},"prop");var j=function(a){var f,d=b.prop(a,"validity");if(d)b.data(a,"cachedValidity",
d);else return!0;if(!d.valid){f=b.Event("invalid");var n=b(a).trigger(f);if(q&&!j.unhandledInvalids&&!f.isDefaultPrevented())c.validityAlert.showFor(n),j.unhandledInvalids=!0}b.removeData(a,"cachedValidity");return d.valid};c.defineNodeNameProperty("form","checkValidity",{prop:{value:function(){var a=!0,f=b("input,textarea,select",this).filter(function(){var a=c.data(this,"shadowData");return!a||!a.nativeElement||a.nativeElement===this});j.unhandledInvalids=!1;for(var d=0,n=f.length;d<n;d++)j(f[d])||
(a=!1);return a}}});c.defineNodeNamesProperties(["input","textarea","select"],{checkValidity:{value:function(){j.unhandledInvalids=!1;return j(b(this).getNativeElement()[0])}},setCustomValidity:{value:function(a){b.removeData(this,"cachedValidity");c.data(this,"customvalidationMessage",""+a)}},willValidate:{set:b.noop,get:function(){var a={button:1,reset:1,hidden:1,image:1};return function(){var f=b(this).getNativeElement()[0];return!(f.disabled||f.readOnly||a[f.type])}}()},validity:{set:b.noop,get:function(){var a=
b(this).getNativeElement(),f=a[0],d=b.data(f,"cachedValidity");if(d)return d;d=b.extend({},t);if(!b.prop(f,"willValidate")||"submit"==f.type)return d;var n=a.val(),i={nodeName:f.nodeName.toLowerCase()};d.customError=!!c.data(f,"customvalidationMessage");if(d.customError)d.valid=!1;b.each(u,function(b,f){if(f(a,n,i))d[b]=!0,d.valid=!1});b(this).getShadowFocusElement().attr("aria-invalid",d.valid?"false":"true");f=a=null;return d}}},"prop");c.defineNodeNamesBooleanProperty(["input","textarea","select"],
"required",{set:function(a){b(this).getShadowFocusElement().attr("aria-required",!!a+"")},initAttr:!b.browser.msie||7<c.browserVersion});c.reflectProperties(["input"],["pattern"]);if(!("maxLength"in m.createElement("textarea"))){var p=function(){var a,f=0,d=b([]),c=1E9,i=function(){var a=d.prop("value"),b=a.length;b>f&&b>c&&(b=Math.max(f,c),d.prop("value",a.substr(0,b)));f=b},g=function(){clearTimeout(a);d.unbind(".maxlengthconstraint")};return function(l,h){g();if(-1<h)c=h,f=b.prop(l,"value").length,
d=b(l),d.bind("keydown.maxlengthconstraint keypress.maxlengthconstraint paste.maxlengthconstraint cut.maxlengthconstraint",function(){setTimeout(i,0)}),d.bind("keyup.maxlengthconstraint",i),d.bind("blur.maxlengthconstraint",g),a=setInterval(i,200)}}();p.update=function(a,f){a===m.activeElement&&(null==f&&(f=b.prop(a,"maxlength")),p(e.target,f))};b(m).bind("focusin",function(a){var f;"TEXTAREA"==a.target.nodeName&&-1<(f=b.prop(a.target,"maxlength"))&&p(a.target,f)});c.defineNodeNameProperty("textarea",
"maxlength",{attr:{set:function(a){this.setAttribute("maxlength",""+a);p.update(this)},get:function(){var a=this.getAttribute("maxlength");return null==a?void 0:a}},prop:{set:function(a){if("number"==typeof a||a&&a==1*a){if(0>a)throw"INDEX_SIZE_ERR";a=parseInt(a,10);this.setAttribute("maxlength",a);p.update(this,a)}else this.setAttribute("maxlength","0"),p.update(this,0)},get:function(){var a=this.getAttribute("maxlength");return("number"==typeof a||a&&a==1*a)&&0<=a?parseInt(a,10):-1}}});c.defineNodeNameProperty("textarea",
"maxLength",{prop:{set:function(a){b.prop(this,"maxlength",a)},get:function(){return b.prop(this,"maxlength")}}})}var z={submit:1,button:1,image:1},g={};[{name:"enctype",limitedTo:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},defaultProp:"application/x-www-form-urlencoded",proptype:"enum"},{name:"method",limitedTo:{get:1,post:1},defaultProp:"get",proptype:"enum"},{name:"action",proptype:"url"},{name:"target"},{name:"novalidate",propName:"noValidate",proptype:"boolean"}].forEach(function(a){var f=
"form"+(a.propName||a.name).replace(/^[a-z]/,function(a){return a.toUpperCase()}),d="form"+a.name,c=a.name,i="click.webshimssubmittermutate"+c,j=function(){if("form"in this&&z[this.type]){var h=b.prop(this,"form");if(h){var o=b.attr(this,d);if(null!=o&&(!a.limitedTo||o.toLowerCase()===b.prop(this,f))){var v=b.attr(h,c);b.attr(h,c,o);setTimeout(function(){if(null!=v)b.attr(h,c,v);else try{b(h).removeAttr(c)}catch(a){h.removeAttribute(c)}},9)}}}};switch(a.proptype){case "url":var l=m.createElement("form");
g[f]={prop:{set:function(a){b.attr(this,d,a)},get:function(){var a=b.attr(this,d);if(null==a)return"";l.setAttribute("action",a);return l.action}}};break;case "boolean":g[f]={prop:{set:function(a){a?b.attr(this,"formnovalidate","formnovalidate"):b(this).removeAttr("formnovalidate")},get:function(){return null!=b.attr(this,"formnovalidate")}}};break;case "enum":g[f]={prop:{set:function(a){b.attr(this,d,a)},get:function(){var h=b.attr(this,d);return!h||(h=h.toLowerCase())&&!a.limitedTo[h]?a.defaultProp:
h}}};break;default:g[f]={prop:{set:function(a){b.attr(this,d,a)},get:function(){var a=b.attr(this,d);return null!=a?a:""}}}}g[d]||(g[d]={});g[d].attr={set:function(a){g[d].attr._supset.call(this,a);b(this).unbind(i).bind(i,j)},get:function(){return g[d].attr._supget.call(this)}};g[d].initAttr=!0;g[d].removeAttr={value:function(){b(this).unbind(i);g[d].removeAttr._supvalue.call(this)}}});c.defineNodeNamesProperties(["input","button"],g);!b.support.getSetAttribute&&null==b("<form novalidate></form>").attr("novalidate")?
c.defineNodeNameProperty("form","novalidate",{attr:{set:function(a){this.setAttribute("novalidate",""+a)},get:function(){var a=this.getAttribute("novalidate");return null==a?void 0:a}}}):c.bugs.bustedValidity&&c.defineNodeNameProperty("form","novalidate",{attr:{set:function(a){c.data(this,"bustedNoValidate",""+a)},get:function(){var a=c.data(this,"bustedNoValidate");return null==a?void 0:a}},removeAttr:{value:function(){c.data(this,"bustedNoValidate",null)}}});c.defineNodeNameProperty("form","noValidate",
{prop:{set:function(a){a?b.attr(this,"novalidate","novalidate"):b(this).removeAttr("novalidate")},get:function(){return null!=b.attr(this,"novalidate")}}});c.addReady(function(a,c){var d;b("form",a).add(c.filter("form")).bind("invalid",b.noop);try{if(a==m&&!("form"in(m.activeElement||{})))(d=b("input[autofocus], select[autofocus], textarea[autofocus]",a).eq(0).getShadowFocusElement()[0])&&d.offsetHeight&&d.offsetWidth&&d.focus()}catch(g){}});(function(){Modernizr.textareaPlaceholder=!!("placeholder"in
b("<textarea />")[0]);if(!Modernizr.input.placeholder||!Modernizr.textareaPlaceholder){var a="over"==c.cfg.forms.placeholderType,f=["textarea"];Modernizr.input.placeholder||f.push("input");var d=function(a){if(a.setSelectionRange)return a.setSelectionRange(0,0),!0;if(a)return a=a.createTextRange(),a.collapse(!0),a.moveEnd("character",0),a.moveStart("character",0),a.select(),!0},g=function(c,o,f,k){!1===f&&(f=b.prop(c,"value"));if(!a&&"password"!=c.type){if(!f&&k&&d(c)){var g;b(c).unbind(".placeholderremove").bind("keydown.placeholderremove keypress.placeholderremove paste.placeholderremove input.placeholderremove",
function(a){if(!a||!(17==a.keyCode||16==a.keyCode))c.value=b.prop(c,"value"),o.box.removeClass("placeholder-visible"),clearTimeout(g),b(c).unbind(".placeholderremove")}).bind("mousedown.placeholderremove drag.placeholderremove select.placeholderremove",function(){d(c);clearTimeout(g);g=setTimeout(function(){d(c)},9)}).bind("blur.placeholderremove",function(){clearTimeout(g);b(c).unbind(".placeholderremove")});return}c.value=f}else if(!f&&k){b(c).unbind(".placeholderremove").bind("keydown.placeholderremove keypress.placeholderremove paste.placeholderremove input.placeholderremove",
function(a){if(!a||!(17==a.keyCode||16==a.keyCode))o.box.removeClass("placeholder-visible"),b(c).unbind(".placeholderremove")}).bind("blur.placeholderremove",function(){b(c).unbind(".placeholderremove")});return}o.box.removeClass("placeholder-visible")},i=function(c,d,f,k,i){if(!k&&(k=b.data(c,"placeHolder"),!k))return;b(c).unbind(".placeholderremove");if("focus"==i||!i&&c===m.activeElement)("password"==c.type||a||b(c).hasClass("placeholder-visible"))&&g(c,k,"",!0);else if(!1===d&&(d=b.prop(c,"value")),
d)g(c,k,d);else if(!1===f&&(f=b.attr(c,"placeholder")||""),f&&!d){d=k;!1===f&&(f=b.prop(c,"placeholder"));if(!a&&"password"!=c.type)c.value=f;d.box.addClass("placeholder-visible")}else g(c,k,d)},j=function(a){var a=b(a),c=a.prop("id"),d=!(!a.prop("title")&&!a.attr("aria-labelledby"));!d&&c&&(d=!!b('label[for="'+c+'"]',a[0].form)[0]);d||(c||(c=b.webshims.getID(a)),d=!!b("label #"+c)[0]);return b(d?'<span class="placeholder-text"></span>':'<label for="'+c+'" class="placeholder-text"></label>')},l=function(){var d=
{text:1,search:1,url:1,email:1,password:1,tel:1};return{create:function(c){var d=b.data(c,"placeHolder");if(d)return d;d=b.data(c,"placeHolder",{});b(c).bind("focus.placeholder blur.placeholder",function(a){i(this,!1,!1,d,a.type);d.box["focus"==a.type?"addClass":"removeClass"]("placeholder-focused")});c.form&&b(c.form).bind("reset.placeholder",function(a){setTimeout(function(){i(c,!1,!1,d,a.type)},0)});if("password"==c.type||a){d.text=j(c);d.box=b(c).wrap('<span class="placeholder-box placeholder-box-'+
(c.nodeName||"").toLowerCase()+'" />').parent();d.text.insertAfter(c).bind("mousedown.placeholder",function(){i(this,!1,!1,d,"focus");try{setTimeout(function(){c.focus()},0)}catch(a){}return!1});b.each(["Left","Top"],function(a,f){var g=(parseInt(b.curCSS(c,"padding"+f),10)||0)+Math.max(parseInt(b.curCSS(c,"margin"+f),10)||0,0)+(parseInt(b.curCSS(c,"border"+f+"Width"),10)||0);d.text.css("padding"+f,g)});b.curCSS(c,"lineHeight");var f={width:b(c).width(),height:b(c).height()},h=b.curCSS(c,"float");
b.each(["lineHeight","fontSize","fontFamily","fontWeight"],function(a,f){var g=b.curCSS(c,f);d.text.css(f)!=g&&d.text.css(f,g)});f.width&&f.height&&d.text.css(f);"none"!==h&&d.box.addClass("placeholder-box-"+h)}else f=function(a){b(c).hasClass("placeholder-visible")&&(g(c,d,""),a&&"submit"==a.type&&setTimeout(function(){a.isDefaultPrevented()&&i(c,!1,!1,d)},9))},b(w).bind("beforeunload",f),d.box=b(c),c.form&&b(c.form).submit(f);return d},update:function(a,f){if(!d[b.prop(a,"type")]&&!b.nodeName(a,
"textarea"))c.warn("placeholder not allowed on type: "+b.prop(a,"type"));else{var g=l.create(a);g.text&&g.text.text(f);i(a,!1,f,g)}}}}();b.webshims.publicMethods={pHolder:l};f.forEach(function(a){c.defineNodeNameProperty(a,"placeholder",{attr:{set:function(a){c.contentAttr(this,"placeholder",a);l.update(this,a)},get:function(){return c.contentAttr(this,"placeholder")}},reflect:!0,initAttr:!0})});f.forEach(function(a){var d={},f;["attr","prop"].forEach(function(a){d[a]={set:function(d){var g=c.contentAttr(this,
"placeholder");b.removeData(this,"cachedValidity");var h=f[a]._supset.call(this,d);g&&"value"in this&&i(this,d,g);return h},get:function(){return b(this).hasClass("placeholder-visible")?"":f[a]._supget.call(this)}}});f=c.defineNodeNameProperty(a,"value",d)})}})()});
