1/*
2*  Checks if property is derived from prototype, applies method if it is not exists
3*
4*  @param string property name
5*  @return bool true if prototyped
6*  @access public
7*/
8if('undefined'==typeof Object.hasOwnProperty){Object.prototype.hasOwnProperty=function(i){return!('undefined'==typeof this[i]||this.constructor&&this.constructor.prototype[i]&&this[i]===this.constructor.prototype[i]);}}if(!window.findPath){function findPath(i){var I=document.getElementsByTagName('script'),l=new RegExp('^(.*/|)('+i+')([#?]|$)');for(var o=0,O=I.length;o<O;o++){var Q=String(I[o].src).match(l);if(Q){if(Q[1].match(/^((https?|file)\:\/{2,}|\w:[\\])/))return Q[1];if(Q[1].indexOf("/")==0)return Q[1];b=document.getElementsByTagName('base');if(b[0]&&b[0].href)return b[0].href+Q[1];return(document.location.href.match(/(.*[\/\\])/)[0]+Q[1]).replace(/^\/+/,"");}}return null}}var PSyHi=function(){var i=this;var I={lang:'en'};var l={'interface':"<div id=\"{ID}\" class=\"PSyHi_Container\">"+"<div class=\"Controls\">{TOOLBAR}<span class=\"stats\">{LNG_TIMINGS}<strong>{PROCESSING}</strong>, {LNG_TOKENS}<strong>{TOKENCOUNT}</strong>, {LNG_SRCLENGTH}<strong>{SRCLENGTH}</strong></span></div>"+"<div class=\"PageContainer showColorText\">"+"<div class=\"CodeContainer\"><div class=\"TextContainer\"><ol>{STRINGS}</ol></div></div>"+"<textarea wrap=\"off\" readonly=\"true\"></textarea>"+"<div class=\"copyrights\"><h1>PSyHi v0.1 (P Syntax Highlighter)</h1>"+"<p><span class=\"copy\">&copy; 2007 <a href=\"mailto:ilya@lebedev.net\">Ilya Lebedev &lt;ilya@lebedev.net&gt;</a></span></p>"+"<h1>{LNG_ACKNOWLEGEMENTS}</h1>"+"<p>Tokenizer library: <a href=\"http://code.google.com/p/google-code-prettify/\" target=\"_blank\">Google Code Prettify</a><br />"+"Cross-browser clipboard copy: <a href=\"http://www.jeffothy.com/weblog/clipboard-copy/\" target=\"_blank\">Jeffothy's Clipboard Copy</a></p>"+"</div>"+"</div></div>",lang:{en:{'linenum':'Line numbers on/off','togglesrc':'Toggle source','about':'About','clipboard':'Copy to clipboard','langsupport':'Supported languages:','acknowlegements':'Acknowlegements','expandsrc':'Toggle code visibility','timings':'Processing time: ','tokens':'tokens: ','srclength':'source length: '}}};var o=function(e){return e;return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");};var O=function(e,v){var V="";V+="<li class=\""+(e%2?"odd":"even")+"\" ><pre>"+v+"</pre></li>";return V};var Q=function(e){var v=PR_lexOne(e),V=[],x=0;for(var X=0,z=v.length;X<z;X++){var Z=[];while(v[X]&&v[X].style!='nl'){switch(v[X].style){case'pln':Z[Z.length]=o(v[X].token);break;case'com':var w=v[X].token.split(/\r\n|\r|\n/);for(var W=0,s=w.length;W<s;W++){if(w[W]){V[V.length]=O(++x,Z.join("")+"<span class=\""+v[X].style+"\">"+o(w[W])+"</span>");Z=[]}}break;default:Z[Z.length]="<span class=\""+v[X].style+"\">"+o(v[X].token)+"</span>";break}X++}if(Z.length>0)V[V.length]=O(++x,Z.join(""));}V.tokenCount=v.length;return V};var _=function(e){var v=l.lang[I.lang]||l.lang.en;for(var V in v){if(v.hasOwnProperty(V)){e=e.replace('{LNG_'+V.toUpperCase()+'}',v[V]);}}return e};var c=function(e){var v=[];for(var V in PSyHi.toolbar){if(PSyHi.toolbar.hasOwnProperty(V)){var x=PSyHi.toolbar[V];v[v.length]="<input type=\"button\" title=\""+x.label+"\" onclick=\"PSyHi.toolbar."+V+".handler(this);\" class=\""+x['class']+"\" />"}}return e.replace("{TOOLBAR}",v.join("&nbsp;"));};var C=function(){l.interface=_(c(l.interface));var e=document.getElementsByTagName('pre'),v=e.length-1,V,x,X,z=document.createElement('div'),Z,w;for(;v>=0;v--){if(V=e[v].className.match(/code/)){w=new Date;try{Z=e[v].value||e[v].innerHTML}catch(err){continue}x=Q(Z);if(!x)continue;while(document.getElementById("PSyHi_Container_"+v))v++;X="PSyHi_Container_"+v;z.innerHTML=l.interface.replace("{STRINGS}",x.join("")).replace("{ID}",X).replace('{TOKENCOUNT}',x.tokenCount).replace('{SRCLENGTH}',Math.round(Z.length/10.24)/100+'Kb');var W=z.firstChild,s=W.childNodes[1];s.childNodes[1].value=Z.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");e[v].style.padding=0;e[v].style.margin=0;e[v].style.border=0;var S=e[v].offsetWidth;var k=e[v].offsetHeight;e[v].style.display='none';W.style.width=S+"px";s.style.width=S+"px";s.childNodes[1].style.height=k+"px";e[v].parentNode.insertBefore(W,e[v]);k=Math.min(k,s.firstChild.firstChild.offsetHeight);s.firstChild.style.height=k+(s.firstChild.offsetHeight-s.firstChild.clientHeight)+"px";s.firstChild.style.height=k+(s.firstChild.offsetHeight-s.firstChild.clientHeight)+"px";W.firstChild.lastChild.innerHTML=W.firstChild.lastChild.innerHTML.replace('{PROCESSING}',((new Date).valueOf()-w.valueOf())+'ms')}}z=null};C();};PSyHi.toolbar={expand:{'class':'expandSource','label':'{LNG_EXPANDSRC}','handler':function(i){var I=i.parentNode.parentNode.childNodes[1];I.style.display=I.style.display=='none'?'':'none';i.className=i.className=='expandSource'?'collapseSource':'expandSource'}},togglelinenumbers:{'class':'toggleLineNumbers','label':'{LNG_LINENUM}','handler':function(i){i=i.parentNode.parentNode.getElementsByTagName('ol')[0];i.className=i.className.match(/(^|\s)noLineNumbers(\s|$)/)?i.className.replace(/(^|\s)noLineNumbers(\s|$)/,""):i.className+" noLineNumbers"}},togglesource:{'class':'toggleSource','label':'{LNG_TOGGLESRC}','handler':function(i){i=i.parentNode.nextSibling;cn=i.className;if(cn.match(/(^|\s)showColorText(\s|$)/)){i.className=cn.replace(/(^|\s)show(ColorText|Copy)(\s|$)/g," showPlainText");}else{i.className=cn.replace(/(^|\s)show(PlainText|Copy)(\s|$)/g," showColorText");}}},clipboardcopy:{'class':'clipboardCopy','label':'{LNG_CLIPBOARD}','handler':function(i){if(window.clipboardData){window.clipboardData.setData('text',I);}else{if(!arguments.callee.fc){arguments.callee.fc=document.createElement('div');document.body.appendChild(arguments.callee.fc);}if(!arguments.callee.tpath)arguments.callee.tpath='/lib/plugins/code/';var I=i.parentNode.parentNode.getElementsByTagName('textarea')[0].value;arguments.callee.fc.innerHTML='<embed src="'+arguments.callee.tpath+'clipboard.swf" FlashVars="clipboard='+encodeURIComponent(I)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>'}}},toggleabout:{'class':'toggleAbout','label':'{LNG_ABOUT}','handler':function(i){i=i.parentNode.nextSibling;cn=i.className;if(cn.match(/(^|\s)showCopy(\s|$)/)){i.className=cn.replace(/(^|\s)showCopy(\s|$)/g," showColorText");}else{i.className=cn.replace(/(^|\s)show(Plain|Color)Text(\s|$)/g,"")+" showCopy"}}}};new function(){var i=document.getElementsByTagName("*").length;if(arguments.callee.nodes!=i){arguments.callee.nodes=i;setTimeout(arguments.callee,100);}else{new PSyHi}};
9
10// Copyright (C) 2006 Google Inc.
11var PR_keywords={};(function(){var i="abstract bool break case catch char class const "+"const_cast continue default delete deprecated dllexport dllimport do "+"double dynamic_cast else enum explicit extern false float for friend "+"goto if inline int long mutable naked namespace new noinline noreturn "+"nothrow novtable operator private property protected public register "+"reinterpret_cast return selectany short signed sizeof static "+"static_cast struct switch template this thread throw true try typedef "+"typeid typename union unsigned using declaration, directive uuid "+"virtual void volatile while typeof";var I="as base by byte checked decimal delegate descending "+"event finally fixed foreach from group implicit in interface internal "+"into is lock null object out override orderby params readonly ref sbyte "+"sealed stackalloc string select uint ulong unchecked unsafe ushort var";var l="package synchronized boolean implements import throws "+"instanceof transient extends final strictfp native super";var o="debugger export function with NaN Infinity";var O="require sub unless until use elsif BEGIN END";var Q="and assert def del elif except exec global lambda "+"not or pass print raise yield False True None";var _="then end begin rescue ensure module when undef next "+"redo retry alias defined";var c="done fi";var C=[i,I,l,o,O,Q,_,c];for(var e=0;e<C.length;e++){var v=C[e].split(' ');for(var V=0;V<v.length;V++){if(v[V]){PR_keywords[v[V]]=true}}}}).call(this);var PR_STRING='str';var PR_KEYWORD='kwd';var PR_COMMENT='com';var PR_TYPE='typ';var PR_LITERAL='lit';var PR_PUNCTUATION='pun';var PR_PLAIN='pln';var PR_REGEX='reg';var PR_CONSTANT='const';var PR_TAG='tag';var PR_DECLARATION='dec';var PR_SOURCE='src';var PR_ATTRIB_NAME='atn';var PR_ATTRIB_VALUE='atv';var PR_NL='nl';var PR_TAB_WIDTH=8;function PR_TokenEnd(i,I){if(undefined===I){throw new Error('BAD');}if('number'!=typeof(i)){throw new Error('BAD');}this.end=i;this.style=I}PR_TokenEnd.prototype.toString=function(){return'[PR_TokenEnd '+this.end+(this.style?':'+this.style:'')+']'};function PR_Token(i,I){if(undefined===I){throw new Error('BAD');}this.token=i;this.style=I}PR_Token.prototype.toString=function(){return'[PR_Token '+this.token+(this.style?':'+this.style:'')+']'};function PR_DecodeHelper(){this.next=0;this.ch='\0'}var PR_NAMED_ENTITIES={'lt':'<','gt':'>','quot':'"','apos':"'",'amp':'&'};PR_DecodeHelper.prototype.decode=function(i,I){var l=I+1;var o=i.charAt(I);if('&'===o){var O=i.indexOf(';',l);if(O>=0&&O<l+4){var Q=i.substring(l,O);var _=null;if(Q.charAt(0)==='#'){var c=Q.charAt(1);var C;if(c==='x'||c==='X'){C=parseInt(Q.substring(2),16);}else{C=parseInt(Q.substring(1),10);}if(!isNaN(C)){_=String.fromCharCode(C);}}if(!_){_=PR_NAMED_ENTITIES[Q.toLowerCase()]}if(_){o=_;l=O+1}else{l=I+1;o='\0'}}}this.next=l;this.ch=o;return this.ch};function PR_isWordChar(i){return(i>='a'&&i<='z')||(i>='A'&&i<='Z');}function PR_isIdentifierStart(i){return PR_isWordChar(i)||i=='_'||i=='$'||i=='@'}function PR_isIdentifierPart(i){return PR_isIdentifierStart(i)||PR_isDigitChar(i);}function PR_isSpaceChar(i){return"\t \r\n".indexOf(i)>=0}function PR_isDigitChar(i){return i>='0'&&i<='9'}function PR_trim(i){var I=0,l=i.length-1;while(I<=l&&PR_isSpaceChar(i.charAt(I))){++I}while(l>I&&PR_isSpaceChar(i.charAt(l))){--l}return i.substring(I,l+1);}function PR_startsWith(i,I){return i.length>=I.length&&I==i.substring(0,I.length);}function PR_endsWith(i,I){return i.length>=I.length&&I==i.substring(i.length-I.length,i.length);}var REGEXP_PRECEDER_PATTERN=(function(){var i=["!","!=","!==","#","%","%=","&","&&","&&=","&=","(","*","*=","+=",",","-=","->","/","/=",":","::",";","<","<<","<<=","<=","=","==","===",">",">=",">>",">>=",">>>",">>>=","?","@","[","^","^=","^^","^^=","{","|","|=","||","||=","~","break","case","continue","delete","do","else","finally","instanceof","return","throw","try","typeof"];var I='(?:'+'(?:(?:^|[^0-9\.])\\.{1,3})|'+'(?:(?:^|[^\\+])\\+)|'+'(?:(?:^|[^\\-])-)';for(var l=0;l<i.length;++l){var o=i[l];if(PR_isWordChar(o.charAt(0))){I+='|\\b'+o}else{I+='|'+o.replace(/([^=<>:&])/g,'\\$1');}}I+=')\\s*$';return new RegExp(I);})();function PR_prefixMatch(i,I,l){if(I<l.length){return false}for(var o=0,O=l.length;o<O;++o){if(l.charAt(o)!=i[o]){return false}}return true}function PR_attribToHtml(i){return i.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\"/g,'&quot;').replace(/\xa0/,'&nbsp;');}function PR_textToHtml(i){return i.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\xa0/g,'&nbsp;');}function PR_isRawContent(i){return'XMP'==i.tagName}var PR_innerHtmlWorks=null;function PR_getInnerHtml(i){if(null==PR_innerHtmlWorks){var I=document.createElement('PRE');I.appendChild(document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));PR_innerHtmlWorks=!/</.test(I.innerHTML);}if(PR_innerHtmlWorks){var l=i.innerHTML;if(PR_isRawContent(i)){l=PR_textToHtml(l);}return l}var o=[];for(var O=i.firstChild;O;O=O.nextSibling){PR_normalizedHtml(O,o);}return o.join('');}function PR_normalizedHtml(i,I){switch(i.nodeType){case 1:var l=i.tagName.toLowerCase();I.push('\074',l);for(var o=0;o<i.attributes.length;++o){var O=i.attributes[o];if(!O.specified){continue}I.push(' ');PR_normalizedHtml(O,I);}I.push('>');for(var Q=i.firstChild;Q;Q=Q.nextSibling){PR_normalizedHtml(Q,I);}if(i.firstChild||!/^(?:br|link|img)$/.test(l)){I.push('<\/',l,'>');}break;case 2:I.push(i.name.toLowerCase(),'="',PR_attribToHtml(i.value),'"');break;case 3:case 4:I.push(PR_textToHtml(i.nodeValue));break}}function PR_expandTabs(i,I){var l='                ';var o=0;var O=new PR_DecodeHelper();var Q=[];for(var _=0;_<i.length;++_){var c=i[_];if(c.style==null){Q.push(c);continue}var C=c.token;var e=0;var v=[];for(var V=0,x=C.length;V<x;V=O.next){O.decode(C,V);var X=O.ch;switch(X){case'\t':v.push(C.substring(e,V));var z=I-(o%I);o+=z;for(;z>=0;z-=l.length){v.push(l.substring(0,z));}e=O.next;break;case'\n':case'\r':o=0;break;default:++o}}v.push(C.substring(e));Q.push(new PR_Token(v.join(''),c.style));}return Q}function PR_chunkify(i){var I= /(?:[^<]+|<\/?[a-zA-Z][^>]*>|<)/g;var l=i.match(I);var o=[];if(l){var O=null;for(var Q=0,_=l.length;Q<_;++Q){var c=l[Q];var C;if(c.length<2||c.charAt(0)!=='<'){if(O&&O.style===PR_PLAIN){O.token+=c;continue}C=PR_PLAIN}else{C=null}O=new PR_Token(c,C);o.push(O);}}return o}function PR_splitChunks(i,I){var l=[];var o=0;var O=0;var Q=0;var _=new PR_Token('',null);for(var c=0,C=I.length,e=0;c<C;++c){var v=I[c];var V=v.end;if(V===e){continue}var x=V-O;var X=_.token.length-Q;while(X<=x){if(X>0){l.push(new PR_Token(_.token.substring(Q,_.token.length),null==_.style?null:v.style));}O+=X;Q=0;if(o<i.length){_=i[o++]}x=V-O;X=_.token.length-Q}if(x){l.push(new PR_Token(_.token.substring(Q,Q+x),v.style));O+=x;Q+=x}}return l}function PR_splitMarkup(i){var I=[];var l=0;var o=0;var O=-1;var Q=new Array(12);var _=0;var c=null;var C=new PR_DecodeHelper();for(var e=0,v=i.length;e<v;++e){var V=i[e];if(PR_PLAIN!=V.style){o+=V.token.length;continue}var x=V.token;var X=0;for(var z=0,Z=x.length;z<Z;){C.decode(x,z);var w=C.ch;var W=C.next;var s=null;switch(l){case 0:if('<'==w){l=1}if(w.match(/[\r\n]/)){l=13}break;case 1:_=0;if('/'==w){l=7}else if(null==c){if('!'==w){l=2}else if(PR_isWordChar(w)){l=8}else if('?'==w){l=9}else if('%'==w){l=11}else if('<'!=w){l=0}}else if('<'!=w){l=0}break;case 2:if('-'==w){l=4}else if(PR_isWordChar(w)){l=3}else if('<'==w){l=1}else{l=0}break;case 3:if('>'==w){l=0;s=PR_DECLARATION}break;case 4:if('-'==w){l=5}break;case 5:if('-'==w){l=6}break;case 6:if('>'==w){l=0;s=PR_COMMENT}else if('-'==w){l=6}else{l=4}break;case 7:if(PR_isWordChar(w)){l=8}else if('<'==w){l=1}else{l=0}break;case 8:if('>'==w){l=0;s=PR_TAG}break;case 9:if('?'==w){l=10}break;case 10:if('>'==w){l=0;s=PR_SOURCE}else if('?'!=w){l=9}break;case 11:if('%'==w){l=12}break;case 12:if('>'==w){l=0;s=PR_SOURCE}else if('%'!=w){l=11}break;case 13:_=0;if(!w.match(/[\r\n]/)){l=0;s=PR_NL;W=z}break}if(_<Q.length){Q[_++]=w.toLowerCase();}if(1==l||13==l){O=o+z}z=W;if(s!=null){if(null!=s){if(c){if(PR_prefixMatch(Q,_,c)){c=null}}else{if(PR_prefixMatch(Q,_,'script')){c='/script'}else if(PR_prefixMatch(Q,_,'style')){c='/style'}else if(PR_prefixMatch(Q,_,'xmp')){c='/xmp'}}if(c&&_&&'/'==Q[0]){s=null}}if(null!=s){I.push(new PR_TokenEnd(O,PR_PLAIN));I.push(new PR_TokenEnd(o+W,s));}}}o+=V.token.length}I.push(new PR_TokenEnd(o,PR_PLAIN));return I}function PR_splitStringAndCommentTokens(i){var I=[];var l=0;var o=-1;var O=0;var Q=[];var _='';for(var c=0,C=i.length;c<C;++c){var e=i[c];var v=e.token;if(PR_PLAIN==e.style){var V=new PR_DecodeHelper();var x=-1;var X;for(var z=0,Z=v.length;z<Z;x=z,z=X){V.decode(v,z);var w=V.ch;X=V.next;if(0==l){if(w=='"'||w=='\''||w=='`'){I.push(new PR_TokenEnd(O+z,PR_PLAIN));l=1;o=w}else if(w=='/'){l=3}else if(w=='#'){l=4;I.push(new PR_TokenEnd(O+z,PR_PLAIN));}}else if(1==l){if(w==o){l=0;I.push(new PR_TokenEnd(O+X,'/'==w?PR_REGEX:PR_STRING));}else if(w=='\\'){l=2}}else if(2==l){l=1}else if(3==l){if(w=='/'){l=4;I.push(new PR_TokenEnd(O+x,PR_PLAIN));}else if(w=='*'){l=5;I.push(new PR_TokenEnd(O+x,PR_PLAIN));}else{if((!Q.length||REGEXP_PRECEDER_PATTERN.test(Q.join('')))){l=1;o='/';I.push(new PR_TokenEnd(O+x,PR_PLAIN));}else{l=0;X=z;continue}}}else if(4==l){if(w=='\r'||w=='\n'){l=0;I.push(new PR_TokenEnd(O+z,PR_COMMENT));}}else if(5==l){if(w=='*'){l=6}}else if(6==l){if(w=='/'){l=0;I.push(new PR_TokenEnd(O+X,PR_COMMENT));continue}else if(w!='*'){l=5}}if(3>l||l>6){var W=PR_isSpaceChar(w);if(!(_===' '&&W)){if(Q.length>16){Q.shift();}_=W?' ':w;Q.push(_);}}}}O+=v.length}var s;switch(l){case 1:case 2:s=PR_STRING;break;case 4:case 5:case 6:s=PR_COMMENT;break;default:s=PR_PLAIN;break}I.push(new PR_TokenEnd(O,s));return PR_splitChunks(i,I);}function PR_splitNonStringNonCommentToken(i,I){var l=0;var o=0;var O=new PR_DecodeHelper();var Q;for(var _=0;_<=i.length;_=Q){if(_==i.length){C=-2;Q=_+1}else{O.decode(i,_);Q=O.next;var c=O.ch;var C=o;switch(o){case 0:if(PR_isIdentifierStart(c)){C=1}else if(PR_isDigitChar(c)){C=2}else if(c.match(/[\r\n]/)){C=3}else if(!PR_isSpaceChar(c)){C=3}if(C&&l<_){var e=i.substring(l,_);I.push(new PR_Token(e,PR_PLAIN));l=_}break;case 1:if(!PR_isIdentifierPart(c)){C=-1}break;case 2:if(!(PR_isDigitChar(c)||PR_isWordChar(c)||c=='_')){C=-1}break;case 3:if(PR_isIdentifierStart(c)||PR_isDigitChar(c)||PR_isSpaceChar(c)){C=-1}break}}if(C!=o){if(C<0){if(_>l){var e=i.substring(l,_);var v=new PR_DecodeHelper();v.decode(e,0);var V=v.ch;var x=v.next==e.length;var X;if(PR_isIdentifierStart(V)){if(PR_keywords[e]){X=PR_KEYWORD}else if(V==='@'){X=PR_LITERAL}else{var z=false;if(V>='A'&&V<='Z'){for(var Z=v.next;Z<e.length;Z=v.next){v.decode(e,Z);var w=v.ch;if(w>='a'&&w<='z'){z=true;break}}if(!z&&!x&&e.substring(e.length-2)=='_t'){z=true}}X=z?PR_TYPE:e==e.toUpperCase()?PR_CONSTANT:PR_PLAIN}}else if(PR_isDigitChar(V)){X=PR_LITERAL}else if(!PR_isSpaceChar(V)){X=PR_PUNCTUATION}else if(V.match(/[\r\n]/)){X=PR_NL}else{X=PR_PLAIN}l=_;I.push(new PR_Token(e,X));}o=0;if(C==-1){Q=_;continue}}o=C}}}function PR_tokenizeMarkup(i){if(!(i&&i.length)){return i}var I=PR_splitMarkup(i);return PR_splitChunks(i,I);}function PR_splitTagAttributes(i){var I=[];var l=0;var o=PR_TAG;var O=null;var Q=new PR_DecodeHelper();for(var _=0;_<i.length;++_){var c=i[_];if(PR_TAG==c.style){var C=c.token;var e=0;for(var v=0;v<C.length;){Q.decode(C,v);var V=Q.ch;var x=Q.next;var X=null;var z=null;if(V=='>'){if(PR_TAG!=o){X=v;z=PR_TAG}}else{switch(l){case 0:if('<'==V){l=1}break;case 1:if(PR_isSpaceChar(V)){l=2}break;case 2:if(!PR_isSpaceChar(V)){z=PR_ATTRIB_NAME;X=v;l=3}break;case 3:if('='==V){X=v;z=PR_TAG;l=5}else if(PR_isSpaceChar(V)){X=v;z=PR_TAG;l=4}break;case 4:if('='==V){l=5}else if(!PR_isSpaceChar(V)){X=v;z=PR_ATTRIB_NAME;l=3}break;case 5:if('"'==V||'\''==V){X=v;z=PR_ATTRIB_VALUE;l=6;O=V}else if(!PR_isSpaceChar(V)){X=v;z=PR_ATTRIB_VALUE;l=7}break;case 6:if(V==O){X=x;z=PR_TAG;l=2}break;case 7:if(PR_isSpaceChar(V)){X=v;z=PR_TAG;l=2}break}}if(X){if(X>e){I.push(new PR_Token(C.substring(e,X),o));e=X}o=z}v=x}if(C.length>e){I.push(new PR_Token(C.substring(e,C.length),o));}}else{if(c.style){l=0;o=PR_TAG}I.push(c);}}return I}function PR_splitSourceNodes(i){var I=[];var l=null;var o=new PR_DecodeHelper();var O=null;for(var Q=0,_=i.length;;++Q){var c;if(Q<_){c=i[Q];if(null==c.style){i.push(c);continue}}else if(!l){break}else{c=new PR_Token('',null);}var C=c.token;if(null==l){if(PR_SOURCE==c.style){if('<'==o.decode(C,0)){o.decode(C,o.next);if('%'==o.ch||'?'==o.ch){l=o.ch;I.push(new PR_Token(C.substring(0,o.next),PR_TAG));C=C.substring(o.next,C.length);}}}else if(PR_TAG==c.style){if('<'==o.decode(C,0)&&'/'!=C.charAt(o.next)){var e=C.substring(o.next).toLowerCase();if(PR_startsWith(e,'script')||PR_startsWith(e,'style')||PR_startsWith(e,'xmp')){l='/'}}}}if(null!=l){var v=null;if(PR_SOURCE==c.style){if(l=='%'||l=='?'){var V=C.lastIndexOf(l);if(V>=0&&'>'==o.decode(C,V+1)&&C.length==o.next){v=new PR_Token(C.substring(V,C.length),PR_TAG);C=C.substring(0,V);}}if(null==O){O=[]}O.push(new PR_Token(C,PR_PLAIN));}else if(PR_PLAIN==c.style){if(null==O){O=[]}O.push(c);}else if(PR_TAG==c.style){if('<'==o.decode(c.token,0)&&c.token.length>o.next&&'/'==o.decode(c.token,o.next)){v=c}else{I.push(c);}}else if(Q>=_){v=c}else{if(O){O.push(c);}else{I.push(c);}}if(v){if(O){var x=PR_lexSource(O);I.push(new PR_Token('<span class=embsrc>',null));for(var X=0,z=x.length;X<z;++X){I.push(x[X]);}I.push(new PR_Token('</span>',null));O=null}if(v.token){I.push(v);}l=null}}else{I.push(c);}}return I}function PR_splitAttributeQuotes(i){var I=null,l=null;for(var o=0;o<i.length;++o){if(PR_PLAIN==i[o].style){I=o;break}}for(var o=i.length;--o>=0;){if(PR_PLAIN==i[o].style){l=o;break}}if(null==I){return i}var O=new PR_DecodeHelper();var Q=i[I].token;var _=O.decode(Q,0);if('"'!=_&&'\''!=_){return i}var c=O.next;var C=i[l].token;var e=C.lastIndexOf('&');if(e<0){e=C.length-1}var v=O.decode(C,e);if(v!=_||O.next!=C.length){v=null;e=C.length}var V=[];for(var o=0;o<I;++o){V.push(i[o]);}V.push(new PR_Token(Q.substring(0,c),PR_ATTRIB_VALUE));if(l==I){V.push(new PR_Token(Q.substring(c,e),PR_PLAIN));}else{V.push(new PR_Token(Q.substring(c,Q.length),PR_PLAIN));for(var o=I+1;o<l;++o){V.push(i[o]);}if(v){i.push(new PR_Token(C.substring(0,e),PR_PLAIN));}else{i.push(i[l]);}}if(v){V.push(new PR_Token(C.substring(e,C.length),PR_PLAIN));}for(var o=l+1;o<i.length;++o){V.push(i[o]);}return V}function PR_splitSourceAttributes(i){var I=[];var l=null;var o=false;var O='';for(var Q=0,_=i.length;Q<_;++Q){var c=i[Q];var C=I;if(PR_TAG==c.style){if(o){o=false;O='';if(l){I.push(new PR_Token('<span class=embsrc>',null));var e=PR_lexSource(PR_splitAttributeQuotes(l));for(var v=0,V=e.length;v<V;++v){I.push(e[v]);}I.push(new PR_Token('</span>',null));l=null}}else if(O&&c.token.indexOf('=')>=0){var x=O.toLowerCase();if(PR_startsWith(x,'on')||'style'==x){o=true}}else{O=''}}else if(PR_ATTRIB_NAME==c.style){O+=c.token}else if(PR_ATTRIB_VALUE==c.style){if(o){if(null==l){l=[]}C=l;c=new PR_Token(c.token,PR_PLAIN);}}else{if(l){C=l}}C.push(c);}return I}function PR_lexSource(i){var I=PR_splitStringAndCommentTokens(i);var l=[];for(var o=0;o<I.length;++o){var O=I[o];if(PR_PLAIN===O.style){PR_splitNonStringNonCommentToken(O.token,l);continue}l.push(O);}return l}function PR_lexMarkup(i){var I=PR_tokenizeMarkup(i);I=PR_splitTagAttributes(I);I=PR_splitSourceNodes(I);I=PR_splitSourceAttributes(I);return I}function PR_lexOne(i){var I=PR_chunkify(i);var l=false;for(var o=0;o<I.length;++o){if(PR_PLAIN==I[o].style){if(PR_startsWith(PR_trim(I[o].token),'&lt;')){for(var O=I.length;--O>=0;){if(PR_PLAIN==I[O].style){l=PR_endsWith(PR_trim(I[O].token),'&gt;');break}}}break}}return l?PR_lexMarkup(I):PR_lexSource(I);}
12