--- /dev/null
+/**\r
+ * QLIB 1.0 Text Label\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 QLabel_set_ie(value) {\r
+ this.label.innerText = (this.value = value) || "\xA0";\r
+}\r
+\r
+function QLabel_set_dom2(value) {\r
+ with (this.label) {\r
+ replaceChild(this.document.createTextNode((this.value = value) || "\xA0"), firstChild);\r
+ }\r
+}\r
+\r
+function QLabel_set_ns4(value) {\r
+ this.value = value || "";\r
+ with (this) {\r
+ document.open();\r
+ document.write('<div class="qlabel">' + (clickable ? '<a href="#" title="' + tooltip + '" onClick="return ' +\r
+ name + '.doEvent()" onMouseOut="window.top.status=\'\'" onMouseOver="window.top.status=' + name +\r
+ '.tooltip;return true">' + value + '</a>' : value) + '</div>');\r
+ document.close();\r
+ }\r
+}\r
+\r
+function QLabel_doEvent() {\r
+ this.onClick(this.value, this.tag);\r
+ return false;\r
+}\r
+\r
+function QLabel(parent, name, value, clickable, tooltip) {\r
+ this.init(parent, name);\r
+ this.value = value || "";\r
+ this.clickable = clickable || false;\r
+ this.tooltip = tooltip || "";\r
+ this.doEvent = QLabel_doEvent;\r
+ this.onClick = QControl.event;\r
+ with (this) {\r
+ if (document.getElementById || document.all) {\r
+ document.write(clickable ? '<div class="qlabel" unselectable="on"><a id="' + id + '" href="#" title="' +\r
+ tooltip + '" onClick="return ' + name + '.doEvent()" onMouseOver="window.top.status=' + name +\r
+ '.tooltip;return true" onMouseOut="window.top.status=\'\'" hidefocus="true" unselectable="on">' +\r
+ (value || ' ') + '</a></div>' : '<div id="' + id + '" class="qlabel" unselectable="on">' +\r
+ (value || ' ') + '</div>');\r
+ this.label = document.getElementById ? document.getElementById(id) :\r
+ (document.all.item ? document.all.item(id) : document.all[id]);\r
+ this.set = (label && (label.innerText ? QLabel_set_ie :\r
+ (label.replaceChild && QLabel_set_dom2))) || QControl.nop;\r
+ } else if (document.layers) {\r
+ var suffix = "";\r
+ for (var j=value.length; j<QLabel.TEXTQUOTA; j++) suffix += " ";\r
+ document.write('<div><ilayer id="i' + id + '"><layer id="' + id + '"><div class="qlabel">' +\r
+ (clickable ? '<a href="#" title="' + tooltip + '" onClick="return ' + name +\r
+ '.doEvent()" onMouseOver="window.top.status=' + name +\r
+ '.tooltip;return true" onMouseOut="window.top.status=\'\'">' + value + suffix + '</a>' :\r
+ value + suffix) + '</div></layer></ilayer></div>');\r
+ this.label = (this.label = document.layers["i" + id]) && label.document.layers[id];\r
+ this.document = label && label.document;\r
+ this.set = (label && document) ? QLabel_set_ns4 : QControl.nop;\r
+ } else {\r
+ document.write("Object is not supported");\r
+ }\r
+ }\r
+}\r
+QLabel.prototype = new QControl();\r
+QLabel.TEXTQUOTA = 50;\r