thou_separator=','; deci_point='.'; function nccurrency_display_format(amount) { amount=amount.toString().replace(/\./,deci_point); return(amount); } function nccurrency_calculation_format(value) { var pattern_sp=/,/g; var pattern_pt=/\./g; value=value.toString().replace(pattern_sp,""); //remove thousand separator if any value=value.toString().replace(pattern_pt,"."); //restore decimal point return value; } function ncis_empty(ncstr) { ncnew_str=ncstr.replace(/^\s+|\s+$/g,""); if(ncnew_str.length>0) return (false); else return (true); } function seo_string(field_name,str,dirlist,dirchk,ncwhere) ///ncwhere =1 mean front else back end { dir_pat=RegExp("^("+dirlist.replace(/,/g,"|")+")$","i"); dir_str=dirlist.replace(/,/g,", "); if(str.match(/[\.\/\?& ]/)) if(ncwhere==1) return (field_name+" must not contain \.\/\?& characters"); else return (field_name+" must not contain \.\/\?& characters"); else if(dirchk==true && str.match(dir_pat) ) if(ncwhere==1) return (field_name+" value is not allowed. Try appending /removing some characters to the value"); else return (field_name+" value is not allowed. Try appending /removing some characters to the value"); else return false; } function seo_dircompare(arr) { for(i=0;i255) { if(ncwhere==1) alert("Destination IP address is invalid!"); else alert("Destination IP address is invalid!"); return false } } return true } var domainArray=domain.match(domainPat) if (domainArray==null) { if(ncwhere==1) alert("The domain name doesn't seem to be valid."); else alert("The domain name doesn't seem to be valid."); return false } var atomPat=new RegExp(atom,"g") var domArr=domain.match(atomPat) var len=domArr.length if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>4) { if(ncwhere==1) alert("The address must end in a valid domain, or two letter country."); else alert("The address must end in a valid domain, or two letter country."); return false } if (len<2) { if(ncwhere==1) var errStr="This address is missing a hostname!" else var errStr="This address is missing a hostname!" alert(errStr) return false } return true; }