/* Copyright 2009 Google Inc.  All Rights Reserved. */ (function() { 
var g=false,h=true;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=new RegExp("^[a-zA-Z\\u00c0-\\u00ff]+$");this.validationExp.alphanum=new RegExp("^[a-zA-Z0-9\\u00c0-\\u00ff]+$");this.validationExp.domain=new 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();var b=h,c="",d="",e=this.g([this.errorClass,this.prefix],this.b,this.errorTag),f=0,i=e.length;for(;f<i;f++){var k=g,j=e[f],l=this.h(j.id,j.className);if(l&&l!=d){if(!this.q(l,j.className)){c=b?j.id:c;b=g;k=h;d=l}this.f(j,k)}}if(!b){if(this.jump)window.location=this.anchor.length?this.anchor:"#"+c;this.r(this.a(this.h(c)))}return b};
window.goog.forms.Validation.prototype.hideAllErrors=function(){var a=this.g([this.errorClass,this.prefix],this.b,this.errorTag),b=0,c=a.length;for(;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||"";var c=a.substring(0,a.length-this.suffix.length),d=b.split(" "),e=this.prefix+this.multiClass,f=0,i=d.length;for(;f<i;f++)if(d[f]==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;var b=a.split("-"),c={method:"",args:[]},d=[],e=0,f=b.length;for(;e<f;e++)b[e].length&&d.push(b[e]);switch(d.length){case 0:c.method="";break;case 1:c.method=d[0];break;default:c.method=d[0];var e=1,f=d.length;for(;e<f;e++)c.args.push(d[e]);break}return c};
window.goog.forms.Validation.prototype.j=function(a,b){var c=a.split(" "),d,e=0,a;for(;a=c[e];e++){d=h;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);break}}if(!d)return g}return h};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;var c=a.substring(0,b);return this.e(c,"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];var c=0,d=b.length;for(;c<d;c++)if(b[c]===a)return h;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);case "button":case "hidden":case "image":case "reset":case "submit":default:return h}};
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){var b=this.a(a);if(b.length){var c=0,d=b.length;for(;c<d;c++)if(!this.c(b[c])&&b[c].checked)return h;return g}else return this.c(b)||b.checked};window.goog.forms.Validation.prototype.m=function(a){var b=this.a(a),c=0,d=b.length;for(;c<d;c++)if(b[c].checked)return h;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){var b=this.a(a);return this.c(b)||this.d(b.options[b.selectedIndex].value)};window.goog.forms.Validation.prototype.o=function(a){var b=this.a(a);return this.c(b)||this.i(b)||this.d(b.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=[],e=b.getElementsByTagName(c),f=new RegExp("^[a-zA-Z0-9 -]*"+a+"[a-zA-Z0-9 -]*$"),i=0,k=e.length;for(;i<k;i++)f.test(e[i].className)&&d.push(e[i]);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";
 })();
