2 * QLIB 1.0 Base Abstract Control
\r
3 * Copyright (C) 2002 2003, Quazzle.com Serge Dolgov
\r
4 * This program is free software; you can redistribute it and/or
\r
5 * modify it under the terms of the GNU General Public License
\r
6 * as published by the Free Software Foundation; either version 2
\r
7 * of the License, or (at your option) any later version.
\r
8 * http://qlib.quazzle.com
\r
11 function QControl_init(parent, name) {
\r
12 this.parent = parent || self;
\r
13 this.window = (parent && parent.window) || self;
\r
14 this.document = (parent && parent.document) || self.document;
\r
15 this.name = (parent && parent.name) ? (parent.name + "." + name) : ("self." + name);
\r
17 var h = this.hash(this.name);
\r
18 for (var j=0; j<8; j++) {
\r
19 this.id += QControl.HEXTABLE.charAt(h & 15);
\r
24 function QControl_hash(str) {
\r
27 for (var j=str.length-1; j>=0; j--) {
\r
28 h ^= QControl.ANTABLE.indexOf(str.charAt(j)) + 1;
\r
29 for (var i=0; i<3; i++) {
\r
30 var m = (h = h<<7 | h>>>25) & 150994944;
\r
31 h ^= m ? (m == 150994944 ? 1 : 0) : 1;
\r
38 function QControl_nop() {
\r
41 function QControl() {
\r
42 this.init = QControl_init;
\r
43 this.hash = QControl_hash;
\r
45 this.document = self.document;
\r
48 QControl.ANTABLE = "w5Q2KkFts3deLIPg8Nynu_JAUBZ9YxmH1XW47oDpa6lcjMRfi0CrhbGSOTvqzEV";
\r
49 QControl.HEXTABLE = "0123456789ABCDEF";
\r
50 QControl.nop = QControl_nop;
\r
51 QControl.event = QControl_nop;
\r