function RES_FRM(_1){
this.sID=_1;
this.asVars=new Array();
this.arVRule=new Array();
this.asVText=new Array();
this.iColCnt=0;
}
function RES_FRM_addField(_2,_3,_4){
this.asVars[this.iColCnt]=_2;
this.arVRule[this.iColCnt]=_3;
this.asVText[this.iColCnt]=_4;
this.iColCnt++;
}
function RES_FRM_validate(){
var _5,bProceed=true;
for(var i in this.asVars){
_5=document.getElementById(this.asVars[i]);
if(!this._validateField(_5)){
bProceed=false;
}
}
if(!this._validateLogic()){
bProceed=false;
}
if(!bProceed){
alert("Invalid inputs detected, please correct them before submission.");
}
return bProceed;
}
function RES_FRM__validateField(_7){
var _8=_7.id;
var _9=_7.value;
var _a=true;
var i,j;
var _c=/^(\s+)?([.\S]?)(\s+)?$/;
var _d;
j=Array_search(_8,this.asVars);
var _e=this.arVRule[j];
if(!_e.test(_9.replace(_c,"$2"))){
_d=this.asVText[j];
_7.setAttribute("title",_d);
setAttribClass(_7,"error");
_a=false;
}else{
_7.removeAttribute("title");
unsetAttribClass(_7);
_a=true;
}
return _a;
}
function RES_FRM_validateImage(_f){
var _10=/(.+)[\/\\]([^\/\\]+)$/;
var _11=/(.+)\.([\w\d]+)$/;
var _12=_f.getAttribute("id");
var sFN=_f.value.replace(_10,"$2");
var sFX=sFN.replace(_11,"$2").toLowerCase();
switch(sFX){
case "jpg":
break;
default:
alert("It appears that you have selected an invalid file type for upload.\nOnly JPG images allowed!");
_f.value="";
break;
}
}
function RES_FRM__validateLogic(){
return true;
}
RES_FRM.prototype.addField=RES_FRM_addField;
RES_FRM.prototype.validate=RES_FRM_validate;
RES_FRM.prototype._validateField=RES_FRM__validateField;
RES_FRM.prototype._validateLogic=RES_FRM__validateLogic;
RES_FRM.prototype.validateImage=RES_FRM_validateImage;

