+/* implement jQuery.parseQuerystring() for parsing URL parameters */
+jQuery.extend({
+ parseQuerystring: function() {
+ var nvpair = {};
+ var qs = window.location.search.replace('?', '');
+ var pairs = qs.split('&');
+ $.each(pairs, function(i, v){
+ var pair = v.split('=');
+ nvpair[pair[0]] = pair[1];
+ });
+ return nvpair;
+} });
+
+function debug(string) {
+ if (!mkws_debug)
+ return;
+
+ if (!console) { /* ARGH!!! */
+ return;
+ }
+
+ // you need to disable use strict at the top of the file!!!
+ if (mkws_debug >= 3) {
+ console.log(arguments.callee.caller);
+ } else if (mkws_debug >= 2) {
+ console.log(">>> called from function " + arguments.callee.caller.name + ' <<<');
+ }
+ console.log(string);
+}
+