function typeOf(value){var s=typeof value;if(s==='object'){if(value){if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))&&typeof value.splice==='function'){s='array';}}else{s='null';}}
return s;}
Function.prototype.forEach=function(object,block,context){for(var key in object){if(typeof this.prototype[key]==="undefined"){block.call(context,object[key],key,object);}}};var forEach=function(object,block,context){if(object){var resolve=Object;if(object instanceof Function){resolve=Function;}else if(object.forEach instanceof Function){object.forEach(block,context);return;}else if(typeof object.length==="number"){resolve=Array;}
resolve.forEach(object,block,context);}};var Dom={get:function(el){if(typeof el==='string'){return document.getElementById(el);}else{return el;}},add:function(el,dest){el=this.get(el);dest=this.get(dest);position=arguments[2]||'bottom';switch(position){case'before':dest.parentNode.insertBefore(el,dest);break;case'top':dest.insertBefore(el,dest.firstChild);break;case'bottom':dest.appendChild(el);break;case'after':if(dest.nextSibling){dest.parentNode.insertBefore(el,dest.nextSibling);}else{dest.parentNode.appendChild(el);}
break;default:dest.appendChild(el);break;}},remove:function(el){el=this.get(el);el.parentNode.removeChild(el);},create:function(tag){var el=document.createElement(tag);forEach(arguments,function(arg,index){if(index>0){Dom.attr.set(el,arg);}});return el;}};Dom.attr={parent:Dom,get:function(el,name){el=this.parent.get(el);return el.getAttribute(name);},set:function(el,attr){el=this.parent.get(el);var name,value;for(name in attr)if(attr.hasOwnProperty(name)){value=attr[name];el.setAttribute(name,value);}}};Dom.style={parent:Dom,get:function(el,name){el=this.parent.get(el);return el.style[name];},set:function(el,attr){el=this.parent.get(el);var name,value;for(name in attr)if(attr.hasOwnProperty(name)){value=attr[name];el.style[name]=value;}}};var Event={add:function(){if(window.addEventListener){return function(el,type,fn){Dom.get(el).addEventListener(type,fn,false);};}else if(window.attachEvent){return function(el,type,fn){var f=function(){fn.call(Dom.get(el),window.event);};Dom.get(el).attachEvent('on'+type,f);};}}()};if(!nameSpace){var nameSpace={};}
nameSpace.autoscroll={speed:3,delay:20,add:function(id){var self,el;var i,arg,name;self=this;el=Dom.get(id);for(i=1;i<arguments.length;i++){arg=arguments[i];for(name in arg)if(arg.hasOwnProperty(name)){if(name==='speed'||name==='delay'){el[name]=arg[name];}
if(name==='up'||name==='down'||name==='left'||name==='right'){el[name]=this.initButton(name,arg[name],el);}}}
if(!el.up&&!el.down&&!el.left&&!el.right){if(el.scrollWidth<el.scrollHeight){this.add(id,{up:''},{down:''});}else{this.add(id,{left:''},{right:''});}}else{Dom.style.set(el,{overflow:'hidden'});el.speed=el.speed||this.speed;el.delay=el.delay||this.delay;el.scroll=this.scroll;el.stop=this.stop;}},initButton:function(dir,value,target){var info,position;info={};info.type=(value>'')?'image':'button';if(info.type==='image'){info.img=value;}
position={up:'before',down:'after',left:'before',right:'after'};info.position=position[dir];if(dir==='left'&&info.type==='button'){info.position='after';}
var button=this.createButton(dir,info.type,info.img,target);Dom.add(button,target,info.position);return info;},createButton:function(dir,type,img,target){var button,span,value;if(type==='image'){button=Dom.create('img');Dom.attr.set(button,{src:img});}else if(type==='button'){button=Dom.create('input');Dom.attr.set(button,{type:'button'});value=dir.substring(0,1).toUpperCase()+dir.substring(1,dir.length);Dom.attr.set(button,{value:value});span=Dom.create('span');span.appendChild(button);button=span;}
Dom.attr.set(button,{'class':dir+'-scroll'});Event.add(button,'mouseover',function(){target.direction=dir;target.increment=target.speed*(dir==='up'||dir==='left')?-1:1;target.scroll(target);});Event.add(button,'mouseout',function(){target.stop(target);});return button;},scroll:function(id){var el=Dom.get(id);var dir=el.direction;if(dir==='up'||dir==='down'){el.scrollTop+=el.speed*el.increment;}else if(dir==='left'||dir==='right'){el.scrollLeft+=el.speed*el.increment;}
el.timer=setTimeout(function(){el.scroll(id);},this.delay);},stop:function(id){clearTimeout(Dom.get(id).timer);}};String.prototype.parse=function(language,destination,outputInstruction){function getSyntax(x){if(x.parseString)
return x;if(typeof x!="string")
if(x.length>1)
return new Syntax(x);else
return getSyntax(x[0]);x=x.toLowerCase();if(typeof String.prototype.parse[x]=="string")
return getSyntax(String.prototype.parse[x]);return(String.prototype.parse[x])||new Syntax([x,"",/[^\s\S]/]);}
function Syntax(specification){this.name=(specification[0]!="=")?specification[0].toLowerCase():false;if(this.name)
String.prototype.parse[this.name]=this;if(specification[1]!="="){this.superSource=[];for(var i=2,j=0;specification[i];i+=this[j].used,j++){this[j]=new Selector(specification[i],specification[i-1],specification[i+1],specification[i+2],(specification[0]=="="))
this.superSource[j]=this[j].source;}
this.superSource=this.superSource.join("|");}
else{this[0]=new Selector(specification.slice(1));this.superSource=this[0].source;}}
function Selector(selector,name,useMatch,parseFurther,equal){this.used=4;if(typeof useMatch!="number"){parseFurther=useMatch;useMatch=0;this.used=this.used-1;}
if(/string|undefined/.test(typeof parseFurther)){parseFurther=false;this.used=this.used-1;}
if(!selector.exec){if(typeof selector!="string"){parseFurther=selector=getSyntax(selector);this.used=2;if(equal==false)
var selectAll=true;}
selector=new RegExp(getSyntax(selector).superSource);}
this.source=selector.source;if(equal){selector=new RegExp("^("+this.source+")");useMatch=useMatch+1;}
if(parseFurther){parseFurther=getSyntax(parseFurther);parseFurther=parseFurther.name||parseFurther;}
this.selector=selector;this.selectAll=selectAll||false;this.useMatch=useMatch;this.name=name||false;this.parseFurther=parseFurther;}
Syntax.prototype.parseString=function(string){for(var i=0,result=[string];this[i];i++)
result=this[i].parseList(result);return result;}
Selector.prototype.parseList=function(list){for(var i=0,out=[];i<list.length;i++){if(!list[i].name)
while(list[i]){var match=this.cut(list[i]);if(!match)
break;if(match.before)
out[out.length]=match.before;if(match.selected instanceof String||match.selected.name)
out[out.length]=match.selected;else
out=out.concat(match.selected);list[i]=match.after;}
if(list[i])
out[out.length]=list[i];}
return out;}
Selector.prototype.cut=function(select){if(!this.selectAll){var match=this.selector.exec(select);if(!match)
return false;select=new String(match[this.useMatch]);if(index=match.index+match[0].indexOf(select))
var before=match.input.slice(0,index);var after=match.input.slice(index+select.length);}
if(this.parseFurther)
select=getSyntax(this.parseFurther).parseString(select)
select.name=this.name;return{before:before||false,selected:select,after:after||false};}
parsedList=getSyntax(language).parseString(this);if(outputInstruction&&outputInstruction!="link"){stringWrap=XMLStringWrap;DOMWrap=XMLDOMWrap;if(outputInstruction=="elements"){XMLStringWrap3=XMLStringWrap2=XMLStringWrap;XMLDOMWrap2=XMLDOMWrap;}
outputInstruction=outputInstruction.replace(/[^\w\d_:.-]/g,"")}
switch((destination&&destination.nodeType||typeof destination).toString()){case"1":case"11":return DOMOutput(parsedList,destination);case"string":return stringOutput(parsedList,destination);case"2":case"3":destination.nodeValue+=stringOutput(parsedList,"");return destination;case"undefined":return parsedList;default:throw"Invalid parse destination "+destination;}
function DOMOutput(parsedList,destination){for(var i=0;parsedList[i];i++){var putHere=(!parsedList[i].name)?destination:DOMWrap(parsedList[i].name.replace(/[^\w\d_:.\-\s]/g,"").replace(/\s+/," "),destination,parsedList[i]);if(typeof parsedList[i].valueOf()=="string")
putHere.appendChild(document.createTextNode(parsedList[i]));else
DOMOutput(parsedList[i],putHere);}
return destination;}
function DOMWrap(description,destination,content){if(description!="url"||outputInstruction!="link"||content.toString().charAt(0)=="&"){var element=document.createElement("span");element.className=description;}
else{element=document.createElement("a");element.title=content.toString().replace(/,/g,"");element.href=element.title;}
return destination.appendChild(element);}
function XMLDOMWrap(description,destination){var x=description.indexOf(" ");if(x<0)
return destination.appendChild(document.createElement(description));return XMLDOMWrap2(description.slice(x+1),XMLDOMWrap(description.slice(0,x),destination));}
function XMLDOMWrap2(description,element){element.setAttribute(outputInstruction,description);return element;}
function stringOutput(parsedList,destination){for(var i=0;parsedList[i];i++){var string=(typeof parsedList[i].valueOf()=="string")?parsedList[i].replace(/\&/g,"&").replace(/</g,"<").replace(/>/g,">"):stringOutput(parsedList[i],"");if(!parsedList[i].name)
destination=destination+string;else
destination=destination+stringWrap(parsedList[i].name,string);}
return destination;}
function stringWrap(description,content){if(description!="url"||outputInstruction!="link"||content.replace(/<[^>]*>/,"").charAt(0)=="&")
return'<span class="'+description+'">'+content+"</span>";else{var href=content.replace(/<[^>]*>/g,"");return'<a href="'+href+'" title = "'+href+'">'+
content+"</a>";}}
function XMLStringWrap(description,content){var x=description.indexOf(" ");if(x<0)
return"<"+description+">"+content+"</"+description+">";return XMLStringWrap2(description.slice(0,x),XMLStringWrap3(description.slice(x+1),content));}
function XMLStringWrap2(tagName,stuff){return"<"+tagName+" "+stuff+"</"+tagName+">";}
function XMLStringWrap3(attribute,content){return outputInstruction+'="'+attribute+'">'+content;}}
void"".parse(["ECMAScript","",["","=","literal string",/"([^\n"\\]|\\[\s\S])*"|'([^\n'\\]|\\[\s\S])*'/,"literal regexp",/\/[^*\/\n\s]([^\n\/\\]|\\[^\n])*\/[gim]{0,3}/,"comment multiline",/\/\*([^*]|\*[^\/])*\*\//,["urls"],"comment single-line",/(^|[^\\])(\/\/[^\n]*)/,2,["urls"],],"literal number decimal",/(^|[^\w])([+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?)\b/,2,"literal number hex",/\b(0[xX][\da-fA-F]*)\b/,1,"literal number keyword",/\b(infinity|NaN)\b/,1,"literal boolean keyword",/\b(true|false)\b/,1,"literal primitive keyword",/\b(null|undefined)\b/,1,"operator keyword",/\b(delete|in|instanceof|new|this|typeof|void)\b/,1,"operator keyword",/\b(function)[^\w_$\(]*\(/,1,"local builtin",/\b(arguments)\b/,1,"property builtin",/\.(prototype|constructor|callee)\b/,1,"function builtin",/\b(decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|Number|parseFloat|parseInt|String)\s*\(/,1,"global builtin",/\b(Object|Function|Array|String|Boolean|Number|Math|Date|RegExp)\b/,1,"statement keyword declaration",/\b(const|function|var)\b/,1,"statement keyword",/\b(break|continue|do|while|export|for|in|if|else|import|label|return|switch|case|default|throw|try|catch|finally|with)\b/,1,]);void"".parse(["JavaScript","",["ECMAScript"],"global builtin host",/\b(history|window|document|navigator)\b/,1,]);void"".parse(["php script"]);void"".parse(["Cascading Style Sheets","",["","=","",["css comments and urls","comment",/\/\*([^*]|\*[^\/])*\*\//,["urls"],"",/\b(url\([^\)]*\))/,1,["","function",/^url/,"url",/\(\s*["']?(([^\)\s'"]|\s+[^\s\)"'])*)/,1,],],"",/[\S][^;{}]*\{(([^{}]|(\/\*([^*]|\*[^\/])*\*\/)|'[^']*'|"[^"]*")*)\}/,1,["css style rules","",["","=","",["css comments and urls"],"string",/'[^']*'|"[^"]*"/,],"property proprietary",/[^\w]((-|mso-)[\w-\\]+)\s*:/,1,"property",/([\w-\\]+)\s*:/,1,"color",/(^|[^\w])(#[\da-fA-F]{3,6})\b/,2,"unit",/\b(\d+|\d*\.\d+)+(cm|em|ex|pt|px|%)/,2,"number",/\b(\d+\.?\d*|\d*\.\d+)\b/,1,"important",/!\s*important/,"function",/\b(attr|rect|rgb|auto|inherit)\b/,1,"value",/\w[^\s;]*/,],"atrule",/@\w([\S]|\s[^\{;])*/,["css comments and urls"],],"",/(\S[\s\S]+)\{/,1,["","",["css comments and urls"],"selector",/[^,;{}\s]([^,\s]|\s+[^\s,])*/,],"",/\}\s*(\S[\s\S]+)/,1,["css comments and urls"],]);void"".parse(["xml","",["xml declarations","=","",["xml comments","comment",/<!--([^-]|-[^-])*-->/,["","",["xml delimiters","delimiter",/^<(\/|\?|!(--|\[%?\w+\[)?)?|(\/|\?|--|\]\])?>$/,],"",["urls","url",/http:[\\\/][\\\/]+[\w\\\/\-%&#=.,?+$]+/,],],],"",["xml cdata sections","cdata",/<!\[CDATA\[(([^\]]|\][^\]]|]][^>])*)\]\]>/,["xml delimiters"],],"declaration doctype",/<!DOCTYPE\s[^>[]*(\[([^<\]]|<[^>]*>)*\])?\s*>/,["","dtd subset internal",/<!DOCTYPE\s[^>[]*(\[(([^<\]]|<[^>]*>)*)\])\s*>/,1,["xml dtd"],"",["xml declaration innards"],],],"",["xml prolog","declaration xml",/^<(\?xml\s+([^?]|\?[^>])*\?)>/,],"",["xml processing instructions","pi",/<\?([\w_][\w\d_:.-]+([^?]|\?[^>])*)\?>/,["xml pi innards","target",/^<\?([\w\d_:.-]+)/,1,],],"",["xml tags","tag",/<([^>'"]|'[^']*'|"[^"]*")*>/,["xml tag innards","tagname",/^<\/?([\w_][\w\d_:.-]*)(\s|\/?>)/,1,"",["xml strings","value",/('[^']*'|"[^"]*")/,1,["xml entity references"],],"attribute",/\s([\w_][\w\d_:.-]*)\s*=/,1,"",["xml delimiters"],],],"",["xml entity references","entity",/&#?\w+;/,],]);void"".parse(["xml dtd","declaration",/<!(-?[^>-]|--([^-]|-[^-])*--)*>/,["xml declaration innards","",/^ATTLIST\s[\s\S]*/,["","",/\(([^\)]*)\)/,1,["","value enumerated",/[^|]+/,],],"",["","=","comment",/--([^-]|-[^-])*--/,["urls"],"",["xml strings"],],"",["xml delimiters"],"keyword",/^\w+|SYSTEM|PUBLIC|NOTATION/,"keyword contentmodel",/#PCDATA|EMPTY/,"keyword attributetype",/CDATA|NMTOKENS?|ID(REFS?)?|ENTIT(Y|IES)/,"keyword attributedefault",/#\w+/,"entity parameter",/%[^;]+;/,"name",/[^%\s(),\|?&+]+/,],"entity parameter",/%[^;]+;/,])
void"".parse(["xml html","",["","=","",["xml declarations"],"",/<(style|STYLE)([^>]*[^\/])?>(([^<]|<[^\/!]|<![^\[]|<!\[CDATA\[(([^\]]|\][^\]]|]][^>])*)\]\]>)+)<\/(style|STYLE)>/,3,["","comment","xml comments",["","delimiter","xml delimiters","stylesheet css",/.*\n([\s\S]*)/,1,["Cascading Style Sheets"],],"cdata","xml cdata sections",["","delimiter","xml delimiters","stylesheet css",["Cascading Style Sheets"],],"stylesheet css",["Cascading Style Sheets"],],"",/<(script|SCRIPT)([^>]*[^\/])?>(([^<]|<[^\/!]|<![^\[]|<!\[CDATA\[(([^\]]|\][^\]]|]][^>])*)\]\]>)+)<\/(script|SCRIPT)>/,3,["","comment","xml comments",["","delimiter","xml delimiters","script JavaScript",/.*\n([\s\S]*)/,1,["JavaScript"],],"cdata","xml cdata sections",["","delimiter","xml delimiters","script JavaScript",["JavaScrIpt"],],"script JavaScript",["JavaScript"],,],],"",["xml prolog"],"pi","xml processing instructions",["","",/^<\?php([\s\S]+)\?>$/,1,["","script php",["php script"],],"",["xml pi innards"],],"tag","xml tags",["","value",/href\s*=\s*('javascript:[^']*'|"javascript:[^"]*")/i,1,["","JavaScript script",/["']javascript:([\s\S]*)['"]/,1,["JavaScript"],],"value",/style\s*=\s*('[^']*'|"[^"]*")/i,1,["","css",/["']([\s\S]*)['"]/,1,["css style rules"],],"value",/(src|href)\s*=\s*('[^']*'|"[^"]*")/i,2,["","url",/["']([\s\S]*)['"]/,1,["xml entity references"],],"",["xml tag innards"],],"",["xml entity references"],]);String.prototype.parse.php=String.prototype.parse.htm=String.prototype.parse.html=String.prototype.parse.xht=String.prototype.parse.xhtml="xml html";String.prototype.parse.dtd="xml dtd";String.prototype.parse.js="JavaScript script";String.prototype.parse["javascript script"]="JavaScript";String.prototype.parse.css="css stylesheet";String.prototype.parse["css stylesheet"]="Cascading Style Sheets";
