// 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;
if (((dir==40) && (p.y>p0.y)) || (dir==38 && (p.y<p0.y))
|| ((dir==37) && (p.x<p0.x)) || ((dir==39 && (p.x>p0.x)))) {
var l1 = (p.y-p0.y)*(p.y-p0.y)+(p.x-p0.x)*(p.x-p0.x);
if (((dir==40) && (p.y>p0.y)) || (dir==38 && (p.y<p0.y))
|| ((dir==37) && (p.x<p0.x)) || ((dir==39 && (p.x>p0.x)))) {
var l1 = (p.y-p0.y)*(p.y-p0.y)+(p.x-p0.x)*(p.x-p0.x);