+};
+
+qwebirc.util.arrayCmp = function(a, b) {
+ for(var p=0;p<a.length;p++) {
+ var ap = a[p];
+ var bp = b[p];
+ if(ap == bp)
+ continue;
+
+ if(ap < bp)
+ return -1;
+
+ return 1;
+ }
+ return 0;
+};
+
+qwebirc.util.__log = function(x) {
+ if(QWEBIRC_DEBUG) {
+ if(typeof console == "undefined") {
+ alert("log: " + x);
+ } else {
+ console.log(x);
+ }
+ }
+};
+
+qwebirc.util.logger = {
+ log: function(x) { qwebirc.util.__log("L " + x) },
+ info: function(x) { qwebirc.util.__log("I " + x) },
+ error: function(x) { qwebirc.util.__log("E " + x) },
+ warn: function(x) { qwebirc.util.__log("W " + x) }
+};
+
+qwebirc.util.log = qwebirc.util.logger.log;