function htmlspecialchars(a){if(typeof(a)=="undefined"||!a.toString){return""}if(a===false){return"0"}else{if(a===true){return"1"}}return a.toString().replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function escape_js_quotes(a){if(typeof(a)=="undefined"||!a.toString){return""}return a.toString().replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/"/g,"\\x22").replace(/'/g,"\\'").replace(/</g,"\\x3c").replace(/>/g,"\\x3e").replace(/&/g,"\\x26")}function trim(a){if(typeof(a)=="undefined"||!a.toString){return""}return a.toString().replace(/^\s*|\s*$/g,"")}function nl2br(a){if(typeof(a)=="undefined"||!a.toString){return""}return a.toString().replace(/\n/g,"<br />")}function sprintf(){if(arguments.length==0){Util.warn("sprintf() was called with no arguments; it should be called with at least one argument.");return""}var f=["This is an argument vector."];for(var g=arguments.length-1;g>0;g--){if(typeof(arguments[g])=="undefined"){Util.log("You passed an undefined argument (argument "+g+" to sprintf(). Pattern was: `"+(arguments[0])+"'.","error");
f.push("")}else{if(arguments[g]===null){f.push("")}else{if(arguments[g]===true){f.push("true")}else{if(arguments[g]===false){f.push("false")}else{if(!arguments[g].toString){Util.log("Argument "+(g+1)+" to sprintf() does not have a toString() method. The pattern was: `"+(arguments[0])+"'.","error");return""}f.push(arguments[g])}}}}}var e=arguments[0];e=e.toString().split("%");var c=e.length;var j=e[0];for(var g=1;g<c;g++){if(f.length==0){Util.log("Not enough arguments were provide to sprintf(). The pattern was: `"+(arguments[0])+"'.","error");return""}if(!e[g].length){j+="%";continue}switch(e[g].substr(0,1)){case"s":j+=htmlspecialchars(f.pop().toString());break;case"h":j+=f.pop().toString();break;case"d":j+=parseInt(f.pop());break;case"f":j+=parseFloat(f.pop());break;case"q":j+="`"+htmlspecialchars(f.pop().toString())+"'";break;case"e":j+="'"+escape_js_quotes(f.pop().toString())+"'";break;case"L":var d=f.pop();for(var g=0;g<d.length;g++){d[g]="`"+htmlspecialchars(f.pop().toString())+"'"}if(d.length>1){d[d.length-1]="and "+d[d.length-1]
}j+=d.join(", ");break;case"x":x=f.pop();var i="?";var a="?";try{if(typeof(x.line)!="undefined"){i=x.line}else{if(typeof(x.lineNumber)!="undefined"){i=x.lineNumber}}if(typeof(x.sourceURL)!="undefined"){a=x.sourceURL}else{if(typeof(x.fileName)!="undefined"){a=h.fileName}}}catch(b){}var h="[An Exception]";try{h=x.message||x.toString()}catch(b){}j+=h+" [at line "+i+" in "+a+"]";break;default:j+="%"+e[g].substring(0,1);break}j+=e[g].substring(1)}if(f.length>1){Util.log("Too many arguments ("+(f.length-1)+" extras) were passed to sprintf(). Pattern was: `"+(arguments[0])+"'.","error")}return j}String.prototype._split=String.prototype.split;String.prototype.split=function(g,b){var a="";if(g===null||b===null){return[]}else{if(typeof g=="string"){return this._split(g,b)}else{if(g===undefined){return[this.toString()]}else{if(g instanceof RegExp){if(!g._2||!g._1){a=g.toString().replace(/^[\S\s]+\//,"");if(!g._1){if(!g.global){g._1=new RegExp(g.source,"g"+a)}else{g._1=1}}}separator1=g._1==1?g:g._1;
var e=(g._2?g._2:g._2=new RegExp("^"+separator1.source+"$",a));if(b===undefined||b<0){b=false}else{b=Math.floor(b);if(!b){return[]}}var d,c=[],h=0,f=0;while((b?f++<=b:true)&&(d=separator1.exec(this))){if((d[0].length===0)&&(separator1.lastIndex>d.index)){separator1.lastIndex--}if(separator1.lastIndex>h){if(d.length>1){d[0].replace(e,function(){for(var i=1;i<arguments.length-2;i++){if(arguments[i]===undefined){d[i]=undefined}}})}c=c.concat(this.substring(h,d.index),(d.index===this.length?[]:d.slice(1)));h=separator1.lastIndex}if(d[0].length===0){separator1.lastIndex++}}return(h===this.length)?(separator1.test("")?c:c.concat("")):(b?c:c.concat(this.substring(h)))}else{return this._split(g,b)}}}}};