1
  
{"version":3,"sources":["roxen.js","lib.js","Math.uuid.js","config.js","afs.js","run.js"],"names":["ROXEN","lib","array2object","a","res","i","length","arrayUnique","filter","value","index","indexOf","indices","o","key","hasOwnProperty","push","bind","f","apply","arguments","clone","F","prototype","deepCompare","x","y","Object","constructor","p","deepCopy","obj","out","len","toString","call","callee","createElement","type","className","attributes","el","document","isString","YAHOO","util","Dom","addClass","setAttribute","createObject","values","createObjects","debugLog","s","AFS","message","escape","replace","escapeURIComponent","encodeURIComponent","escapeHTML","unescapeHTML","result","r","dirname","path","charAt","segments","split","pop","join","basename","slash_pos","lastIndexOf","substr","fromUTF8","decodeURIComponent","generateId","getISOTimeString","date","pad","n","isUndefined","Date","getUTCHours","getUTCMinutes","getUTCSeconds","hasValue","inArray","log","console","formatLog","info","warn","error","args","concat","Array","slice","isArray","lang","isBoolean","isFunction","isNull","isNumber","isObject","isValue","isUSASCII","c","charCodeAt","ltrim","map","queryify","b","j","getQueryVariable","uri","variable","query","vars","pair","rtrim","toUTF8","unescape","count_inflection","num","singular","plural","opt_zero","trim","richtextToPlaintext","rich_text","tmp_div","innerHTML","plain_text","innerText","textContent","typeOf","substitute","debug","logger","logger_visible","toggle_logger","this","hide","show","weekStartsOnSunday","week_starts_on_sun","navigator","language","toLowerCase","country","shortDate","unixtime","tm","locale","date_fmt","format","shortDateTime","timestamp","force_include_time","am_pm","today","fmt","time_fmt","tm_yday","getMonth","getDate","today_yday","getYear","augmentObject","Math","uuid","CHARS","radix","chars","random","config","session","encode_afs_args","json_args","got_json_args","name","val","JSON","stringify","request_failure","resp","status","statusText","error_callbacks","cb","debug_log","err","tagged_callbacks","groups","open_connections","restart_poll","connection_ok","json_parse_failure","e","request_success","msgs","ct","getResponseHeader","match","Error","parse","responseText","_etag","Etag","ETag","msg","tag","msg_type","ent","undefined","group","g","splice","global_callbacks","action","fn","scope","call_or_post","post","postargs","Connect","setForm","postdata","item","idx","post_files","files","tag_count","session_var","url","actions_prefix","fd","FormData","append","xhr","XMLHttpRequest","open","onreadystatechange","readyState","send","method","con","asyncRequest","cache","success","failure","abort","group_name","has_connection","add_global_callback","remove_global_callback","add_error_callback","remove_error_callback","poll_callback","response","poll_timeout","poll_interval","poll_delay","after_error","poll_delay_timeout_id","delay","poll_error_delay","window","setTimeout","timeout","interval","init","options","clearTimeout","is_initialized","initialized","request","parseInt","location","href","run","main"],"mappings":"AAMA,GAAqB,mBAAVA,SAA0BA,MAMnC,GAAIA;CCVN,WAEE,GAAIC,IAQFC,aAAc,SAAUC,GAEtB,IAAK,GADDC,MACKC,EAAI,EAAGA,EAAIF,EAAEG,OAAQD,IAC5BD,EAAID,EAAEE,KAAM,CAEd,OAAOD,IASTG,YAAa,SAASJ,GAGpB,MAAOA,GAAEK,OAAO,SAASC,EAAOC,GAC5B,MAAOP,GAAEQ,QAAQF,KAAWC,KAUlCE,QAAS,SAASC,GAChB,GAAIT,KACJ,KAAK,GAAIU,KAAOD,GACVA,EAAEE,eAAeD,IACnBV,EAAIY,KAAKF,EACb,OAAOV,IAUTa,KAAM,SAAUJ,EAAGK,GACjB,MAAO,YACL,MAAOA,GAAEC,MAAMN,EAAGO,aAUtBC,MAAO,SAAUR,GACf,QAASS,MAET,MADAA,GAAEC,UAAYV,EACP,GAAIS,IAUbE,YAAa,SAASC,EAAGC,GAOvB,GAAID,IAAMC,EAAG,OAAO,CAGpB,MAAMD,YAAaE,SAAaD,YAAaC,SAAS,OAAO,CAI7D,IAAIF,EAAEG,cAAgBF,EAAEE,YAAa,OAAO,CAE5C,KAAK,GAAIC,KAAKJ,GAEZ,GAAKA,EAAEV,eAAec,GAAtB,CAGA,IAAKH,EAAEX,eAAec,GAAI,OAAO,CAGjC,IAAIJ,EAAEI,KAAOH,EAAEG,GAAf,CAGA,GAAqB,gBAAVJ,GAAEI,GAAkB,OAAO,CAGtC,KAAKL,YAAYC,EAAEI,GAAIH,EAAEG,IAAK,OAAO,GAGvC,IAAKA,IAAKH,GAER,GAAIA,EAAEX,eAAec,KAA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lR,MAAMsD,IAAI2N,KAAKC","file":"roxen-all.min.js","sourcesContent":["/**\n * The ROXEN object.\n * @module roxen\n * @title ROXEN Global\n */\n\nif (typeof ROXEN === \"undefined\" || !ROXEN) {\n  /**\n   * The ROXEN global namespace object. \n   * @class ROXEN\n   * @static\n   */\n  var ROXEN = {};\n}\n","/*global ROXEN, YAHOO, escape, unescape, document, console */\n\n(function () {\n\n  var lib = {\n\n    /**\n     * Returns the object as an array.\n     * @method array2object\n     * @param  {Array}  a  The array.\n     * @return {Object}    The result.\n     */\n    array2object: function (a) {\n      var res = {};\n      for (var i = 0; i < a.length; i++) {\n        res[a[i]] = true;\n      }\n      return res;\n    },\n\n    /**\n     * Returns array with unique entries.\n     * @method arrayUnique\n     * @param  {array} a The array.\n     * @return {array}   A new array with duplicates removed.\n     */\n    arrayUnique: function(a) {\n      //  Requires the JavaScript 1.6/ECMAScript 5 filter function.\n      //  Credit to <http://stackoverflow.com/a/14438954>.\n      return a.filter(function(value, index) {\n          return a.indexOf(value) === index;\n        });\n    },\n\n    /**\n     * Returns the object keys as an array.\n     * @method indices\n     * @param  {Object}  o  The array.\n     * @return {Array}      The result.\n     */\n    indices: function(o) {\n      var res = [ ];\n      for (var key in o)\n        if (o.hasOwnProperty(key))\n          res.push(key);\n      return res;\n    },\n\n    /**\n     * Binds a function to a scope.\n     * @method bind\n     * @param  {Object}   o Scope.\n     * @param  {Function} f Function.\n     * @return {Function}   The scoped function.\n     */\n    bind: function (o, f) {\n      return function() {\n        return f.apply(o, arguments);\n      };\n    },\n\n    /**\n     * Clones an object.\n     * @method clone\n     * @param  {Object}   o Object to clone.\n     * @return {Object}   The cloned object.\n     */\n    clone: function (o) {\n      function F() {}\n      F.prototype = o;\n      return new F();\n    },\n\n    /*\n     * Performs a recursive value comparison of JS values.\n     * @method deepCompare\n     * @param  {any}     x  The first value.\n     * @param  {any}     y  The second value.\n     * @return {Boolean}    Equality result.\n     */\n    deepCompare: function(x, y) {\n      //  Adopted from Jean Vincent's answer at\n      //  stackoverflow.com/questions/1068834/object-comparison-in-javascript\n      //\n      //  NOTE: Does not handle NaN, cyclical structures or +/-0.\n\n      // If both x and y are null or undefined and exactly the same\n      if (x === y) return true;\n\n      // If they are not strictly equal, they both need to be Objects\n      if (!(x instanceof Object) || !(y instanceof Object)) return false;\n\n      // They must have the exact same prototype chain, the closest we can do\n      // is test there constructor.\n      if (x.constructor !== y.constructor) return false;\n\n      for (var p in x) {\n        // Other properties were tested using x.constructor === y.constructor\n        if (!x.hasOwnProperty(p)) continue;\n\n        // Allows to compare x[p] and y[p] when set to undefined\n        if (!y.hasOwnProperty(p)) return false;\n\n        // If they have the same strict value or identity then they are equal\n        if (x[p] === y[p]) continue;\n\n        // Numbers, Strings, Functions, Booleans must be strictly equal\n        if (typeof(x[p]) !== \"object\") return false;\n\n        // Objects and Arrays must be tested recursively\n        if (!deepCompare(x[p], y[p])) return false;\n      }\n\n      for (p in y) {\n        // Allows x[p] to be set to undefined\n        if (y.hasOwnProperty(p) && !x.hasOwnProperty(p)) return false;\n      }\n\n      return true;\n    },\n\n    /**\n     * Performs a deep copy of an object or array.\n     * @method deepCopy\n     * @param  {Object}    obj The array/object to deep copy.\n     * @return {Object}    The copy.\n     */\n    deepCopy: function(obj) {\n      //  Borrowed from\n      //  http://james.padolsey.com/javascript/deep-copying-of-objects-and-arrays/\n      //\n      //  FIXME: Replace with clone() in YUI3?\n      var out, i, len;\n      if (Object.prototype.toString.call(obj) === \"[object Array]\") {\n        out = [ ];\n        len = obj.length;\n        for (i = 0 ; i < len; i++)\n          out[i] = arguments.callee(obj[i]);\n        return out;\n      } else if (obj === null) {\n        return null;\n      } else if (typeof obj === \"object\") {\n        out = { };\n        for (i in obj)\n          out[i] = arguments.callee(obj[i]);\n        return out;\n      }\n      return obj;\n    },\n\n    /**\n     * Creates a HTMLElement\n     * @method createElement\n     * @param  {String}      type        Element type.\n     * @param  {String}      className   Class name.\n     * @param  {Array}       attributes  Array of attributes\n     * @return {HTMLElement}             The result.\n     */\n    createElement: function (type, className, attributes) {\n      var el = document.createElement(type);\n      if (ROXEN.isString(className)) {\n        YAHOO.util.Dom.addClass(el, className);\n      }\n      for (var i in attributes) {\n        if (attributes.hasOwnProperty(i)) {\n          el.setAttribute(i, attributes[i]);\n        }\n      }\n      return el;\n    },\n\n    /**\n     * Creates an object from two arrays\n     * The two arrays must be of equal length.\n     * @method createObject\n     * @param {Array} indices Array of indices.\n     * @param {Array} values  Array of values.\n     * @return {Object}       The result.\n     */\n    createObject: function (indices, values) {\n      var res = {};\n      for (var i = 0; i < indices.length; i++) {\n        res[indices[i]] = values[i];\n      }\n      return res;\n    },\n\n    /**\n     * Creates an array of objects from from two arrays,\n     * where the second array is an array of arrays of values.\n     * Indices array and the he arrays of values and must be of equal length.\n     * @method createObjects\n     * @param {Array} indices Array of indices.\n     * @param {Array} values  Array of arrays of values.\n     * @return {Array}        The result.\n     */\n    createObjects: function (indices, values) {\n      var res = [];\n      for (var i = 0; i < values.length; i++) {\n        res.push(ROXEN.createObject(indices, values[i]));\n      }\n      return res;\n    },\n\n    /**\n     * Outputs string to Roxen Webserver debug log.\n     * @method debugLog\n     * @param  {String} s  The string.\n     */\n    debugLog: function (s) {\n      ROXEN.AFS.call(\"debug-log\", {message: s});\n    },\n\n     escape: function (s) {\n      // We would love to use the \"encodeURIComponent\" function, but it\n      // encodes utf8 without using the %uXXXX standard encoding, which\n      // makes it unsuitable for reception on the server side. This\n      // implementation of escape uses %uXXXX, but we need to post process\n      // the '+' character since it's not handled at all by escape.\n      return escape(s).replace(/\\+/g, \"%2B\");\n    },\n\n   /**\n     * Escapes a string for use as an URI component. Like\n     * encodeURIComponent, but also encodes ! ' ( ) * which are part\n     * of the reserved set in RFC 3987.\n     *\n     * @method escape\n     * @param  {String} s String to encode.\n     * @return {String}   The result.\n     */\n    escapeURIComponent: function (s) {\n      return encodeURIComponent (s).\n        replace(/!/g, \"%21\").\n        replace(/\\x27/g, \"%27\"). // ' escaped to avoid unbalanced quotes.\n        replace(/\\(/g, \"%28\").\n        replace(/\\)/g, '%29').\n        replace(/\\*/g, '%2A');\n    },\n\n    /**\n     * Escapes a string for use in HTML.\n     * @method escapeHTML\n     * @param  {String} s String to encode.\n     * @return {String}   The result.\n     */\n    escapeHTML: function(s) {\n      return s.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").\n             replace(/\\x27/g,\"&apos;\").replace(/\\x22/g,\"&quot;\");\n    },\n\n    /**\n     * Unescapes a string for use in HTML.\n     * @method unescapeHTML\n     * @param  {String} s String to decode.\n     * @return {String}   The result.\n     */\n    unescapeHTML: function(s) {\n      return s.replace(/&amp;/g,\"&\").replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\").\n             replace(/&apos;/g, \"'\").replace(/&quot;/g,'\"');\n    },\n\n    /**\n     * Filter an array by executing a filter function on each array element\n     * and return the result.\n     * @method filter\n     * @param {Array}    a Array of elements.\n     * @param {Function} f Applied function to each element.\n     *                     f's argument list is (element, index, array).\n     * @param {Object}   o Scope correction.\n     * @return {Array}     The result.\n     */\n    filter: function (a, f, o) {\n      var result = [];\n      for (var i = 0; i < a.length; i++) {\n        var r = f.call(o, a[i], i, a);\n        if (r) {\n          result.push(a[i]);\n        }\n      }\n      return result;\n    },\n\n    /**\n     * Returns the parent path for a full path by stripping off the trailing\n     * segment. The result will always end in \"/\".\n     *\n     * @method dirname\n     * @param {String} path The input path.\n     * @return {string}     The result.\n     */\n    dirname: function(path) {\n      if (!path || path === \"\")\n        return \"/\";\n      if (path.charAt(path.length - 1) === \"/\")\n        return path;\n\n      //  Strip the trailing file name from a path and return the directory\n      var segments = path.split(\"/\");\n      segments.pop();\n      return segments.join(\"/\") + \"/\";\n    },\n\n    /**\n     * Returns the name excluding parent levels in full path by stripping off\n     * preceding segments separated by \"/\".\n     *\n     * @method basename\n     * @param {String} path The input path.\n     * @return {string}     The result.\n     */\n    basename: function(path) {\n      if (!path || path === \"\")\n        return \"\";\n      var slash_pos = path.lastIndexOf(\"/\");\n      if (slash_pos >= 0)\n        return path.substr(slash_pos + 1);\n      return path;\n    },\n\n    /**\n     * Decode string from UTF8.\n     * @method fromUTF8\n     * @param  {String} s String to decode.\n     * @return {String}   The result.\n     */\n    fromUTF8: function (s) {\n      return decodeURIComponent(escape(s));\n    },\n\n    /**\n     * Generates an unique id for DOM nodes.\n     * @method generateId\n     * @return  {String} The result.\n     */\n    generateId: function () {\n      // YUI may warn about \"batch called with invalid arguments\",\n      // but there is no convenient way to avoid it.\n      return YAHOO.util.Dom.generateId(null, \"roxen-\");\n    },\n\n    /**\n     * Returns a ISO time string from a date object.\n     * @method getISOTimeString\n     * @param  {Date}   date  Date object (optional).\n     * @return {String}       The result.\n     */\n    getISOTimeString: function (date) {\n      function pad(n){\n        return n < 10 ? \"0\" + n : n;\n      }\n      if (ROXEN.isUndefined(date)) {\n        date = new Date();\n      }\n      return pad(date.getUTCHours()) + \":\" +\n             pad(date.getUTCMinutes()) + \":\" +\n             pad(date.getUTCSeconds());\n    },\n\n    /**\n     * Check if array has any of the object properties.\n     * @method hasValue\n     * @param  {Array}   a The haystack.\n     * @param  {Object}  o The needle.\n     * @return {Boolean}   The result.\n     */\n    hasValue: function (a, o) {\n      for (var i = 0; i < a.length; i++) {\n        if (o[a[i]]) {\n          return true;\n        }\n      }\n      return false;\n    },\n\n    /**\n     * Check if a value exist in a array.\n     * @method inArray\n     * @param {Array}   a The haystack.\n     * @param {any}     o The needle.\n     * @param {boolean}   The result.\n     */\n    inArray: function (a, o) {\n      for (var i = 0; i < a.length; i++) {\n        if (a[i] === o) {\n          return true;\n        }\n      }\n      return false;\n    },\n\n    /**\n     * Outputs all arguments to client log.\n     * @method log\n     */\n    log: function () {\n      if (typeof console !== \"undefined\" && console.log) {\n        console.log.apply(console, ROXEN.formatLog(arguments));\n      }\n    },\n    info: function () {\n      if (typeof console !== \"undefined\" && console.info) {\n        console.info.apply(console, ROXEN.formatLog(arguments));\n      }\n    },\n    warn: function () {\n      if (typeof console !== \"undefined\" && console.warn) {\n        console.warn.apply(console, ROXEN.formatLog(arguments));\n      }\n    },\n    error: function () {\n      if (typeof console !== \"undefined\" && console.error) {\n        console.error.apply(console, ROXEN.formatLog(arguments));\n      }\n    },\n\n    formatLog: function (args) {\n      return [ ROXEN.getISOTimeString() + \" test (UTC): \" ].\n        concat(Array.prototype.slice.call(args));\n    },\n\n    /**\n     * Determines wheather or not the provided object is an array.\n     * This an alias for YAHOO.lang.isArray().\n     * @method isArray\n     * @param {any} o The object being testing\n     * @return {boolean} the result\n     */\n    isArray: YAHOO.lang.isArray,\n\n    /**\n     * Determines whether or not the provided object is a boolean.\n     * This an alias for YAHOO.lang.isBoolean().\n     * @method isBoolean\n     * @param {any} o The object being testing\n     * @return {boolean} the result\n     */\n    isBoolean: YAHOO.lang.isBoolean,\n\n    /**\n     * Determines whether or not the provided object is a function.\n     * This an alias for YAHOO.lang.isFunction().\n     * @method isFunction\n     * @param {any} o The object being testing\n     * @return {boolean} the result\n     */\n    isFunction: YAHOO.lang.isFunction,\n\n    /**\n     * Determines whether or not the provided object is null\n     * This an alias for YAHOO.lang.isNull().\n     * @method isNull\n     * @param {any} o The object being testing\n     * @return {boolean} the result\n     */\n    isNull: YAHOO.lang.isNull,\n\n    /**\n     * Determines whether or not the provided object is a legal number.\n     * This an alias for YAHOO.lang.isNumber().\n     * @method isNumber\n     * @param {any} o The object being testing\n     * @return {boolean} the result\n     */\n    isNumber: YAHOO.lang.isNumber,\n\n    /**\n     * Determines whether or not the provided object is of type object\n     * or function.\n     * This an alias for YAHOO.lang.isObject().\n     * @method isObject\n     * @param {any} o The object being testing\n     * @return {boolean} the result\n     */\n    isObject: YAHOO.lang.isObject,\n\n    /**\n     * Determines whether or not the provided object is a string.\n     * This an alias for YAHOO.lang.isString().\n     * @method isString\n     * @param {any} o The object being testing\n     * @return {boolean} the result\n     */\n    isString: YAHOO.lang.isString,\n\n    /**\n     * Determines whether or not the provided object is undefined.\n     * This an alias for YAHOO.lang.isUndefined().\n     * @method isUndefined\n     * @param {any} o The object being testing\n     * @return {boolean} the result\n     */\n    isUndefined: YAHOO.lang.isUndefined,\n\n    /**\n     * A convenience method for detecting a legitimate non-null value.\n     * Returns false for null/undefined/NaN, true for other values,\n     * including 0/false/''\n     * This an alias for YAHOO.lang.isValue().\n     * @method isValue\n     * @param o {any} the item to test\n     * @return {boolean} true if it is not null/undefined/NaN || false\n     */\n    isValue: YAHOO.lang.isValue,\n\n    /**\n     * Test if string only has US ASCII characters.\n     * @method isUSASCII\n     * @param  {String} s  The string.\n     * @return {Boolean}   The result.\n     */\n    isUSASCII: function (s) {\n      for (var i = 0; i < s.length; i++) {\n        var c = s.charCodeAt(i);\n        if ((c < 32) || (c > 126)) {\n          return false;\n        }\n      }\n      return true;\n    },\n\n    /**\n     * Trims whitespaces from the beginning of a given string.\n     * @method ltrim\n     * @param  {String} s The string to trim.\n     * @return {String}   The result.\n     */\n    ltrim: function (s) {\n      return s.replace(/^\\s+/g, \"\");\n    },\n\n    /**\n     * Execute a function on each array element and return the result.\n     * @method map\n     * @param {Array}    a Array of elements.\n     * @param {Function} f Applied function to each element.\n     *                     f's argument list is (element, index, array).\n     * @param {Object}   o Scope correction.\n     * @retrun {Array}     The result.\n     */\n    map: function (a, f, o) {\n      var result = [];\n      for (var i = 0; i < a.length; i++) {\n        result.push(f.call(o, a[i], i, a));\n      }\n      return result;\n    },\n\n   /**\n     * Takes an object and return it as a query string.\n     * @method queryify\n     * @param  {Object} o The object to queryify.\n     * @return {String}   The result\n     */\n    queryify: function (args) {\n      var a = [\"?\"];\n      for (var i in args) {\n        if (args.hasOwnProperty(i) &&\n            !ROXEN.isUndefined(args[i])) {\n          if (a.length > 1)\n            a.push(\"&\");\n          a.push(i.toString());\n          a.push(\"=\");\n          if (ROXEN.isArray(args[i])) {\n            var b = [];\n            for (var j = 0; j < args[i].length; j++)\n              b.push(ROXEN.escapeURIComponent(args[i][j]));\n            a.push(b.join(\",\"));\n          }\n          else {\n            a.push(ROXEN.escapeURIComponent(args[i]));\n          }\n        }\n      }\n      return a.join(\"\");\n    },\n\n    getQueryVariable: function (uri, variable) {\n      var query = uri.split(\"?\");\n      if (query.length < 2) return false;\n      query = query[1];\n      var vars = query.split(\"&\");\n      for (var i = 0; i < vars.length; i++) {\n        var pair = vars[i].split(\"=\");\n        if(pair[0] === variable) {\n          return pair[1];\n        }\n      }\n      return false;\n    },\n\n    /**\n     * Trims whitespaces from the end of a given string.\n     * @method rtrim\n     * @param  {String} s The string to trim.\n     * @return {String}   The result.\n     */\n    rtrim: function (s) {\n      return s.replace(/\\s+$/g, \"\");\n    },\n\n    /**\n     * Encode string to UTF8.\n     * @method toUTF8\n     * @param  {String} s String to encode.\n     * @return {String}   The result.\n     */\n    toUTF8: function (s) {\n      return unescape(encodeURIComponent(s));\n    },\n\n    /*\n     * Given a count number it returns either the singluar or plural phrase,\n     * or optionally the zero count phrase.\n     * @method count_inflection\n     * @param {Number} num      The count number to base the decision on.\n     * @param {String} singular The singular phrase if count is 1.\n     * @param {String} plural   The plural phrase if count is not 1 (including\n     *                          zero if opt_zero isn't available).\n     * @param {String} opt_zero The optional phrase to return for zero count.\n     */\n    count_inflection: function(num, singular, plural, opt_zero)\n    {\n      if ((num === 0) && opt_zero)\n        return opt_zero;\n      return (num == 1) ? singular : plural;\n    },\n\n    /**\n     * Trims whitespaces from both the beginning and end of a given string.\n     * @method trim\n     * @param  {String} s The string to trim.\n     * @return {String}   The result.\n     */\n    trim: function (s) {\n      return s.replace(/^\\s+|\\s+$/g, \"\");\n    },\n\n    richtextToPlaintext: function(rich_text) {\n      //  Make sure adjacent paragraphs and <br> leaves a space after\n      //  removal.\n      var tmp_div = document.createElement(\"div\");\n      rich_text = rich_text.replace(/<\\/div>/gi, \" </div>\");\n      rich_text = rich_text.replace(/<br/gi, \" <br\");\n      tmp_div.innerHTML = rich_text;\n      var plain_text = tmp_div.innerText || tmp_div.textContent;\n      plain_text = plain_text.replace(/\\r\\n/g, \"\\n\");\n      return ROXEN.trim(plain_text);\n    },\n\n    /**\n     * Returns type for object.\n     * @method typeOf\n     * @param  {any} o  The object to test.\n     * @return {String} The objects type.\n     */\n    typeOf: function (o) {\n      var s = typeof o;\n      if (s === \"object\") {\n        if (o) {\n          if (ROXEN.isArray(o)) {\n            s = \"array\";\n          }\n        } else {\n          s = \"null\";\n        }\n      }\n      return s;\n    },\n\n    /**\n     * Does variable substitution on a string. It scans through the string\n     * looking for expressions enclosed in { } braces. If an expression\n     * is found, it is used a key on the object.  If there is a space in\n     * the key, the first word is used for the key and the rest is provided\n     * to an optional function to be used to programatically determine the\n     * value (the extra information might be used for this decision). If\n     * the value for the key in the object, or what is returned from the\n     * function has a string value, number value, or object value, it is\n     * substituted for the bracket expression and it repeats.  If this\n     * value is an object, it uses the Object's toString() if this has\n     * been overridden, otherwise it does a shallow dump of the key/value\n     * pairs.\n     * This an alias for YAHOO.lang.substitute().\n     * @method substitute\n     * @param s {String} The string that will be modified.\n     * @param o {Object} An object containing the replacement values\n     * @param f {Function} An optional function that can be used to\n     *                     process each match.  It receives the key,\n     *                     value, and any extra metadata included with\n     *                     the key inside of the braces.\n     * @return {String} the substituted string\n     */\n    substitute: YAHOO.lang.substitute,\n\n    /**\n     * Enables various debuging options.\n     */\n    debug: false,\n\n    /**\n     * YUI Logger Control object.\n     */\n    logger: null,\n    logger_visible: true,\n\n    /**\n     * Toggle the visibility state of the YUI Logger.\n     */\n    toggle_logger: function () {\n      if (this.logger_visible) {\n        this.logger.hide();\n        this.logger_visible = false;\n      } else {\n        this.logger.show();\n        this.logger_visible = true;\n      }\n    },\n\n    weekStartsOnSunday: function() {\n      //  Date.getDay() returns locally-unaware 0-6 for Sun-Sat for a given\n      //  date. We can therefore only make a guess based on browser locale\n      //  extracted from the language setting.\n      //\n      //  C.f. <http://en.wikipedia.org/wiki/Seven-day_week#mediaviewer/File:First_Day_of_Week_World_Map.svg>.\n      //  (We don't list every single tiny country on the map below.)\n      var week_starts_on_sun =\n        [ \"us\", \"cn\", \"jp\", \"ca\",     //  US, China, Japan, Canada,\n          \"za\", \"zw\", \"ke\",           //  South Africa, Zimbabwe, Kenya,\n          \"ph\", \"tw\", \"hk\",           //  Philippines, Taiwan, Hong Kong\n          \"mx\", \"gt\", \"sv\",           //  Mexico, Guatemala, El Salvador\n          \"ni\", \"cr\", \"pa\",           //  Nicaragua, Costa Rica, Panama\n          \"co\", \"ve\", \"ec\",           //  Colombia, Venezuela, Ecuador\n          \"pe\", \"br\", \"bo\",           //  Peru, Brazil, Bolivia\n          \"cl\", \"ar\", \"il\" ];         //  Chile, Argentina, Israel\n      var lang = navigator.language.toLowerCase();\n      if (lang.length >= 5) {\n        var country = lang.substr(3, 2);\n        if (week_starts_on_sun.indexOf(country) >= 0)\n          return true;\n      }\n      return false;\n    },\n\n    shortDate: function(unixtime) {\n      var tm = new Date(unixtime * 1000);\n      var locale = \"en-US\";\n      var date_fmt = \"%b %e, %Y\";\n      return YAHOO.util.Date.format(tm, { format: date_fmt },\n                                    locale).replace(\"  \", \" \");\n    },\n\n    /**\n      * Return a short readable date and time string similar to\n      * Sitebuilder.mtime_to_str().\n      * @method shortDateTime\n      * @param timestamp {Int or Date}\n      */\n    shortDateTime: function (timestamp, force_include_time, am_pm) {\n      var tm;\n      if (typeof (timestamp) === \"number\") tm = new Date(timestamp*1000);\n      else tm = timestamp;\n\n      var today = new Date();\n      var fmt = \"\";\n      // YUI date formats:\n      // http://developer.yahoo.com/yui/docs/YAHOO.util.Date.html\n      // FIXME - Use user setting\n      var locale = \"en-US\";\n      var date_fmt = \"%b %e, %Y\";\n      var time_fmt = am_pm ? \"%l:%M %P\" : \"%H:%M\";\n\n      // The following simplistic calculation is bogus, but the only\n      // effect is that we'll return a date instead of \"yesterday\" if\n      // today is the first day of a month where the preceding month\n      // was shorter than 31 days.\n      var tm_yday = (tm.getMonth() + 1) * 31 + tm.getDate();\n      var today_yday = (today.getMonth() + 1) * 31 + today.getDate();\n\n      if (tm.getYear() != today.getYear()) {\n        //  Feb 23, 2010\n        fmt = date_fmt;\n        if (force_include_time)\n          fmt += \", \" + time_fmt;\n      } else if (tm_yday < today_yday - 1 ||\n                 tm_yday > today_yday) {\n        //  Feb 23, 14:30\n        fmt = date_fmt.replace(\", %Y\", \"\");\n        fmt = fmt.replace(\" %Y\", \"\");\n        fmt = fmt + \", \" + time_fmt;\n      } else if (tm_yday == today_yday - 1) {\n        //  Yesterday, 14:30\n        fmt = \"yesterday, \" + time_fmt;\n      } else {\n        //  Today, 14:30\n        fmt = \"today, \" + time_fmt;\n      }\n      return YAHOO.util.Date.format(tm, { format: fmt }, locale);\n    }\n  };\n\n  // Alias for REP compat only. This function used to call the global\n  // JS escape() function and additionally encode +. That means it\n  // used %uXXXX for wide chars, which isn't valid in URI:s.\n  lib.escape = lib.escapeURIComponent;\n\n  YAHOO.lang.augmentObject(ROXEN, lib);\n})();\n","/*\nFile: Math.uuid.js\nVersion: 1.4-roxen\nLatest version:   http://www.broofa.com/Tools/Math.uuid.js\nInformation:      http://www.broofa.com/blog/?p=151\nContact:          robert@broofa.com\n----\nCopyright (c) 2008, Robert Kieffer\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n    * Neither the name of Robert Kieffer nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*\n * Generate a random uuid.\n *\n * USAGE: Math.uuid(length, radix)\n *   length - the desired number of characters\n *   radix  - the number of allowable values for each character.\n *\n * EXAMPLES:\n *   // No arguments  - returns RFC4122, version 4 ID\n *   >>> Math.uuid()\n *   \"92329D39-6F5C-4520-ABFC-AAB64544E172\"\n * \n *   // One argument - returns ID of the specified length\n *   >>> Math.uuid(15)     // 15 character ID (default base=62)\n *   \"VcydxgltxrVZSTV\"\n *\n *   // Two arguments - returns ID of the specified length, and radix. (Radix must be <= 62)\n *   >>> Math.uuid(8, 2)  // 8 character ID (base=2)\n *   \"01001010\"\n *   >>> Math.uuid(8, 10) // 8 character ID (base=10)\n *   \"47473046\"\n *   >>> Math.uuid(8, 16) // 8 character ID (base=16)\n *   \"098F4D35\"\n */\nMath.uuid = (function() {\n  // Private array of chars to use\n  var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); \n\n  return function (len, radix) {\n    var chars = CHARS, uuid = [], i;\n    radix = radix || chars.length;\n\n    if (len) {\n      // Compact form\n      for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random()*radix];\n    } else {\n      // rfc4122, version 4 form\n      var r;\n\n      // rfc4122 requires these characters\n      uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';\n      uuid[14] = '4';\n\n      // Fill in random data.  At i==19 set the high bits of clock sequence as\n      // per rfc4122, sec. 4.1.5\n      for (i = 0; i < 36; i++) {\n        if (!uuid[i]) {\n          r = 0 | Math.random()*16;\n          uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r & 0xf];\n        }\n      }\n    }\n\n    return uuid.join('');\n  };\n})();\n","/*global ROXEN */\n\n/**\n * The configuration object.\n *\n * @module config\n * @class config\n * @namespace ROXEN\n * @static\n */\nROXEN.config = function () {\n  /**\n   * A client unique identifier.\n   *\n   * @property session\n   * @type {String}\n   */\n  var session = Math.uuid();\n\n  return {\n    session: session\n  };\n}();\n","/*global ROXEN, YAHOO */\n/* jshint indent: 2 */\n\n/**\n * Module interface to the new Action File System\n *\n * @module afs\n * @class AFS\n * @namespace ROXEN\n * @static\n */\nROXEN.AFS = function () {\n\n  // 1 - Log AFS calls and responses.\n  // 2 - Also log calls to tagged callbacks, i.e. the single-response\n  //     callbacks passed to call().\n  // 3 - Also log calls to global and error callbacks.\n  var debug_log = parseInt(ROXEN.getQueryVariable(window.location.href,\n                                                  \"__afs-debug\"), 10);\n\n  var session = ROXEN.config.session;\n\n  /**\n   * AFS actions path prefix.\n   */\n  var actions_prefix = \"/actions/\";\n\n  /**\n   * AFS session variable name in action URLs.\n   */\n  var session_var = \"session_id\";\n\n  /**\n   * How long a poll for new msgs is held by the server.\n   * A value of 0 disables blocking polls.\n   * A value of -1 means automatic (parameters decided by server).\n   * A value of -2 disables polling altogether.\n   *\n   * @property poll_timeout\n   * @type {Int}\n   * @private\n   */\n  var poll_timeout = -1; // Auto mode.\n\n  /**\n   * Seconds to wait after the last AFS response before issuing\n   * another poll. When the client is idle, this is effectively the\n   * interval between polls.\n   *\n   * @property poll_delay\n   * @type {Int}\n   * @private\n   */\n  var poll_delay = 30;\n\n  /**\n   * Seconds to wait after a low-level AFS error before issuing\n   * another poll.\n   *\n   * @property poll_error_delay\n   * @type {Int}\n   * @private\n   */\n  var poll_error_delay = 30;\n\n  // True as long as the last AFS call was successful.\n  var connection_ok = false;\n\n  // Number of ongoing AFS calls.\n  var open_connections = 0;\n\n  var poll_delay_timeout_id;\n\n  // Maps the tag for the ongoing calls to the callback function and an\n  // optional group identifier when the response comes.\n  var tagged_callbacks = {};\n\n  // Track groups of connections so they can aborted.\n  var groups = {};\n\n  // Counter to produce unique tags.\n  var tag_count = 0;\n\n  // Set of callback functions that will receive all AFS responses.\n  var global_callbacks = [];\n\n  // Set of callback functions that get called when there are\n  // low-level AFS errors (connection errors or JSON format errors).\n  var error_callbacks = [];\n\n  // Set on init().\n  var is_initialized = false;\n\n  function encode_afs_args (args)\n  {\n    var query = [];\n    var json_args = {}, got_json_args = false;\n\n    // Send strings as ordinary variables. Everything else is sent as\n    // json in the special __afs variable. That way it's possible to\n    // send variables that are parsed by the server outside the main\n    // afs query handler.\n\n    for (var name in args)\n      if (args.hasOwnProperty (name)) {\n        var val = args[name];\n        if (YAHOO.lang.isString (val))\n          // Assume the name only contains ordinary characters. May\n          // escape it later should it be a problem.\n          query.push (name + \"=\" + ROXEN.escapeURIComponent (val));\n        else {\n          json_args[name] = val;\n          got_json_args = true;\n        }\n      }\n\n    if (got_json_args)\n      query.push (\"__afs=\" + ROXEN.escapeURIComponent(YAHOO.lang.JSON.stringify (json_args)));\n\n    return query.join (\"&\");\n  }\n\n  function request_failure (resp)\n  {\n    ROXEN.log(\"ROXEN.AFS: connection error: \" +\n              resp.status + \" \" + resp.statusText);\n\n    for (var i = 0; i < error_callbacks.length; i++) {\n      var cb = error_callbacks[i];\n      if (debug_log > 2)\n        ROXEN.log (\"  AFS calling error callback: \" + cb.name);\n      try {\n        cb (resp);\n      } catch (err) {\n        ROXEN.log (\"AFS: error in callback \" + cb.name + \": \" + err);\n        if (ROXEN.debug)\n          throw err;\n      }\n    }\n\n    // Forget all ongoing calls since we cannot hope to receive any\n    // useful responses to them anyway after this.\n    tagged_callbacks = {};\n    groups = {};\n\n    if (open_connections) {\n      open_connections = 0;\n      restart_poll (true);\n    }\n\n    connection_ok = false;\n  }\n\n  function json_parse_failure (err)\n  {\n    ROXEN.log(\"ROXEN.AFS: JSON parse error: \" + err);\n\n    for (var i = 0; i < error_callbacks.length; i++) {\n      var cb = error_callbacks[i];\n      if (debug_log > 2)\n        ROXEN.log (\"  AFS calling error callback: \" + cb.name);\n      // FIXME: Need a flag to tell it apart from a connection error?\n\n      try {\n        cb (err);\n      } catch (e) {\n        ROXEN.log (\"AFS: error in callback \" + cb.name + \": \" + e);\n        if (ROXEN.debug)\n          throw e;\n      }\n    }\n\n    // Forget all ongoing calls since we cannot hope to receive any\n    // useful responses to them anyway after this.\n    tagged_callbacks = {};\n    groups = {};\n\n    if (open_connections) {\n      open_connections = 0;\n      restart_poll (true);\n    }\n\n    connection_ok = false;\n  }\n\n  function request_success (resp)\n  {\n    var msgs, cb, ct;\n\n    // YAHOO.util.Connect.asyncRequest follows redirect transparently and\n    // we want to detect the case when this is a redirect to a login page.\n    ct = resp.getResponseHeader[\"Content-Type\"];\n    if (ct && !ct.match(/application\\/json/)) {\n      json_parse_failure(new Error(\"ContentTypeError\"));\n      return;\n    }\n\n    try {\n      msgs = YAHOO.lang.JSON.parse(resp.responseText);\n    }\n    catch (err) {\n      json_parse_failure (err);\n      return;\n    }\n    msgs._etag = resp.getResponseHeader.Etag || resp.getResponseHeader.ETag;\n\n    for (var i = 0; i < msgs.length; i++) {\n      var msg = msgs[i];\n      var tag = msg.tag;\n\n      if (tag) {\n        if (debug_log)\n          ROXEN.log (\"AFS response: \" + msg.msg_type + \", tag \" + tag);\n\n        var ent = tagged_callbacks[tag];\n        cb = ent && ent[0];\n        if (ent === undefined)\n          ROXEN.log (\"ROXEN.AFS: Warning: Got AFS response with \" +\n                     \"unknown tag: \" + msg.msg_type);\n        else if (cb == -1) {\n          if (debug_log > 1)\n            ROXEN.log (\"  AFS tagged callback was canceled\");\n          delete tagged_callbacks[tag];\n        } else {\n          if (debug_log > 1)\n            ROXEN.log (\"  AFS calling tagged callback: \" + cb.name);\n          if (ROXEN.debug)\n            cb(msg);\n          else {\n            try {\n              cb(msg);\n            } catch (err) {\n              ROXEN.log(\"AFS: error in callback \" + cb.name + \": \" + err);\n            }\n          }\n          // Assume no more than one response with a given tag. See\n          // also AFS.ClientSession.push_response.\n          delete tagged_callbacks[tag];\n          var group = ent[1];\n          if (group) {\n            var g = groups[group];\n            g.splice(g.indexOf(tag), 1);\n          }\n        }\n      }\n\n      else {\n        if (debug_log)\n          ROXEN.log (\"AFS response: \" + msg.msg_type);\n      }\n\n      for (var j = 0; j < global_callbacks.length; j++) {\n        cb = global_callbacks[j];\n        if (debug_log > 2)\n          ROXEN.log (\"  AFS calling global callback: \" + cb.name);\n        try {\n          cb (msg);\n        } catch (err) {\n          ROXEN.log (\"AFS: error in callback \" + cb.name + \": \" + err);\n          if (ROXEN.debug)\n            throw err;\n        }\n      }\n    }\n\n    if (open_connections > 0) {\n      open_connections--;\n      if (!open_connections) restart_poll (false);\n    }\n\n    connection_ok = true;\n  }\n\n  /**\n   * Calls an AFS action.\n   *\n   * @param {String}   action Requested action name.\n   * @param {Object}   args   Action arguments. \"session_id\" (or whatever\n   *                          name the session variable is given) and \"tag\"\n   *                          arguments get added to it.\n   * @param {Function} fn     Optional callback function to run when the\n   *                          corresponding AFS response comes back.\n   *                          It gets a single argument that is the\n   *                          response message in JSON. If this isn't\n   *                          given then the AFS action is untagged,\n   *                          and any response it produces will be\n   *                          sent to the global callbacks only.\n   * @param {Object}   scope  Scope correction (optional).\n   * @param {String}   group  Group identifier (optional).\n   * @return {Object}         Returns the connection object.\n   */\n  function call(action, args, fn, scope, group) {\n    return call_or_post(action, \"GET\", args, 0, fn, scope, group);\n  }\n\n  function post(action, args, postargs, fn, scope, group) {\n    if (ROXEN.isString(postargs)) {\n      //  ID or name of a <form> tag that should be encoded\n      YAHOO.util.Connect.setForm(postargs);\n      postargs = undefined;\n    } else if (!ROXEN.isObject(postargs)) {\n      postargs = { };\n    }\n\n    var postdata = [ ];\n    if (postargs) {\n      var item = 0;\n      for (var idx in postargs)\n        if (postargs.hasOwnProperty(idx)) {\n          postdata[item++] =\n            encodeURIComponent(idx) + \"=\" + encodeURIComponent(postargs[idx]);\n        }\n    }\n    return call_or_post(action, \"POST\", args, postdata.join(\"&\"), fn, scope);\n  }\n\n  function post_files(action, args, files, fn, scope, group)\n  {\n    //  File should come from the browser's FileList API. We will use FormData\n    //  together with XHR to post directly to the server without involving YUI.\n\n    //  Prepare AFS call\n    if (!ROXEN.isObject(args))\n      args = { };\n    if (scope)\n      fn = ROXEN.bind(scope, fn);\n    if (fn) {\n      var tag = ++tag_count + \"\";\n      if (debug_log)\n        ROXEN.log (\"AFS call: \" + action + \" \" +\n                   YAHOO.lang.JSON.stringify (args) +\n                   \", callback \" + fn.name + \", tag \" + tag);\n      args.tag = tag;\n      tagged_callbacks[tag] = [ fn, group ];\n    } else if (debug_log) {\n      ROXEN.log (\"AFS call: \" + action + \" \" +\n                 YAHOO.lang.JSON.stringify (args));\n    }\n    if (fn && group) {\n      if (!groups[group]) groups[group] = [ ];\n      groups[group].push(args.tag);\n    }\n\n    args[session_var] = session;\n    open_connections++;\n\n    //  Initiate transfer\n    var url = actions_prefix + action + \"?\" + encode_afs_args(args);\n    var fd = new FormData();\n    for (var i = 0; i < files.length; i++) {\n      fd.append(\"upload-file-\" + i, files[i], files[i].name);\n    }\n    var xhr = new XMLHttpRequest();\n    xhr.open(\"POST\", url, true);\n    xhr.onreadystatechange = function() {\n      if (xhr.readyState === 4) {\n        if (xhr.status === 200) {\n          //  Invoke success callback\n          request_success(xhr);\n        } else if (xhr.status === 0 || xhr.status >= 400) {\n          //  Invoke failure callback\n          request_failure(xhr);\n        }\n      }\n    };\n    xhr.send(fd);\n  }\n\n  function call_or_post(action, method, args, postdata, fn, scope, group) {\n    if (!ROXEN.isObject(args)) {\n      args = {};\n    }\n\n    if (scope)\n      fn = ROXEN.bind (scope, fn);\n\n    if (fn) {\n      var tag = ++tag_count+\"\";\n      if (debug_log)\n        ROXEN.log (\"AFS call: \" + action + \" \" +\n                   YAHOO.lang.JSON.stringify (args) +\n                   \", callback \" + fn.name + \", tag \" + tag);\n      args.tag = tag;\n      tagged_callbacks[tag] = [ fn, group ];\n    }\n    else {\n      if (debug_log)\n        ROXEN.log (\"AFS call: \" + action + \" \" +\n                   YAHOO.lang.JSON.stringify (args));\n    }\n\n    args[session_var] = session;\n\n    open_connections++;\n    var url = actions_prefix + action + \"?\" + encode_afs_args (args);\n    var con = YAHOO.util.Connect.asyncRequest ( method, url,\n                                                { cache: false,\n                                                  success: request_success,\n                                                  failure: request_failure },\n                                                postdata);\n    if (fn && group) {\n      if (!groups[group]) groups[group] = [ ];\n      groups[group].push(args.tag);\n    }\n\n    return con;\n  }\n\n  /**\n   * Abort all requests created with specified group.\n   *\n   * @param {String} group\n   *   Group identifier.\n   */\n  function abort(group_name) {\n    var group = groups[group_name];\n    if (!group) return;\n    for (var i = 0; i < group.length; i++) {\n      tagged_callbacks[group[i]][0] = -1;\n    }\n    delete groups[group_name];\n  }\n\n\n  /**\n   * Returns the status of the AFS connection, without querying the\n   * server.\n   *\n   * @return {Boolean}\n   *   Returns true if the last AFS call returned successfully, false\n   *   otherwise.\n   */\n  function has_connection()\n  {\n    return connection_ok;\n  }\n\n  /**\n   * Adds a global callback, i.e. a callback that will be called for\n   * every AFS response from the server.\n   *\n   * @param {Function} fn\n   *   Callback function. It will be called with a single argument\n   *   that is the AFS response message in JSON.\n   * @param {Object} scope\n   *   Optional scope correction.\n   * @return {Function}\n   *   Returns the function actually added, which can be used in a later\n   *   call to remove_global_callback.\n   */\n  function add_global_callback (fn, scope)\n  {\n    if (scope)\n      fn = ROXEN.bind (scope, fn);\n    global_callbacks.push (fn);\n    return fn;\n  }\n\n  /**\n   * Removes a callback from the set of global callbacks.\n   *\n   * @param {Function} fn\n   *   Callback to remove. Nothing happens if it doesn't match any\n   *   registered callback.\n   */\n  function remove_global_callback (fn)\n  {\n    for (var i = 0; i < global_callbacks.length; i++)\n      if (global_callbacks[i] === fn) {\n        global_callbacks.splice (i, 1);\n        break;\n      }\n  }\n\n  /**\n   * Adds a callback that will be called whenever there is a low-level\n   * AFS error; either a connection error or a syntax error in a JSON\n   * response.\n   *\n   * @param {Function} fn\n   *   Callback function. It will be called with a single argument\n   *   which is either a YAHOO.util.Connect.asyncRequest or XMLHttpRequest\n   *   failure handler response, or an exception object thrown by\n   *   YAHOO.lang.JSON.parse.\n   * @param {Object} scope\n   *   Optional scope correction.\n   * @return {Function}\n   *   Returns the function actually added, which can be used in a later\n   *   call to remove_error_callback.\n   */\n  function add_error_callback (fn, scope)\n  {\n    if (scope)\n      fn = ROXEN.bind (scope, fn);\n    error_callbacks.push (fn);\n    return fn;\n  }\n\n  /**\n   * Removes a callback from the set of callbacks called for low-level\n   * AFS errors.\n   *\n   * @param {Function} fn\n   *   Callback to remove. Nothing happens if it doesn't match any\n   *   registered callback.\n   */\n  function remove_error_callback (fn)\n  {\n    for (var i = 0; i < error_callbacks.length; i++)\n      if (error_callbacks[i] === fn) {\n        error_callbacks.splice (i, 1);\n        break;\n      }\n  }\n\n  function poll_callback (response)\n  {\n    if (poll_timeout == -1 && !ROXEN.isUndefined (response.poll_interval))\n      poll_delay = response.poll_interval;\n  }\n\n  function restart_poll (after_error)\n  {\n    if (poll_timeout >= -1 && !poll_delay_timeout_id) {\n      var delay = (after_error ? poll_error_delay : poll_delay) * 1000;\n      if (debug_log > 2)\n        ROXEN.log (\"AFS poll delay \" + delay + \" ms\");\n      poll_delay_timeout_id =\n        window.setTimeout (function () {\n          poll_delay_timeout_id = undefined;\n          call (\"poll\",\n                {timeout  : poll_timeout,\n                 interval : poll_delay},\n                poll_callback);\n        }, delay);\n    }\n  }\n\n  /**\n   * (Re)initializes the AFS lib. All open connections are forgotten,\n   * and a poll action is started right away (provided polling is\n   * enabled).\n   *\n   * Global and error callbacks are not forgotten, and responses from\n   * old open connections can still be delivered to them (subject to\n   * change if necessary).\n   *\n   * @param {String}   actions_prefix   Path prefix for all AFS actions.\n   *                                    If not provided /actions/ is used.\n   * @param {String}   session_var      Session variable name. Will be set to\n   *                                    \"session_var\" If not provided.\n   * @param {Number}   poll_timeout     Poll timeout in seconds, or -1 for\n   *                                    auto mode (default), and -2 to disable.\n   */\n  function init(options)\n  {\n    if (options) {\n      if (options.actions_prefix)\n        actions_prefix = options.actions_prefix;\n      if (options.session_var)\n        session_var = options.session_var;\n      if (options.poll_timeout)\n        poll_timeout = options.poll_timeout;\n    }\n\n    if (debug_log)\n      ROXEN.log (\"AFS init\");\n\n    connection_ok = false;\n    open_connections = 0;\n    tagged_callbacks = {};\n\n    if (poll_delay_timeout_id) {\n      clearTimeout (poll_delay_timeout_id);\n      poll_delay_timeout_id = undefined;\n    }\n\n    if (poll_timeout >= -1 && !open_connections)\n      call (\"poll\",\n            {timeout  : poll_timeout,\n             interval : poll_delay},\n            poll_callback);\n\n    is_initialized = true;\n  }\n\n  /**\n   * Will return true after init() has been called once.\n   */\n  function initialized() {\n    return is_initialized;\n  }\n\n  /**\n   * Makes an asynchronous GET request to any URL.\n   *\n   * Note that this really has nothing to do with AFS.\n   *\n   * @method request\n   * @param {String}   url   Requested URL.\n   * @param {Function} fn    Callback function to run when done.\n   *                         fn's argument list is (result, status).\n   *                         status is AFS_REQUEST_SUCCESS or\n   *                         AFS_REQUEST_FAILURE.\n   * @param {Object}   scope Scope correction (optional).\n   * @return {Object}        Returns the connection object.\n   */\n  function request(url, fn, scope) {\n    var cb = {\n      cache: false,\n      success: function (o) {\n        fn.call(scope, o, \"AFS_REQUEST_SUCCESS\");\n      },\n      failure: function  (o) {\n        ROXEN.log(\"ROXEN.AFS: connection error: \" +\n                   o.status + \" \" + o.statusText);\n        fn.call(scope, o, \"AFS_REQUEST_FAILURE\");\n      }\n    };\n    return YAHOO.util.Connect.asyncRequest(\"GET\", url, cb);\n  }\n\n  return {\n    call: call,\n    post: post,\n    post_files: post_files,\n    abort: abort,\n    has_connection: has_connection,\n    add_global_callback: add_global_callback,\n    remove_global_callback: remove_global_callback,\n    add_error_callback: add_error_callback,\n    remove_error_callback: remove_error_callback,\n    init: init,\n    initialized: initialized,\n    request: request\n  };\n}();\n","(function() {\n\n  ROXEN.run = {};\n\n  /**\n   * Executed after system load.\n   * @method main\n   */\n  ROXEN.main = function(options) {\n    ROXEN.AFS.init(options);\n  };\n})();\n"]} 
(No newline at end of file)