/*
 *  UPDATED: 02.07.08
 *	VERSION: 1.5
 *
 *  This class is used for unabotrusive form field validation
 *  every input to be validated must start with a class name of validate followed by "|" then whether it is required then "|" validation type
 *  VALIDATION TYPES: 
 *		date  					Matches: [1/1/2006], [1-1-2006], [1.1.2006]
 *		zipcode (5 or 9 digit)	Matches: [12345], [12345-6789], [123456789]
 *		numeric					Matches: [5,000], [-5,000], [100.044]
 *		email					Matches: any valid email
 *		phone (10 digit)		Matches: (800)-123-1234, 800.123.1234, 800-123-1234
 *		notfirst (for selects)	Matches: a select list with a selectedIndex > 1
 *		checked					Matches: a checkbox or radio that is checked
 *		lengthN (N=any number)	Matches: a lengthe less than the given number
 
 * 	OPTIONS:
 *		errBox - id of the location for the errors, if not given then the errors are shown in an ALERT
 *		className - the CSS class that will be applied to the errBox
 *		overlay - the path to the image to display on the overlay **requires the dialog.js library**
 *		labelColor - the font color of the label for the field that has an error
 *		inputColor - the background color for the field that has an error
 *		custom - a custom function that is called when the form is submitted before it checks the required fields
 *  
 *  EXAMPLE: 
 *  var myForm = new WSC.Validator('form1', {labelColor: '#FF0000', inputColor: '#FEC7C7', errBox: 'msgBox', overlay: 'path/to/image'});
 *  
 *  <input type="text" name="var1" class='validate|yes|date' value="12/12/2006" size="12" maxlength="10" />
 *  
 *  
 * ------------------------------------------------------------------------------------------------ */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7(D 13.v==="E"){6 v={}}(8($){v.14=8(g){6 h=$.15({K:F,x:F,G:\'16\',L:\'#17\',M:\'#18\',H:F},19[1]||{});z.q=[];6 i=z;6 j=[];6 k=8(){6 f=$(\'#\'+h.K);7(f.r>0){f.1a(h.G).N()}i.q=[];$(j).A({O:\'\'});7(D P!=\'E\'){P.1b()}7(h.H){h.H()}$(\'[Q*="R"]\').1c(8(){6 a=$(z);a.A({T:\'\'});6 b=a.I(\'Q\').1d(/R[\\S]*/)[0].1e(\'|\');6 c=(b[1]==\'1f\')?J:B;6 d=b[2];6 e=(c||z.U!==\'\')?l(a,d):B;7(e){m(a);n(a);i.q.V(a.I(\'1g\'))}});7(i.q.r>0){7(f){1h(0,0);f.1i(h.G).N(i.q.W(\'<1j>\'))}X{1k(i.q.W(\'\\n\'))}t B}X{7(h.x&&D v.Y!="E"){v.Y(h.x,{1l:\'1m\'})}t J}};6 l=8(a,b){6 c;6 d=a[0].U;7(!b||b===\'\'){t(d===\'\')}b=b.1n();7(/^r/.u(b)){t(d.r<1o(b.1p(\'r\',\'\'),10))}6 e;1q(b){p\'1r\':e=/^([0]?[1-9]|[1][0-2])[.\\/-]([0]?[1-9]|[1|2][0-9]|[3][0|1])[.\\/-]([0-9]{4}|[0-9]{2})$/;c=!e.u(d);o;p\'1s\':e=/^\\d{5}((-|\\s)?\\d{4})?$/;c=(!e.u(d));o;p\'1t\':e=/^(\\d|-)?(\\d|,)*\\.?\\d*$/;c=(!e.u(d));o;p\'1u\':e=/^([0-C-y-Z]([-.\\w]*[0-C-y-Z])*@([0-C-y-Z][-\\w]*[0-C-y-Z]\\.)+[a-y-Z]{2,9})$/;c=(!e.u(d));o;p\'1v\':e=/^(\\(?\\d\\d\\d\\)?)?( |-|\\.)?\\d\\d\\d( |-|\\.)?\\d{4,4}(( |-|\\.)?[1w\\.]+ ?\\d+)?$/;c=(!e.u(d));o;p\'1x\':c=(a[0].1y===0)?J:B;o;p\'11\':c=(!a[0].11);o;1z:c=(d===\'\');o}t c};6 m=8(a){6 b=a.1A(\'12\');7(b.r===0){b=$(\'12[1B="\'+a.I(\'1C\')+\'"]\')}7(b.1D>0){b.A({O:h.L});j.V(b)}t};6 n=8(a){a.A({T:h.M})};$(8(){7(h.x){6 a=1E 1F();a.1G=h.x}$(\'#\'+g).1H(k)})}})(1I);',62,107,'||||||var|if|function||||||||||||||||break|case|errors|length||return|test|WSC||overlay|zA|this|css|false|9a|typeof|undefined|null|className|custom|attr|true|errBox|labelColor|inputColor|html|color|tinyMCE|class|validate||backgroundColor|value|push|join|else|Dialog|||checked|label|window|Validator|extend|error|FF0000|FEC7C7|arguments|removeClass|triggerSave|each|match|split|yes|title|scroll|addClass|br|alert|type|image|toLowerCase|parseInt|replace|switch|date|zipcode|numeric|email|phone|ext|notfirst|selectedIndex|default|parent|for|name|lenght|new|Image|src|submit|jQuery'.split('|'),0,{}))
