| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- function popup(poppage,popwidth,popheight){
- var popwd=window.open(poppage,'erp','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+popwidth+',height='+popheight+'');
- popwd.focus()
- }
- function popupstandard(poppage){
- var popwd=window.open(poppage,'erp','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=800,height=600');
- popwd.focus()
- }
- function mOvr(src) {
- src.bgColor = "#DEEFFF";
- }
- function mOut(src, col) {
- if (col.indexOf("#") == -1) {
- src.bgColor = "#"+col;
- } else {
- src.bgColor = colr;
- }
- }
- function trim(stringToTrim) {
- return stringToTrim.replace(/^\s+|\s+$/g,"");
- }
- function IsNumeric(ObjVal){
- //var NumericRegExp = "^[0-9.]$";
- var NumericRegExp = /^(-)?(\d*)(\.?)(\d*)$/
- var regex = new RegExp(NumericRegExp);
- return regex.test(ObjVal);
- }
- function formatCurrency(num) {
- num = num.toString().replace(/\$|\,/g,'');
- if (isNaN(num))
- num = "0";
- sign = (num == (num = Math.abs(num)));
- num = Math.floor(num*100+0.50000000001);
- cents = num%100;
- num = Math.floor(num/100).toString();
- if (cents<10)
- cents = "0" + cents;
- for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
- num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));
- //return (((sign)?'':'-') + '$' + num + '.' + cents);
- return (((sign)?'':'-') + num + '.' + cents);
- }
- function doDisable(frm, objectType) {
- if (frm) {
- var el = frm.getElementsByTagName("input");
- for (var i=0; i<el.length; i++) {
- if (el[i] && el[i].type.toLowerCase() == objectType.toLowerCase()) {
- el[i].disabled = true;
- }
- }
- }
- }
- function doEnable(frm, objectType) {
- if (frm) {
- var el = frm.getElementsByTagName("input");
- for (var i=0; i<el.length; i++) {
- if (el[i] && el[i].type.toLowerCase() == objectType.toLowerCase()) {
- el[i].disabled = false;
- }
- }
- }
- }
- function checkLength(field, maxChars) {
- if (field) {
- if (field.value.length >= maxChars) {
- field.value = field.value.substring(0, maxChars);
- //event.returnValue = false;
- //return false;
- }
- var label = document.getElementById("_" + field.name);
- if (label) {
- label.innerHTML = maxChars - field.value.length;
- }
- }
- }
- /*
- function maxLengthPaste(field, maxChars) {
- event.returnValue = false;
- if ((field.value.length + window.clipboardData.getData("Text").length) > maxChars) {
- return false;
- }
- event.returnValue=true;
- }
- */
|