// seek element by id if there is no elemnt with given name
objElement = document.getElementsByName(id)[0] || document.getElementById(id);
if(cmd=='as') {
// seek element by id if there is no elemnt with given name
objElement = document.getElementsByName(id)[0] || document.getElementById(id);
if(cmd=='as') {
if (max) // strip trailing 0
cents = cents.toString().replace(/0+$/,'');
if (max) // strip trailing 0
cents = cents.toString().replace(/0+$/,'');
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+user.ts+
num.substring(num.length-(4*i+3));
num = ((sign)?'':'-') + num;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+user.ts+
num.substring(num.length-(4*i+3));
num = ((sign)?'':'-') + num;