DHTML progress bar for glacial rate adding and editing, closes: Bug#1100
[freeside.git] / httemplate / elements / qlib / control.js
diff --git a/httemplate/elements/qlib/control.js b/httemplate/elements/qlib/control.js
new file mode 100644 (file)
index 0000000..f50206e
--- /dev/null
@@ -0,0 +1,51 @@
+/**\r
+ * QLIB 1.0 Base Abstract Control\r
+ * Copyright (C) 2002 2003, Quazzle.com Serge Dolgov\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * http://qlib.quazzle.com\r
+ */\r
+\r
+function QControl_init(parent, name) {\r
+    this.parent = parent || self;\r
+    this.window = (parent && parent.window) || self;\r
+    this.document = (parent && parent.document) || self.document;\r
+    this.name = (parent && parent.name) ? (parent.name + "." + name) : ("self." + name);\r
+    this.id = "Q";\r
+    var h = this.hash(this.name);\r
+    for (var j=0; j<8; j++) {\r
+        this.id += QControl.HEXTABLE.charAt(h & 15);\r
+        h >>>= 4;\r
+    }\r
+}\r
+\r
+function QControl_hash(str) {\r
+    var h = 0;\r
+    if (str) {\r
+        for (var j=str.length-1; j>=0; j--) {\r
+            h ^= QControl.ANTABLE.indexOf(str.charAt(j)) + 1;\r
+            for (var i=0; i<3; i++) {\r
+                var m = (h = h<<7 | h>>>25) & 150994944;\r
+                h ^= m ? (m == 150994944 ? 1 : 0) : 1;\r
+            }\r
+        }\r
+    }\r
+    return h;\r
+}\r
+\r
+function QControl_nop() {\r
+}\r
+\r
+function QControl() {\r
+    this.init = QControl_init;\r
+    this.hash = QControl_hash;\r
+    this.window = self;\r
+    this.document = self.document;\r
+    this.tag = null;\r
+}\r
+QControl.ANTABLE  = "w5Q2KkFts3deLIPg8Nynu_JAUBZ9YxmH1XW47oDpa6lcjMRfi0CrhbGSOTvqzEV";\r
+QControl.HEXTABLE = "0123456789ABCDEF";\r
+QControl.nop = QControl_nop;\r
+QControl.event = QControl_nop;\r