code: function(dec) {
           var r = parseInt(dec,10).toString(16);
           if (r.length == 1) r = "0"+r;
           return r;
        }
docs: Convert integer (int or string) to hexadecimal (2 chars) ex: "214" -> "d6"