var XRegExp;if(XRegExp)throw Error("can't load XRegExp twice in the same frame");(function(e){function c(e,t){if(!XRegExp.isRegExp(e))throw TypeError("type RegExp expected");var n=e._xregexp;return e=XRegExp(e.source,h(e)+(t||"")),n&&(e._xregexp={source:n.source,captureNames:n.captureNames?n.captureNames.slice(0):null}),e}function h(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function p(e,t,n,r){var o=s.length,u,a,f;i=!0;try{while(o--){f=s[o];if(n&f.scope&&(!f.trigger||f.trigger.call(r))){f.pattern.lastIndex=t,a=f.pattern.exec(e);if(a&&a.index===t){u={output:f.handler.call(r,a,n),match:a};break}}}}catch(l){throw l}finally{i=!1}return u}function d(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(var r=n||0;r-1},setFlag:function(e){r+=e}};while(a1&&d(n,"")>-1&&(i=RegExp(this.source,o.replace.call(h(this),"g","")),o.replace.call((t+"").slice(n.index),i,function(){for(var t=1;tn.index&&this.lastIndex--}return this.global||(this.lastIndex=s),n},RegExp.prototype.test=function(e){var t,n;return this.global||(n=this.lastIndex),t=o.exec.call(this,e),t&&!a&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,this.global||(this.lastIndex=n),!!t},String.prototype.match=function(e){XRegExp.isRegExp(e)||(e=RegExp(e));if(e.global){var t=o.match.apply(this,arguments);return e.lastIndex=0,t}return e.exec(this)},String.prototype.replace=function(e,n){var r=XRegExp.isRegExp(e),i,s,u,a;return r?(e._xregexp&&(i=e._xregexp.captureNames),e.global||(a=e.lastIndex)):e+="",Object.prototype.toString.call(n)==="[object Function]"?s=o.replace.call(this+"",e,function(){if(i){arguments[0]=new String(arguments[0]);for(var t=0;t-1?e[o+1]:t)}switch(n){case"$":return"$";case"&":return e[0];case"`":return e[e.length-1].slice(0,e[e.length-2]);case"'":return e[e.length-1].slice(e[e.length-2]+e[0].length);default:var s="";n=+n;if(!n)return t;while(n>e.length-3)s=String.prototype.slice.call(n,-1)+s,n=Math.floor(n/10);return(n?e[n]||"":"$")+s}})})),r&&(e.global?e.lastIndex=0:e.lastIndex=a),s},String.prototype.split=function(t,n){if(!XRegExp.isRegExp(t))return o.split.apply(this,arguments);var r=this+"",i=[],s=0,u,a;if(n===e||+n<0)n=Infinity;else{n=Math.floor(+n);if(!n)return[]}t=XRegExp.copyAsGlobal(t);while(u=t.exec(r)){if(t.lastIndex>s){i.push(r.slice(s,u.index)),u.length>1&&u.index=n)break}t.lastIndex===u.index&&t.lastIndex++}return s===r.length?(!o.test.call(t,"")||a)&&i.push(""):i.push(r.slice(s)),i.length>n?i.slice(0,n):i},XRegExp.addToken(/\(\?#[^)]*\)/,function(e){return o.test.call(r,e.input.slice(e.index+e[0].length))?"":"(?:)"}),XRegExp.addToken(/\((?!\?)/,function(){return this.captureNames.push(null),"("}),XRegExp.addToken(/\(\?<([$\w]+)>/,function(e){return this.captureNames.push(e[1]),this.hasNamedCapture=!0,"("}),XRegExp.addToken(/\\k<([\w$]+)>/,function(e){var t=d(this.captureNames,e[1]);return t>-1?"\\"+(t+1)+(isNaN(e.input.charAt(e.index+e[0].length))?"":"(?:)"):e[0]}),XRegExp.addToken(/\[\^?]/,function(e){return e[0]==="[]"?"\\b\\B":"[\\s\\S]"}),XRegExp.addToken(/^\(\?([imsx]+)\)/,function(e){return this.setFlag(e[1]),""}),XRegExp.addToken(/(?:\s+|#.*)+/,function(e){return o.test.call(r,e.input.slice(e.index+e[0].length))?"":"(?:)"},XRegExp.OUTSIDE_CLASS,function(){return this.hasFlag("x")}),XRegExp.addToken(/\./,function(){return"[\\s\\S]"},XRegExp.OUTSIDE_CLASS,function(){return this.hasFlag("s")})})();if(typeof SyntaxHighlighter=="undefined")var SyntaxHighlighter=function(){function t(e,t){return e.className.indexOf(t)!=-1}function n(e,n){t(e,n)||(e.className+=" "+n)}function r(e,t){e.className=e.className.replace(t,"")}function i(e){var t=[];for(var n=0;n(.*?))\\]$"),i=new XRegExp("(?[\\w-]+)\\s*:\\s*(?[\\w-%#]+|\\[.*?\\]|\".*?\"|'.*?')\\s*;?","g");while((t=i.exec(e))!=null){var s=t.value.replace(/^['"]|['"]$/g,"");if(s!=null&&r.test(s)){var o=r.exec(s);s=o.values.length>0?o.values.split(/\s*,\s*/):[]}n[t.name]=s}return n}function x(t,n){return t==null||t.length==0||t=="\n"?t:(t=t.replace(/'+e+""})),t)}function T(e,t){var n=e.toString();while(n.length|<br\s*\/?>/gi;return e.config.bloggerMode==1&&(t=t.replace(n,"\n")),e.config.stripBrs==1&&(t=t.replace(n,"")),t}function L(e){return e.replace(/^\s+|\s+$/g,"")}function A(e){var t=s(k(e)),n=new Array,r=/^\s*/,i=1e3;for(var o=0;o0;o++){var u=t[o];if(L(u).length==0)continue;var a=r.exec(u);if(a==null)return e;i=Math.min(a[0].length,i)}if(i>0)for(var o=0;ot.index?1:e.lengtht.length?1:0}function M(t,n){function r(e,t){return e[0]}var i=0,s=null,o=[],u=n.func?n.func:r;while((s=n.regex.exec(t))!=null){var a=u(s,n);typeof a=="string"&&(a=[new e.Match(a,s.index,n.css)]),o=o.concat(a)}return o}function _(t){var n=/(.*)((>|<).*)/;return t.replace(e.regexLib.url,function(e){var t="",r=null;if(r=n.exec(e))e=r[1],t=r[2];return''+e+""+t})}function D(){var e=document.getElementsByTagName("script"),t=[];for(var n=0;n)/gm,url:/\w+:\/\/[\w-.\/?%&=:@;#]*/g,phpScriptTags:{left:/(<|<)\?(?:=|php)?/g,right:/\?(>|>)/g,eof:!0},aspScriptTags:{left:/(<|<)%=?/g,right:/%(>|>)/g},scriptScriptTags:{left:/(<|<)\s*script.*?(>|>)/gi,right:/(<|<)\/\s*script\s*(>|>)/gi}},toolbar:{getHtml:function(t){function s(t,n){return e.toolbar.getButtonHtml(t,n,e.config.strings[n])}var n='
',r=e.toolbar.items,i=r.list;for(var o=0;o'+n+""},handler:function(t){function i(e){var t=new RegExp(e+"_(\\w+)"),n=t.exec(r);return n?n[1]:null}var n=t.target,r=n.className||"",s=u(c(n,".syntaxhighlighter").id),o=i("command");s&&o&&e.toolbar.items[o].execute(s),t.preventDefault()},items:{list:["expandSource","help"],expandSource:{getHtml:function(t){if(t.getParam("collapse")!=1)return"";var n=t.getParam("title");return e.toolbar.getButtonHtml(t,"expandSource",n?n:e.config.strings.expandSource)},execute:function(e){var t=a(e.id);r(t,"collapsed")}},help:{execute:function(t){var n=m("","_blank",500,250,"scrollbars=0"),r=n.document;r.write(e.config.strings.aboutDialog),r.close(),n.focus()}}}},findElements:function(t,n){var r=n?[n]:i(document.getElementsByTagName(e.config.tagName)),s=e.config,o=[];s.useScriptTags&&(r=r.concat(D()));if(r.length===0)return o;for(var u=0;ur)break;s.index==n.index&&s.length>n.length?e[t]=null:s.index>=n.index&&s.index'+n+"
"},getLineNumbersHtml:function(t,n){var r="",i=s(t).length,o=parseInt(this.getParam("first-line")),u=this.getParam("pad-line-numbers");u==1?u=(o+i-1).toString().length:isNaN(u)==1&&(u=0);for(var a=0;a'+c+"":"")+f)}return t},getTitleHtml:function(e){return e?""+e+"":""},getMatchesHtml:function(e,t){function s(e){var t=e?e.brushName||i:i;return t?t+" ":""}var n=0,r="",i=this.getParam("brush","");for(var o=0;o'+(this.getParam("toolbar")?e.toolbar.getHtml(this):"")+''+this.getTitleHtml(this.getParam("title"))+""+""+(gutter?'":"")+'"+""+""+"
'+this.getLineNumbersHtml(t)+"'+'
'+n+"
"+"
"+"",n},getDiv:function(t){t===null&&(t=""),this.code=t;var n=this.create("div");return n.innerHTML=this.getHtml(t),this.getParam("toolbar")&&g(l(n,".toolbar"),"click",e.toolbar.handler),this.getParam("quick-code")&&g(l(n,".code"),"dblclick",H),n},init:function(t){this.id=p(),f(this),this.params=d(e.defaults,t||{}),this.getParam("light")==1&&(this.params.toolbar=this.params.gutter=!1)},getKeywords:function(e){return e=e.replace(/^\s+|\s+$/g,"").replace(/\s+/g,"|"),"\\b(?:"+e+")\\b"},forHtmlScript:function(e){var t={end:e.right.source};e.eof&&(t.end="(?:(?:"+t.end+")|$)"),this.htmlScript={left:{regex:e.left,css:"script"},right:{regex:e.right,css:"script"},code:new XRegExp("(?"+e.left.source+")"+"(?.*?)"+"(?"+t.end+")","sgi")}}},e}();typeof exports!="undefined"?exports.SyntaxHighlighter=SyntaxHighlighter:null