if(!window.ccs){window.ccs={};} if(!ccs.validation){ccs.validation={};} ccs.Validation=function(){var self;function constructorFn(){self=this;} constructorFn.prototype.isPhoneNumber=function(input){var ValidChars="0123456789.-() ";var IsNumber=true;var Char;for(i=0;imaxRows){return false;} for(i=0;imaxCharInARow){return false;}} return true;} constructorFn.prototype.validateDatePassed=function(year,month,day){var tempDate=new Date(year,month,day);var currentDate=new Date();if(tempDate.getTime()>currentDate.getTime()){return false;} return true;} constructorFn.prototype.isDateInFuture=function(popupDate){var parts=popupDate.split("-");var year=parts[2];var month=parts[1];var day=parts[0];return!self.validateDatePassed(year,month*1-1,day);} constructorFn.prototype.validateDate=function(year,month,day){if((year+"").length==0||(month+"").length==0||(day+"").length==0){return false;}else{var tempDate=new Date(year,month,day);if(tempDate.getDate()!=(day*1)){return false;}} return true;} constructorFn.prototype.validateSAIDnumber=function(idnumber){if(isNaN(idnumber)||(idnumber.length!=13)){return false;} var tempDate=new Date(idnumber.substring(0,2),idnumber.substring(2,4)-1,idnumber.substring(4,6));if(!((tempDate.getYear()==idnumber.substring(0,2))&&(tempDate.getMonth()==idnumber.substring(2,4)-1)&&(tempDate.getDate()==idnumber.substring(4,6)))){return false;} var tempTotal=0;var checkSum=0;var multiplier=1;for(var i=0;i<13;++i){tempTotal=parseInt(idnumber.charAt(i))*multiplier;if(tempTotal>9){tempTotal=parseInt(tempTotal.toString().charAt(0))+parseInt(tempTotal.toString().charAt(1));} checkSum=checkSum+tempTotal;multiplier=(multiplier%2==0)?1:2;} if((checkSum%10)==0){return true};return false;} constructorFn.prototype.isEmail=function(input){var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i if(input.length<60&&filter.test(input)) return true;else{return false;}} constructorFn.prototype.isCheckBoxTicked=function(input){if(input.checked){return true;}else{return false;}} constructorFn.prototype.isNotBlank=function(input){input=input.replace(/ /g,"");if(input==""){return false;}else{return true;}} constructorFn.prototype.exceedsOccurenceLimit=function(input,substring,limit){var items=input.split(substring);if(items.length-1<=limit){return false;}else{return true;}} constructorFn.prototype.occursAtExtremes=function(input,character){if(input.charAt(0)==character||input.charAt(input.length-1)==character){return true;}else{return false;}} constructorFn.prototype.limitText=function(limitField,limitCount,limitNum){if(limitField.value.length>limitNum){limitField.value=limitField.value.substring(0,limitNum);}else{if(limitCount!=null){limitCount.value=limitNum-limitField.value.length;}}} return new constructorFn();} ccs.validation=new ccs.Validation();