return l.join("");
}
+
+qwebirc.util.importJS = function(name, watchFor, onload) {
+ var script = document.createElement("script");
+ script.type = "text/javascript";
+ script.src = name;
+
+ if(Browser.Engine.trident) {
+ /* HORRID */
+ var checkFn = function() {
+ if(eval("typeof " + watchFor) != "undefined") {
+ onload();
+ } else {
+ checkFn.delay(10);
+ }
+ }
+ checkFn();
+ } else {
+ script.onload = onload;
+ }
+ document.getElementsByTagName("head")[0].appendChild(script);
+}
+
+qwebirc.util.createInput = function(type, parent, name, selected) {
+ var r;
+ if(Browser.Engine.trident) {
+ if(name) {
+ name = " name=\"" + escape(name) + "\"";
+ } else {
+ name = "";
+ }
+ r = $(document.createElement("<input type=\"" + type + "\"" + name + " " + (selected?" checked":"") + "/>"));
+ } else {
+ r = new Element("input");
+ r.type = type;
+ if(name)
+ r.name = name;
+
+ if(selected)
+ r.checked = true;
+ }
+
+ parent.appendChild(r);
+ return r;
+}