enhanced $ function to accept the window handler too
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Tue, 28 May 2013 05:37:58 +0000 (07:37 +0200)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Tue, 28 May 2013 05:37:58 +0000 (07:37 +0200)
web/commons.js

index 7ba8b31..e6b5cb3 100644 (file)
@@ -52,9 +52,12 @@ var mlang_commons = { 'imgload_a' : { 'it' : 'Immagine caricate ',
                                                'en' : '(isolation)' } }
                     };
 
-function $(id) { return document.getElementById(id); }
-
-function $$(win, id) { return win.document.getElementById(id); }
+function $() {
+    if (arguments.length == 1)
+        return document.getElementById(arguments[0]);
+    else
+        return (arguments[0]).document.getElementById((arguments[1]));
+}
 
 function dec2hex(d, padding)
 {