Merged changes up to version 2.3.4 into unstable.
[fa-stable.git] / js / utils.js
index 9b1b1ac479202cbb08e91cf391aa09298c97a2c9..51a7a491bfeedd96f7d9da8a12c4a560ba7358b5 100644 (file)
@@ -219,12 +219,11 @@ function price_format(post, num, dec, label, color) {
        num = Math.floor(num*decsize+0.50000000001);
        cents = num%decsize;
        num = Math.floor(num/decsize).toString();
+       for( i=cents.toString().length; i<dec; i++){
+               cents = "0"+cents;
+       }
        if (max) // strip trailing 0
                cents = cents.toString().replace(/0+$/,'');
-       else
-               for( i=cents.toString().length; i<dec; i++){
-                       cents = cents + "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));
@@ -296,7 +295,8 @@ function move_focus(dir, e0, neighbours)
        for(var i=0; i<neighbours.length; i++) {
                var e = neighbours[i];
                var p = element_pos(e);
-               if (p!=null && (e.className=='menu_option' || e.className=='printlink')) {
+               if (p!=null && (e.className=='menu_option' || e.className=='printlink'
+                                || e.className == 'repclass_link' || e.className == 'repopts_link')) {
                        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);