// Title: Tigra Form Validator PRO
// URL: http://www.softcomplex.com/products/tigra_form_validator_pro/
// Version: 1.1
// Date: 12/30/2004 (mm/dd/yyyy)
// Notes: Registration needed to use this script legally. Visit official site for details.

var TV0=/^(\d{1,2})\-(\d{1,2})\-(\d{4})$/,TV1=/^(\d{1,2})\:(\d{1,2})\:(\d{1,2})$/,TV2={'alpha':/^[a-zA-Z\.\-]*$/,'alphanum':/^\w+$/,'unsigned':/^\d+$/,'integer':/^[\+\-]?\d*$/,'real':/^[\+\-]?\d*\.?\d*$/,'email':/^[\w-\.]+\@[\w\.-]+\.[a-z]{2,4}$/,'phone':/^[\d\.\s\-]+$/,'date':function(TV3){if(!TV0.test(TV3))return false;if(RegExp.$1>31||RegExp.$2>12)return false;var TV4=new Date(RegExp.$3,Number(RegExp.$2-1),RegExp.$1);if(TV4.getMonth()!=Number(RegExp.$2-1))return false;return true;},'time':function TV5(TV6){if(!TV1.test(TV6))return false;if(RegExp.$1>23||RegExp.$2>59||RegExp.$3>59)return false;return true;}};function TV7(){this.alert=0;this.alert_class=[];this.to_disable=[];this.messages={'setup':['No form name passed to validator construction routine','No array of "%form%" form fields passed to validator construction routine','Form "%form%" can not be found in this document','Can not find area for error message box (id="error_%form%")','Incomplete "%n%" form field descriptor entry. Attribute "%attr%" is missing','Can not find form field "%n%" in the form "%form%"','Can not find label tag (id="%t%")','Can not verify match. Field "%m%" was not found'],'fill':['"%l%" is a required field','"%v%" is not valid value for "%l%"','Value for "%l%" must be %mn% characters or more','Value for "%l%" must be no longer than %mx% characters','"%l%" must match "%ml%"'],'boxes':['<table cellpadding="0" cellspacing="0" border="0" width="100%">'+'<tr><td bgcolor="#CCCC33"><table cellpadding="15" cellspacing="1" border="0" width="100%">'+'<tr><td bgcolor="#FFFFCC" style="color: red;">%error%</td></tr>'+'</table></td></tr><tr><td height="10">&nbsp;</td></tr></table>','<table cellpadding="0" cellspacing="0" border="0" width="100%">'+'<tr><td bgcolor="#CCCC33"><table cellpadding="15" cellspacing="1" border="0" width="100%">'+'<tr><td bgcolor="#FFFFCC" style="color: green; font-weight: bold;">Submitting ...</td></tr>'+'</table></td></tr><tr><td height="10">&nbsp;</td></tr></table>'],'confirm':['The "%form%" form is to be submitted. Are you sure?']}}function validator(TV8,TV9,TVA){this.TVB=TVC;var TVD=new TV7();TVE(TVA,TVD);this.TVA=TVD;this.TVF=TVD.alert;this.TVG=this.TVF&4?function(TVH){alert(TVH);return false}:function(){return false};this.TVI=TVD.alert_class;if(!TV8)return this.TVG(this.TVB('setup',0));this.TV8=TV8;if(!TV9||typeof(TV9)!='object')return this.TVG(this.TVB('setup',1));this.TV9=TV9;this.TVJ=TVD.to_disable;this.exec=TVK;}function TVK(){var TVL=document.forms[this.TV8];if(!TVL)return this.TVG(this.TVB('setup',2));var TVM=TVN('error_'+this.TV8),TVO=document.body&&document.body.innerHTML;if((this.TVF&2)||(this.TVF&8)){if(TVO&&!TVM)return this.TVG(this.TVB('setup',3));if(TVO){TVM.style.display='none';TVM.innerHTML='';}}var TVP=['l'];for(var TVQ in this.TV9){this.TV9[TVQ]['n']=TVQ;for(TVR in TVP)if(!this.TV9[TVQ][TVP[TVR]])return this.TVG(this.TVB('setup',4,this.TV9[TVQ],{'attr':TVP[TVR]}));TVS=TVL.elements[TVQ];if(!TVS)return this.TVG(this.TVB('setup',5,this.TV9[TVQ]));this.TV9[TVQ].TVS=TVS;}if(TVO)for(var TVQ in this.TV9)if(this.TV9[TVQ]['t']){var TVT=this.TV9[TVQ]['t'],TVU=TVN(TVT);if(!TVU)return this.TVG(this.TVB('setup',6,this.TV9[TVQ]));this.TV9[TVQ].TVV=TVU;TVU.className=this.TVI[1];}for(var TVQ in this.TV9){TVS=this.TV9[TVQ].TVS;this.TV9[TVQ]['v']=null;if(TVS.value||TVS.checked)this.TV9[TVQ]['v']=TVS.value;else if(TVS.options)this.TV9[TVQ]['v']=TVS.options[TVS.selectedIndex].value;else if(TVS.length>0)for(var TVW=0;TVW<TVS.length;TVW++)if(TVS[TVW].checked){this.TV9[TVQ]['v']=TVS[TVW].value;break;}}var TVX=0,TVY,TVZ;for(var TVQ in this.TV9){TVZ=this.TV9[TVQ]['f']?(TV2[this.TV9[TVQ]['f']]?TV2[this.TV9[TVQ]['f']]:this.TV9[TVQ]['f']):null;this.TV9[TVQ].TV_=null;if(this.TV9[TVQ]['r']&&!this.TV9[TVQ]['v']){this.TV9[TVQ].TV_=1;TVX++;}else if(this.TV9[TVQ]['mn']&&String(this.TV9[TVQ]['v']).length<this.TV9[TVQ]['mn']){this.TV9[TVQ].TV_=3;TVX++;}else if(this.TV9[TVQ]['mx']&&String(this.TV9[TVQ]['v']).length>this.TV9[TVQ]['mx']){this.TV9[TVQ].TV_=4;TVX++;}else if(this.TV9[TVQ]['v']&&this.TV9[TVQ]['f']&&((typeof(TVZ)=='function'&&!TVZ(this.TV9[TVQ]['v']))||(typeof(TVZ)!='function'&&!TVZ.test(this.TV9[TVQ]['v'])))){this.TV9[TVQ].TV_=2;TVX++;}else if(this.TV9[TVQ]['m']){for(var TVa in this.TV9)if(TVa==this.TV9[TVQ]['m']){TVY=TVa;break;}if(TVY==null)return this.TVG(this.TVB('setup',7,this.TV9[TVQ]));if(this.TV9[TVY]['v']!=this.TV9[TVQ]['v']){this.TV9[TVQ]['ml']=this.TV9[TVY]['l'];this.TV9[TVQ].TV_=5;TVX++;}}}var TVb='',TVc='',TVd;if(TVX){for(var TVQ in this.TV9){var TVe=this.TV9[TVQ].TV_,TVf='';if(TVe)TVf=this.TVB('fill',TVe-1,this.TV9[TVQ]);if(TVf){if(!TVd)TVd=TVL.elements[TVQ];TVb+=TVf+'<br>';TVc+=TVf+"\n";if(TVO&&this.TVI&&this.TV9[TVQ].TVV)this.TV9[TVQ].TVV.className=this.TVI[0];}}TVb=this.TVB('boxes',0,{'error':TVb});if(typeof(this.TVF)!='function'){if(this.TVF&1)alert(TVc);if(TVO&&(this.TVF&2)){TVM.innerHTML=TVb;TVM.style.display='block';}if(TVd.focus&&TVd.type!='hidden')TVd.focus();return false;}}if(typeof(this.TVF)=='function')return this.TVF(TVc,TVb,TVM);else{if((this.TVF&16)&&!confirm(this.TVB('confirm',0)))return false;if(TVO&&(this.TVF&8)){TVM.innerHTML=this.TVB('boxes',1);TVM.style.display='block';}for(TVQ in this.TVJ){var TVg=TVN(this.TVJ[TVQ]);if(TVg&&TVg.disabled!=null)TVg.disabled=true;}}return true;}function TVE(TVh,TVi){for(var TVj in TVh)if(typeof(TVh[TVj])=='object'){if(typeof(TVi[TVj])!='object')alert("Type mismatch ("+TVj+"). Array in place of scalar.");TVE(TVh[TVj],TVi[TVj]);}else{if(typeof(TVi[TVj])=='object')alert("Type mismatch ("+TVj+"). Scalar in place of array.");TVi[TVj]=TVh[TVj];}}function TVC(TVk,TVW){var TVj=this.TVA.messages[TVk][TVW],TVl=2,TVm;for(;TVl<arguments.length;TVl++)for(TVm in arguments[TVl])TVj=TVj.replace('%'+TVm+'%',arguments[TVl][TVm]);TVj=TVj.replace('%form%',this.TV8);return TVj}function TVN(TVn){return(document.all?document.all[TVn]:(document.getElementById?document.getElementById(TVn):null));}