var regValidCharIllegals=/[\!\"\£\$\%\^\&\*\(\)\_\+\=\{\}\[\]\:\;\@\~\#\<\>\,\.\/\?\\]/;var regValidPostcode=/^[A-z][A-z]?[0-9][0-9][0-9]?[A-z][A-z]$/;var regValidEmailIllegals=/[\!\"\£\$\%\^\&\*\(\)\+\=\{\}\[\]\:\;\~\#\<\>\,\/\?\\\s]/;var regValidEmailFormat=/^.+@.+.[.].+$/;var regValidInteger=/\D/;var daysInMonth=new Array();daysInMonth[1]=31;daysInMonth[2]=29;daysInMonth[3]=31;daysInMonth[4]=30;daysInMonth[5]=31;daysInMonth[6]=30;daysInMonth[7]=31;daysInMonth[8]=31;daysInMonth[9]=30;daysInMonth[10]=31;daysInMonth[11]=30;daysInMonth[12]=31;function stripWhitespace(str){var whitespace=" \t\n\r";var returnString="";for(var i=0;i<str.length;i++){var c=str.charAt(i);if(whitespace.indexOf(c)==-1)returnString+=c;};return returnString;};function isValidChar(str){if(stripWhitespace(str).length==0){return true;};if(str.search(regValidCharIllegals)==-1){return true;};return false;};function isValidPostcode(str){if(stripWhitespace(str).length==0){return true;};if(regValidPostcode.test(stripWhitespace(str))){return true;};return false;};function isValidEmail(str){if(stripWhitespace(str).length==0){return true;};if(str.search(regValidEmailIllegals)==-1){return regValidEmailFormat.test(str);};return false;};function isValidInteger(strNumber){if(stripWhitespace(strNumber).length==0){return true;};if(strNumber.search(/\D/)==-1){return true;};return false;};function isValidMandatory(str){if(stripWhitespace(str).length==0){return false;};return true;};function isValidDaysInFebruary(year){if((year%4==0)&&((!(year%100==0))||(year%400==0))){return 29};return 28};function isValidDate(day,month,year){if(stripWhitespace(day+month+year).length==0){return true;};if(!isValidInteger(day+month+year)){return false;};if(year.length!=2&&year.length!=4){return false;};var intYear=parseInt(year);var intMonth=parseInt(month);var intDay=parseInt(day);if(day.length==2&&day.charAt(0)==0){intDay=day.charAt(1);};if(month.length==2&&month.charAt(0)==0){intMonth=month.charAt(1);};if((intYear<=0)||(intMonth<=0)||(intYear<=0)){return false;};if(intDay>daysInMonth[intMonth]||intMonth>12){return false;};if((intMonth==2)&&(intDay>isValidDaysInFebruary(intYear))){return false;};return true;};function isValidCreditCard(str){if(str.length>19||str.length==0){return false;};sum=0;mul=1;l=str.length;for(i=0;i<l;i++){digit=str.substring(l-i-1,l-i);tproduct=parseInt(digit,10)*mul;if(tproduct>=10){sum+=(tproduct%10)+1;}else{sum+=tproduct;};if(mul==1){mul++;}else{mul--;};};if((sum%10)==0){return(true);}else{return(false);};};
