/* Copyright 2009 Google Inc.  All Rights Reserved. */ (function() { var f=true,g=false;window.goog=window.goog||{};window.goog.forms=window.goog.forms||{};
window.goog.forms.Validation=function(a){this.b=a||this.b;this.validationExp={};this.validationExp.alpha=RegExp("^[a-zA-Z\\u00c0-\\u00ff]+$");this.validationExp.alphanum=RegExp("^[a-zA-Z0-9\\u00c0-\\u00ff]+$");this.validationExp.domain=RegExp("^(?:[a-zA-Z0-9_-]*.)*(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?)+.(?:"+this.B+")$");this.validationExp["email-local"]=/^.{1,255}$/;this.validationExp.num=/^\d+$/;this.validationExp.phone=/^[0-9.()+ -]{10,25}$/;this.validationExp.url=/^https?:\/\/.+$/;this.fileTypes.audio=
["mp3","mp4","flac","ogg","wma","wav"];this.fileTypes.image=["bmp","gif","jpg","jpeg","png","tif","raw"];this.fileTypes.pdf=["pdf"];this.fileTypes.text=["txt"];this.fileTypes.html=["html","htm"];this.fileTypes.video=["mov","mpeg","mpg","avi","ogm","wmv"]};window.goog.forms.Validation.prototype.anchor="";window.goog.forms.Validation.prototype.errorTag=null;window.goog.forms.Validation.prototype.errorClass="error";window.goog.forms.Validation.prototype.errorDisplay="block";
window.goog.forms.Validation.prototype.b=null;window.goog.forms.Validation.prototype.jump=g;window.goog.forms.Validation.prototype.multiClass="m";window.goog.forms.Validation.prototype.prefix="v-";window.goog.forms.Validation.prototype.suffix="-err";window.goog.forms.Validation.prototype.fileTypes={};
window.goog.forms.Validation.prototype.isValid=function(a){this.b=a||this.b;this.hideAllErrors();a=f;for(var b="",c="",d=this.g([this.errorClass,this.prefix],this.b,this.errorTag),e=0,h=d.length;e<h;e++){var j=g,i=d[e],k=this.h(i.id,i.className);if(k&&k!=c){if(!this.q(k,i.className)){b=a?i.id:b;a=g;j=f;c=k}this.f(i,j)}}if(!a){if(this.jump)window.location=this.anchor.length?this.anchor:"#"+b;this.r(this.a(this.h(b)))}return a};
window.goog.forms.Validation.prototype.hideAllErrors=function(){for(var a=this.g([this.errorClass,this.prefix],this.b,this.errorTag),b=0,c=a.length;b<c;b++)this.f(a[b],g)};window.goog.forms.Validation.prototype.r=function(a){try{a.focus()}catch(b){a[0].focus()}};window.goog.forms.Validation.prototype.h=function(a,b){b=b||"";for(var c=a.substring(0,a.length-this.suffix.length),d=b.split(" "),e=this.prefix+this.multiClass,h=0,j=d.length;h<j;h++)if(d[h]==e){c=c.substring(0,c.lastIndexOf("-"));break}return c};
window.goog.forms.Validation.prototype.A=function(a){a=a.indexOf(this.prefix)>=0?a.substring(this.prefix.length):a;a=a.split("-");for(var b={method:"",args:[]},c=[],d=0,e=a.length;d<e;d++)a[d].length&&c.push(a[d]);switch(c.length){case 0:b.method="";break;case 1:b.method=c[0];break;default:b.method=c[0];d=1;for(e=c.length;d<e;d++)b.args.push(c[d])}return b};
window.goog.forms.Validation.prototype.j=function(a,b){for(var c=a.split(" "),d,e=0;a=c[e];e++){d=f;if(a.substring(0,this.prefix.length)===this.prefix){a=this.A(a);switch(a.method){case "email":d=this.u(b);break;case "file":case "upload":if(b.charAt(b.length-1)==='"')b=b.substring(0,b.length-2);d=this.v(b,a.args[0]);break;case "len":a.args.length===1&&a.args.push(null);d=this.w(b,a.args[0],a.args[1]);break;case "match":case "eq":case "equal":d=this.t(b,this.a(a.args[0]).value);break;case "required":case "error":case this.errorClass:d=
this.d(b);break;case this.multiClass:break;default:d=this.e(b,a.method)}}if(!d)return g}return f};window.goog.forms.Validation.prototype.t=function(a,b){return a===b};window.goog.forms.Validation.prototype.u=function(a){if(a.indexOf("@")===-1)return g;var b=a.lastIndexOf("@");if(!this.e(a.substring(b+1),"domain"))return g;a=a.substring(0,b);return this.e(a,"email-local")};window.goog.forms.Validation.prototype.w=function(a,b,c){if(!c)return a.length>=b;return b<=c&&a.length>=b&&a.length<=c};
window.goog.forms.Validation.prototype.e=function(a,b){return this.validationExp[b].test(a)};window.goog.forms.Validation.prototype.v=function(a,b){a=this.s(a).toLowerCase();b=this.fileTypes[b];for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return f;return g};window.goog.forms.Validation.prototype.s=function(a){return a.substring(a.lastIndexOf(".")+1)};
window.goog.forms.Validation.prototype.q=function(a,b){var c=this.a(a).type;c=typeof c==="undefined"?this.a(a)[0].type:c;switch(c){case "checkbox":return this.k(a);case "text":case "password":return this.p(a,b);case "select-one":case "select-multiple":return this.n(a);case "textarea":return this.o(a);case "file":return this.l(a,b);case "radio":return this.m(a);default:return f}};window.goog.forms.Validation.prototype.c=function(a){return a.disabled=="disabled"||a.disabled};
window.goog.forms.Validation.prototype.i=function(a){return a.z==="readonly"||a.z};window.goog.forms.Validation.prototype.d=function(a){return!!a.length};window.goog.forms.Validation.prototype.l=function(a,b){var c=this.a(a);return this.c(c)||this.j(b,c.value)};window.goog.forms.Validation.prototype.k=function(a){a=this.a(a);if(a.length){for(var b=0,c=a.length;b<c;b++)if(!this.c(a[b])&&a[b].checked)return f;return g}else return this.c(a)||a.checked};
window.goog.forms.Validation.prototype.m=function(a){a=this.a(a);for(var b=0,c=a.length;b<c;b++)if(a[b].checked)return f;return g};window.goog.forms.Validation.prototype.p=function(a,b){var c=this.a(a);return this.c(c)||this.i(c)||this.j(b,c.value)};window.goog.forms.Validation.prototype.n=function(a){a=this.a(a);return this.c(a)||this.d(a.options[a.selectedIndex].value)};window.goog.forms.Validation.prototype.o=function(a){a=this.a(a);return this.c(a)||this.i(a)||this.d(a.value)};
window.goog.forms.Validation.prototype.a=function(a){if(this.b.elements[a])return this.b.elements[a];else if(this.b.elements[a+"[]"])return this.b.elements[a+"[]"]};window.goog.forms.Validation.prototype.f=function(a,b){a.style.display=b?this.errorDisplay:"none"};
window.goog.forms.Validation.prototype.g=function(a,b,c){b=b||document;c=c||"*";a=typeof a==="string"?a:a.join("|");var d=[];b=b.getElementsByTagName(c);a=RegExp("^[a-zA-Z0-9 -]*"+a+"[a-zA-Z0-9 -]*$");c=0;for(var e=b.length;c<e;c++)a.test(b[c].className)&&d.push(b[c]);return d};window.goog.forms.Validation.prototype.B="ac|ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|asia|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cat|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|info|int|io|iq|ir|is|it|je|jm|jo|jobs|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mo|mobi|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|travel|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn|ye|yt|yu|za|zm|zw"; })();

