Commits

Anonymous committed c36ea58

regen

  • Participants
  • Parent commits af84eaf

Comments (0)

Files changed (5)

static/css/ie.css

-body {text-align:center;}
-.container {text-align:left;}
+body {text-align:left;}
+.fpcontainer {text-align:left;}
 * html .column {overflow-x:hidden;}
 * html legend {margin:-18px -8px 16px 0;padding:0;}
 ol {margin-left:2em;}

static/css/screen.css

 blockquote:before, blockquote:after, q:before, q:after {content:"";}
 blockquote, q {quotes:"" "";}
 a img {border:none;}
-body {font-family:Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;color:#000;line-height:16px;}
+body {font-family:Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;color:#000;line-height:16px;text-align:left;}
 html > body {font-size:12px;}
 h1, h2, h3, h4, h5, h6 {font-weight:normal;}
 h1 {font-size:3em;line-height:1;margin-bottom:0.5em;}
 a:visited {text-decoration:none;}
 a:hover {text-decoration:underline;}
 a:active {text-decoration:underline;}
+.authBox a {font-weight:bold;}
 #nav li {font-size:1.2em;font-weight:bold;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;}
 #header a:hover, #header a:active {text-decoration:none;}
 #review_comment_area pre {display:inline;white-space:pre;}
 form label {line-height:1em;}
 input[type='submit'], input[type='reset'], input[type='button'], button {font-size:1em;font-weight:bold;}
 textarea {line-height:16px;}
+#snippet-edit label,#snippet-edit input['text'],#snippet-edit select,#snippet-edit input['password'],#snippet-edit {font-size:0.9em;}
 #actions ul {list-style:none;}
 #actions form li label {font-weight:normal;font-size:1em;}
 #info {font-size:0.9em;font-weight:bold;}
 div.textmate ol {list-style-type:decimal;}
 p.copyright {font-weight:bold;font-size:0.9em;}
 p.copyright span.powered {font-size:0.8em;}
-#reviews-list li time {font-size:0.8em;font-style:bold;padding:0.3em;}
-html,body {height:100%;width:99.99%;}
-body {margin:0;padding:0;background:url(../images/bg.png) repeat-x;color:#000;height:100%;min-width:750px;}
+#reviews-list li .metadata {font-size:0.8em;font-weight:bold;font-style:italic;padding:0.3em;}
+#reviews-list li .metadata time {font-weight:bold;}
+#reviews-list li {font-size:0.9em;}
+span.reviewflag.new {font-weight:bold;}
+#notify-snippet {font-weight:bold;font-size:0.8em;}
+.comment-box h1 {font-size:1.6em;line-height:1;margin-bottom:0.5em;}
+.comment-box h2 {font-size:1.4em;margin-bottom:0.75em;}
+.comment-box h3 {font-size:1.2em;line-height:1;margin-bottom:1em;}
+.comment-box h4 {font-size:1em;line-height:1.25;margin-bottom:1.25em;height:1.25em;}
+.comment-box h5 {font-size:0.9em;font-weight:bold;margin-bottom:1.5em;}
+.comment-box h6 {font-size:0.9em;font-weight:bold;}
+html,body {height:100%;width:100%;}
+body {margin:0;padding:0;background:url(../images/bg.png) repeat-x;height:100%;min-width:750px;}
 * html {height:100%;}
 section {display:block;}
 h1 {margin-bottom:0.5em;}
 h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
 ul, ol, li, h1, h2, h3, h4, h5, p {margin:0 0 0.3em 0;padding:0;}
 ol, ul {list-style-image:none;list-style-position:outside;list-style-type:none;}
+.fpcontainer {width:100%;z-index:0;clear:both;}
 #site_header {display:block;width:100%;height:100px;}
 #site_header h1 {background:transparent url(../images/logo.gif) no-repeat;width:306px;height:80px;padding:0;margin:0 30px 0;position:relative;float:left;top:10px;}
 #site_header h1 a {display:block;font-size:0px;width:306px;height:80px;text-indent:-700em;}
-#site_header #main_nav {display:block;width:auto;height:40px;float:left;margin-left:80px;position:relative;top:35px;}
+#site_header #main_nav {display:block;width:auto;height:40px;float:left;margin-left:80px;position:relative;top:35px;z-index:100;}
 #main_nav li {display:block;float:left;margin-left:15px;}
 #main_nav li a {display:block;padding:0.5em 1em 0.5em 1em;}
 #main_nav li {float:left;}
+#site_header .authBox {display:block;width:400px;top:5px;margin-left:80px;float:left;position:relative;z-index:90;}
+.authBox a {padding:0.5em 1em 0.5em 1em;}
 .content-wrapper {background:transparent url(../images/home-back.png) no-repeat 100px 0pt;width:100%;margin:0;padding:0;height:100%;}
 #claim {padding-left:20px;}
-#snippet_edit,#snippet_view,#revisions,#new_snippet,#s_snippet_actions {padding:30px 0 25px 0;}
-section.hidden,.hidden {display:none;}
+#edit,#view,#revisions,#new_snippet,#s_snippet_actions {padding:30px 0 25px 0;}
+section.hidden,div.hidden,.hidden {display:none;}
 form, #snippet {width:90%;margin:0pt auto;}
 #snippet {display:block;padding-left:30px;}
-form li {padding:5px 0;margin:0;}
+form li {padding:2px 0;margin:0;}
 form li * {vertical-align:middle;}
-form label {display:block;width:14em;height:12px;float:left;padding:0 1em 3px 0;}
+form label {display:block;width:14em;height:11px;float:left;padding:0 1em 3px 0;}
 input[type='text'], input[type='password'],select {width:174px;border:1px solid;margin:0;}
 textarea {width:99%;border:1px solid;height:280px;}
+.ccode {margin-top:5px;margin-left:15em;}
 .wed {width:99%;height:450px;}
 .wed iframe {width:100%;}
 input[type='submit'], input[type='reset'], input[type='button'], button {border-width:0 1px 1px 0;padding:0.3em 0.5em 0.3em 0.5em;}
+ol.hidden {display:none;}
+.privacy {background:url(../images/closed.png) 0 0.3em no-repeat;height:16px;padding-left:18px;font-weight:bold;font-size:1.2em;cursor:pointer;line-height:16px;vertical-align:middle;}
+.privacy.setPrivacy {background:url(../images/open.png) 0 0.3em no-repeat;}
+#privacy {margin-top:0.8em;}
+#paste_privacy {width:260px;}
 #snippet r h2 {padding-bottom:15px;}
 #snippet .lsnippet {font-size:1.3em;}
 #actions {padding:15px 0;vertical-align:middle;}
 form.embed label {width:auto;}
 form.embed input {font-size:80%;width:320px;}
 .highlight {border:1px solid;background-repeat:repeat;}
-#paste_wrapper,#diff {clear:both;width:100%;margin-top:10px;}
+#paste_wrapper,#diff {clear:both;width:100%;margin-top:10px;overflow-x:auto;}
 #diff {position:relative;}
 #paste_comments {display:block;position:relative;float:left;}
 #paste_comments h2 {font-size:12px;margin:0;padding:0.3em;}
 #bottoma {position:relative;width:100%;clear:both;padding:15pt 0;}
 #bottom form {width:auto;margin:0;padding:0;}
 #bottoma ul {list-style:none;}
-#bottoma li {display:block;float:left;width:100px;margin-right:5px;padding:0;}
+#bottoma li {display:block;float:left;margin-right:5px;padding:0;}
 #revisions,#claim_snippet {position:relative;width:90%;margin:0pt auto;}
 table.revisionstable {position:relative;width:600px;margin:0pt 0pt 45px 0pt;padding:0;border:1px solid;}
 table.revisionstable td {margin-left:20px;}
 div.txt h3 {margin:15px 0 10px 0;padding:0.1em;}
 div.txt pre {border:1px solid;padding:0.3em;}
 div.txt pre.wrap {width:99%;}
-li.errors {padding:0.3em;border:1px solid;}
+div.errors,li.errors {padding:0.3em;border:1px solid;}
 p.errors,ul.errors {padding:0.3em;border:1px solid;margin-bottom:15px;}
 #switch span {display:block;cursor:pointer;padding:0 0.5em 0 0.5em;float:left;}
 #switch {clear:both;margin-bottom:5px;margin-top:10px;width:auto;float:right;}
 #switch span {cursor:pointer;}
 div.textmate {background:url(../images/bundle.png) no-repeat;min-height:64px;padding-left:70px;}
-#bottom {display:block;position:relative;clear:both;width:100%;margin-top:15px;background:repeat-y;padding:0.5em 0 1em 0;height:40px;}
+#bottom {display:block;position:relative;clear:both;width:100%;margin-top:5px;background:repeat-y;height:40px;}
 p.copyright {display:block;margin:0pt auto 0pt auto;width:855px;}
 p.copyright span.brand {float:left;width:400px;}
 p.copyright span.powered {float:right;width:auto;position:relative;}
 div.grippie {background:#E9E9E9 url(../images/resize2.gif) no-repeat scroll 50% 50%;min-height:3px;height:3px;cursor:s-resize;width:99%;}
+#overlay {position:fixed;width:100%;height:100%;top:0;left:0;}
 #commentsOverlay {background-color:#000;}
-.comment-box {display:block;position:absolute;z-index:10000;width:700px;border:1px solid;height:350px;overflow-y:auto;overflow-x:hidden;}
+.comment-box {display:block;position:absolute;z-index:99999;width:700px;border:1px solid;height:350px;overflow-y:auto;overflow-x:hidden;}
 .comments-box h3 {margin-top:8px;}
-#freview {width:100%;padding:0.3em;margin:0;position:relative;text-align:left;}
-#freview h3 {font-size:0.9em;font-weight:bold;margin-top:0;margin-bottom:5px;position:relative;}
-#freview textarea#new_review {height:120px;position:relative;}
+.comment-box #freview {width:100%;padding:0.3em;margin:0;position:relative;text-align:left;}
+#freview {clear:both;}
+#freview h3 {font-size:0.9em;font-weight:bold;margin-top:0;margin-bottom:5px;position:relative;border:none;}
+#freview textarea {height:80px;position:relative;}
 .reviewflag {background:transparent url(../images/comment.png) no-repeat scroll 0 0 !important;cursor:pointer;font-size:90%;font-weight:normal;height:21px;left:5.5%;line-height:1.9em;margin-top:-1px;padding-left:5px;position:absolute;text-align:left;vertical-align:top;width:25px;}
-#bclose {margin-left:10px;}
-#reviews-list li {display:block;width:99%;margin:5px 0 10px 0;padding:0.3em;border-bottom:1px dashed;}
-#reviews-list li time {display:block;clear:both;}
-div.loading {display:block;background:transparent url(../images/loading.gif) no-repeat;height:16;padding-left:18px;color:#303030;}
-body {background-color:#e5f1f4;color:#000;}
+#freview label {width:auto;color:#000;margin:0;padding:0.3em 0.3em 0.3em 0;font-weight:bold;}
+span.rby {display:block;float:left;width:200px;}
+#freview input[type='text'] {width:120px;}
+#freview p span.ractions {display:block;float:right;width:250px;text-align:right;clear:right;}
+#freview p {display:block;height:1.3em;width:100%;padding-left:0.3em;}
+#bclose {margin-left:10px;margin-right:10px;}
+.comment-box #reviews-list {display:block;width:100%;margin:0.3em;background:#fff;}
+.comment-box h3 {clear:both;margin-top:10px;margin-left:0.3em;font-size:1.1em;font-weight:bold;border-top:1px dashed;}
+#reviews-list li {display:block;width:99%;margin:5px 0 10px 0;border-bottom:1px dashed;text-align:left;}
+.metadata {text-align:right;}
+#reviews-list li time {display:inline;margin-left:10px;}
+div.loading {display:block;background:transparent url(../images/loading.gif) no-repeat;height:16px;padding-left:18px;color:#303030;}
+#notify-snippet {display:block;float:left;z-index:2;padding:0.3em;border:1px solid;margin-top:-2px;}
+#notify-snippet.hidden {display:none;}
+body {background-color:#303030;color:#000;}
+div.fpcontainer {background-color:#e5f1f4;}
 h1, h2, h3, h4, h5, h6 {color:#111;}
-a:link {color:#2e8696;}
-a:visited {color:#2e8696;}
+a:link, a:visited {color:#2e8696;}
 #main_nav li {background-color:#899834;}
 #site_header a:link, #site_header a:visited {color:#fff;}
+.authBox a:link,.authBox a:visited {color:#2e8696;}
 form label {color:#333;}
 input[type='text'], input[type='password'],select {border-color:#949494;}
 textarea {width:99%;border:#949494;}
 #revisions h3, div.txt h2 {background-color:#303030;color:#fff;}
 div.txt h3 {background-color:#2e8696;}
 div.txt pre {border-color:#f7f7f0;}
-li.errors {background-color:#ff9898;padding:0.3em;border-color:#ff0000;}
+div.errors,li.errors {background-color:#ff9898;padding:0.3em;border-color:#ff0000;}
 p.errors,ul.errors {border-color:#ff0000;}
 #switch span {color:#000;}
 #switch span.active {color:#666;}
 p.copyright {color:#899834;}
 div.grippie {border-color:#899834;}
 #overlay-frame {background:transparent;}
-.comment-box {border-color:#899834;color:#fff;background-color:#e5f1f4;opacity:0.9;}
-#reviews-list li {color:#303030;border-bottom-color:#899834;}
+.comment-box {border-color:#899834;color:#fff;background-color:#e5f1f4;}
+.comment-box #reviews-list {background:#fff;}
+.comment-box h3,#reviews-list li {color:#303030;border-bottom-color:#dcdcdc;}
+.comment-box h3 {border-top-color:#dcdcdc;}
+.metadata {color:#ccc;}
 #reviews-list li time {color:#899834;}
+#notify-snippet {color:#303030;background:#f8f8f8;border-color:#899834;}

static/js/friendpaste-libs.js

 /*@end @*/
 }if(Base.ancestorOf==klass.ancestorOf){return false}if(Base.ancestorOf==object.constructor.ancestorOf){return klass==Object}switch(klass){case Array:return !!(typeof object=="object"&&object.join&&object.splice);case Function:return typeOf(object)=="function";case RegExp:return typeof object.constructor.$1=="string";case Date:return !!object.getTimezoneOffset;case String:case Number:case Boolean:return typeOf(object)==typeof klass.prototype.valueOf();case Object:return true}return false}function typeOf(object){var type=typeof object;switch(type){case"object":return object==null?"null":typeof object.constructor=="undefined"?_MSIE_NATIVE_FUNCTION.test(object)?"function":type:typeof object.constructor.prototype.valueOf();case"function":return typeof object.call=="function"?type:"object";default:return type}}var JavaScript={name:"JavaScript",version:base2.version,exports:"Array2,Date2,Function2,String2",namespace:"",bind:function(host){var top=global;global=host;forEach.csv(this.exports,function(name2){var name=name2.slice(0,-1);extend(host[name],this[name2]);this[name2](host[name].prototype)},this);global=top;return host}};function _createObject2(Native,constructor,generics,extensions){var INative=Module.extend();var id=INative.toString().slice(1,-1);forEach.csv(generics,function(name){INative[name]=unbind(Native.prototype[name]);INative.namespace+=format("var %1=%2.%1;",name,id)});forEach(_slice.call(arguments,3),INative.implement,INative);var Native2=function(){return INative(this.constructor==INative?constructor.apply(null,arguments):arguments[0])};Native2.prototype=INative.prototype;for(var name in INative){if(name!="prototype"&&Native[name]){INative[name]=Native[name];delete INative.prototype[name]}Native2[name]=INative[name]}Native2.ancestor=Object;delete Native2.extend;Native2.namespace=Native2.namespace.replace(/(var (\w+)=)[^,;]+,([^\)]+)\)/g,"$1$3.$2");return Native2}if((new Date).getYear()>1900){Date.prototype.getYear=function(){return this.getFullYear()-1900};Date.prototype.setYear=function(year){return this.setFullYear(year+1900)}}var _testDate=new Date(Date.UTC(2006,1,20));_testDate.setUTCDate(15);if(_testDate.getUTCHours()!=0){forEach.csv("FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds",function(type){extend(Date.prototype,"setUTC"+type,function(){var value=base(this,arguments);if(value>=57722401000){value-=3600000;this.setTime(value)}return value})})}Function.prototype.prototype={};if("".replace(/^/,K("$$"))=="$"){extend(String.prototype,"replace",function(expression,replacement){if(typeof replacement=="function"){var fn=replacement;replacement=function(){return String(fn.apply(null,arguments)).split("$").join("$$")}}return this.base(expression,replacement)})}var Array2=_createObject2(Array,Array,"concat,join,pop,push,reverse,shift,slice,sort,splice,unshift",Enumerable,{combine:function(keys,values){if(!values){values=keys}return Array2.reduce(keys,function(hash,key,index){hash[key]=values[index];return hash},{})},contains:function(array,item){return Array2.indexOf(array,item)!=-1},copy:function(array){var copy=_slice.call(array);if(!copy.swap){Array2(copy)}return copy},flatten:function(array){var i=0;return Array2.reduce(array,function(result,item){if(Array2.like(item)){Array2.reduce(item,arguments.callee,result)}else{result[i++]=item}return result},[])},forEach:_Array_forEach,indexOf:function(array,item,fromIndex){var length=array.length;if(fromIndex==null){fromIndex=0}else{if(fromIndex<0){fromIndex=Math.max(0,length+fromIndex)}}for(var i=fromIndex;i<length;i++){if(array[i]===item){return i}}return -1},insertAt:function(array,index,item){Array2.splice(array,index,0,item);return item},item:function(array,index){if(index<0){index+=array.length}return array[index]},lastIndexOf:function(array,item,fromIndex){var length=array.length;if(fromIndex==null){fromIndex=length-1}else{if(fromIndex<0){fromIndex=Math.max(0,length+fromIndex)}}for(var i=fromIndex;i>=0;i--){if(array[i]===item){return i}}return -1},map:function(array,block,context){var result=[];Array2.forEach(array,function(item,index){result[index]=block.call(context,item,index,array)});return result},remove:function(array,item){var index=Array2.indexOf(array,item);if(index!=-1){Array2.removeAt(array,index)}},removeAt:function(array,index){Array2.splice(array,index,1)},swap:function(array,index1,index2){if(index1<0){index1+=array.length}if(index2<0){index2+=array.length}var temp=array[index1];array[index1]=array[index2];array[index2]=temp;return array}});Array2.reduce=Enumerable.reduce;Array2.like=function(object){return typeOf(object)=="object"&&typeof object.length=="number"};Enumerable["#implemented_by"].pop();Enumerable["#implemented_by"].push(Array2);var _DATE_PATTERN=/^((-\d+|\d{4,})(-(\d{2})(-(\d{2}))?)?)?T((\d{2})(:(\d{2})(:(\d{2})(\.(\d{1,3})(\d)?\d*)?)?)?)?(([+-])(\d{2})(:(\d{2}))?|Z)?$/;var _DATE_PARTS={FullYear:2,Month:4,Date:6,Hours:8,Minutes:10,Seconds:12,Milliseconds:14};var _TIMEZONE_PARTS={Hectomicroseconds:15,UTC:16,Sign:17,Hours:18,Minutes:20};var _TRIM_ZEROES=/(((00)?:0+)?:0+)?\.0+$/;var _TRIM_TIMEZONE=/(T[0-9:.]+)$/;var Date2=_createObject2(Date,function(yy,mm,dd,h,m,s,ms){switch(arguments.length){case 0:return new Date;case 1:return typeof yy=="number"?new Date(yy):Date2.parse(yy);default:return new Date(yy,mm,arguments.length==2?1:dd,h||0,m||0,s||0,ms||0)}},"",{toISOString:function(date){var string="####-##-##T##:##:##.###";for(var part in _DATE_PARTS){string=string.replace(/#+/,function(digits){var value=date["getUTC"+part]();if(part=="Month"){value++}return("000"+value).slice(-digits.length)})}return string.replace(_TRIM_ZEROES,"").replace(_TRIM_TIMEZONE,"$1Z")}});delete Date2.forEach;Date2.now=function(){return(new Date).valueOf()};Date2.parse=function(string,defaultDate){if(arguments.length>1){assertType(defaultDate,"number","default date should be of type 'number'.")}var parts=match(string,_DATE_PATTERN);if(parts.length){if(parts[_DATE_PARTS.Month]){parts[_DATE_PARTS.Month]--}if(parts[_TIMEZONE_PARTS.Hectomicroseconds]>=5){parts[_DATE_PARTS.Milliseconds]++}var date=new Date(defaultDate||0);var prefix=parts[_TIMEZONE_PARTS.UTC]||parts[_TIMEZONE_PARTS.Hours]?"UTC":"";for(var part in _DATE_PARTS){var value=parts[_DATE_PARTS[part]];if(!value){continue}date["set"+prefix+part](value);if(date["get"+prefix+part]()!=parts[_DATE_PARTS[part]]){return NaN}}if(parts[_TIMEZONE_PARTS.Hours]){var hours=Number(parts[_TIMEZONE_PARTS.Sign]+parts[_TIMEZONE_PARTS.Hours]);var minutes=Number(parts[_TIMEZONE_PARTS.Sign]+(parts[_TIMEZONE_PARTS.Minutes]||0));date.setUTCMinutes(date.getUTCMinutes()+(hours*60)+minutes)}return date.valueOf()}else{return Date.parse(string)}};var String2=_createObject2(String,function(string){return new String(arguments.length==0?"":string)},"charAt,charCodeAt,concat,indexOf,lastIndexOf,match,replace,search,slice,split,substr,substring,toLowerCase,toUpperCase",{csv:csv,format:format,rescape:rescape,trim:trim});delete String2.forEach;function trim(string){return String(string).replace(_LTRIM,"").replace(_RTRIM,"")}function csv(string){return string?(string+"").split(/\s*,\s*/):[]}function format(string){var args=arguments;var pattern=new RegExp("%([1-"+(arguments.length-1)+"])","g");return(string+"").replace(pattern,function(match,index){return args[index]})}function match(string,expression){return(string+"").match(expression)||[]}function rescape(string){return(string+"").replace(_RESCAPE,"\\$1")}var Function2=_createObject2(Function,Function,"",{I:I,II:II,K:K,bind:bind,compose:compose,delegate:delegate,flip:flip,not:not,partial:partial,unbind:unbind});function I(i){return i}function II(i,ii){return ii}function K(k){return function(){return k}}function bind(fn,context){var lateBound=typeof fn!="function";if(arguments.length>2){var args=_slice.call(arguments,2);return function(){return(lateBound?context[fn]:fn).apply(context,args.concat.apply(args,arguments))}}else{return function(){return(lateBound?context[fn]:fn).apply(context,arguments)}}}function compose(){var fns=_slice.call(arguments);return function(){var i=fns.length,result=fns[--i].apply(this,arguments);while(i--){result=fns[i].call(this,result)}return result}}function delegate(fn,context){return function(){var args=_slice.call(arguments);args.unshift(this);return fn.apply(context,args)}}function flip(fn){return function(){return fn.apply(this,Array2.swap(arguments,0,1))}}function not(fn){return function(){return !fn.apply(this,arguments)}}function partial(fn){var args=_slice.call(arguments,1);return function(){var specialised=args.concat(),i=0,j=0;while(i<args.length&&j<arguments.length){if(specialised[i]===undefined){specialised[i]=arguments[j++]}i++}while(j<arguments.length){specialised[i++]=arguments[j++]}if(Array2.contains(specialised,undefined)){specialised.unshift(fn);return partial.apply(null,specialised)}return fn.apply(this,specialised)}}function unbind(fn){return function(context){return fn.apply(context,_slice.call(arguments,1))}}function detect(){var jscript=NaN
 /*@cc_on||@_jscript_version@*/
-;var javaEnabled=global.java?true:false;if(global.navigator){var MSIE=/MSIE[\d.]+/g;var element=document.createElement("span");var userAgent=navigator.userAgent.replace(/([a-z])[\s\/](\d)/gi,"$1$2");if(!jscript){userAgent=userAgent.replace(MSIE,"")}if(MSIE.test(userAgent)){userAgent=userAgent.match(MSIE)[0]+" "+userAgent.replace(MSIE,"")}base2.userAgent=navigator.platform+" "+userAgent.replace(/like \w+/gi,"");javaEnabled&=navigator.javaEnabled()}var _cache={};detect=function(expression){if(_cache[expression]==null){var returnValue=false,test=expression;var not=test.charAt(0)=="!";if(not){test=test.slice(1)}if(test.charAt(0)=="("){try{returnValue=new Function("element,jscript,java,global","return !!"+test)(element,jscript,javaEnabled,global)}catch(ex){}}else{returnValue=new RegExp("("+test+")","i").test(base2.userAgent)}_cache[expression]=!!(not^returnValue)}return _cache[expression]};return detect(arguments[0])}base2=global.base2=new Package(this,base2);var exports=this.exports;lang=new Package(this,lang);exports+=this.exports;JavaScript=new Package(this,JavaScript);eval(exports+this.exports);lang.base=base;lang.extend=extend};new function(_no_shrink_){var DOM=new base2.Package(this,{name:"DOM",version:"1.0.1",imports:"Function2",exports:"Interface,Binding,Node,Document,Element,AbstractView,HTMLDocument,HTMLElement,Selector,Traversal,CSSParser,XPathParser,NodeSelector,DocumentSelector,ElementSelector,StaticNodeList,Event,EventTarget,DocumentEvent,ViewCSS,CSSStyleDeclaration,ClassList",bind:function(node){if(node&&node.nodeType){var base2ID=assignID(node);if(!DOM.bind[base2ID]){switch(node.nodeType){case 1:if(typeof node.className=="string"){(HTMLElement.bindings[node.tagName]||HTMLElement).bind(node)}else{Element.bind(node)}break;case 9:if(node.writeln){HTMLDocument.bind(node)}else{Document.bind(node)}break;default:Node.bind(node)}DOM.bind[base2ID]=true}}return node},"@MSIE5.+win":{bind:function(node){if(node&&node.writeln){node.nodeType=9}return this.base(node)}}});eval(this.imports);var _MSIE=detect("MSIE");var _MSIE5=detect("MSIE5");var Interface=Module.extend(null,{forEach:function(block,context){forEach(this,function(method,name){if(typeOf(method)=="function"&&(this.prototype[name]||method._delegate)){block.call(context,method,name,this)}},this,Module)},implement:function(_interface){if(typeof _interface=="object"){_createDelegates(this,_interface)}else{if(Interface.ancestorOf(_interface)){for(var name in _interface){if(_interface[name]&&_interface[name]._delegate){this[name]=bind(name,_interface);this[name]._delegate=name}}}}return this.base(_interface)}});function _createDelegates(module,_interface){var id=module.toString().slice(1,-1);for(var name in _interface){var property=_interface[name];if(name.charAt(0)=="@"){_createDelegates(module,property)}else{if(!module[name]&&typeof property=="function"&&property.call){var args="abcdefghij".slice(0,property.length).split("");var fn=new Function(args.join(","),format("%2.base=%2.%1.ancestor;var m=%2.base?'base':'%1';return %2[m](%3)",name,args[0],args.slice(1)));fn._delegate=name;module[name]=fn;module.namespace+="var "+name+"=base2.lang.bind('"+name+"',"+id+");"}}}}var Binding=Interface.extend(null,{bind:function(object){return extend(object,this.prototype)}});var Node=Binding.extend({"@!(element.compareDocumentPosition)":{compareDocumentPosition:function(node,other){if(Traversal.contains(node,other)){return 4|16}else{if(Traversal.contains(other,node)){return 2|8}}var nodeIndex=_getSourceIndex(node);var otherIndex=_getSourceIndex(other);if(nodeIndex<otherIndex){return 4}else{if(nodeIndex>otherIndex){return 2}}return 0}}},{"@Gecko":{bind:function(node){return extend(this.base(node),"removeEventListener",function(){var args=Array2.slice(arguments);args.unshift(this);EventTarget.removeEventListener.apply(EventTarget,args)})}}});var _getSourceIndex=document.documentElement.sourceIndex?function(node){return node.sourceIndex}:function(node){var key=0;while(node){key=Traversal.getNodeIndex(node)+"."+key;node=node.parentNode}return key};var Document=Node.extend(null,{bind:function(document){extend(document,"createElement",function(tagName){return DOM.bind(this.base(tagName))});AbstractView.bind(document.defaultView);if(document!=window.document){new DOMContentLoadedEvent(document)}return this.base(document)},"@!(document.defaultView)":{bind:function(document){document.defaultView=Traversal.getDefaultView(document);return this.base(document)}}});var _ATTRIBUTES={"class":"className","for":"htmlFor"};var Element=Node.extend({"@MSIE.+win":{getAttribute:function(element,name){if(element.className===undefined){return this.base(element,name)}var attribute=_getAttributeNode(element,name);if(attribute&&(attribute.specified||name=="value")){if(name=="href"||name=="src"){element.base=element.getAttribute.ancestor;return element[element.base?"base":"getAttribute"](name,2)}else{if(name=="style"){return element.style.cssText.toLowerCase()}else{return attribute.nodeValue}}}else{if(name=="type"&&element.nodeName=="INPUT"){var outerHTML=element.outerHTML;with(outerHTML){outerHTML=slice(0,indexOf(">")+1)}return match(outerHTML,/type="?([^\s">]*)"?/i)[1]||null}}return null},removeAttribute:function(element,name){if(element.className!==undefined){name=_ATTRIBUTES[name.toLowerCase()]||name}this.base(element,name)},setAttribute:function(element,name,value){if(element.className===undefined){this.base(element,name,value)}else{if(name=="style"){element.style.cssText=value}else{value=String(value);var attribute=_getAttributeNode(element,name);if(attribute){attribute.nodeValue=value}else{this.base(element,_ATTRIBUTES[name.toLowerCase()]||name,value)}}}}},"@!(element.hasAttribute)":{hasAttribute:function(element,name){if(element.className===undefined){return this.base(element,name)}return this.getAttribute(element,name)!=null}}});if(detect("MSIE.+win")){extend(Element.prototype,"cloneNode",function(deep){var clone=this.base(deep||false);clone.base2ID=undefined;return clone})}var _HTML_ATTRIBUTES="colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";extend(_ATTRIBUTES,Array2.combine(_HTML_ATTRIBUTES.toLowerCase().split(","),_HTML_ATTRIBUTES.split(",")));var _getAttributeNode=document.documentElement.getAttributeNode?function(element,name){return element.getAttributeNode(name)}:function(element,name){return element.attributes[name]||element.attributes[_ATTRIBUTES[name.toLowerCase()]]};var TEXT=detect("(element.textContent===undefined)")?"innerText":"textContent";var Traversal=Module.extend({getDefaultView:function(node){return this.getDocument(node).defaultView},getNextElementSibling:function(node){while(node&&(node=node.nextSibling)&&!this.isElement(node)){continue}return node},getNodeIndex:function(node){var index=0;while(node&&(node=node.previousSibling)){index++}return index},getOwnerDocument:function(node){return node.ownerDocument},getPreviousElementSibling:function(node){while(node&&(node=node.previousSibling)&&!this.isElement(node)){continue}return node},getTextContent:function(node,isHTML){return node[isHTML?"innerHTML":TEXT]},isEmpty:function(node){node=node.firstChild;while(node){if(node.nodeType==3||this.isElement(node)){return false}node=node.nextSibling}return true},setTextContent:function(node,text,isHTML){return node[isHTML?"innerHTML":TEXT]=text},"@!MSIE":{setTextContent:function(node,text,isHTML){with(node){while(lastChild){parentNode.removeChild(lastChild)}}return this.base(node,text,isHTML)}},"@MSIE":{getDefaultView:function(node){return(node.document||node).parentWindow},"@MSIE5":{getOwnerDocument:function(node){return node.ownerDocument||node.document}}}},{contains:function(node,target){node.nodeType;while(target&&(target=target.parentNode)&&node!=target){continue}return !!target},getDocument:function(node){return this.isDocument(node)?node:node.ownerDocument||node.document},isDocument:function(node){return !!(node&&node.documentElement)},isElement:function(node){return !!(node&&node.nodeType==1)},"@(element.contains)":{contains:function(node,target){return node!=target&&(this.isDocument(node)?node==this.getOwnerDocument(target):node.contains(target))}},"@MSIE5":{isElement:function(node){return !!(node&&node.nodeType==1&&node.nodeName!="!")}}});var AbstractView=Binding.extend();var _CAPTURE_TYPE={},_TYPE_MAP={"2":2,"4":1};var _CAPTURING_PHASE=1,_AT_TARGET=2,_BUBBLING_PHASE=3;var _MOUSE_BUTTON=/^mouse(up|down)|click$/,_MOUSE_CLICK=/click$/,_BUBBLES="abort|error|select|change|resize|scroll|",_CANCELABLE="(dbl)?click|mouse(down|up|over|move|out|wheel)|key(down|up)|submit|reset";_BUBBLES=new RegExp("^("+_BUBBLES+_CANCELABLE+")$");_CANCELABLE=new RegExp("^("+_CANCELABLE+")$");if(_MSIE){var _W3C_EVENT_TYPE={focusin:"focus",focusout:"blur"};_CAPTURE_TYPE={focus:"focusin",blur:"focusout"}}var _CAN_DELEGATE=/^(blur|submit|reset|change|select)$|^(mouse|key|focus)|click$/;var Event=Binding.extend({"@!(document.createEvent)":{initEvent:function(event,type,bubbles,cancelable){event.type=String(type);event.bubbles=!!bubbles;event.cancelable=!!cancelable},preventDefault:function(event){if(event.cancelable!==false){event.returnValue=false}},stopPropagation:function(event){event.cancelBubble=true},"@MSIE":{preventDefault:function(event){this.base(event);if(event.type=="mousedown"){var type="onbeforedeactivate";var document=Traversal.getDocument(event.target);document.attachEvent(type,function(event){event.returnValue=false;document.detachEvent(type,arguments.callee)})}}}}},{CAPTURING_PHASE:_CAPTURING_PHASE,AT_TARGET:_AT_TARGET,BUBBLING_PHASE:_BUBBLING_PHASE,"@!(document.createEvent)":{"@MSIE":{bind:function(event){var type=event.type;if(!event.timeStamp){event.bubbles=_BUBBLES.test(type);event.cancelable=_CANCELABLE.test(type);event.timeStamp=new Date().valueOf()}event.relatedTarget=event[(event.target==event.fromElement?"to":"from")+"Element"];return this.base(event)}}},cloneEvent:function(event){var clone=copy(event);clone.stopPropagation=function(){event.stopPropagation()};clone.preventDefault=function(){event.preventDefault()};return clone},"@MSIE":{cloneEvent:copy}});var EventDispatcher=Base.extend({constructor:function(state){this.state=state;this.events=state.events},dispatch:function(nodes,event,phase){event.eventPhase=phase;var map=this.events[event.type][phase];if(map){var i=nodes.length;while(i--&&!event.cancelBubble){var currentTarget=nodes[i];var listeners=map[currentTarget.base2ID];if(listeners){listeners=copy(listeners);event.currentTarget=currentTarget;event.eventPhase=currentTarget==event.target?_AT_TARGET:phase;for(var listenerID in listeners){var listener=listeners[listenerID];if(typeof listener=="function"){listener.call(currentTarget,event)}else{listener.handleEvent(event)}}}}}},handleEvent:function(event,fixed){Event.bind(event);var type=event.type;var w3cType=_W3C_EVENT_TYPE[type];if(w3cType){event=copy(event);type=event.type=w3cType}if(this.events[type]){if(_MOUSE_BUTTON.test(type)){var button=_MOUSE_CLICK.test(type)?this.state._button:event.button;button=_TYPE_MAP[button]||0;if(event.button!=button){event=copy(event);event.button=button}}var currentTarget=event.target;var nodes=[],i=0;while(currentTarget){nodes[i++]=currentTarget;currentTarget=currentTarget.parentNode}this.dispatch(nodes,event,_CAPTURING_PHASE);if(!event.cancelBubble){if(!event.bubbles){nodes.length=1}nodes.reverse();this.dispatch(nodes,event,_BUBBLING_PHASE)}}return event.returnValue!==false},"@MSIE.+win":{handleEvent:function(event){if(event.type=="scroll"){setTimeout(bind(this.base,this,copy(event),true),0);return true}else{return this.base(event)}},"@MSIE5":{dispatch:function(nodes,event,phase){if(phase==_CAPTURING_PHASE&&!Array2.item(nodes,-1).documentElement){nodes.push(nodes[0].document)}this.base(nodes,event,phase)}}}});var _wrappedListeners={};var EventTarget=Interface.extend({"@!(element.addEventListener)":{addEventListener:function(target,type,listener,useCapture){var documentState=DocumentState.getInstance(target);var targetID=assignID(target);var listenerID=assignID(listener);var phase=useCapture?_CAPTURING_PHASE:_BUBBLING_PHASE;var typeMap=documentState.registerEvent(type,target);var phaseMap=typeMap[phase];if(!phaseMap){phaseMap=typeMap[phase]={}}if(useCapture){type=_CAPTURE_TYPE[type]||type}var listeners=phaseMap[targetID];if(!listeners){listeners=phaseMap[targetID]={}}listeners[listenerID]=listener},dispatchEvent:function(target,event){event.target=target;return DocumentState.getInstance(target).handleEvent(event)},removeEventListener:function(target,type,listener,useCapture){var events=DocumentState.getInstance(target).events;var typeMap=events[type];if(typeMap){var phaseMap=typeMap[useCapture?_CAPTURING_PHASE:_BUBBLING_PHASE];if(phaseMap){var listeners=phaseMap[target.base2ID];if(listeners){delete listeners[listener.base2ID]}}}}},"@(element.addEventListener)":{"@Gecko":{addEventListener:function(target,type,listener,useCapture){if(type=="mousewheel"){type="DOMMouseScroll";var originalListener=listener;listener=_wrappedListeners[assignID(listener)]=function(event){event=Event.cloneEvent(event);event.type="mousewheel";event.wheelDelta=(-event.detail*40)||0;_handleEvent(target,originalListener,event)}}this.base(target,type,listener,useCapture)}},"@webkit[1-4]|KHTML[34]":{addEventListener:function(target,type,listener,useCapture){if(_MOUSE_BUTTON.test(type)){var originalListener=listener;listener=_wrappedListeners[assignID(listener)]=function(event){var button=_TYPE_MAP[event.button]||0;if(event.button!=button){event=Event.cloneEvent(event);event.button=button}_handleEvent(target,originalListener,event)}}else{if(typeof listener=="object"){listener=_wrappedListeners[assignID(listener)]=bind("handleEvent",listener)}}this.base(target,type,listener,useCapture)}},"@Linux|Mac|opera":{addEventListener:function(target,type,listener,useCapture){if(type=="keydown"){var originalListener=listener;listener=_wrappedListeners[assignID(listener)]=function(keydownEvent){var firedCount=0,cancelled=false;extend(keydownEvent,"preventDefault",function(){this.base();cancelled=true});function handleEvent(event){if(cancelled){event.preventDefault()}if(event==keydownEvent||firedCount>1){_handleEvent(target,originalListener,keydownEvent)}firedCount++}handleEvent(keydownEvent);target.addEventListener("keyup",function(){target.removeEventListener("keypress",handleEvent,true);target.removeEventListener("keyup",arguments.callee,true)},true);target.addEventListener("keypress",handleEvent,true)}}this.base(target,type,listener,useCapture)}},removeEventListener:function(target,type,listener,useCapture){this.base(target,type,_wrappedListeners[listener.base2ID]||listener,useCapture)}}});if(detect("Gecko")){EventTarget.removeEventListener._delegate="removeEventListener";delete EventTarget.prototype.removeEventListener}function _handleEvent(target,listener,event){if(typeof listener=="function"){listener.call(target,event)}else{listener.handleEvent(event)}}var DocumentEvent=Interface.extend({"@!(document.createEvent)":{createEvent:function(document,type){var event=document.createEventObject?document.createEventObject():{};event.bubbles=false;event.cancelable=false;event.eventPhase=0;event.target=document;event.currentTarget=null;event.relatedTarget=null;event.timeStamp=new Date().valueOf();return Event(event)}},"@(document.createEvent)":{"@!(document.createEvent('Events'))":{createEvent:function(document,type){return this.base(document,type=="Events"?"UIEvents":type)}}}});var DOMContentLoadedEvent=Base.extend({constructor:function(document){var fired=false;this.fire=function(){if(!fired){fired=true;setTimeout(function(){var event=DocumentEvent.createEvent(document,"Events");Event.initEvent(event,"DOMContentLoaded",true,false);EventTarget.dispatchEvent(document,event)},1)}};EventTarget.addEventListener(document,"DOMContentLoaded",function(){fired=true},false);this.listen(document)},listen:Undefined,"@!Gecko20([^0]|0[3-9])|Webkit[5-9]|Opera[19]|MSIE.+mac":{listen:function(document){EventTarget.addEventListener(Traversal.getDefaultView(document),"load",this.fire,false)},"@MSIE.+win":{listen:function(document){try{document.body.doScroll("left");if(!this.__constructing){this.fire()}}catch(e){setTimeout(bind(this.listen,this,document),10)}}},"@KHTML":{listen:function(document){if(/loaded|complete/.test(document.readyState)){if(!this.__constructing){this.fire()}}else{setTimeout(bind(this.listen,this,document),10)}}}}});Document.implement(DocumentEvent);Document.implement(EventTarget);Element.implement(EventTarget);var _PIXEL=/^\d+(px)?$/i,_METRICS=/(width|height|top|bottom|left|right|fontSize)$/,_COLOR=/^(color|backgroundColor)$/,_RGB_BLACK="rgb(0, 0, 0)",_BLACK={black:1,"#000":1,"#000000":1};var ViewCSS=Interface.extend({"@!(document.defaultView.getComputedStyle)":{"@MSIE":{getComputedStyle:function(view,element,pseudoElement){var currentStyle=element.currentStyle;var computedStyle={};for(var propertyName in currentStyle){if(_METRICS.test(propertyName)||_COLOR.test(propertyName)){computedStyle[propertyName]=this.getComputedPropertyValue(view,element,propertyName)}else{if(propertyName.indexOf("ruby")!=0){computedStyle[propertyName]=currentStyle[propertyName]}}}return computedStyle}}},getComputedStyle:function(view,element,pseudoElement){return _CSSStyleDeclaration_ReadOnly.bind(this.base(view,element,pseudoElement))}},{getComputedPropertyValue:function(view,element,propertyName){return CSSStyleDeclaration.getPropertyValue(this.getComputedStyle(view,element,null),propertyName)},"@MSIE":{getComputedPropertyValue:function(view,element,propertyName){propertyName=this.toCamelCase(propertyName);var value=element.currentStyle[propertyName];if(_METRICS.test(propertyName)){return _MSIE_getPixelValue(element,value)+"px"}if(!_MSIE5&&_COLOR.test(propertyName)){var rgb=_MSIE_getColorValue(element,propertyName=="color"?"ForeColor":"BackColor");return(rgb==_RGB_BLACK&&!_BLACK[value])?value:rgb}return value}},toCamelCase:function(string){return string.replace(/\-([a-z])/g,flip(String2.toUpperCase))}});function _MSIE_getPixelValue(element,value){if(_PIXEL.test(value)){return parseInt(value)}var styleLeft=element.style.left;var runtimeStyleLeft=element.runtimeStyle.left;element.runtimeStyle.left=element.currentStyle.left;element.style.left=value||0;value=element.style.pixelLeft;element.style.left=styleLeft;element.runtimeStyle.left=runtimeStyleLeft;return value}function _MSIE_getColorValue(element,type){if(element.createTextRange){var range=element.createTextRange()}else{range=element.document.body.createTextRange();range.moveToElementText(element)}var color=range.queryCommandValue(type);return format("rgb(%1, %2, %3)",color&255,(color&65280)>>8,(color&16711680)>>16)}var _CSSStyleDeclaration_ReadOnly=Binding.extend({getPropertyValue:function(style,propertyName){return this.base(style,_CSSPropertyNameMap[propertyName]||propertyName)},"@MSIE.+win":{getPropertyValue:function(style,propertyName){return propertyName=="float"?style.styleFloat:style[ViewCSS.toCamelCase(propertyName)]}}});var CSSStyleDeclaration=_CSSStyleDeclaration_ReadOnly.extend({setProperty:function(style,propertyName,value,priority){return this.base(style,_CSSPropertyNameMap[propertyName]||propertyName,value,priority)},"@MSIE.+win":{setProperty:function(style,propertyName,value,priority){if(propertyName=="opacity"){value*=100;style.opacity=value;style.zoom=1;style.filter="Alpha(opacity="+value+")"}else{if(priority=="important"){style.cssText+=format(";%1:%2!important;",propertyName,value)}else{style.setAttribute(ViewCSS.toCamelCase(propertyName),value)}}}}},{"@MSIE":{bind:function(style){style.getPropertyValue=this.prototype.getPropertyValue;style.setProperty=this.prototype.setProperty;return style}}});var _CSSPropertyNameMap=new Base({"@Gecko":{opacity:"-moz-opacity"},"@KHTML":{opacity:"-khtml-opacity"}});with(CSSStyleDeclaration.prototype){getPropertyValue.toString=setProperty.toString=K("[base2]")}AbstractView.implement(ViewCSS);var NodeSelector=Interface.extend({"@(element.querySelector)":{querySelector:function(node,selector){try{var element=this.base(node,trim(selector));if(element){return element}}catch(x){}return new Selector(selector).exec(node,1)},querySelectorAll:function(node,selector){try{var nodeList=this.base(node,trim(selector));if(nodeList){return new StaticNodeList(nodeList)}}catch(x){}return new Selector(selector).exec(node)}},"@!(element.querySelector)":{querySelector:function(node,selector){return new Selector(selector).exec(node,1)},querySelectorAll:function(node,selector){return new Selector(selector).exec(node)}}});extend(NodeSelector.prototype,{querySelector:function(selector){return DOM.bind(this.base(selector))},querySelectorAll:function(selector){return extend(this.base(selector),"item",function(index){return DOM.bind(this.base(index))})}});var DocumentSelector=NodeSelector.extend();var ElementSelector=NodeSelector.extend({"@!(element.matchesSelector)":{matchesSelector:function(element,selector){return new Selector(selector).test(element)}}});var _CSS_ESCAPE=/'(\\.|[^'\\])*'|"(\\.|[^"\\])*"/g,_CSS_IMPLIED_ASTERISK=/([\s>+~,]|[^(]\+|^)([#.:\[])/g,_CSS_IMPLIED_SPACE=/(^|,)([^\s>+~])/g,_CSS_WHITESPACE=/\s*([\s>+~,]|^|$)\s*/g,_CSS_WILD_CARD=/\s\*\s/g,_CSS_UNESCAPE=/\x01(\d+)/g,_QUOTE=/'/g;var CSSParser=RegGrp.extend({constructor:function(items){this.base(items);this.cache={};this.sorter=new RegGrp;this.sorter.add(/:not\([^)]*\)/,RegGrp.IGNORE);this.sorter.add(/([ >](\*|[\w-]+))([^: >+~]*)(:\w+-child(\([^)]+\))?)([^: >+~]*)/,"$1$3$6$4")},cache:null,ignoreCase:true,escape:function(selector,simple){var strings=this._strings=[];selector=this.optimise(this.format(String(selector).replace(_CSS_ESCAPE,function(string){return"\x01"+strings.push(string.slice(1,-1).replace(_QUOTE,"\\'"))})));if(simple){selector=selector.replace(/(^|,) \*?/g,"$1")}return selector},format:function(selector){return selector.replace(_CSS_WHITESPACE,"$1").replace(_CSS_IMPLIED_SPACE,"$1 $2").replace(_CSS_IMPLIED_ASTERISK,"$1*$2")},optimise:function(selector){return this.sorter.exec(selector.replace(_CSS_WILD_CARD,">* "))},parse:function(selector,simple){return this.cache[selector]||(this.cache[selector]=this.unescape(this.exec(this.escape(selector,simple))))},unescape:function(selector){var strings=this._strings;return selector.replace(_CSS_UNESCAPE,function(match,index){return strings[index-1]})}});function _nthChild(match,args,position,last,not,and,mod,equals){last=/last/i.test(match)?last+"+1-":"";if(!isNaN(args)){args="0n+"+args}else{if(args=="even"){args="2n"}else{if(args=="odd"){args="2n+1"}}}args=args.split("n");var a=args[0]?(args[0]=="-")?-1:parseInt(args[0]):1;var b=parseInt(args[1])||0;var negate=a<0;if(negate){a=-a;if(a==1){b++}}var query=format(a==0?"%3%7"+(last+b):"(%4%3-%2)%6%1%70%5%4%3>=%2",a,b,position,last,and,mod,equals);if(negate){query=not+"("+query+")"}return query}var XPathParser=CSSParser.extend({constructor:function(){this.base(XPathParser.build());this.sorter.putAt(1,"$1$4$3$6")},escape:function(selector,simple){return this.base(selector,simple).replace(/,/g,"\x02")},unescape:function(selector){return this.base(selector.replace(/\[self::\*\]/g,"").replace(/(^|\x02)\//g,"$1./").replace(/\x02/g," | ")).replace(/'[^'\\]*\\'(\\.|[^'\\])*'/g,function(match){return"concat("+match.split("\\'").join("',\"'\",'")+")"})},"@opera(7|8|9\\.[1-4])":{unescape:function(selector){return this.base(selector.replace(/last\(\)/g,"count(preceding-sibling::*)+count(following-sibling::*)+1"))}}},{build:function(){this.values.attributes[""]="[@$1]";forEach(this.types,function(add,type){forEach(this.values[type],add,this.rules)},this);this.build=K(this.rules);return this.rules},optimised:{pseudoClasses:{"first-child":"[1]","last-child":"[last()]","only-child":"[last()=1]"}},rules:extend({},{"@!KHTML|opera":{"(^|\\x02) (\\*|[\\w-]+)#([\\w-]+)":"$1id('$3')[self::$2]"},"@!KHTML":{"([ >])(\\*|[\\w-]+):([\\w-]+-child(\\(([^)]+)\\))?)":function(match,token,tagName,pseudoClass,$4,args){var replacement=(token==" ")?"//*":"/*";if(/^nth/i.test(pseudoClass)){replacement+=_xpath_nthChild(pseudoClass,args,"position()")}else{replacement+=XPathParser.optimised.pseudoClasses[pseudoClass]}return replacement+"[self::"+tagName+"]"}}}),types:{identifiers:function(replacement,token){this[rescape(token)+"([\\w-]+)"]=replacement},combinators:function(replacement,combinator){this[rescape(combinator)+"(\\*|[\\w-]+)"]=replacement},attributes:function(replacement,operator){this["\\[\\s*([\\w-]+)\\s*"+rescape(operator)+"\\s*([^\\]\\s]*)\\s*\\]"]=replacement},pseudoClasses:function(replacement,pseudoClass){this[":"+pseudoClass.replace(/\(\)$/,"\\(([^)]+)\\)")]=replacement}},values:{identifiers:{"#":"[@id='$1'][1]",".":"[contains(concat(' ',@class,' '),' $1 ')]"},combinators:{" ":"/descendant::$1",">":"/child::$1","+":"/following-sibling::*[1][self::$1]","~":"/following-sibling::$1"},attributes:{"*=":"[contains(@$1,'$2')]","^=":"[starts-with(@$1,'$2')]","$=":"[substring(@$1,string-length(@$1)-string-length('$2')+1)='$2']","~=":"[contains(concat(' ',@$1,' '),' $2 ')]","|=":"[contains(concat('-',@$1,'-'),'-$2-')]","!=":"[not(@$1='$2')]","=":"[@$1='$2']"},pseudoClasses:{link:"[false]",visited:"[false]",empty:"[not(child::*) and not(text())]","first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","not()":_xpath_not,"nth-child()":_xpath_nthChild,"nth-last-child()":_xpath_nthChild,"only-child":"[not(preceding-sibling::*) and not(following-sibling::*)]",root:"[not(parent::*)]"}},"@opera(7|8|9\\.[1-4])":{build:function(){this.optimised.pseudoClasses["last-child"]=this.values.pseudoClasses["last-child"];this.optimised.pseudoClasses["only-child"]=this.values.pseudoClasses["only-child"];return this.base()}}});var _notParser;function _xpath_not(match,args){if(!_notParser){_notParser=new XPathParser}return"[not("+_notParser.exec(trim(args)).replace(/\[1\]/g,"").replace(/^(\*|[\w-]+)/,"[self::$1]").replace(/\]\[/g," and ").slice(1,-1)+")]"}function _xpath_nthChild(match,args,position){return"["+_nthChild(match,args,position||"count(preceding-sibling::*)+1","last()","not"," and "," mod ","=")+"]"}var Selector=Base.extend({constructor:function(selector){this.toString=K(trim(selector))},exec:function(context,count,simple){return Selector.parse(this,simple)(context,count)},isSimple:function(){if(!_parser.exec){_parser=new CSSParser(_parser)}return !_COMBINATOR.test(trim(_parser.escape(this)))},test:function(element){if(this.isSimple()){return !!Selector.parse(this,true)(element,1)}else{element.setAttribute("b2-test",true);var result=new Selector(this+"[b2-test]").exec(Traversal.getOwnerDocument(element),1);element.removeAttribute("b2-test");return result==element}},toXPath:function(simple){return Selector.toXPath(this,simple)},"@(XPathResult)":{exec:function(context,count,simple){if(_NOT_XPATH.test(this)){return this.base(context,count,simple)}var document=Traversal.getDocument(context);var type=count==1?9:7;var result=document.evaluate(this.toXPath(simple),context,null,type,null);return count==1?result.singleNodeValue:result}},"@MSIE":{exec:function(context,count,simple){if(typeof context.selectNodes!="undefined"&&!_NOT_XPATH.test(this)){var method=single?"selectSingleNode":"selectNodes";return context[method](this.toXPath(simple))}return this.base(context,count,simple)}},"@(true)":{exec:function(context,count,simple){try{var result=this.base(context||document,count,simple)}catch(error){throw new SyntaxError(format("'%1' is not a valid CSS selector.",this))}return count==1?result:new StaticNodeList(result)}}},{toXPath:function(selector,simple){if(!_xpathParser){_xpathParser=new XPathParser}return _xpathParser.parse(selector,simple)}});var _COMBINATOR=/[^,]\s|[+>~]/;var _NOT_XPATH=":(checked|disabled|enabled|contains|hover|active|focus)|^(#[\\w-]+\\s*)?\\w+$";if(detect("KHTML")){if(detect("WebKit5")){_NOT_XPATH+="|nth\\-|,"}else{_NOT_XPATH="."}}_NOT_XPATH=new RegExp(_NOT_XPATH);Selector.operators={"=":"%1=='%2'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/};Selector.operators[""]="%1!=null";Selector.pseudoClasses={checked:"e%1.checked",contains:"e%1[TEXT].indexOf('%2')!=-1",disabled:"e%1.disabled",empty:"Traversal.isEmpty(e%1)",enabled:"e%1.disabled===false","first-child":"!Traversal.getPreviousElementSibling(e%1)","last-child":"!Traversal.getNextElementSibling(e%1)","only-child":"!Traversal.getPreviousElementSibling(e%1)&&!Traversal.getNextElementSibling(e%1)",root:"e%1==Traversal.getDocument(e%1).documentElement",target:"e%1.id&&e%1.id==location.hash.slice(1)",hover:"DocumentState.getInstance(d).isHover(e%1)",active:"DocumentState.getInstance(d).isActive(e%1)",focus:"DocumentState.getInstance(d).hasFocus(e%1)",link:"false",visited:"false"};var _INDEXED=document.documentElement.sourceIndex!==undefined,_VAR="var p%2=0,i%2,e%3,n%2=e%1.",_ID=_INDEXED?"e%1.sourceIndex":"assignID(e%1)",_TEST="var g="+_ID+";if(!p[g]){p[g]=1;",_STORE="r[k++]=e%1;if(s==1)return e%1;if(k===s){_query.state=[%2];_query.complete=%3;return r;",_FN="var _query=function(e0,s%1){_indexed++;var r=[],p={},p0=0,reg=[%4],d=Traversal.getDocument(e0),c=d.writeln?'toUpperCase':'toString',k=0;";var _xpathParser;var _reg,_index,_wild,_list,_group,_listAll,_duplicate,_cache={},_simple={};function sum(list){var total=0;for(var i=0;i<list.length;i++){total+=list[i]}return total}var _parser={"^(\\*|[\\w-]+)":function(match,tagName){return tagName=="*"?"":format("if(e0.nodeName=='%1'[c]()){",tagName)},"^ \\*:root":function(match){_wild=false;var replacement="e%2=d.documentElement;if(Traversal.contains(e%1,e%2)){";return format(replacement,_index++,_index)}," (\\*|[\\w-]+)#([\\w-]+)":function(match,tagName,id){_wild=false;var replacement="var e%2=_byId(d,'%4');if(e%2&&";if(tagName!="*"){replacement+="e%2.nodeName=='%3'[c]()&&"}replacement+="Traversal.contains(e%1,e%2)){";if(_list[_group]){replacement+=format("i%1=n%1.length;",sum(_list))}return format(replacement,_index++,_index,tagName,id)}," (\\*|[\\w-]+)":function(match,tagName){_duplicate++;_wild=tagName=="*";var replacement=format(_VAR,_index++,"%2",_index);replacement+=(_wild&&_MSIE5)?"all":"getElementsByTagName('%3')";replacement+=";for(i%2=a%2||0;(e%1=n%2[i%2]);i%2++){";_list[_group]++;return format(replacement,_index,sum(_list),tagName)},">(\\*|[\\w-]+)":function(match,tagName){var children=_MSIE&&_index;_wild=tagName=="*";var replacement=_VAR+(children?"children":"childNodes");replacement=format(replacement,_index++,"%2",_index);if(!_wild&&_MSIE&&children){replacement+=".tags('%3')"}replacement+=";for(i%2=a%2||0;(e%1=n%2[i%2]);i%2++){";if(_wild){replacement+="if(e%1.nodeType==1){";_wild=_MSIE5}else{if(!_MSIE||!children){replacement+="if(e%1.nodeName=='%3'[c]()){"}}_list[_group]++;return format(replacement,_index,sum(_list),tagName)},"\\+(\\*|[\\w-]+)":function(match,tagName){var replacement="";if(_wild&&_MSIE){replacement+="if(e%1.nodeName!='!'){"}_wild=false;replacement+="e%1=Traversal.getNextElementSibling(e%1);if(e%1";if(tagName!="*"){replacement+="&&e%1.nodeName=='%2'[c]()"}replacement+="){";return format(replacement,_index,tagName)},"~(\\*|[\\w-]+)":function(match,tagName){var replacement="";if(_wild&&_MSIE){replacement+="if(e%1.nodeName!='!'){"}_wild=false;_duplicate=2;replacement+="while(e%1=e%1.nextSibling){if(e%1.b2_adjacent==_indexed)break;if(";if(tagName=="*"){replacement+="e%1.nodeType==1";if(_MSIE5){replacement+="&&e%1.nodeName!='!'"}}else{replacement+="e%1.nodeName=='%2'[c]()"}replacement+="){e%1.b2_adjacent=_indexed;";return format(replacement,_index,tagName)},"#([\\w-]+)":function(match,id){_wild=false;var replacement="if(e%1.id=='%2'){";if(_list[_group]){replacement+=format("i%1=n%1.length;",sum(_list))}return format(replacement,_index,id)},"\\.([\\w-]+)":function(match,className){_wild=false;_reg.push(new RegExp("(^|\\s)"+rescape(className)+"(\\s|$)"));return format("if(e%1.className&&reg[%2].test(e%1.className)){",_index,_reg.length-1)},":not\\((\\*|[\\w-]+)?([^)]*)\\)":function(match,tagName,filters){var replacement=(tagName&&tagName!="*")?format("if(e%1.nodeName=='%2'[c]()){",_index,tagName):"";replacement+=_parser.exec(filters);return"if(!"+replacement.slice(2,-1).replace(/\)\{if\(/g,"&&")+"){"},":nth(-last)?-child\\(([^)]+)\\)":function(match,last,args){_wild=false;last=format("e%1.parentNode.b2_length",_index);var replacement="if(p%1!==e%1.parentNode)p%1=_register(e%1.parentNode);";replacement+="var i=e%1[p%1.b2_lookup];if(p%1.b2_lookup!='b2_index')i++;if(";return format(replacement,_index)+_nthChild(match,args,"i",last,"!","&&","% ","==")+"){"},":([\\w-]+)(\\(([^)]+)\\))?":function(match,pseudoClass,$2,args){return"if("+format(Selector.pseudoClasses[pseudoClass]||"throw",_index,args||"")+"){"},"\\[\\s*([\\w-]+)\\s*([^=]?=)?\\s*([^\\]\\s]*)\\s*\\]":function(match,attr,operator,value){value=trim(value);if(_MSIE){var getAttribute="Element.getAttribute(e%1,'%2')"}else{getAttribute="e%1.getAttribute('%2')"}getAttribute=format(getAttribute,_index,attr);var replacement=Selector.operators[operator||""];if(instanceOf(replacement,RegExp)){_reg.push(new RegExp(format(replacement.source,rescape(_parser.unescape(value)))));replacement="reg[%2].test(%1)";value=_reg.length-1}return"if("+format(replacement,getAttribute,value)+"){"}};(function(_no_shrink_){var _byId=detect("MSIE[5-7]")?function(document,id){var result=document.all[id]||null;if(!result||result.id==id){return result}for(var i=0;i<result.length;i++){if(result[i].id==id){return result[i]}}return null}:function(document,id){return document.getElementById(id)};var _indexed=1;function _register(element){if(element.rows){element.b2_length=element.rows.length;element.b2_lookup="rowIndex"}else{if(element.cells){element.b2_length=element.cells.length;element.b2_lookup="cellIndex"}else{if(element.b2_indexed!=_indexed){var index=0;var child=element.firstChild;while(child){if(child.nodeType==1&&child.nodeName!="!"){child.b2_index=++index}child=child.nextSibling}element.b2_length=index;element.b2_lookup="b2_index"}}}element.b2_indexed=_indexed;return element}Selector.parse=function(selector,simple){var cache=simple?_simple:_cache;if(!cache[selector]){if(!_parser.exec){_parser=new CSSParser(_parser)}_reg=[];_list=[];var fn="";var selectors=_parser.escape(selector,simple).split(",");for(_group=0;_group<selectors.length;_group++){_wild=_index=_list[_group]=0;_duplicate=selectors.length>1?2:0;var block=_parser.exec(selectors[_group])||"throw;";if(_wild&&_MSIE){block+=format("if(e%1.tagName!='!'){",_index)}var store=(_duplicate>1)?_TEST:"";block+=format(store+_STORE,_index,"%2");block+=Array(match(block,/\{/g).length+1).join("}");fn+=block}fn=_parser.unescape(fn);if(selectors.length>1){fn+="r.unsorted=1;"}var args="";var state=[];var total=sum(_list);for(var i=1;i<=total;i++){args+=",a"+i;state.push("i"+i+"?(i"+i+"-1):0")}if(total){var complete=[],k=0;for(var i=0;i<_group;i++){k+=_list[i];if(_list[i]){complete.push(format("n%1&&i%1==n%1.length",k))}}}fn+="_query.state=[%2];_query.complete=%3;return s==1?null:r}";eval(format(_FN+fn,args,state.join(","),total?complete.join("&&"):true,_reg));cache[selector]=_query}return cache[selector]}})();var StaticNodeList=Base.extend({constructor:function(nodes){nodes=nodes||[];this.length=nodes.length;this.item=function(index){if(index<0){index+=this.length}return nodes[index]};if(nodes.unsorted){nodes.sort(_SORTER)}},length:0,forEach:function(block,context){for(var i=0;i<this.length;i++){block.call(context,this.item(i),i,this)}},item:Undefined,not:function(test,context){return this.filter(not(test),context)},slice:function(start,end){return new StaticNodeList(this.map(I).slice(start,end))},"@(XPathResult)":{constructor:function(nodes){if(nodes&&nodes.snapshotItem){this.length=nodes.snapshotLength;this.item=function(index){if(index<0){index+=this.length}return nodes.snapshotItem(index)}}else{this.base(nodes)}}}});StaticNodeList.implement(Enumerable);var _matchesSelector=function(test,context){if(typeof test!="function"){test=bind("test",new Selector(test))}return this.base(test,context)};StaticNodeList.implement({every:_matchesSelector,filter:_matchesSelector,not:_matchesSelector,some:_matchesSelector});StaticNodeList.implement({filter:function(test,context){return new StaticNodeList(this.base(test,context))}});var _SORTER=_INDEXED?function(node1,node2){return node1.sourceIndex-node2.sourceIndex}:function(node1,node2){return(Node.compareDocumentPosition(node1,node2)&2)-1};Document.implement(DocumentSelector);Element.implement(ElementSelector);var HTMLDocument=Document.extend(null,{bind:function(document){DocumentState.createState(document);return this.base(document)}});var HTMLElement=Element.extend(null,{bindings:{},tags:"*",bind:function(element){if(!element.classList){element.classList=new _ElementClassList(element)}if(!element.ownerDocument){element.ownerDocument=Traversal.getOwnerDocument(element)}return this.base(element)},extend:function(){var binding=base(this,arguments);forEach.csv(binding.tags,function(tagName){HTMLElement.bindings[tagName]=binding});return binding}});HTMLElement.extend(null,{tags:"APPLET,EMBED",bind:I});var ClassList=Module.extend({add:function(element,token){if(!this.has(element,token)){element.className+=(element.className?" ":"")+token}},has:function(element,token){var regexp=new RegExp("(^|\\s)"+token+"(\\s|$)");return regexp.test(element.className)},remove:function(element,token){var regexp=new RegExp("(^|\\s)"+token+"(\\s|$)","g");element.className=trim(element.className.replace(regexp,"$2"))},toggle:function(element,token){this[this.has(element,token)?"remove":"add"](element,token)}});function _ElementClassList(element){this.add=function(token){ClassList.add(element,token)};this.has=function(token){return ClassList.has(element,token)};this.remove=function(token){ClassList.remove(element,token)}}_ElementClassList.prototype.toggle=function(token){this[this.has(token)?"remove":"add"](token)};var DocumentState=Base.extend({constructor:function(document){this.document=document;this.events={};this._hoverElement=document.documentElement;this.isBound=function(){return !!DOM.bind[document.base2ID]};forEach(this,function(method,name,documentState){if(/^on((DOM)?\w+|[a-z]+)$/.test(name)){documentState.registerEvent(name.slice(2))}})},includes:function(element,target){return target&&(element==target||Traversal.contains(element,target))},hasFocus:function(element){return element==this._focusElement},isActive:function(element){return this.includes(element,this._activeElement)},isHover:function(element){return this.includes(element,this._hoverElement)},handleEvent:function(event){return this["on"+event.type](event)},onblur:function(event){delete this._focusElement},onmouseover:function(event){this._hoverElement=event.target},onmouseout:function(event){delete this._hoverElement},onmousedown:function(event){this._activeElement=event.target},onfocus:function(event){this._focusElement=event.target},onmouseup:function(event){delete this._activeElement},registerEvent:function(type){this.document.addEventListener(type,this,true);this.events[type]=true},"@(document.activeElement===undefined)":{constructor:function(document){this.base(document);if(this.isBound()){document.activeElement=document.body}},onfocus:function(event){this.base(event);if(this.isBound()){this.document.activeElement=this._focusElement}},onblur:function(event){this.base(event);if(this.isBound()){this.document.activeElement=this.document.body}}},"@!(element.addEventListener)":{constructor:function(document){this.base(document);var dispatcher=new EventDispatcher(this);this._dispatch=function(event){event.target=event.target||event.srcElement||document;dispatcher.handleEvent(event)};this.handleEvent=function(event){if(this["on"+event.type]){this["on"+event.type](event)}return dispatcher.handleEvent(event)}},registerEvent:function(type,target){var events=this.events[type];var canDelegate=_CAN_DELEGATE.test(type);if(!events||!canDelegate){if(!events){events=this.events[type]={}}if(canDelegate||!target){target=this.document}var state=this;target["on"+type]=function(event){if(!event){event=Traversal.getDefaultView(this).event}if(event){state.handleEvent(event)}}}return events},"@MSIE.+win":{constructor:function(document){this.base(document);var forms={};this._registerForm=function(form){var formID=assignID(form);if(!forms[formID]){forms[formID]=true;form.attachEvent("onsubmit",this._dispatch);form.attachEvent("onreset",this._dispatch)}}},fireEvent:function(type,event){event=copy(event);event.type=type;this.handleEvent(event)},registerEvent:function(type,target){var events=this.events[type];var canDelegate=_CAN_DELEGATE.test(type);if(!events||!canDelegate){if(!events){events=this.events[type]={}}if(canDelegate||!target){target=this.document}var state=this;target.attachEvent("on"+type,function(event){event.target=event.srcElement||state.document;state.handleEvent(event);if(state["after"+type]){state["after"+type](event)}})}return events},onDOMContentLoaded:function(event){forEach(event.target.forms,this._registerForm,this);this.setFocus(this.document.activeElement)},onmousedown:function(event){this.base(event);this._button=event.button},onmouseup:function(event){this.base(event);if(this._button==null){this.fireEvent("mousedown",event)}delete this._button},aftermouseup:function(){if(this._selectEvent){this._dispatch(this._selectEvent);delete this._selectEvent}},onfocusin:function(event){this.setFocus(event.target);this.onfocus(event)},setFocus:function(target){var change=this.events.change,select=this.events.select;if(change||select){var dispatch=this._dispatch;if(change){target.attachEvent("onchange",dispatch)}if(select){var state=this;var onselect=function(event){if(state._activeElement==target){state._selectEvent=copy(event)}else{dispatch(event)}};target.attachEvent("onselect",onselect)}target.attachEvent("onblur",function(){target.detachEvent("onblur",arguments.callee);if(change){target.detachEvent("onchange",dispatch)}if(select){target.detachEvent("onselect",onselect)}})}},onfocusout:function(event){this.onblur(event)},onclick:function(event){var target=event.target;if(target.form){this._registerForm(target.form)}},ondblclick:function(event){this.fireEvent("click",event)}}}},{init:function(){assignID(document);DocumentState=this;this.createState(document);new DOMContentLoadedEvent(document)},createState:function(document){var base2ID=document.base2ID;if(!this[base2ID]){this[base2ID]=new this(document)}return this[base2ID]},getInstance:function(target){return this[Traversal.getDocument(target).base2ID]}});eval(this.exports)};new function(_no_shrink_){var JSON=new base2.Package(this,{name:"JSON",imports:"Enumerable",version:"0.9",VALID:/^("(\\.|[^"\\\n\r])*"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])*$/,copy:function(object){return this.parse(this.toString(object))},parse:function(string){return this.String.parseJSON(string)}});eval(this.imports);JSON.toString=function(object){if(arguments.length==0){return"[base2.JSON]"}var module=this.Object;try{forEach(this,function(property,name){if(JSON.Object.ancestorOf(property)&&instanceOf(object,global[name])){module=property;throw StopIteration}})}catch(error){if(error!=StopIteration){throw error}}return module.toJSONString(object)};JSON.Object=Module.extend({toJSONString:function(object){return object==null?"null":"{"+reduce(object,function(properties,property,name){if(JSON.Object.isValid(property)){properties.push(JSON.String.toJSONString(name)+":"+JSON.toString(property))}return properties},[]).join(",")+"}"}},{VALID_TYPE:/^(object|boolean|number|string)$/,isValid:function(object){return this.VALID_TYPE.test(typeof object)}});JSON.Array=JSON.Object.extend({toJSONString:function(array){return"["+reduce(array,function(items,item){if(JSON.Object.isValid(item)){items.push(JSON.toString(item))}return items},[]).join(",")+"]"}});JSON.Boolean=JSON.Object.extend({toJSONString:function(bool){return String(bool)}});JSON.Date=JSON.Object.extend({toJSONString:function(date){var pad=function(n){return n<10?"0"+n:n};return'"'+date.getUTCFullYear()+"-"+pad(date.getUTCMonth()+1)+"-"+pad(date.getUTCDate())+"T"+pad(date.getUTCHours())+":"+pad(date.getUTCMinutes())+":"+pad(date.getUTCSeconds())+'Z"'}});JSON.Number=JSON.Object.extend({toJSONString:function(number){return isFinite(number)?String(number):"null"}});JSON.String=JSON.Object.extend({parseJSON:function(string){try{if(JSON.VALID.test(string)){return new Function("return "+string)()}}catch(error){throw new SyntaxError("parseJSON")}return""},toJSONString:function(string){return'"'+this.ESCAPE.exec(string)+'"'}},{ESCAPE:new RegGrp({"\b":"\\b","\\t":"\\t","\\n":"\\n","\\f":"\\f","\\r":"\\r",'"':'\\"',"\\\\":"\\\\","[\\x00-\\x1f]":function(chr){var charCode=chr.charCodeAt(0);return"\\u00"+Math.floor(charCode/16).toString(16)+(charCode%16).toString(16)}})});eval(this.exports)};base2.DOM.bind(document);base2.DOM.bind(window);base2.JavaScript.bind(window);base2.JavaScript.Array2(Array.prototype);function extend_object(a,c){for(var b in c){a[b]=c[b]}return a}function remove(){for(var a=0,b;b=arguments[a];a++){if(b&&b.parentNode){b.parentNode.removeChild(b)}}}Function.prototype.bindAsEventListener=function(a){var c=this;var b=Array.prototype.slice.call(arguments,0);return function(d){return c.apply(a,[d||window.event].concat(b))}};Function.prototype.bind=function(a){var c=this;var b=Array.prototype.slice.call(arguments,1);return function(){return c.apply(a,b.concat(Array.prototype.slice.call(arguments,0)))}};Date.parseRFC3339=function(c){var b=new Date(0);var a=c.match(/(\d{4})-(\d\d)-(\d\d)\s*(?:[\sT]\s*(\d\d):(\d\d)(?::(\d\d))?(\.\d*)?\s*(Z|([-+])(\d\d):(\d\d))?)?/);if(!a){return}if(a[2]){a[2]--}if(a[7]){a[7]=(a[7]+"000").substring(1,4)}var e=[null,"FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"];for(var d=1;d<=7;d++){if(a[d]){b["setUTC"+e[d]](a[d])}}if(a[9]){b.setTime(b.getTime()+(a[9]=="-"?1:-1)*(a[10]*3600000+a[11]*60000))}return b.getTime()};function localizeDates(){var b="";var a=new Date();document.querySelectorAll("time").forEach(function(e,d){if(e.getAttribute("title")=="GMT"){var c=new Date(Date.parseRFC3339(e.getAttribute("datetime")));if(!c.getTime()){return}diff=((a.getTime()-c.getTime())/1000),day_diff=Math.floor(diff/86400);if(isNaN(day_diff)||day_diff<0||day_diff>=31){return}var g=c.toLocaleString();var f=c.toLocaleString();if(day_diff==0){g=(diff<60&&"Just Now"||diff<120&&"1 minute ago"||diff<3600&&Math.floor(diff/60)+" minutes ago"||diff<7200&&"1 hour ago"||diff<86400&&Math.floor(diff/3600)+" hours ago");f=c.toLocaleTimeString()}else{hours=c.getHours();minutes=c.getMinutes();hours=(hours<10)&&"0"+hours||hours;minutes=(minutes<10)&&"0"+minutes||minutes;g=(day_diff==1&&"Yesterday at "+hours+":"+minutes||e.textContent);f=c.toLocaleString()}e.setAttribute("title",f);e.textContent="posted "+g}})}function resizeBottom(){height=0;if(window.innerHeight){height=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){height=document.documentElement.clientHeight}else{height=document.body.clientHeight}}var a=document.querySelector("#bottom");new_height=(height-a.offsetTop);if(new_height!="undefined"&&new_height>40){a.style.height=new_height+"px"}else{a.style.height="40px"}}var userAgent=navigator.userAgent.toLowerCase();var Ajax=base2.Base.extend({lastModified:{},browser:{version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)},constructor:function(a){this.options={url:location.href,method:"GET",timeout:0,async:true,contentType:"application/x-www-form-urlencoded",processData:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}};extend_object(this.options,a||{})},get:function(a,c,d,b){if(typeof c=="function"){d=c;c=null}return this.request({method:"GET",url:a,data:c,success:d,dataType:b})},post:function(a,c,d,b){if(typeof c=="function"){d=c;c=null}return this.request({method:"POST",url:a,data:c,success:d,dataType:b})},request:function(o){extend_object(Ajax.options,o||{});extend_object(o,Ajax.options);var f,g,a=o.method.toUpperCase();if(o.data&&o.processData&&typeof o.data!="string"){o.data=Ajax.param(o.data)}if(o.cache===false&&a=="GET"){var j=now();var i=o.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+j+"$2");o.url=i+((i==o.url)?(o.url.match(/\?/)?"&":"?")+"_="+j:"")}if(o.data&&a=="GET"){o.url+=(o.url.match(/\?/)?"&":"?")+o.data;o.data=null}Ajax.active++;var c=/^(?:\w+:)?\/\/([^\/?#]+)/;var d=false;var n=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(o.username){n.open(a,o.url,o.async,o.username,o.password)}else{n.open(a,o.url,o.async)}try{if(o.data){n.setRequestHeader("Content-Type",o.contentType)}if(o.ifModified){n.setRequestHeader("If-Modified-Since",Ajax.lastModified[o.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}n.setRequestHeader("X-Requested-With","XMLHttpRequest");n.setRequestHeader("Accept",o.dataType&&o.accepts[o.dataType]?o.accepts[o.dataType]+", */*":o.accepts._default)}catch(h){}if(o.beforeSend&&o.beforeSend(n,o)===false){Ajax.active--;n.abort();return false}var l=function(p){if(!d&&n&&(n.readyState==4||p=="timeout")){d=true;if(k){clearInterval(k);k=null}f=p=="timeout"&&"timeout"||!Ajax.httpSuccess(n)&&"error"||o.ifModified&&Ajax.httpNotModified(n,o.url)&&"notmodified"||"success";if(f=="success"){try{g=Ajax.httpData(n,o.dataType,o.dataFilter)}catch(r){f="parsererror"}}if(f=="success"){var q;try{q=n.getResponseHeader("Last-Modified")}catch(r){}if(o.ifModified&&q){Ajax.lastModified[o.url]=q}m()}else{Ajax.handleError(o,n,f)}b();if(o.async){n=null}}};if(o.async){var k=setInterval(l,13);if(o.timeout>0){setTimeout(function(){if(n){n.abort();if(!d){l("timeout")}}},o.timeout)}}try{n.send(o.data)}catch(h){Ajax.handleError(o,n,null,h)}if(!o.async){l()}function m(){if(o.success){o.success(g,f)}}function b(){if(o.complete){o.complete(n,f)}--Ajax.active}return n},handleError:function(b,d,a,c){if(b.error){b.error(d,a,c)}},active:0,httpSuccess:function(b){try{return !b.status&&location.protocol=="file:"||(b.status>=200&&b.status<300)||b.status==304||b.status==1223||Ajax.browser.safari&&b.status==undefined}catch(a){}return false},httpNotModified:function(c,a){try{var d=c.getResponseHeader("Last-Modified");return c.status==304||d==this.lastModified[a]||Ajax.browser.safari&&c.status==undefined}catch(b){}return false},httpData:function(f,d,c){var b=f.getResponseHeader("content-type"),a=d=="xml"||!d&&b&&b.indexOf("xml")>=0,e=a?f.responseXML:f.responseText;if(a&&e.documentElement.tagName=="parsererror"){throw"parsererror"}if(c){e=c(e,d)}if(d=="json"){e=base2.JSON.parse(e)}return e},param:function(b){var d=[];if(b.constructor==Array){b.forEach(function(e,a,f){d.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))})}else{for(var c in b){if(b[c]&&b[c].constructor==Array){b[c].forEach(function(e,a,f){d.push(encodeURIComponent(c)+"="+encodeURIComponent(e))})}else{d.push(encodeURIComponent(c)+"="+encodeURIComponent((typeof b[c]=="function"?b[c]():b[c])))}}}return d.join("&").replace(/%20/g,"+")}});window.Ajax=new Ajax();
+;var javaEnabled=global.java?true:false;if(global.navigator){var MSIE=/MSIE[\d.]+/g;var element=document.createElement("span");var userAgent=navigator.userAgent.replace(/([a-z])[\s\/](\d)/gi,"$1$2");if(!jscript){userAgent=userAgent.replace(MSIE,"")}if(MSIE.test(userAgent)){userAgent=userAgent.match(MSIE)[0]+" "+userAgent.replace(MSIE,"")}base2.userAgent=navigator.platform+" "+userAgent.replace(/like \w+/gi,"");javaEnabled&=navigator.javaEnabled()}var _cache={};detect=function(expression){if(_cache[expression]==null){var returnValue=false,test=expression;var not=test.charAt(0)=="!";if(not){test=test.slice(1)}if(test.charAt(0)=="("){try{returnValue=new Function("element,jscript,java,global","return !!"+test)(element,jscript,javaEnabled,global)}catch(ex){}}else{returnValue=new RegExp("("+test+")","i").test(base2.userAgent)}_cache[expression]=!!(not^returnValue)}return _cache[expression]};return detect(arguments[0])}base2=global.base2=new Package(this,base2);var exports=this.exports;lang=new Package(this,lang);exports+=this.exports;JavaScript=new Package(this,JavaScript);eval(exports+this.exports);lang.base=base;lang.extend=extend};new function(_no_shrink_){var DOM=new base2.Package(this,{name:"DOM",version:"1.0.1",imports:"Function2",exports:"Interface,Binding,Node,Document,Element,AbstractView,HTMLDocument,HTMLElement,Selector,Traversal,CSSParser,XPathParser,NodeSelector,DocumentSelector,ElementSelector,StaticNodeList,Event,EventTarget,DocumentEvent,ViewCSS,CSSStyleDeclaration,ClassList",bind:function(node){if(node&&node.nodeType){var base2ID=assignID(node);if(!DOM.bind[base2ID]){switch(node.nodeType){case 1:if(typeof node.className=="string"){(HTMLElement.bindings[node.tagName]||HTMLElement).bind(node)}else{Element.bind(node)}break;case 9:if(node.writeln){HTMLDocument.bind(node)}else{Document.bind(node)}break;default:Node.bind(node)}DOM.bind[base2ID]=true}}return node},"@MSIE5.+win":{bind:function(node){if(node&&node.writeln){node.nodeType=9}return this.base(node)}}});eval(this.imports);var _MSIE=detect("MSIE");var _MSIE5=detect("MSIE5");var Interface=Module.extend(null,{forEach:function(block,context){forEach(this,function(method,name){if(typeOf(method)=="function"&&(this.prototype[name]||method._delegate)){block.call(context,method,name,this)}},this,Module)},implement:function(_interface){if(typeof _interface=="object"){_createDelegates(this,_interface)}else{if(Interface.ancestorOf(_interface)){for(var name in _interface){if(_interface[name]&&_interface[name]._delegate){this[name]=bind(name,_interface);this[name]._delegate=name}}}}return this.base(_interface)}});function _createDelegates(module,_interface){var id=module.toString().slice(1,-1);for(var name in _interface){var property=_interface[name];if(name.charAt(0)=="@"){_createDelegates(module,property)}else{if(!module[name]&&typeof property=="function"&&property.call){var args="abcdefghij".slice(0,property.length).split("");var fn=new Function(args.join(","),format("%2.base=%2.%1.ancestor;var m=%2.base?'base':'%1';return %2[m](%3)",name,args[0],args.slice(1)));fn._delegate=name;module[name]=fn;module.namespace+="var "+name+"=base2.lang.bind('"+name+"',"+id+");"}}}}var Binding=Interface.extend(null,{bind:function(object){return extend(object,this.prototype)}});var Node=Binding.extend({"@!(element.compareDocumentPosition)":{compareDocumentPosition:function(node,other){if(Traversal.contains(node,other)){return 4|16}else{if(Traversal.contains(other,node)){return 2|8}}var nodeIndex=_getSourceIndex(node);var otherIndex=_getSourceIndex(other);if(nodeIndex<otherIndex){return 4}else{if(nodeIndex>otherIndex){return 2}}return 0}}},{"@Gecko":{bind:function(node){return extend(this.base(node),"removeEventListener",function(){var args=Array2.slice(arguments);args.unshift(this);EventTarget.removeEventListener.apply(EventTarget,args)})}}});var _getSourceIndex=document.documentElement.sourceIndex?function(node){return node.sourceIndex}:function(node){var key=0;while(node){key=Traversal.getNodeIndex(node)+"."+key;node=node.parentNode}return key};var Document=Node.extend(null,{bind:function(document){extend(document,"createElement",function(tagName){return DOM.bind(this.base(tagName))});AbstractView.bind(document.defaultView);if(document!=window.document){new DOMContentLoadedEvent(document)}return this.base(document)},"@!(document.defaultView)":{bind:function(document){document.defaultView=Traversal.getDefaultView(document);return this.base(document)}}});var _ATTRIBUTES={"class":"className","for":"htmlFor"};var Element=Node.extend({"@MSIE.+win":{getAttribute:function(element,name){if(element.className===undefined){return this.base(element,name)}var attribute=_getAttributeNode(element,name);if(attribute&&(attribute.specified||name=="value")){if(name=="href"||name=="src"){element.base=element.getAttribute.ancestor;return element[element.base?"base":"getAttribute"](name,2)}else{if(name=="style"){return element.style.cssText.toLowerCase()}else{return attribute.nodeValue}}}else{if(name=="type"&&element.nodeName=="INPUT"){var outerHTML=element.outerHTML;with(outerHTML){outerHTML=slice(0,indexOf(">")+1)}return match(outerHTML,/type="?([^\s">]*)"?/i)[1]||null}}return null},removeAttribute:function(element,name){if(element.className!==undefined){name=_ATTRIBUTES[name.toLowerCase()]||name}this.base(element,name)},setAttribute:function(element,name,value){if(element.className===undefined){this.base(element,name,value)}else{if(name=="style"){element.style.cssText=value}else{value=String(value);var attribute=_getAttributeNode(element,name);if(attribute){attribute.nodeValue=value}else{this.base(element,_ATTRIBUTES[name.toLowerCase()]||name,value)}}}}},"@!(element.hasAttribute)":{hasAttribute:function(element,name){if(element.className===undefined){return this.base(element,name)}return this.getAttribute(element,name)!=null}}});if(detect("MSIE.+win")){extend(Element.prototype,"cloneNode",function(deep){var clone=this.base(deep||false);clone.base2ID=undefined;return clone})}var _HTML_ATTRIBUTES="colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";extend(_ATTRIBUTES,Array2.combine(_HTML_ATTRIBUTES.toLowerCase().split(","),_HTML_ATTRIBUTES.split(",")));var _getAttributeNode=document.documentElement.getAttributeNode?function(element,name){return element.getAttributeNode(name)}:function(element,name){return element.attributes[name]||element.attributes[_ATTRIBUTES[name.toLowerCase()]]};var TEXT=detect("(element.textContent===undefined)")?"innerText":"textContent";var Traversal=Module.extend({getDefaultView:function(node){return this.getDocument(node).defaultView},getNextElementSibling:function(node){while(node&&(node=node.nextSibling)&&!this.isElement(node)){continue}return node},getNodeIndex:function(node){var index=0;while(node&&(node=node.previousSibling)){index++}return index},getOwnerDocument:function(node){return node.ownerDocument},getPreviousElementSibling:function(node){while(node&&(node=node.previousSibling)&&!this.isElement(node)){continue}return node},getTextContent:function(node,isHTML){return node[isHTML?"innerHTML":TEXT]},isEmpty:function(node){node=node.firstChild;while(node){if(node.nodeType==3||this.isElement(node)){return false}node=node.nextSibling}return true},setTextContent:function(node,text,isHTML){return node[isHTML?"innerHTML":TEXT]=text},"@!MSIE":{setTextContent:function(node,text,isHTML){with(node){while(lastChild){parentNode.removeChild(lastChild)}}return this.base(node,text,isHTML)}},"@MSIE":{getDefaultView:function(node){return(node.document||node).parentWindow},"@MSIE5":{getOwnerDocument:function(node){return node.ownerDocument||node.document}}}},{contains:function(node,target){node.nodeType;while(target&&(target=target.parentNode)&&node!=target){continue}return !!target},getDocument:function(node){return this.isDocument(node)?node:node.ownerDocument||node.document},isDocument:function(node){return !!(node&&node.documentElement)},isElement:function(node){return !!(node&&node.nodeType==1)},"@(element.contains)":{contains:function(node,target){return node!=target&&(this.isDocument(node)?node==this.getOwnerDocument(target):node.contains(target))}},"@MSIE5":{isElement:function(node){return !!(node&&node.nodeType==1&&node.nodeName!="!")}}});var AbstractView=Binding.extend();var _CAPTURE_TYPE={},_TYPE_MAP={"2":2,"4":1};var _CAPTURING_PHASE=1,_AT_TARGET=2,_BUBBLING_PHASE=3;var _MOUSE_BUTTON=/^mouse(up|down)|click$/,_MOUSE_CLICK=/click$/,_BUBBLES="abort|error|select|change|resize|scroll|",_CANCELABLE="(dbl)?click|mouse(down|up|over|move|out|wheel)|key(down|up)|submit|reset";_BUBBLES=new RegExp("^("+_BUBBLES+_CANCELABLE+")$");_CANCELABLE=new RegExp("^("+_CANCELABLE+")$");if(_MSIE){var _W3C_EVENT_TYPE={focusin:"focus",focusout:"blur"};_CAPTURE_TYPE={focus:"focusin",blur:"focusout"}}var _CAN_DELEGATE=/^(blur|submit|reset|change|select)$|^(mouse|key|focus)|click$/;var Event=Binding.extend({"@!(document.createEvent)":{initEvent:function(event,type,bubbles,cancelable){event.type=String(type);event.bubbles=!!bubbles;event.cancelable=!!cancelable},preventDefault:function(event){if(event.cancelable!==false){event.returnValue=false}},stopPropagation:function(event){event.cancelBubble=true},"@MSIE":{preventDefault:function(event){this.base(event);if(event.type=="mousedown"){var type="onbeforedeactivate";var document=Traversal.getDocument(event.target);document.attachEvent(type,function(event){event.returnValue=false;document.detachEvent(type,arguments.callee)})}}}}},{CAPTURING_PHASE:_CAPTURING_PHASE,AT_TARGET:_AT_TARGET,BUBBLING_PHASE:_BUBBLING_PHASE,"@!(document.createEvent)":{"@MSIE":{bind:function(event){var type=event.type;if(!event.timeStamp){event.bubbles=_BUBBLES.test(type);event.cancelable=_CANCELABLE.test(type);event.timeStamp=new Date().valueOf()}event.relatedTarget=event[(event.target==event.fromElement?"to":"from")+"Element"];return this.base(event)}}},cloneEvent:function(event){var clone=copy(event);clone.stopPropagation=function(){event.stopPropagation()};clone.preventDefault=function(){event.preventDefault()};return clone},"@MSIE":{cloneEvent:copy}});var EventDispatcher=Base.extend({constructor:function(state){this.state=state;this.events=state.events},dispatch:function(nodes,event,phase){event.eventPhase=phase;var map=this.events[event.type][phase];if(map){var i=nodes.length;while(i--&&!event.cancelBubble){var currentTarget=nodes[i];var listeners=map[currentTarget.base2ID];if(listeners){listeners=copy(listeners);event.currentTarget=currentTarget;event.eventPhase=currentTarget==event.target?_AT_TARGET:phase;for(var listenerID in listeners){var listener=listeners[listenerID];if(typeof listener=="function"){listener.call(currentTarget,event)}else{listener.handleEvent(event)}}}}}},handleEvent:function(event,fixed){Event.bind(event);var type=event.type;var w3cType=_W3C_EVENT_TYPE[type];if(w3cType){event=copy(event);type=event.type=w3cType}if(this.events[type]){if(_MOUSE_BUTTON.test(type)){var button=_MOUSE_CLICK.test(type)?this.state._button:event.button;button=_TYPE_MAP[button]||0;if(event.button!=button){event=copy(event);event.button=button}}var currentTarget=event.target;var nodes=[],i=0;while(currentTarget){nodes[i++]=currentTarget;currentTarget=currentTarget.parentNode}this.dispatch(nodes,event,_CAPTURING_PHASE);if(!event.cancelBubble){if(!event.bubbles){nodes.length=1}nodes.reverse();this.dispatch(nodes,event,_BUBBLING_PHASE)}}return event.returnValue!==false},"@MSIE.+win":{handleEvent:function(event){if(event.type=="scroll"){setTimeout(bind(this.base,this,copy(event),true),0);return true}else{return this.base(event)}},"@MSIE5":{dispatch:function(nodes,event,phase){if(phase==_CAPTURING_PHASE&&!Array2.item(nodes,-1).documentElement){nodes.push(nodes[0].document)}this.base(nodes,event,phase)}}}});var _wrappedListeners={};var EventTarget=Interface.extend({"@!(element.addEventListener)":{addEventListener:function(target,type,listener,useCapture){var documentState=DocumentState.getInstance(target);var targetID=assignID(target);var listenerID=assignID(listener);var phase=useCapture?_CAPTURING_PHASE:_BUBBLING_PHASE;var typeMap=documentState.registerEvent(type,target);var phaseMap=typeMap[phase];if(!phaseMap){phaseMap=typeMap[phase]={}}if(useCapture){type=_CAPTURE_TYPE[type]||type}var listeners=phaseMap[targetID];if(!listeners){listeners=phaseMap[targetID]={}}listeners[listenerID]=listener},dispatchEvent:function(target,event){event.target=target;return DocumentState.getInstance(target).handleEvent(event)},removeEventListener:function(target,type,listener,useCapture){var events=DocumentState.getInstance(target).events;var typeMap=events[type];if(typeMap){var phaseMap=typeMap[useCapture?_CAPTURING_PHASE:_BUBBLING_PHASE];if(phaseMap){var listeners=phaseMap[target.base2ID];if(listeners){delete listeners[listener.base2ID]}}}}},"@(element.addEventListener)":{"@Gecko":{addEventListener:function(target,type,listener,useCapture){if(type=="mousewheel"){type="DOMMouseScroll";var originalListener=listener;listener=_wrappedListeners[assignID(listener)]=function(event){event=Event.cloneEvent(event);event.type="mousewheel";event.wheelDelta=(-event.detail*40)||0;_handleEvent(target,originalListener,event)}}this.base(target,type,listener,useCapture)}},"@webkit[1-4]|KHTML[34]":{addEventListener:function(target,type,listener,useCapture){if(_MOUSE_BUTTON.test(type)){var originalListener=listener;listener=_wrappedListeners[assignID(listener)]=function(event){var button=_TYPE_MAP[event.button]||0;if(event.button!=button){event=Event.cloneEvent(event);event.button=button}_handleEvent(target,originalListener,event)}}else{if(typeof listener=="object"){listener=_wrappedListeners[assignID(listener)]=bind("handleEvent",listener)}}this.base(target,type,listener,useCapture)}},"@Linux|Mac|opera":{addEventListener:function(target,type,listener,useCapture){if(type=="keydown"){var originalListener=listener;listener=_wrappedListeners[assignID(listener)]=function(keydownEvent){var firedCount=0,cancelled=false;extend(keydownEvent,"preventDefault",function(){this.base();cancelled=true});function handleEvent(event){if(cancelled){event.preventDefault()}if(event==keydownEvent||firedCount>1){_handleEvent(target,originalListener,keydownEvent)}firedCount++}handleEvent(keydownEvent);target.addEventListener("keyup",function(){target.removeEventListener("keypress",handleEvent,true);target.removeEventListener("keyup",arguments.callee,true)},true);target.addEventListener("keypress",handleEvent,true)}}this.base(target,type,listener,useCapture)}},removeEventListener:function(target,type,listener,useCapture){this.base(target,type,_wrappedListeners[listener.base2ID]||listener,useCapture)}}});if(detect("Gecko")){EventTarget.removeEventListener._delegate="removeEventListener";delete EventTarget.prototype.removeEventListener}function _handleEvent(target,listener,event){if(typeof listener=="function"){listener.call(target,event)}else{listener.handleEvent(event)}}var DocumentEvent=Interface.extend({"@!(document.createEvent)":{createEvent:function(document,type){var event=document.createEventObject?document.createEventObject():{};event.bubbles=false;event.cancelable=false;event.eventPhase=0;event.target=document;event.currentTarget=null;event.relatedTarget=null;event.timeStamp=new Date().valueOf();return Event(event)}},"@(document.createEvent)":{"@!(document.createEvent('Events'))":{createEvent:function(document,type){return this.base(document,type=="Events"?"UIEvents":type)}}}});var DOMContentLoadedEvent=Base.extend({constructor:function(document){var fired=false;this.fire=function(){if(!fired){fired=true;setTimeout(function(){var event=DocumentEvent.createEvent(document,"Events");Event.initEvent(event,"DOMContentLoaded",true,false);EventTarget.dispatchEvent(document,event)},1)}};EventTarget.addEventListener(document,"DOMContentLoaded",function(){fired=true},false);this.listen(document)},listen:Undefined,"@!Gecko20([^0]|0[3-9])|Webkit[5-9]|Opera[19]|MSIE.+mac":{listen:function(document){EventTarget.addEventListener(Traversal.getDefaultView(document),"load",this.fire,false)},"@MSIE.+win":{listen:function(document){try{document.body.doScroll("left");if(!this.__constructing){this.fire()}}catch(e){setTimeout(bind(this.listen,this,document),10)}}},"@KHTML":{listen:function(document){if(/loaded|complete/.test(document.readyState)){if(!this.__constructing){this.fire()}}else{setTimeout(bind(this.listen,this,document),10)}}}}});Document.implement(DocumentEvent);Document.implement(EventTarget);Element.implement(EventTarget);var _PIXEL=/^\d+(px)?$/i,_METRICS=/(width|height|top|bottom|left|right|fontSize)$/,_COLOR=/^(color|backgroundColor)$/,_RGB_BLACK="rgb(0, 0, 0)",_BLACK={black:1,"#000":1,"#000000":1};var ViewCSS=Interface.extend({"@!(document.defaultView.getComputedStyle)":{"@MSIE":{getComputedStyle:function(view,element,pseudoElement){var currentStyle=element.currentStyle;var computedStyle={};for(var propertyName in currentStyle){if(_METRICS.test(propertyName)||_COLOR.test(propertyName)){computedStyle[propertyName]=this.getComputedPropertyValue(view,element,propertyName)}else{if(propertyName.indexOf("ruby")!=0){computedStyle[propertyName]=currentStyle[propertyName]}}}return computedStyle}}},getComputedStyle:function(view,element,pseudoElement){return _CSSStyleDeclaration_ReadOnly.bind(this.base(view,element,pseudoElement))}},{getComputedPropertyValue:function(view,element,propertyName){return CSSStyleDeclaration.getPropertyValue(this.getComputedStyle(view,element,null),propertyName)},"@MSIE":{getComputedPropertyValue:function(view,element,propertyName){propertyName=this.toCamelCase(propertyName);var value=element.currentStyle[propertyName];if(_METRICS.test(propertyName)){return _MSIE_getPixelValue(element,value)+"px"}if(!_MSIE5&&_COLOR.test(propertyName)){var rgb=_MSIE_getColorValue(element,propertyName=="color"?"ForeColor":"BackColor");return(rgb==_RGB_BLACK&&!_BLACK[value])?value:rgb}return value}},toCamelCase:function(string){return string.replace(/\-([a-z])/g,flip(String2.toUpperCase))}});function _MSIE_getPixelValue(element,value){if(_PIXEL.test(value)){return parseInt(value)}var styleLeft=element.style.left;var runtimeStyleLeft=element.runtimeStyle.left;element.runtimeStyle.left=element.currentStyle.left;element.style.left=value||0;value=element.style.pixelLeft;element.style.left=styleLeft;element.runtimeStyle.left=runtimeStyleLeft;return value}function _MSIE_getColorValue(element,type){if(element.createTextRange){var range=element.createTextRange()}else{range=element.document.body.createTextRange();range.moveToElementText(element)}var color=range.queryCommandValue(type);return format("rgb(%1, %2, %3)",color&255,(color&65280)>>8,(color&16711680)>>16)}var _CSSStyleDeclaration_ReadOnly=Binding.extend({getPropertyValue:function(style,propertyName){return this.base(style,_CSSPropertyNameMap[propertyName]||propertyName)},"@MSIE.+win":{getPropertyValue:function(style,propertyName){return propertyName=="float"?style.styleFloat:style[ViewCSS.toCamelCase(propertyName)]}}});var CSSStyleDeclaration=_CSSStyleDeclaration_ReadOnly.extend({setProperty:function(style,propertyName,value,priority){return this.base(style,_CSSPropertyNameMap[propertyName]||propertyName,value,priority)},"@MSIE.+win":{setProperty:function(style,propertyName,value,priority){if(propertyName=="opacity"){value*=100;style.opacity=value;style.zoom=1;style.filter="Alpha(opacity="+value+")"}else{if(priority=="important"){style.cssText+=format(";%1:%2!important;",propertyName,value)}else{style.setAttribute(ViewCSS.toCamelCase(propertyName),value)}}}}},{"@MSIE":{bind:function(style){style.getPropertyValue=this.prototype.getPropertyValue;style.setProperty=this.prototype.setProperty;return style}}});var _CSSPropertyNameMap=new Base({"@Gecko":{opacity:"-moz-opacity"},"@KHTML":{opacity:"-khtml-opacity"}});with(CSSStyleDeclaration.prototype){getPropertyValue.toString=setProperty.toString=K("[base2]")}AbstractView.implement(ViewCSS);var NodeSelector=Interface.extend({"@(element.querySelector)":{querySelector:function(node,selector){try{var element=this.base(node,trim(selector));if(element){return element}}catch(x){}return new Selector(selector).exec(node,1)},querySelectorAll:function(node,selector){try{var nodeList=this.base(node,trim(selector));if(nodeList){return new StaticNodeList(nodeList)}}catch(x){}return new Selector(selector).exec(node)}},"@!(element.querySelector)":{querySelector:function(node,selector){return new Selector(selector).exec(node,1)},querySelectorAll:function(node,selector){return new Selector(selector).exec(node)}}});extend(NodeSelector.prototype,{querySelector:function(selector){return DOM.bind(this.base(selector))},querySelectorAll:function(selector){return extend(this.base(selector),"item",function(index){return DOM.bind(this.base(index))})}});var DocumentSelector=NodeSelector.extend();var ElementSelector=NodeSelector.extend({"@!(element.matchesSelector)":{matchesSelector:function(element,selector){return new Selector(selector).test(element)}}});var _CSS_ESCAPE=/'(\\.|[^'\\])*'|"(\\.|[^"\\])*"/g,_CSS_IMPLIED_ASTERISK=/([\s>+~,]|[^(]\+|^)([#.:\[])/g,_CSS_IMPLIED_SPACE=/(^|,)([^\s>+~])/g,_CSS_WHITESPACE=/\s*([\s>+~,]|^|$)\s*/g,_CSS_WILD_CARD=/\s\*\s/g,_CSS_UNESCAPE=/\x01(\d+)/g,_QUOTE=/'/g;var CSSParser=RegGrp.extend({constructor:function(items){this.base(items);this.cache={};this.sorter=new RegGrp;this.sorter.add(/:not\([^)]*\)/,RegGrp.IGNORE);this.sorter.add(/([ >](\*|[\w-]+))([^: >+~]*)(:\w+-child(\([^)]+\))?)([^: >+~]*)/,"$1$3$6$4")},cache:null,ignoreCase:true,escape:function(selector,simple){var strings=this._strings=[];selector=this.optimise(this.format(String(selector).replace(_CSS_ESCAPE,function(string){return"\x01"+strings.push(string.slice(1,-1).replace(_QUOTE,"\\'"))})));if(simple){selector=selector.replace(/(^|,) \*?/g,"$1")}return selector},format:function(selector){return selector.replace(_CSS_WHITESPACE,"$1").replace(_CSS_IMPLIED_SPACE,"$1 $2").replace(_CSS_IMPLIED_ASTERISK,"$1*$2")},optimise:function(selector){return this.sorter.exec(selector.replace(_CSS_WILD_CARD,">* "))},parse:function(selector,simple){return this.cache[selector]||(this.cache[selector]=this.unescape(this.exec(this.escape(selector,simple))))},unescape:function(selector){var strings=this._strings;return selector.replace(_CSS_UNESCAPE,function(match,index){return strings[index-1]})}});function _nthChild(match,args,position,last,not,and,mod,equals){last=/last/i.test(match)?last+"+1-":"";if(!isNaN(args)){args="0n+"+args}else{if(args=="even"){args="2n"}else{if(args=="odd"){args="2n+1"}}}args=args.split("n");var a=args[0]?(args[0]=="-")?-1:parseInt(args[0]):1;var b=parseInt(args[1])||0;var negate=a<0;if(negate){a=-a;if(a==1){b++}}var query=format(a==0?"%3%7"+(last+b):"(%4%3-%2)%6%1%70%5%4%3>=%2",a,b,position,last,and,mod,equals);if(negate){query=not+"("+query+")"}return query}var XPathParser=CSSParser.extend({constructor:function(){this.base(XPathParser.build());this.sorter.putAt(1,"$1$4$3$6")},escape:function(selector,simple){return this.base(selector,simple).replace(/,/g,"\x02")},unescape:function(selector){return this.base(selector.replace(/\[self::\*\]/g,"").replace(/(^|\x02)\//g,"$1./").replace(/\x02/g," | ")).replace(/'[^'\\]*\\'(\\.|[^'\\])*'/g,function(match){return"concat("+match.split("\\'").join("',\"'\",'")+")"})},"@opera(7|8|9\\.[1-4])":{unescape:function(selector){return this.base(selector.replace(/last\(\)/g,"count(preceding-sibling::*)+count(following-sibling::*)+1"))}}},{build:function(){this.values.attributes[""]="[@$1]";forEach(this.types,function(add,type){forEach(this.values[type],add,this.rules)},this);this.build=K(this.rules);return this.rules},optimised:{pseudoClasses:{"first-child":"[1]","last-child":"[last()]","only-child":"[last()=1]"}},rules:extend({},{"@!KHTML|opera":{"(^|\\x02) (\\*|[\\w-]+)#([\\w-]+)":"$1id('$3')[self::$2]"},"@!KHTML":{"([ >])(\\*|[\\w-]+):([\\w-]+-child(\\(([^)]+)\\))?)":function(match,token,tagName,pseudoClass,$4,args){var replacement=(token==" ")?"//*":"/*";if(/^nth/i.test(pseudoClass)){replacement+=_xpath_nthChild(pseudoClass,args,"position()")}else{replacement+=XPathParser.optimised.pseudoClasses[pseudoClass]}return replacement+"[self::"+tagName+"]"}}}),types:{identifiers:function(replacement,token){this[rescape(token)+"([\\w-]+)"]=replacement},combinators:function(replacement,combinator){this[rescape(combinator)+"(\\*|[\\w-]+)"]=replacement},attributes:function(replacement,operator){this["\\[\\s*([\\w-]+)\\s*"+rescape(operator)+"\\s*([^\\]\\s]*)\\s*\\]"]=replacement},pseudoClasses:function(replacement,pseudoClass){this[":"+pseudoClass.replace(/\(\)$/,"\\(([^)]+)\\)")]=replacement}},values:{identifiers:{"#":"[@id='$1'][1]",".":"[contains(concat(' ',@class,' '),' $1 ')]"},combinators:{" ":"/descendant::$1",">":"/child::$1","+":"/following-sibling::*[1][self::$1]","~":"/following-sibling::$1"},attributes:{"*=":"[contains(@$1,'$2')]","^=":"[starts-with(@$1,'$2')]","$=":"[substring(@$1,string-length(@$1)-string-length('$2')+1)='$2']","~=":"[contains(concat(' ',@$1,' '),' $2 ')]","|=":"[contains(concat('-',@$1,'-'),'-$2-')]","!=":"[not(@$1='$2')]","=":"[@$1='$2']"},pseudoClasses:{link:"[false]",visited:"[false]",empty:"[not(child::*) and not(text())]","first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","not()":_xpath_not,"nth-child()":_xpath_nthChild,"nth-last-child()":_xpath_nthChild,"only-child":"[not(preceding-sibling::*) and not(following-sibling::*)]",root:"[not(parent::*)]"}},"@opera(7|8|9\\.[1-4])":{build:function(){this.optimised.pseudoClasses["last-child"]=this.values.pseudoClasses["last-child"];this.optimised.pseudoClasses["only-child"]=this.values.pseudoClasses["only-child"];return this.base()}}});var _notParser;function _xpath_not(match,args){if(!_notParser){_notParser=new XPathParser}return"[not("+_notParser.exec(trim(args)).replace(/\[1\]/g,"").replace(/^(\*|[\w-]+)/,"[self::$1]").replace(/\]\[/g," and ").slice(1,-1)+")]"}function _xpath_nthChild(match,args,position){return"["+_nthChild(match,args,position||"count(preceding-sibling::*)+1","last()","not"," and "," mod ","=")+"]"}var Selector=Base.extend({constructor:function(selector){this.toString=K(trim(selector))},exec:function(context,count,simple){return Selector.parse(this,simple)(context,count)},isSimple:function(){if(!_parser.exec){_parser=new CSSParser(_parser)}return !_COMBINATOR.test(trim(_parser.escape(this)))},test:function(element){if(this.isSimple()){return !!Selector.parse(this,true)(element,1)}else{element.setAttribute("b2-test",true);var result=new Selector(this+"[b2-test]").exec(Traversal.getOwnerDocument(element),1);element.removeAttribute("b2-test");return result==element}},toXPath:function(simple){return Selector.toXPath(this,simple)},"@(XPathResult)":{exec:function(context,count,simple){if(_NOT_XPATH.test(this)){return this.base(context,count,simple)}var document=Traversal.getDocument(context);var type=count==1?9:7;var result=document.evaluate(this.toXPath(simple),context,null,type,null);return count==1?result.singleNodeValue:result}},"@MSIE":{exec:function(context,count,simple){if(typeof context.selectNodes!="undefined"&&!_NOT_XPATH.test(this)){var method=single?"selectSingleNode":"selectNodes";return context[method](this.toXPath(simple))}return this.base(context,count,simple)}},"@(true)":{exec:function(context,count,simple){try{var result=this.base(context||document,count,simple)}catch(error){throw new SyntaxError(format("'%1' is not a valid CSS selector.",this))}return count==1?result:new StaticNodeList(result)}}},{toXPath:function(selector,simple){if(!_xpathParser){_xpathParser=new XPathParser}return _xpathParser.parse(selector,simple)}});var _COMBINATOR=/[^,]\s|[+>~]/;var _NOT_XPATH=":(checked|disabled|enabled|contains|hover|active|focus)|^(#[\\w-]+\\s*)?\\w+$";if(detect("KHTML")){if(detect("WebKit5")){_NOT_XPATH+="|nth\\-|,"}else{_NOT_XPATH="."}}_NOT_XPATH=new RegExp(_NOT_XPATH);Selector.operators={"=":"%1=='%2'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/};Selector.operators[""]="%1!=null";Selector.pseudoClasses={checked:"e%1.checked",contains:"e%1[TEXT].indexOf('%2')!=-1",disabled:"e%1.disabled",empty:"Traversal.isEmpty(e%1)",enabled:"e%1.disabled===false","first-child":"!Traversal.getPreviousElementSibling(e%1)","last-child":"!Traversal.getNextElementSibling(e%1)","only-child":"!Traversal.getPreviousElementSibling(e%1)&&!Traversal.getNextElementSibling(e%1)",root:"e%1==Traversal.getDocument(e%1).documentElement",target:"e%1.id&&e%1.id==location.hash.slice(1)",hover:"DocumentState.getInstance(d).isHover(e%1)",active:"DocumentState.getInstance(d).isActive(e%1)",focus:"DocumentState.getInstance(d).hasFocus(e%1)",link:"false",visited:"false"};var _INDEXED=document.documentElement.sourceIndex!==undefined,_VAR="var p%2=0,i%2,e%3,n%2=e%1.",_ID=_INDEXED?"e%1.sourceIndex":"assignID(e%1)",_TEST="var g="+_ID+";if(!p[g]){p[g]=1;",_STORE="r[k++]=e%1;if(s==1)return e%1;if(k===s){_query.state=[%2];_query.complete=%3;return r;",_FN="var _query=function(e0,s%1){_indexed++;var r=[],p={},p0=0,reg=[%4],d=Traversal.getDocument(e0),c=d.writeln?'toUpperCase':'toString',k=0;";var _xpathParser;var _reg,_index,_wild,_list,_group,_listAll,_duplicate,_cache={},_simple={};function sum(list){var total=0;for(var i=0;i<list.length;i++){total+=list[i]}return total}var _parser={"^(\\*|[\\w-]+)":function(match,tagName){return tagName=="*"?"":format("if(e0.nodeName=='%1'[c]()){",tagName)},"^ \\*:root":function(match){_wild=false;var replacement="e%2=d.documentElement;if(Traversal.contains(e%1,e%2)){";return format(replacement,_index++,_index)}," (\\*|[\\w-]+)#([\\w-]+)":function(match,tagName,id){_wild=false;var replacement="var e%2=_byId(d,'%4');if(e%2&&";if(tagName!="*"){replacement+="e%2.nodeName=='%3'[c]()&&"}replacement+="Traversal.contains(e%1,e%2)){";if(_list[_group]){replacement+=format("i%1=n%1.length;",sum(_list))}return format(replacement,_index++,_index,tagName,id)}," (\\*|[\\w-]+)":function(match,tagName){_duplicate++;_wild=tagName=="*";var replacement=format(_VAR,_index++,"%2",_index);replacement+=(_wild&&_MSIE5)?"all":"getElementsByTagName('%3')";replacement+=";for(i%2=a%2||0;(e%1=n%2[i%2]);i%2++){";_list[_group]++;return format(replacement,_index,sum(_list),tagName)},">(\\*|[\\w-]+)":function(match,tagName){var children=_MSIE&&_index;_wild=tagName=="*";var replacement=_VAR+(children?"children":"childNodes");replacement=format(replacement,_index++,"%2",_index);if(!_wild&&_MSIE&&children){replacement+=".tags('%3')"}replacement+=";for(i%2=a%2||0;(e%1=n%2[i%2]);i%2++){";if(_wild){replacement+="if(e%1.nodeType==1){";_wild=_MSIE5}else{if(!_MSIE||!children){replacement+="if(e%1.nodeName=='%3'[c]()){"}}_list[_group]++;return format(replacement,_index,sum(_list),tagName)},"\\+(\\*|[\\w-]+)":function(match,tagName){var replacement="";if(_wild&&_MSIE){replacement+="if(e%1.nodeName!='!'){"}_wild=false;replacement+="e%1=Traversal.getNextElementSibling(e%1);if(e%1";if(tagName!="*"){replacement+="&&e%1.nodeName=='%2'[c]()"}replacement+="){";return format(replacement,_index,tagName)},"~(\\*|[\\w-]+)":function(match,tagName){var replacement="";if(_wild&&_MSIE){replacement+="if(e%1.nodeName!='!'){"}_wild=false;_duplicate=2;replacement+="while(e%1=e%1.nextSibling){if(e%1.b2_adjacent==_indexed)break;if(";if(tagName=="*"){replacement+="e%1.nodeType==1";if(_MSIE5){replacement+="&&e%1.nodeName!='!'"}}else{replacement+="e%1.nodeName=='%2'[c]()"}replacement+="){e%1.b2_adjacent=_indexed;";return format(replacement,_index,tagName)},"#([\\w-]+)":function(match,id){_wild=false;var replacement="if(e%1.id=='%2'){";if(_list[_group]){replacement+=format("i%1=n%1.length;",sum(_list))}return format(replacement,_index,id)},"\\.([\\w-]+)":function(match,className){_wild=false;_reg.push(new RegExp("(^|\\s)"+rescape(className)+"(\\s|$)"));return format("if(e%1.className&&reg[%2].test(e%1.className)){",_index,_reg.length-1)},":not\\((\\*|[\\w-]+)?([^)]*)\\)":function(match,tagName,filters){var replacement=(tagName&&tagName!="*")?format("if(e%1.nodeName=='%2'[c]()){",_index,tagName):"";replacement+=_parser.exec(filters);return"if(!"+replacement.slice(2,-1).replace(/\)\{if\(/g,"&&")+"){"},":nth(-last)?-child\\(([^)]+)\\)":function(match,last,args){_wild=false;last=format("e%1.parentNode.b2_length",_index);var replacement="if(p%1!==e%1.parentNode)p%1=_register(e%1.parentNode);";replacement+="var i=e%1[p%1.b2_lookup];if(p%1.b2_lookup!='b2_index')i++;if(";return format(replacement,_index)+_nthChild(match,args,"i",last,"!","&&","% ","==")+"){"},":([\\w-]+)(\\(([^)]+)\\))?":function(match,pseudoClass,$2,args){return"if("+format(Selector.pseudoClasses[pseudoClass]||"throw",_index,args||"")+"){"},"\\[\\s*([\\w-]+)\\s*([^=]?=)?\\s*([^\\]\\s]*)\\s*\\]":function(match,attr,operator,value){value=trim(value);if(_MSIE){var getAttribute="Element.getAttribute(e%1,'%2')"}else{getAttribute="e%1.getAttribute('%2')"}getAttribute=format(getAttribute,_index,attr);var replacement=Selector.operators[operator||""];if(instanceOf(replacement,RegExp)){_reg.push(new RegExp(format(replacement.source,rescape(_parser.unescape(value)))));replacement="reg[%2].test(%1)";value=_reg.length-1}return"if("+format(replacement,getAttribute,value)+"){"}};(function(_no_shrink_){var _byId=detect("MSIE[5-7]")?function(document,id){var result=document.all[id]||null;if(!result||result.id==id){return result}for(var i=0;i<result.length;i++){if(result[i].id==id){return result[i]}}return null}:function(document,id){return document.getElementById(id)};var _indexed=1;function _register(element){if(element.rows){element.b2_length=element.rows.length;element.b2_lookup="rowIndex"}else{if(element.cells){element.b2_length=element.cells.length;element.b2_lookup="cellIndex"}else{if(element.b2_indexed!=_indexed){var index=0;var child=element.firstChild;while(child){if(child.nodeType==1&&child.nodeName!="!"){child.b2_index=++index}child=child.nextSibling}element.b2_length=index;element.b2_lookup="b2_index"}}}element.b2_indexed=_indexed;return element}Selector.parse=function(selector,simple){var cache=simple?_simple:_cache;if(!cache[selector]){if(!_parser.exec){_parser=new CSSParser(_parser)}_reg=[];_list=[];var fn="";var selectors=_parser.escape(selector,simple).split(",");for(_group=0;_group<selectors.length;_group++){_wild=_index=_list[_group]=0;_duplicate=selectors.length>1?2:0;var block=_parser.exec(selectors[_group])||"throw;";if(_wild&&_MSIE){block+=format("if(e%1.tagName!='!'){",_index)}var store=(_duplicate>1)?_TEST:"";block+=format(store+_STORE,_index,"%2");block+=Array(match(block,/\{/g).length+1).join("}");fn+=block}fn=_parser.unescape(fn);if(selectors.length>1){fn+="r.unsorted=1;"}var args="";var state=[];var total=sum(_list);for(var i=1;i<=total;i++){args+=",a"+i;state.push("i"+i+"?(i"+i+"-1):0")}if(total){var complete=[],k=0;for(var i=0;i<_group;i++){k+=_list[i];if(_list[i]){complete.push(format("n%1&&i%1==n%1.length",k))}}}fn+="_query.state=[%2];_query.complete=%3;return s==1?null:r}";eval(format(_FN+fn,args,state.join(","),total?complete.join("&&"):true,_reg));cache[selector]=_query}return cache[selector]}})();var StaticNodeList=Base.extend({constructor:function(nodes){nodes=nodes||[];this.length=nodes.length;this.item=function(index){if(index<0){index+=this.length}return nodes[index]};if(nodes.unsorted){nodes.sort(_SORTER)}},length:0,forEach:function(block,context){for(var i=0;i<this.length;i++){block.call(context,this.item(i),i,this)}},item:Undefined,not:function(test,context){return this.filter(not(test),context)},slice:function(start,end){return new StaticNodeList(this.map(I).slice(start,end))},"@(XPathResult)":{constructor:function(nodes){if(nodes&&nodes.snapshotItem){this.length=nodes.snapshotLength;this.item=function(index){if(index<0){index+=this.length}return nodes.snapshotItem(index)}}else{this.base(nodes)}}}});StaticNodeList.implement(Enumerable);var _matchesSelector=function(test,context){if(typeof test!="function"){test=bind("test",new Selector(test))}return this.base(test,context)};StaticNodeList.implement({every:_matchesSelector,filter:_matchesSelector,not:_matchesSelector,some:_matchesSelector});StaticNodeList.implement({filter:function(test,context){return new StaticNodeList(this.base(test,context))}});var _SORTER=_INDEXED?function(node1,node2){return node1.sourceIndex-node2.sourceIndex}:function(node1,node2){return(Node.compareDocumentPosition(node1,node2)&2)-1};Document.implement(DocumentSelector);Element.implement(ElementSelector);var HTMLDocument=Document.extend(null,{bind:function(document){DocumentState.createState(document);return this.base(document)}});var HTMLElement=Element.extend(null,{bindings:{},tags:"*",bind:function(element){if(!element.classList){element.classList=new _ElementClassList(element)}if(!element.ownerDocument){element.ownerDocument=Traversal.getOwnerDocument(element)}return this.base(element)},extend:function(){var binding=base(this,arguments);forEach.csv(binding.tags,function(tagName){HTMLElement.bindings[tagName]=binding});return binding}});HTMLElement.extend(null,{tags:"APPLET,EMBED",bind:I});var ClassList=Module.extend({add:function(element,token){if(!this.has(element,token)){element.className+=(element.className?" ":"")+token}},has:function(element,token){var regexp=new RegExp("(^|\\s)"+token+"(\\s|$)");return regexp.test(element.className)},remove:function(element,token){var regexp=new RegExp("(^|\\s)"+token+"(\\s|$)","g");element.className=trim(element.className.replace(regexp,"$2"))},toggle:function(element,token){this[this.has(element,token)?"remove":"add"](element,token)}});function _ElementClassList(element){this.add=function(token){ClassList.add(element,token)};this.has=function(token){return ClassList.has(element,token)};this.remove=function(token){ClassList.remove(element,token)}}_ElementClassList.prototype.toggle=function(token){this[this.has(token)?"remove":"add"](token)};var DocumentState=Base.extend({constructor:function(document){this.document=document;this.events={};this._hoverElement=document.documentElement;this.isBound=function(){return !!DOM.bind[document.base2ID]};forEach(this,function(method,name,documentState){if(/^on((DOM)?\w+|[a-z]+)$/.test(name)){documentState.registerEvent(name.slice(2))}})},includes:function(element,target){return target&&(element==target||Traversal.contains(element,target))},hasFocus:function(element){return element==this._focusElement},isActive:function(element){return this.includes(element,this._activeElement)},isHover:function(element){return this.includes(element,this._hoverElement)},handleEvent:function(event){return this["on"+event.type](event)},onblur:function(event){delete this._focusElement},onmouseover:function(event){this._hoverElement=event.target},onmouseout:function(event){delete this._hoverElement},onmousedown:function(event){this._activeElement=event.target},onfocus:function(event){this._focusElement=event.target},onmouseup:function(event){delete this._activeElement},registerEvent:function(type){this.document.addEventListener(type,this,true);this.events[type]=true},"@(document.activeElement===undefined)":{constructor:function(document){this.base(document);if(this.isBound()){document.activeElement=document.body}},onfocus:function(event){this.base(event);if(this.isBound()){this.document.activeElement=this._focusElement}},onblur:function(event){this.base(event);if(this.isBound()){this.document.activeElement=this.document.body}}},"@!(element.addEventListener)":{constructor:function(document){this.base(document);var dispatcher=new EventDispatcher(this);this._dispatch=function(event){event.target=event.target||event.srcElement||document;dispatcher.handleEvent(event)};this.handleEvent=function(event){if(this["on"+event.type]){this["on"+event.type](event)}return dispatcher.handleEvent(event)}},registerEvent:function(type,target){var events=this.events[type];var canDelegate=_CAN_DELEGATE.test(type);if(!events||!canDelegate){if(!events){events=this.events[type]={}}if(canDelegate||!target){target=this.document}var state=this;target["on"+type]=function(event){if(!event){event=Traversal.getDefaultView(this).event}if(event){state.handleEvent(event)}}}return events},"@MSIE.+win":{constructor:function(document){this.base(document);var forms={};this._registerForm=function(form){var formID=assignID(form);if(!forms[formID]){forms[formID]=true;form.attachEvent("onsubmit",this._dispatch);form.attachEvent("onreset",this._dispatch)}}},fireEvent:function(type,event){event=copy(event);event.type=type;this.handleEvent(event)},registerEvent:function(type,target){var events=this.events[type];var canDelegate=_CAN_DELEGATE.test(type);if(!events||!canDelegate){if(!events){events=this.events[type]={}}if(canDelegate||!target){target=this.document}var state=this;target.attachEvent("on"+type,function(event){event.target=event.srcElement||state.document;state.handleEvent(event);if(state["after"+type]){state["after"+type](event)}})}return events},onDOMContentLoaded:function(event){forEach(event.target.forms,this._registerForm,this);this.setFocus(this.document.activeElement)},onmousedown:function(event){this.base(event);this._button=event.button},onmouseup:function(event){this.base(event);if(this._button==null){this.fireEvent("mousedown",event)}delete this._button},aftermouseup:function(){if(this._selectEvent){this._dispatch(this._selectEvent);delete this._selectEvent}},onfocusin:function(event){this.setFocus(event.target);this.onfocus(event)},setFocus:function(target){var change=this.events.change,select=this.events.select;if(change||select){var dispatch=this._dispatch;if(change){target.attachEvent("onchange",dispatch)}if(select){var state=this;var onselect=function(event){if(state._activeElement==target){state._selectEvent=copy(event)}else{dispatch(event)}};target.attachEvent("onselect",onselect)}target.attachEvent("onblur",function(){target.detachEvent("onblur",arguments.callee);if(change){target.detachEvent("onchange",dispatch)}if(select){target.detachEvent("onselect",onselect)}})}},onfocusout:function(event){this.onblur(event)},onclick:function(event){var target=event.target;if(target.form){this._registerForm(target.form)}},ondblclick:function(event){this.fireEvent("click",event)}}}},{init:function(){assignID(document);DocumentState=this;this.createState(document);new DOMContentLoadedEvent(document)},createState:function(document){var base2ID=document.base2ID;if(!this[base2ID]){this[base2ID]=new this(document)}return this[base2ID]},getInstance:function(target){return this[Traversal.getDocument(target).base2ID]}});eval(this.exports)};new function(_no_shrink_){var JSON=new base2.Package(this,{name:"JSON",imports:"Enumerable",version:"0.9",VALID:/^("(\\.|[^"\\\n\r])*"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])*$/,copy:function(object){return this.parse(this.toString(object))},parse:function(string){return this.String.parseJSON(string)}});eval(this.imports);JSON.toString=function(object){if(arguments.length==0){return"[base2.JSON]"}var module=this.Object;try{forEach(this,function(property,name){if(JSON.Object.ancestorOf(property)&&instanceOf(object,global[name])){module=property;throw StopIteration}})}catch(error){if(error!=StopIteration){throw error}}return module.toJSONString(object)};JSON.Object=Module.extend({toJSONString:function(object){return object==null?"null":"{"+reduce(object,function(properties,property,name){if(JSON.Object.isValid(property)){properties.push(JSON.String.toJSONString(name)+":"+JSON.toString(property))}return properties},[]).join(",")+"}"}},{VALID_TYPE:/^(object|boolean|number|string)$/,isValid:function(object){return this.VALID_TYPE.test(typeof object)}});JSON.Array=JSON.Object.extend({toJSONString:function(array){return"["+reduce(array,function(items,item){if(JSON.Object.isValid(item)){items.push(JSON.toString(item))}return items},[]).join(",")+"]"}});JSON.Boolean=JSON.Object.extend({toJSONString:function(bool){return String(bool)}});JSON.Date=JSON.Object.extend({toJSONString:function(date){var pad=function(n){return n<10?"0"+n:n};return'"'+date.getUTCFullYear()+"-"+pad(date.getUTCMonth()+1)+"-"+pad(date.getUTCDate())+"T"+pad(date.getUTCHours())+":"+pad(date.getUTCMinutes())+":"+pad(date.getUTCSeconds())+'Z"'}});JSON.Number=JSON.Object.extend({toJSONString:function(number){return isFinite(number)?String(number):"null"}});JSON.String=JSON.Object.extend({parseJSON:function(string){try{if(JSON.VALID.test(string)){return new Function("return "+string)()}}catch(error){throw new SyntaxError("parseJSON")}return""},toJSONString:function(string){return'"'+this.ESCAPE.exec(string)+'"'}},{ESCAPE:new RegGrp({"\b":"\\b","\\t":"\\t","\\n":"\\n","\\f":"\\f","\\r":"\\r",'"':'\\"',"\\\\":"\\\\","[\\x00-\\x1f]":function(chr){var charCode=chr.charCodeAt(0);return"\\u00"+Math.floor(charCode/16).toString(16)+(charCode%16).toString(16)}})});eval(this.exports)};base2.DOM.bind(document);base2.DOM.bind(window);base2.JavaScript.bind(window);base2.JavaScript.Array2(Array.prototype);function remove(){for(var a=0,b;b=arguments[a];a++){if(b&&b.parentNode){b.parentNode.removeChild(b)}}}Function.prototype.bindAsEventListener=function(a){var c=this;var b=Array.prototype.slice.call(arguments,0);return function(d){return c.apply(a,[d||window.event].concat(b))}};Function.prototype.bind=function(a){var c=this;var b=Array.prototype.slice.call(arguments,1);return function(){return c.apply(a,b.concat(Array.prototype.slice.call(arguments,0)))}};Date.parseRFC3339=function(c){var b=new Date(0);var a=c.match(/(\d{4})-(\d\d)-(\d\d)\s*(?:[\sT]\s*(\d\d):(\d\d)(?::(\d\d))?(\.\d*)?\s*(Z|([-+])(\d\d):(\d\d))?)?/);if(!a){return}if(a[2]){a[2]--}if(a[7]){a[7]=(a[7]+"000").substring(1,4)}var e=[null,"FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"];for(var d=1;d<=7;d++){if(a[d]){b["setUTC"+e[d]](a[d])}}if(a[9]){b.setTime(b.getTime()+(a[9]=="-"?1:-1)*(a[10]*3600000+a[11]*60000))}return b.getTime()};function localizeDates(){var b="";var a=new Date();document.querySelectorAll("time").forEach(function(e,d){if(e.getAttribute("title")=="GMT"){var c=new Date(Date.parseRFC3339(e.getAttribute("datetime")));if(!c.getTime()){return}diff=((a.getTime()-c.getTime())/1000),day_diff=Math.floor(diff/86400);if(isNaN(day_diff)||day_diff<0||day_diff>=31){return}var g=c.toLocaleString();var f=c.toLocaleString();if(day_diff==0){g=(diff<60&&"Just Now"||diff<120&&"1 minute ago"||diff<3600&&Math.floor(diff/60)+" minutes ago"||diff<7200&&"1 hour ago"||diff<86400&&Math.floor(diff/3600)+" hours ago");f=c.toLocaleTimeString()}else{hours=c.getHours();minutes=c.getMinutes();hours=(hours<10)&&"0"+hours||hours;minutes=(minutes<10)&&"0"+minutes||minutes;g=(day_diff==1&&"Yesterday at "+hours+":"+minutes||e.textContent);f=c.toLocaleString()}e.setAttribute("title",f);e.textContent="posted "+g}})}var Ajax=base2.Base.extend({lastModified:{},constructor:function(a){this.options={url:location.href,method:"GET",timeout:0,async:true,contentType:"application/x-www-form-urlencoded",processData:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}};base2.lang.extend(this.options,a||{})},get:function(a,c,d,b){if(typeof c=="function"){d=c;c=null}return Ajax.request({method:"GET",url:a,data:c,success:d,dataType:b})},post:function(a,c,d,b){if(typeof c=="function"){d=c;c=null}return Ajax.request({method:"POST",url:a,data:c,success:d,dataType:b})},request:function(o){Ajax.options.data="";base2.lang.extend(Ajax.options,o||{});base2.lang.extend(o,Ajax.options);var f,g,a=o.method.toUpperCase();if(o.data&&o.processData&&typeof o.data!="string"){o.data=Ajax.param(o.data)}if(o.cache===false&&a=="GET"){var j=now();var i=o.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+j+"$2");o.url=i+((i==o.url)?(o.url.match(/\?/)?"&":"?")+"_="+j:"")}if(o.data&&a=="GET"){o.url+=(o.url.match(/\?/)?"&":"?")+o.data;o.data=null}Ajax.active++;var c=/^(?:\w+:)?\/\/([^\/?#]+)/;var d=false;var n=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(o.username){n.open(a,o.url,o.async,o.username,o.password)}else{n.open(a,o.url,o.async)}try{if(o.data){n.setRequestHeader("Content-Type",o.contentType)}if(o.ifModified){n.setRequestHeader("If-Modified-Since",Ajax.lastModified[o.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}n.setRequestHeader("X-Requested-With","XMLHttpRequest");n.setRequestHeader("Accept",o.dataType&&o.accepts[o.dataType]?o.accepts[o.dataType]+", */*":o.accepts._default)}catch(h){}if(o.beforeSend&&o.beforeSend(n,o)===false){Ajax.active--;n.abort();return false}var l=function(p){if(!d&&n&&(n.readyState==4||p=="timeout")){d=true;if(k){clearInterval(k);k=null}f=p=="timeout"&&"timeout"||!Ajax.httpSuccess(n)&&"error"||o.ifModified&&Ajax.httpNotModified(n,o.url)&&"notmodified"||"success";if(f=="success"){try{g=Ajax.httpData(n,o.dataType,o.dataFilter)}catch(r){f="parsererror"}}if(f=="success"){var q;try{q=n.getResponseHeader("Last-Modified")}catch(r){}if(o.ifModified&&q){Ajax.lastModified[o.url]=q}m()}else{Ajax.handleError(o,n,f)}b();if(o.async){n=null}}};if(o.async){var k=setInterval(l,13);if(o.timeout>0){setTimeout(function(){if(n){n.abort();if(!d){l("timeout")}}},o.timeout)}}try{n.send(o.data)}catch(h){Ajax.handleError(o,n,null,h)}if(!o.async){l()}function m(){if(o.success){o.success(g,f)}}function b(){if(o.complete){o.complete(n,f)}--Ajax.active}return n},handleError:function(b,d,a,c){if(b.error){b.error(d,a,c)}},active:0,httpSuccess:function(b){try{return !b.status&&location.protocol=="file:"||(b.status>=200&&b.status<300)||b.status==304||b.status==1223||base2.detect("safari")&&b.status==undefined}catch(a){}return false},httpNotModified:function(c,a){try{var d=c.getResponseHeader("Last-Modified");return c.status==304||d==this.lastModified[a]||base2.detect("safari")&&c.status==undefined}catch(b){}return false},httpData:function(f,d,c){var b=f.getResponseHeader("content-type"),a=d=="xml"||!d&&b&&b.indexOf("xml")>=0,e=a?f.responseXML:f.responseText;if(a&&e.documentElement.tagName=="parsererror"){throw"parsererror"}if(c){e=c(e,d)}if(d=="json"){e=base2.JSON.parse(e)}return e},param:function(b){var d=[];if(b.constructor==Array){b.forEach(function(e,a,f){d.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))})}else{for(var c in b){if(b[c]&&b[c].constructor==Array){b[c].forEach(function(e,a,f){d.push(encodeURIComponent(c)+"="+encodeURIComponent(e))})}else{d.push(encodeURIComponent(c)+"="+encodeURIComponent((typeof b[c]=="function"?b[c]():b[c])))}}}return d.join("&").replace(/%20/g,"+")}});window.Ajax=new Ajax();

static/js/friendpaste.js

-var Showdown={};Showdown.converter=function(){var a;var k;var C;var j=0;this.makeHtml=function(J){a=new Array();k=new Array();C=new Array();J=J.replace(/~/g,"~T");J=J.replace(/\$/g,"~D");J=J.replace(/\r\n/g,"\n");J=J.replace(/\r/g,"\n");J="\n\n"+J+"\n\n";J=B(J);J=J.replace(/^[ \t]+$/mg,"");J=n(J);J=e(J);J=I(J);J=s(J);J=J.replace(/~D/g,"$$");J=J.replace(/~T/g,"~");return J};var e=function(J){var J=J.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm,function(M,O,N,L,K){O=O.toLowerCase();a[O]=i(N);if(L){return L+K}else{if(K){k[O]=K.replace(/"/g,"&quot;")}}return""});return J};var n=function(L){L=L.replace(/\n/g,"\n\n");var K="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del";var J="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";L=L.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,z);L=L.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,z);L=L.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,z);L=L.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,z);L=L.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,z);L=L.replace(/\n\n/g,"\n");return L};var z=function(J,K){var L=K;L=L.replace(/\n\n/g,"\n");L=L.replace(/^\n/,"");L=L.replace(/\n+$/g,"");L="\n\n~K"+(C.push(L)-1)+"K\n\n";return L};var I=function(K){K=g(K);var J=q("<hr />");K=K.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,J);K=K.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,J);K=K.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,J);K=G(K);K=b(K);K=w(K);K=n(K);K=h(K);return K};var t=function(J){J=E(J);J=m(J);J=f(J);J=H(J);J=A(J);J=o(J);J=i(J);J=d(J);J=J.replace(/  +\n/g," <br />\n");return J};var m=function(K){var J=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;K=K.replace(J,function(M){var L=M.replace(/(.)<\/?code>(?=.)/g,"$1`");L=y(L,"\\`*_");return L});return K};var A=function(J){J=J.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,F);J=J.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,F);J=J.replace(/(\[([^\[\]]+)\])()()()()()/g,F);return J};var F=function(P,V,U,T,S,R,O,N){if(N==undefined){N=""}var M=V;var K=U;var L=T.toLowerCase();var J=S;var Q=N;if(J==""){if(L==""){L=K.toLowerCase().replace(/ ?\n/g," ")}J="#"+L;if(a[L]!=undefined){J=a[L];if(k[L]!=undefined){Q=k[L]}}else{if(M.search(/\(\s*\)$/m)>-1){J=""}else{return M}}}J=y(J,"*_");var W='<a href="'+J+'"';if(Q!=""){Q=Q.replace(/"/g,"&quot;");Q=y(Q,"*_");W+=' title="'+Q+'"'}W+=">"+K+"</a>";return W};var H=function(J){J=J.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,v);J=J.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,v);return J};var v=function(P,V,U,T,S,R,O,N){var M=V;var L=U;var K=T.toLowerCase();var J=S;var Q=N;if(!Q){Q=""}if(J==""){if(K==""){K=L.toLowerCase().replace(/ ?\n/g," ")}J="#"+K;if(a[K]!=undefined){J=a[K];if(k[K]!=undefined){Q=k[K]}}else{return M}}L=L.replace(/"/g,"&quot;");J=y(J,"*_");var W='<img src="'+J+'" alt="'+L+'"';Q=Q.replace(/"/g,"&quot;");Q=y(Q,"*_");W+=' title="'+Q+'"';W+=" />";return W};var g=function(J){J=J.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(K,L){return q("<h1>"+t(L)+"</h1>")});J=J.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(L,K){return q("<h2>"+t(K)+"</h2>")});J=J.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(K,N,M){var L=N.length;return q("<h"+L+">"+t(M)+"</h"+L+">")});return J};var r;var G=function(K){K+="~0";var J=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;if(j){K=K.replace(J,function(M,P,O){var Q=P;var N=(O.search(/[*+-]/g)>-1)?"ul":"ol";Q=Q.replace(/\n{2,}/g,"\n\n\n");var L=r(Q);L=L.replace(/\s+$/,"");L="<"+N+">"+L+"</"+N+">\n";return L})}else{J=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;K=K.replace(J,function(N,R,P,M){var Q=R;var S=P;var O=(M.search(/[*+-]/g)>-1)?"ul":"ol";var S=S.replace(/\n{2,}/g,"\n\n\n");var L=r(S);L=Q+"<"+O+">\n"+L+"</"+O+">\n";return L})}K=K.replace(/~0/,"");return K};r=function(J){j++;J=J.replace(/\n{2,}$/,"\n");J+="~0";J=J.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(M,O,N,L,K){var Q=K;var P=O;var R=N;if(P||(Q.search(/\n{2,}/)>-1)){Q=I(u(Q))}else{Q=G(u(Q));Q=Q.replace(/\n$/,"");Q=t(Q)}return"<li>"+Q+"</li>\n"});J=J.replace(/~0/g,"");j--;return J};var b=function(J){J+="~0";J=J.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(K,M,L){var N=M;var O=L;N=x(u(N));N=B(N);N=N.replace(/^\n+/g,"");N=N.replace(/\n+$/g,"");N="<pre><code>"+N+"\n</code></pre>";return q(N)+O});J=J.replace(/~0/,"");return J};var q=function(J){J=J.replace(/(^\n+|\n+$)/g,"");return"\n\n~K"+(C.push(J)-1)+"K\n\n"};var E=function(J){J=J.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(M,O,N,L,K){var P=L;P=P.replace(/^([ \t]*)/g,"");P=P.replace(/[ \t]*$/g,"");P=x(P);return O+"<code>"+P+"</code>"});return J};var x=function(J){J=J.replace(/&/g,"&amp;");J=J.replace(/</g,"&lt;");J=J.replace(/>/g,"&gt;");J=y(J,"*_{}[]\\",false);return J};var d=function(J){J=J.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"<strong>$2</strong>");J=J.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"<em>$2</em>");return J};var w=function(J){J=J.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(K,L){var M=L;M=M.replace(/^[ \t]*>[ \t]?/gm,"~0");M=M.replace(/~0/g,"");M=M.replace(/^[ \t]+$/gm,"");M=I(M);M=M.replace(/(^|\n)/g,"$1  ");M=M.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(N,O){var P=O;P=P.replace(/^  /mg,"~0");P=P.replace(/~0/g,"");return P});return q("<blockquote>\n"+M+"\n</blockquote>")});return J};var h=function(P){P=P.replace(/^\n+/g,"");P=P.replace(/\n+$/g,"");var O=P.split(/\n{2,}/g);var L=new Array();var J=O.length;for(var K=0;K<J;K++){var N=O[K];if(N.search(/~K(\d+)K/g)>=0){L.push(N)}else{if(N.search(/\S/)>=0){N=t(N);N=N.replace(/^([ \t]*)/g,"<p>");N+="</p>";L.push(N)}}}J=L.length;for(var K=0;K<J;K++){while(L[K].search(/~K(\d+)K/)>=0){var M=C[RegExp.$1];M=M.replace(/\$/g,"$$$$");L[K]=L[K].replace(/~K\d+K/,M)}}return L.join("\n\n")};var i=function(J){J=J.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;");J=J.replace(/<(?![a-z\/?\$!])/gi,"&lt;");return J};var f=function(J){J=J.replace(/\\(\\)/g,l);J=J.replace(/\\([`*_{}\[\]()>#+-.!])/g,l);return J};var o=function(J){J=J.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'<a href="$1">$1</a>');J=J.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(K,L){return D(s(L))});return J};var D=function(L){function K(N){var M="0123456789ABCDEF";var O=N.charCodeAt(0);return(M.charAt(O>>4)+M.charAt(O&15))}var J=[function(M){return"&#"+M.charCodeAt(0)+";"},function(M){return"&#x"+K(M)+";"},function(M){return M}];L="mailto:"+L;L=L.replace(/./g,function(M){if(M=="@"){M=J[Math.floor(Math.random()*2)](M)}else{if(M!=":"){var N=Math.random();M=(N>0.9?J[2](M):N>0.45?J[1](M):J[0](M))}}return M});L='<a href="'+L+'">'+L+"</a>";L=L.replace(/">.+:/g,'">');return L};var s=function(J){J=J.replace(/~E(\d+)E/g,function(K,M){var L=parseInt(M);return String.fromCharCode(L)});return J};var u=function(J){J=J.replace(/^(\t|[ ]{1,4})/gm,"~0");J=J.replace(/~0/g,"");return J};var B=function(J){J=J.replace(/\t(?=\t)/g,"    ");J=J.replace(/\t/g,"~A~B");J=J.replace(/~B(.+?)~A/g,function(K,N,M){var P=N;var L=4-P.length%4;for(var O=0;O<L;O++){P+=" "}return P});J=J.replace(/~A/g,"    ");J=J.replace(/~B/g,"");return J};var y=function(N,K,L){var J="(["+K.replace(/([\[\]\\])/g,"\\$1")+"])";if(L){J="\\\\"+J}var M=new RegExp(J,"g");N=N.replace(M,l);return N};var l=function(J,L){var K=L.charCodeAt(0);return"~E"+K+"E"}};var Resizeable=base2.Base.extend({min_height:280,constructor:function(e,d){var b=this;if(d){this.min_height=d}var a=document.createElement("div");a.className="grippie";a.style.cursor="s-resize";base2.DOM.bind(a);document.querySelectorAll(e).forEach(function(f){f.parentNode.appendChild(a);a.addEventListener("mousedown",function(g){g.preventDefault();g.stopPropagation();b.handleResize(g,f);return false},false)})},handleResize:function(h,d){var a=this;var i=d;var j={x:h.screenX,y:h.screenY};var f={width:i.offsetWidth,height:i.offsetHeight};var g=function(l){l.preventDefault();var m=l.screenY-j.y;if(m){var k=f.height+m;if(k>a.min_height){i.style.height=k+"px";f.height=k;j.y=l.screenY}}return false};var b=function(k){document.removeEventListener("mousemove",g,false);this.removeEventListener("mouseup",arguments.callee,false);return false};document.addEventListener("mousemove",g,false);document.addEventListener("mouseup",b,false)}});var Editor=base2.Base.extend({tab_spacing:true,constructor:function(b){this.el=document.querySelector(b);this.lastSelection={};this.lineHeight=16;this.tab_nb_char=4;if(base2.detect("webkit")){this.tab_nb_char+=1}if(this.tab_spacing){this.tabulation="";for(var a=0;a<this.tab_nb_char;a++){this.tabulation+=" "}}else{this.tabulation="\t"}this._tab_detected=false;if(base2.detect("MSIE")){this.el.selectionStart=this.el.selectionEnd=0}this.el.addEventListener("keydown",this.handleKey.bindAsEventListener(this),false)},handleKey:function(a){c=a.keyCode;if(c==9){a.preventDefault();this.tab_selection();a.returnValue=false;return false}else{if(c==13){if(this.do_enter()){a.preventDefault();a.returnValue=false}return false}}return true},tab_selection:function(){if(this._is_tabbing){return}this._is_tabbing=true;var d=this;if(base2.detect("MSIE")){this._getIESelection()}if(!this._tab_detected){this._detect_tab()}var i=this.el.selectionStart;var a=this.el.selectionEnd;var e=this.el.value.substring(i,a);var g=this.el.scrollTop;var h=this.el.scrollLeft;var b=i;var f=a;if(e.length==0){this.el.value=this.el.value.substr(0,i)+this.tabulation+this.el.value.substr(a);b=i+this.tabulation.length;f=b}else{i=Math.max(0,this.el.value.substr(0,i).lastIndexOf("\n")+1);endText=this.el.value.substr(a);startText=this.el.value.substr(0,i);tmp=e.split("\n");e=this.tabulation+tmp.join("\n"+this.tabulation);this.el.value=startText+e+endText;b=i;f=this.el.value.indexOf("\n",startText.length+e.length);if(f==-1){f=this.el.value.length}}this.el.selectionStart=b;this.el.selectionEnd=f;if(base2.detect("MSIE")){this._setIESelection();setTimeout(function(){d._is_tabbing=false},100);this._is_tabbing=false}else{this._is_tabbing=false}this.el.scrollTop=g;this.el.scrollLeft=h},do_enter:function(){if(base2.detect("MSIE")){this._getIESelection()}var f=this.el.scrollTop;var g=this.el.scrollLeft;var h=this.el.selectionStart;var a=this.el.selectionEnd;var e=Math.max(0,this.el.value.substring(0,h).lastIndexOf("\n")+1);var b=this.el.value.substring(e,h);if(b.match(/^[ \t]+$/mg,"")){return false}var d=b.replace(/^([ \t]*).*/gm,"$1");if(d=="\n"||d=="\r"||d.length==0){return false}if(base2.detect("MSIE")||base2.detect("opera")){d="\r\n"+d}else{d="\n"+d}this.el.value=this.el.value.substring(0,h)+d+this.el.value.substring(a);this.area_select(h+d.length,0);this.el.scrollTop=f;this.el.scrollLeft=g;return true},area_select:function(b,a){b=Math.max(0,Math.min(this.el.value.length,b));end=Math.max(b,Math.min(this.el.value.length,b+a));if(base2.detect("MSIE")){this.el.selectionStart=b;this.el.selectionEnd=end;this._setIESelection()}else{if(base2.detect("opera")){this.el.setSelectionRange(0,0)}this.el.setSelectionRange(b,end)}},_detect_tab:function(){if(this.el.value.indexOf("\t")>0){this.tabulation="\t"}else{this.tabulation="";for(var a=0;a<this.tab_nb_char;a++){this.tabulation+=" "}}this._tab_detected=true},_getIESelection:function(){this.el.focus();var a=this.el.createTextRange();var b=a.duplicate();a.moveToBookmark(document.selection.createRange().getBookmark());a.moveEnd("character",this.el.value.length);this.el.selectionStart=this.el.value.length-a.text.length;b.moveToBookmark(document.selection.createRange().getBookmark());b.moveStart("character",-this.el.value.length);this.el.selectionEnd=b.text.length;if(this.el.selectionEnd<this.el.selectionStart){this.el.selectionEnd=this.el.selectionStart}},_setIESelection:function(){var a=this.el.value.substr(0,this.el.selectionStart).split("\n").length-1;var b=this.el.value.substr(0,this.el.selectionEnd).split("\n").length-1;var d=document.selection.createRange();d.moveToElementText(this.el);d.setEndPoint("EndToStart",d);d.collapse(true);d.moveStart("character",this.el.selectionStart-a);d.moveEnd("character",this.el.selectionEnd-b-(this.el.selectionStart-a));d.select()}});var Review=base2.Base.extend({constructor:function(){document.querySelectorAll(".review-flag").forEach(function(d){p=base2.DOM.bind(d.parentNode);offsets=p.getOffsets();d.style.top=offsets.y+"px"});var b=document.createElement("img");b.id="ghost-reviewflag";b.setStyle({position:"absolute",left:"5.5%",cursor:"pointer"});b.classList.add("hidden");b.src="/static/images/comment-ghost.png";document.body.appendChild(b);this.ghostReview=b;this.ghostReview.addEventListener("mousedown",this._sourceMouseDown.bind(this),false);this.ghostReview.addEventListener("mouseup",this._sourceMouseUp.bind(this),false);this.ghostReview.addEventListener("mouseover",this._sourceMouseOver.bind(this),true);this.nb_lines=null;this.sourceRow=null;this.numRow=null;this._loading=false;var a=document.querySelector("table.numsTable");a.addEventListener("mousedown",this._sourceMouseDown.bind(this),false);a.addEventListener("mouseup",this._sourceMouseUp.bind(this),false);a.addEventListener("mouseover",this._sourceMouseOver.bind(this),true);a.addEventListener("mouseout",this._sourceMouseOut.bind(this),true);this.converter=new Showdown.converter},_sourceRow:function(a){var b=document.querySelector("td.lines table").rows;--a;return base2.DOM.bind(b[a])},_numRow:function(a){var b=document.querySelector("td.nums table").rows;--a;return base2.DOM.bind(b[a])},_lineNumberForRow:function(b){var a=0;while(b){++a;b=b.previousSibling}return a},_handleKey:function(a){if(a.keyCode==27){this.hideCommentBox();document.removeEventListener("keydown",arguments.callee,false)}},_selectRow:function(a,d){if(a!=this.nb_line){if(this.nb_line){this.numRow.classList.remove("selected");this.sourceRow.classList.remove("selected")}this.nb_line=a;this.numRow=d;this.sourceRow=this._sourceRow(a);this.numRow.classList.add("selected");this.sourceRow.classList.add("selected");if(!d.classList.has("hasreview")){var b=d.getOffsets();this.ghostReview.style.top=b.y-1+"px";this.ghostReview.numLine=a;this.ghostReview.classList.remove("hidden")}else{this.ghostReview.classList.add("hidden")}}},_sourceMouseOver:function(f){f.stopPropagation();var b=f.target;var d=f.target.parentNode;base2.DOM.bind(b);base2.DOM.bind(d);if(b==this.ghostReview&&!b.classList.has("hidden")){a=b.numLine;g=this._numRow(a);this._selectRow(a,g)}else{if(b.classList.has("line-number")||d.classList.has("line-number")){var g=b.enclosingNodeOrSelfWithNodeName("tr");base2.DOM.bind(g);var a=this._lineNumberForRow(g);this._selectRow(a,g)}}return},_sourceMouseOut:function(a){if(!this.nb_line){return}relTarget=base2.DOM.bind(a.relatedTarget||a.toElement);if(this.ghostReview&&relTarget!=this.ghostReview){this.ghostReview.classList.add("hidden")}if(relTarget.tagName=="SPAN"){relTarget=base2.DOM.bind(relTarget.parentNode)}if(!relTarget.classList.has("line-number")){this.numRow.classList.remove("selected");this.sourceRow.classList.remove("selected");this.nb_line=this.sourceRow=this.numRow=null}},_sourceMouseDown:function(b){var a=b.target;base2.DOM.bind(a);if(this.ghostReview&&a==this.ghostReview){this.currentRow=this._numRow(this.ghostReview.numLine)}else{if(a.tagName=="SPAN"){a=base2.DOM.bind(a.parentNode)}if(!a.classList.has("line-number")){return}this.currentRow=base2.DOM.bind(a.enclosingNodeOrSelfWithNodeName("tr"))}},_sourceMouseUp:function(h){var f=h.target;var g=h.target.parentNode;base2.DOM.bind(f);base2.DOM.bind(g);if(this.ghostReview&&f!=this.ghostReview){if(!f.classList.has("line-number")&&(!g.classList.has("line-number"))){return}}this.el=this.currentRow.querySelector("td");if(this.ghostReview&&!this.ghostReview.classList.has("hidden")){this.ghostReview.classList.add("hidden")}var a=this.el.querySelector("span.reviewflag");if(!a){var d=document.createElement("span");d.classList.add("reviewflag");d.appendChild(document.createTextNode("0"));this.el.appendChild(d)}var b=this._lineNumberForRow(this.currentRow);var i=this._sourceRow(b);if(this.currentRow.classList.has("selected")){this.currentRow.classList.remove("selected");this.sourceRow.classList.remove("selected")}i.classList.add("highlighted-line");this.currentRow.classList.add("highlighted-line");this.showCommentBox()},buildCommentBox:function(h){var q=this;this.overlay=document.createElement("div");this.overlay.id="overlay";this.overlay.setStyle({display:"block",position:"fixed",top:0,left:0,"z-index":"1001",height:"100%",width:"100%"});this.overlay.setOpacity("0");var b=document.createElement("div");b.classList.add("comment-box");b.setOpacity("0.9");this.divComment=this.rootLayers=b;document.body.appendChild(this.overlay);document.body.appendChild(this.divComment);if(base2.detect("MSIE")){this.ieframe=document.createElement("iframe");this.ieframe.id="overlay-frame";this.ieframe.setStyle("z-index:1000;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0");this.ieframe.setOpacity("0");document.body.appendChild(this.ieframe)}var h=this._lineNumberForRow(this.currentRow);var d="/"+snippet_id+"/reviews/"+h;var k="/"+snippet_id+"/review/"+h;if(typeof revid!="undefined"){d+="?rev="+revid;k+="?rev="+revid}var f=document.createElement("form");f.action=k;f.id="freview";var n=document.createElement("h3");n.appendChild(document.createTextNode("Add your review to line "+h));f.appendChild(n);var l=document.createElement("div");l.id="row-form";var o=document.createElement("textarea");o.id="new_review";o.name="new_review";o.setAttribute("cols",70);o.setAttribute("rows",5);l.appendChild(o);f.appendChild(l);var e=document.createElement("p");var m=document.createElement("input");m.type="submit";m.name=m.id="sreview";m.value="save comment";e.appendChild(m);var a=document.createElement("input");a.type="submit";a.id=a.name="bclose";a.value="close";e.appendChild(a);f.appendChild(e);b.appendChild(f);var g=document.createElement("h3");g.appendChild(document.createTextNode("All comments for this line"));b.appendChild(g);var j=document.createElement("div");j.id="reviews-list";j.classList.add("hidden");b.appendChild(j);var i=document.createElement("div");i.classList.add("loading");i.appendChild(document.createTextNode("loading comments for line"));b.appendChild(i);a.addEventListener("click",function(r){r.preventDefault();q.hideCommentBox();return false},false);m.addEventListener("click",this.add_review.bind(this),false);if(!base2.detect("webkit")){new Resizeable("#new_review",120)}o.focus();new Ajax.request({url:d,dataType:"json",contentType:"application/json",method:"GET",success:function(u){if(u.ok){if(u.r.reviews){var t=document.createElement("ul");for(var s=0;s<u.r.reviews.length;s++){var r=document.createElement("li");var v=document.createElement("time");v.title="GMT";v.setAttribute("datetime",u.r.reviews[s]["created"]);v.textContent=u.r.reviews[s]["fcreated"];r.appendChild(v);r.innerHTML=q.converter.makeHtml(u.r.reviews[s]["comment"])+r.innerHTML;t.appendChild(r)}j.appendChild(t);remove(i);j.classList.remove("hidden");localizeDates()}}}})},add_review:function(g){g.preventDefault();g.stopPropagation();var b=this;var d=this.divComment.querySelector("#freview").action;var a=this.divComment.querySelector("textarea");var f=a.value;if(f){new Ajax.request({url:d,dataType:"json",contentType:"application/json",data:this.toJSON({new_review:f}),method:"POST",success:function(l){if(l.ok){var n=b.divComment.querySelector("#reviews-list");var j=n.querySelector("ul");if(j){remove(j)}j=document.createElement("ul");for(var h=0;h<l.r.length;h++){var e=document.createElement("li");var m=document.createElement("time");m.title="GMT";m.setAttribute("datetime",l.r[h]["created"]);m.textContent=l.r[h]["fcreated"];e.appendChild(m);e.innerHTML+=b.converter.makeHtml(l.r[h]["comment"]);j.appendChild(e)}n.appendChild(j);var k=b.currentRow.querySelector("span.reviewflag");line_count=parseInt(k.innerHTML)+1;k.innerHTML=line_count.toString();a.value="";a.focus()}}})}},hideCommentBox:function(){reviewflag=this.el.querySelector("span.reviewflag");var a=0;if(reviewflag){a=parseInt(reviewflag.innerHTML)}if(a==0){remove(reviewflag)}this.currentRow.classList.remove("highlighted-line");var b=this._lineNumberForRow(this.currentRow);var d=this._sourceRow(b);d.classList.remove("highlighted-line");this.divComment.classList.add("hidden");remove(this.divComment);remove(this.overlay);if(this.ieframe){remove(this.ieframe)}if(this.hideIfClickOutside){document.removeEventListener("click",this.hideIfClickOutside,false);this.hideIfClickOutside=null}},setCommentBoxPosition:function(){var a=this.el.getOffsets();this.divComment.style.top=a.y+this.el.outerHeight()+5+"px";this.divComment.style.left=a.x+this.el.offsetWidth+20+"px";if(this.ieframe){this.ieframe.width=this.divComment.outerWidth();this.ieframe.height=this.divComment.outerHeight()}window.scrollTo(document.body.scrollLeft,a.y-64)},insideCommentBox:function(b){var d=this.divComment.getOffsets();d.right=d.x+this.divComment.outerWidth();d.bottom=d.y+this.divComment.outerHeight();if(!b.pageY&&!b.pageY){var a=document.documentElement;b.pageX=b.clientX+(a.scrollLeft||document.body.scrollLeft)-(a.clientLeft||0);b.pageY=b.clientY+(a.scrollTop||document.body.scrollTop)-(a.clientTop||0)}return b.pageY<d.bottom&&b.pageY>d.y&&b.pageX<d.right&&b.pageX>d.x},showCommentBox:function(){this.buildCommentBox();this.divComment.classList.remove("hidden");this.setCommentBoxPosition();var a=this;this.hideIfClickOutside=function(b){var d=base2.DOM.bind(b.target);if(a.ghostReview&&d==a.ghostReview){return}if(d.tagName=="SPAN"){d=d.parentNode}if(d!=a.el&&!a.insideCommentBox(b)){a.hideCommentBox()}};document.addEventListener("click",this.hideIfClickOutside,false);document.addEventListener("keydown",this._handleKey.bind(this),false)},toJSON:function(a){return a!==null?base2.JSON.toJSONString(a):null}});var Friendpaste=base2.Base.extend({snippet:null,snippet_edit:null,constructor:function(){var a=this;var d=document.querySelector(".e");var b=document.querySelectorAll(".cancel");var e=document.querySelector(".show-history");if(d){d.addEventListener("click",this.do_edit.bindAsEventListener(this),false)}if(b){b.forEach(function(f){f.addEventListener("click",a.do_cancel.bindAsEventListener(a),false)})}if(e){e.addEventListener("click",this.do_history.bindAsEventListener(this),false)}this.snippet=document.querySelector("#snippet_view");this.snippet_edit=document.querySelector("#snippet_edit");this.revisions=document.querySelector("#revisions");this.bdelete=document.querySelector("#snippet_actions li.delete");if(this.bdelete!=null){this.block=document.querySelector("#snippet_actions li.lock");this.adelete=document.querySelector("#snippet_actions li.delete a");this.alock=document.querySelector("#snippet_actions li.lock a");this._deleteListener=function(f){f.preventDefault();this.removeEventListener("click",arguments.callee,false);a.alock.removeEventListener("click",a._lockListener,false);a.block.classList.add("disabled");a.deletePaste()};this._lockListener=function(f){f.preventDefault();this.removeEventListener("click",arguments.callee,false);a.adelete.removeEventListener("click",a._deleteListener,false);a.bdelete.classList.add("disabled");a.lockPaste()};this.listenPasteActions()}this.editing=false;this.show_history=false;if(!base2.detect("webkit")){new Resizeable("#paste_snippet")}new Editor("#paste_snippet");new Review();this.setSettings();document.querySelector("#change-theme").addEventListener("change",this.setTheme.bindAsEventListener(this),false);document.querySelector("#show-linenos").addEventListener("click",this.toggleLineNumber.bindAsEventListener(this),false)},listenPasteActions:function(){this.adelete.addEventListener("click",this._deleteListener,false);this.alock.addEventListener("click",this._lockListener,false)},deletePaste:function(){var b=this;var d=this.formPassword("delete","Delete paste");var a=base2.DOM.bind(this.adelete.parentNode);this.adelete.style.display="none";a.appendChild(d);a.querySelector("input.ano").addEventListener("click",function(f){f.preventDefault();this.removeEventListener("click",arguments.callee,false);b.adelete.style.display="inline";b.block.classList.remove("disabled");remove(d);b.listenPasteActions()},false);return false},lockPaste:function(){var b=this;if(!this.snippet_edit){var d=this.formPassword("unlock","Unlock paste")}else{var d=this.formPassword("lock","Lock paste")}var a=base2.DOM.bind(this.alock.parentNode);a.appendChild(d);this.alock.style.display="none";a.querySelector("input.ano").addEventListener("click",function(f){f.preventDefault();this.removeEventListener("click",arguments.callee,false);b.alock.style.display="inline";b.bdelete.classList.remove("disabled");remove(d);b.listenPasteActions()},false);return false},formPassword:function(a,b){url="/"+snippet_id+"/"+a;form=document.createElement("form");form.className="fsnippet_action";form.action=url;form.method="POST";h4=document.createElement("h4");h4.appendChild(document.createTextNode(b));form.appendChild(h4);p=document.createElement("p");p.appendChild(document.createTextNode("Enter code entered when you create the paste to confirm:"));form.appendChild(p);label=document.createElement("label");label.setAttribute("for","edit_code");label.appendChild(document.createTextNode("Code: "));form.appendChild(label);input=document.createElement("input");input.type="password";input.name="edit_code";input.className="password";form.appendChild(input);submit=document.createElement("input");submit.name="f"+a;submit.type="submit";submit.value=a.substring(0,1).toUpperCase()+a.substring(1,a.length);submit.className="ayes";form.appendChild(submit);cancel=document.createElement("input");cancel.type="submit";cancel.value="Cancel";cancel.className="ano";form.appendChild(cancel);return form},handleSnippetAction:function(a){},do_edit:function(a){a.preventDefault();this._edit();return false},_edit:function(){this.snippet.classList.add("hidden");this.snippet_edit.classList.remove("hidden");this.editing=true;resizeBottom()},do_cancel:function(a){a.preventDefault();this._cancel();return false},_cancel:function(){this.editing=false;if(this.snippet_edit&&!this.snippet_edit.classList.has("hidden")){this.snippet_edit.classList.add("hidden")}if(!this.revisions.classList.has("hidden")){this.revisions.classList.add("hidden")}this.snippet.classList.remove("hidden");resizeBottom()},toggleLineNumber:function(a){document.querySelector("#paste").classList.toggle("hidenos");this.saveSettings()},setSettings:function(){new Ajax.request({url:"/settings",dataType:"json",contentType:"application/json",method:"GET",success:function(a){showlineos=a.settings["showlinenos"];if(typeof(showlineos)!="undefined"){document.querySelector("#show-linenos").checked=a.settings["showlinenos"];if(!a.settings["showlinenos"]){document.querySelector("#paste").classList.add("hidenos")}}if(typeof(a.settings["theme"])!="undefined"&&a.settings["theme"]){theme=a.settings["theme"]}else{theme="default"}document.querySelector("#change-theme").value=theme;document.querySelectorAll('link[rel="stylesheet"][title]').forEach(function(b){if(b.getAttribute("title")=="syntax_theme"){b.href="/static/css/"+theme+".css"}})}})},saveSettings:function(){var d=document.querySelector("#factions");var b=true;var a=document.querySelector("#show-linenos:checked");if(!a){b=false}new Ajax.request({url:d.action,dataType:"json",contentType:"application/json",method:"POST",data:this.toJSON({theme:document.querySelector("#change-theme").value,showlinenos:b}),success:function(e){}})},setTheme:function(b){var a=b.target.value;document.querySelectorAll('link[rel="stylesheet"][title]').forEach(function(d){if(d.getAttribute("title")=="syntax_theme"){d.href="/static/css/"+a+".css"}});this.saveSettings()},do_history:function(b){b.preventDefault();this.show_history=true;url="/"+snippet_id+"/revisions";if(typeof(revid)!="undefined"){url=url+"?rev="+revid}var a=this;new Ajax.get(url,null,function(f,d){document.querySelector(".pasteHistory").innerHTML="";var e="";f.forEach(function(h,g){e+='<tr><td><time title="GMT" datetime="'+h.updated+'">'+h.updated+'</time></td><td class="rev">rev. <a href=\'/'+h.pasteid+"?rev="+h.nb_revision+"'>"+h.nb_revision+'</a></td><td class="changeset"><a href=\'/'+h.pasteid+"/changeset?rev="+h.nb_revision+"'>Diff</a></td><td class=\"view-rev\"><a href='/"+h.pasteid+"?rev="+h.nb_revision+"'>View</a></td></tr>"});e='<table class="revisionstable">'+e+"</table>";document.querySelector(".pasteHistory").innerHTML=e;a.snippet.classList.add("hidden");a.revisions.classList.remove("hidden");localizeDates();resizeBottom()},"json");return false},toJSON:function(a){return a!==null?base2.JSON.toJSONString(a):null}});var Diff=base2.Base.extend({constructor:function(){this.sourcetable=document.querySelector(".sourceTable");this.difftabular=document.querySelector(".difftabular");this.switcher=document.querySelector("#switch");this.sourcetable.classList.add("hidden");this.switcher.innerHTML='<span class="stab active">Tabular</span><span class="suni">Unified</span>';this.stab=this.switcher.querySelector(".stab");this.suni=this.switcher.querySelector(".suni");var a=this;this.stab.addEventListener("click",this.setTabular.bindAsEventListener(this),false);this.suni.addEventListener("click",this.setUnified.bindAsEventListener(this),false);this.setSettings();document.querySelector("#show-linenos").addEventListener("click",this.toggleLineNumber.bindAsEventListener(this),false)},setTabular:function(a){a.preventDefault();if(!this.sourcetable.classList.has("hidden")){this.sourcetable.classList.add("hidden")}this.difftabular.classList.remove("hidden");this.suni.classList.remove("active");this.stab.classList.add("active");resizeBottom()},setUnified:function(a){a.preventDefault();if(!this.difftabular.classList.has("hidden")){this.difftabular.classList.add("hidden")}this.sourcetable.classList.remove("hidden");this.stab.classList.remove("active");this.suni.classList.add("active");resizeBottom()},toggleLineNumber:function(a){document.querySelector("#paste").classList.toggle("hidenos");this.saveSettings()},setSettings:function(){Ajax.request({url:"/settings",dataType:"json",contentType:"application/json",method:"GET",success:function(a){document.querySelector("#show-linenos").checked=a.settings["showlinenos"];if(!a.settings["showlinenos"]){document.querySelector("#paste").classList.add("hidenos")}}})},saveSettings:function(){var d=document.querySelector("#factions");var b=true;var a=document.querySelector("#show-linenos:checked");if(!a){b=false}Ajax.request({url:d.action,dataType:"json",contentType:"application/json",method:"POST",data:this.toJSON({showlinenos:b}),success:function(e){}})},toJSON:function(a){return a!==null?base2.JSON.toJSONString(a):null}});
+var Showdown={};Showdown.converter=function(){var a;var k;var D;var j=0;this.makeHtml=function(K){a=new Array();k=new Array();D=new Array();K=K.replace(/~/g,"~T");K=K.replace(/\$/g,"~D");K=K.replace(/\r\n/g,"\n");K=K.replace(/\r/g,"\n");K="\n\n"+K+"\n\n";K=C(K);K=K.replace(/^[ \t]+$/mg,"");K=n(K);K=e(K);K=J(K);K=s(K);K=K.replace(/~D/g,"$$");K=K.replace(/~T/g,"~");return K};var e=function(K){var K=K.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm,function(N,P,O,M,L){P=P.toLowerCase();a[P]=i(O);if(M){return M+L}else{if(L){k[P]=L.replace(/"/g,"&quot;")}}return""});return K};var n=function(M){M=M.replace(/\n/g,"\n\n");var L="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del";var K="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";M=M.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,A);M=M.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,A);M=M.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,A);M=M.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,A);M=M.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,A);M=M.replace(/\n\n/g,"\n");return M};var A=function(K,L){var M=L;M=M.replace(/\n\n/g,"\n");M=M.replace(/^\n/,"");M=M.replace(/\n+$/g,"");M="\n\n~K"+(D.push(M)-1)+"K\n\n";return M};var J=function(L){L=g(L);var K=q("<hr />");L=L.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,K);L=L.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,K);L=L.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,K);L=H(L);L=b(L);L=w(L);L=n(L);L=h(L);return L};var t=function(K){K=F(K);K=m(K);K=f(K);K=I(K);K=B(K);K=o(K);K=i(K);K=d(K);K=K.replace(/  +\n/g," <br />\n");return K};var m=function(L){var K=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;L=L.replace(K,function(N){var M=N.replace(/(.)<\/?code>(?=.)/g,"$1`");M=z(M,"\\`*_");return M});return L};var B=function(K){K=K.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,G);K=K.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,G);K=K.replace(/(\[([^\[\]]+)\])()()()()()/g,G);return K};var G=function(Q,W,V,U,T,S,P,O){if(O==undefined){O=""}var N=W;var L=V;var M=U.toLowerCase();var K=T;var R=O;if(K==""){if(M==""){M=L.toLowerCase().replace(/ ?\n/g," ")}K="#"+M;if(a[M]!=undefined){K=a[M];if(k[M]!=undefined){R=k[M]}}else{if(N.search(/\(\s*\)$/m)>-1){K=""}else{return N}}}K=z(K,"*_");var X='<a href="'+K+'"';if(R!=""){R=R.replace(/"/g,"&quot;");R=z(R,"*_");X+=' title="'+R+'"'}X+=">"+L+"</a>";return X};var I=function(K){K=K.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,v);K=K.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,v);return K};var v=function(Q,W,V,U,T,S,P,O){var N=W;var M=V;var L=U.toLowerCase();var K=T;var R=O;if(!R){R=""}if(K==""){if(L==""){L=M.toLowerCase().replace(/ ?\n/g," ")}K="#"+L;if(a[L]!=undefined){K=a[L];if(k[L]!=undefined){R=k[L]}}else{return N}}M=M.replace(/"/g,"&quot;");K=z(K,"*_");var X='<img src="'+K+'" alt="'+M+'"';R=R.replace(/"/g,"&quot;");R=z(R,"*_");X+=' title="'+R+'"';X+=" />";return X};var g=function(K){K=K.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(L,M){return q("<h1>"+t(M)+"</h1>")});K=K.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(M,L){return q("<h2>"+t(L)+"</h2>")});K=K.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(L,O,N){var M=O.length;return q("<h"+M+">"+t(N)+"</h"+M+">")});return K};var r;var H=function(L){L+="~0";var K=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;if(j){L=L.replace(K,function(N,Q,P){var R=Q;var O=(P.search(/[*+-]/g)>-1)?"ul":"ol";R=R.replace(/\n{2,}/g,"\n\n\n");var M=r(R);M=M.replace(/\s+$/,"");M="<"+O+">"+M+"</"+O+">\n";return M})}else{K=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;L=L.replace(K,function(O,S,Q,N){var R=S;var T=Q;var P=(N.search(/[*+-]/g)>-1)?"ul":"ol";var T=T.replace(/\n{2,}/g,"\n\n\n");var M=r(T);M=R+"<"+P+">\n"+M+"</"+P+">\n";return M})}L=L.replace(/~0/,"");return L};r=function(K){j++;K=K.replace(/\n{2,}$/,"\n");K+="~0";K=K.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(N,P,O,M,L){var R=L;var Q=P;var S=O;if(Q||(R.search(/\n{2,}/)>-1)){R=J(u(R))}else{R=H(u(R));R=R.replace(/\n$/,"");R=t(R)}return"<li>"+R+"</li>\n"});K=K.replace(/~0/g,"");j--;return K};var b=function(K){K+="~0";K=K.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(L,N,M){var O=N;var P=M;O=x(u(O));O=C(O);O=O.replace(/^\n+/g,"");O=O.replace(/\n+$/g,"");O="<pre><code>"+O+"\n</code></pre>";return q(O)+P});K=K.replace(/~0/,"");return K};var q=function(K){K=K.replace(/(^\n+|\n+$)/g,"");return"\n\n~K"+(D.push(K)-1)+"K\n\n"};var F=function(K){K=K.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(N,P,O,M,L){var Q=M;Q=Q.replace(/^([ \t]*)/g,"");Q=Q.replace(/[ \t]*$/g,"");Q=x(Q);return P+"<code>"+Q+"</code>"});return K};var x=function(K){K=K.replace(/&/g,"&amp;");K=K.replace(/</g,"&lt;");K=K.replace(/>/g,"&gt;");K=z(K,"*_{}[]\\",false);return K};var d=function(K){K=K.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"<strong>$2</strong>");K=K.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"<em>$2</em>");return K};var w=function(K){K=K.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(L,M){var N=M;N=N.replace(/^[ \t]*>[ \t]?/gm,"~0");N=N.replace(/~0/g,"");N=N.replace(/^[ \t]+$/gm,"");N=J(N);N=N.replace(/(^|\n)/g,"$1  ");N=N.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(O,P){var Q=P;Q=Q.replace(/^  /mg,"~0");Q=Q.replace(/~0/g,"");return Q});return q("<blockquote>\n"+N+"\n</blockquote>")});return K};var h=function(Q){Q=Q.replace(/^\n+/g,"");Q=Q.replace(/\n+$/g,"");var P=Q.split(/\n{2,}/g);var M=new Array();var K=P.length;for(var L=0;L<K;L++){var O=P[L];if(O.search(/~K(\d+)K/g)>=0){M.push(O)}else{if(O.search(/\S/)>=0){O=t(O);O=O.replace(/^([ \t]*)/g,"<p>");O+="</p>";M.push(O)}}}K=M.length;for(var L=0;L<K;L++){while(M[L].search(/~K(\d+)K/)>=0){var N=D[RegExp.$1];N=N.replace(/\$/g,"$$$$");M[L]=M[L].replace(/~K\d+K/,N)}}return M.join("\n\n")};var i=function(K){K=K.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;");K=K.replace(/<(?![a-z\/?\$!])/gi,"&lt;");return K};var f=function(K){K=K.replace(/\\(\\)/g,l);K=K.replace(/\\([`*_{}\[\]()>#+-.!])/g,l);return K};var o=function(K){K=K.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'<a href="$1">$1</a>');K=K.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(L,M){return E(s(M))});return K};var E=function(M){function L(O){var N="0123456789ABCDEF";var P=O.charCodeAt(0);return(N.charAt(P>>4)+N.charAt(P&15))}var K=[function(N){return"&#"+N.charCodeAt(0)+";"},function(N){return"&#x"+L(N)+";"},function(N){return N}];M="mailto:"+M;M=M.replace(/./g,function(N){if(N=="@"){N=K[Math.floor(Math.random()*2)](N)}else{if(N!=":"){var O=Math.random();N=(O>0.9?K[2](N):O>0.45?K[1](N):K[0](N))}}return N});M='<a href="'+M+'">'+M+"</a>";M=M.replace(/">.+:/g,'">');return M};var s=function(K){K=K.replace(/~E(\d+)E/g,function(L,N){var M=parseInt(N);return String.fromCharCode(M)});return K};var u=function(K){K=K.replace(/^(\t|[ ]{1,4})/gm,"~0");K=K.replace(/~0/g,"");return K};var C=function(K){K=K.replace(/\t(?=\t)/g,"    ");K=K.replace(/\t/g,"~A~B");K=K.replace(/~B(.+?)~A/g,function(L,O,N){var Q=O;var M=4-Q.length%4;for(var P=0;P<M;P++){Q+=" "}return Q});K=K.replace(/~A/g,"    ");K=K.replace(/~B/g,"");return K};var z=function(O,L,M){var K="(["+L.replace(/([\[\]\\])/g,"\\$1")+"])";if(M){K="\\\\"+K}var N=new RegExp(K,"g");O=O.replace(N,l);return O};var l=function(K,M){var L=M.charCodeAt(0);return"~E"+L+"E"}};var Resizeable=base2.Base.extend({min_height:280,constructor:function(e,d){var b=this;if(d){this.min_height=d}var a=document.createElement("div");a.className="grippie";a.style.cursor="s-resize";base2.DOM.bind(a);document.querySelectorAll(e).forEach(function(f){f.parentNode.appendChild(a);a.addEventListener("mousedown",function(g){g.preventDefault();g.stopPropagation();b.handleResize(g,f);return false},false)})},handleResize:function(h,d){var a=this;var i=d;var j={x:h.screenX,y:h.screenY};var f={width:i.offsetWidth,height:i.offsetHeight};var g=function(l){l.preventDefault();var m=l.screenY-j.y;if(m){var k=f.height+m;if(k>a.min_height){i.style.height=k+"px";f.height=k;j.y=l.screenY}}return false};var b=function(k){document.removeEventListener("mousemove",g,false);this.removeEventListener("mouseup",arguments.callee,false);return false};document.addEventListener("mousemove",g,false);document.addEventListener("mouseup",b,false)}});var Editor=base2.Base.extend({tab_spacing:true,constructor:function(b){this.el=document.querySelector(b);this.lastSelection={};this.lineHeight=16;this.tab_nb_char=4;if(base2.detect("webkit")){this.tab_nb_char+=1}if(this.tab_spacing){this.tabulation="";for(var a=0;a<this.tab_nb_char;a++){this.tabulation+=" "}}else{this.tabulation="\t"}this._tab_detected=false;if(base2.detect("MSIE")){this.el.selectionStart=this.el.selectionEnd=0}this.el.addEventListener("keydown",this.handleKey.bindAsEventListener(this),false)},handleKey:function(a){c=a.keyCode;if(c==9){a.preventDefault();this.tab_selection();a.returnValue=false;return false}else{if(c==13){if(this.do_enter()){a.preventDefault();a.returnValue=false}return false}}return true},tab_selection:function(){if(this._is_tabbing){return}this._is_tabbing=true;var d=this;if(base2.detect("MSIE")){this._getIESelection()}if(!this._tab_detected){this._detect_tab()}var i=this.el.selectionStart;var a=this.el.selectionEnd;var e=this.el.value.substring(i,a);var g=this.el.scrollTop;var h=this.el.scrollLeft;var b=i;var f=a;if(e.length==0){this.el.value=this.el.value.substr(0,i)+this.tabulation+this.el.value.substr(a);b=i+this.tabulation.length;f=b}else{i=Math.max(0,this.el.value.substr(0,i).lastIndexOf("\n")+1);endText=this.el.value.substr(a);startText=this.el.value.substr(0,i);tmp=e.split("\n");e=this.tabulation+tmp.join("\n"+this.tabulation);this.el.value=startText+e+endText;b=i;f=this.el.value.indexOf("\n",startText.length+e.length);if(f==-1){f=this.el.value.length}}this.el.selectionStart=b;this.el.selectionEnd=f;if(base2.detect("MSIE")){this._setIESelection();setTimeout(function(){d._is_tabbing=false},100);this._is_tabbing=false}else{this._is_tabbing=false}this.el.scrollTop=g;this.el.scrollLeft=h},do_enter:function(){if(base2.detect("MSIE")){this._getIESelection()}var f=this.el.scrollTop;var g=this.el.scrollLeft;var h=this.el.selectionStart;var a=this.el.selectionEnd;var e=Math.max(0,this.el.value.substring(0,h).lastIndexOf("\n")+1);var b=this.el.value.substring(e,h);if(b.match(/^[ \t]+$/mg,"")){return false}var d=b.replace(/^([ \t]*).*/gm,"$1");if(d=="\n"||d=="\r"||d.length==0){return false}if(base2.detect("MSIE")||base2.detect("opera")){d="\r\n"+d}else{d="\n"+d}this.el.value=this.el.value.substring(0,h)+d+this.el.value.substring(a);this.area_select(h+d.length,0);this.el.scrollTop=f;this.el.scrollLeft=g;return true},area_select:function(b,a){b=Math.max(0,Math.min(this.el.value.length,b));end=Math.max(b,Math.min(this.el.value.length,b+a));if(base2.detect("MSIE")){this.el.selectionStart=b;this.el.selectionEnd=end;this._setIESelection()}else{if(base2.detect("opera")){this.el.setSelectionRange(0,0)}this.el.setSelectionRange(b,end)}},_detect_tab:function(){if(this.el.value.indexOf("\t")>0){this.tabulation="\t"}else{this.tabulation="";for(var a=0;a<this.tab_nb_char;a++){this.tabulation+=" "}}this._tab_detected=true},_getIESelection:function(){this.el.focus();var a=this.el.createTextRange();var b=a.duplicate();a.moveToBookmark(document.selection.createRange().getBookmark());a.moveEnd("character",this.el.value.length);this.el.selectionStart=this.el.value.length-a.text.length;b.moveToBookmark(document.selection.createRange().getBookmark());b.moveStart("character",-this.el.value.length);this.el.selectionEnd=b.text.length;if(this.el.selectionEnd<this.el.selectionStart){this.el.selectionEnd=this.el.selectionStart}},_setIESelection:function(){var a=this.el.value.substr(0,this.el.selectionStart).split("\n").length-1;var b=this.el.value.substr(0,this.el.selectionEnd).split("\n").length-1;var d=document.selection.createRange();d.moveToElementText(this.el);d.setEndPoint("EndToStart",d);d.collapse(true);d.moveStart("character",this.el.selectionStart-a);d.moveEnd("character",this.el.selectionEnd-b-(this.el.selectionStart-a));d.select()}});var Review=base2.Base.extend({constructor:function(){var b=this;this._reviews={};this.latest_add=null;document.querySelectorAll(".review-flag").forEach(function(e){p=base2.DOM.bind(e.parentNode);offsets=p.getOffsets();e.style.top=offsets.y+"px"});var d=document.createElement("img");d.id="ghost-reviewflag";d.setStyle({position:"absolute",left:"5.5%",cursor:"pointer"});d.classList.add("hidden");d.src="/static/images/comment-ghost.png";document.body.appendChild(d);this.ghostReview=d;this.ghostReview.addEventListener("mousedown",this._sourceMouseDown.bind(this),false);this.ghostReview.addEventListener("mouseup",this._sourceMouseUp.bind(this),false);this.ghostReview.addEventListener("mouseover",this._sourceMouseOver.bind(this),true);this.nb_lines=null;this.sourceRow=null;this.numRow=null;this._loading=false;var a=document.querySelector("table.numsTable");a.addEventListener("mousedown",this._sourceMouseDown.bind(this),false);a.addEventListener("mouseup",this._sourceMouseUp.bind(this),false);a.addEventListener("mouseover",this._sourceMouseOver.bind(this),true);a.addEventListener("mouseout",this._sourceMouseOut.bind(this),true);this.converter=new Showdown.converter();this.canRestart=true;window.addEventListener("close",function(f){b.canRestart=false},false);this._init_stomp()},_init_stomp:function(){var a=this;stomp=new STOMPClient();stomp.onopen=function(){};stomp.onerror=function(b){alert("Error: "+b)};stomp.onerrorframe=function(b){alert("Error: "+b.body)};stomp.onconnectedframe=function(){stomp.subscribe("/paste/"+snippet_id+"/"+revid,{exchange:""});stomp.subscribe("/paste/"+snippet_id,{exchange:""})};stomp.onmessageframe=function(b){a.handle_messages(b)};stomp.onclose=function(){if(a.canRestart){window.setTimeout("stomp.connect('localhost', 61613)",2000)}};stomp.connect("localhost",61613)},_notify:function(b){var a=document.querySelector("#notify-snippet");a.innerHTML=b;if(a.classList.has("hidden")){a.classList.remove("hidden")}setTimeout(function(){a.classList.add("hidden")},30000)},handle_messages:function(a){var j=base2.JSON.parse(a.body);var e=false;if(j.type=="review"){if(this.latest_add&&this.latest_add.nb_line==j.nb_line&&this.latest_add.reviews_count+1==j.reviews_count){e=true}var i=this._reviews[j.nb_line]||null;if(!i){var i=this._numRow(j.nb_line);if(!i){return}this._reviews[j.nb_line]=i}var b=i.querySelector("td");var f=b.querySelector("span.reviewflag");var h=false;if(!f){var g=document.createElement("span");g.classList.add("reviewflag");if(!e){g.classList.add("new")}g.appendChild(document.createTextNode(j.reviews_count));b.appendChild(g);h=true}else{line_count=parseInt(f.innerHTML);if(line_count<j.reviews_count){f.innerHTML=j.reviews_count;if(!f.classList.has("new")&&!e){f.classList.add("new")}if(!e&&j.nb_line==this.currentLineNumber){this.updateComments(j.nb_line)}h=true}}if(h&&!e){var d='a new review has been added to line <a href="#'+j.nb_line+'">#'+j.nb_line+"</a>.";this._notify(d)}}else{if(j.type=="update"){if(j.nb_revision==revid){return}var d='Past has been updated to <a href="/'+snippet_id+"?rev="+j.nb_revision+'">revision '+j.nb_revision+"</a>";this._notify(d)}else{if(j.type=="delete"){var d="Paste has been deleted.";this._notify(d)}}}},_sourceRow:function(a){var b=document.querySelector("td.lines table").rows;--a;return base2.DOM.bind(b[a])},_numRow:function(a){var b=document.querySelector("td.nums table").rows;--a;return base2.DOM.bind(b[a])},_lineNumberForRow:function(b){var a=0;while(b){++a;b=b.previousSibling}return a},_handleKey:function(a){if(a.keyCode==27){this.hideCommentBox();document.removeEventListener("keydown",arguments.callee,false)}},_selectRow:function(a,d){if(a!=this.nb_line){if(this.nb_line){this.numRow.classList.remove("selected");this.sourceRow.classList.remove("selected")}this.nb_line=a;this.numRow=d;this.sourceRow=this._sourceRow(a);this.numRow.classList.add("selected");this.sourceRow.classList.add("selected");if(!d.classList.has("hasreview")){var b=d.getOffsets();this.ghostReview.style.top=b.y-1+"px";this.ghostReview.numLine=a;this.ghostReview.classList.remove("hidden")}else{this.ghostReview.classList.add("hidden")}}},_sourceMouseOver:function(f){f.stopPropagation();var b=f.target;var d=f.target.parentNode;base2.DOM.bind(b);base2.DOM.bind(d);if(b==this.ghostReview&&!b.classList.has("hidden")){a=b.numLine;g=this._numRow(a);this._selectRow(a,g)}else{if(b.classList.has("line-number")||d.classList.has("line-number")){var g=b.enclosingNodeOrSelfWithNodeName("tr");base2.DOM.bind(g);var a=this._lineNumberForRow(g);this._selectRow(a,g)}}return},_sourceMouseOut:function(a){if(!this.nb_line){return}relTarget=base2.DOM.bind(a.relatedTarget||a.toElement);if(typeof relTarget=="undefined"){return}if(this.ghostReview&&relTarget!=this.ghostReview){this.ghostReview.classList.add("hidden")}if(relTarget.tagName=="SPAN"){relTarget=base2.DOM.bind(relTarget.parentNode)}if(!relTarget.classList.has("line-number")){this.numRow.classList.remove("selected");this.sourceRow.classList.remove("selected");this.nb_line=this.sourceRow=this.numRow=null}},_sourceMouseDown:function(b){var a=b.target;base2.DOM.bind(a);if(this.ghostReview&&a==this.ghostReview){this.currentRow=this._numRow(this.ghostReview.numLine);this.currentLineNumber=this.ghostReview.numLine}else{if(a.tagName=="SPAN"){a=base2.DOM.bind(a.parentNode)}if(!a.classList.has("line-number")){return}this.currentRow=base2.DOM.bind(a.enclosingNodeOrSelfWithNodeName("tr"));this.currentLineNumber=this._lineNumberForRow(this.currentRow)}},_sourceMouseUp:function(h){var f=h.target;var g=h.target.parentNode;base2.DOM.bind(f);base2.DOM.bind(g);if(this.ghostReview&&f!=this.ghostReview){if(!f.classList.has("line-number")&&(!g.classList.has("line-number"))){return}}this.el=this.currentRow.querySelector("td");if(this.ghostReview&&!this.ghostReview.classList.has("hidden")){this.ghostReview.classList.add("hidden")}var a=this.el.querySelector("span.reviewflag");if(!a){var d=document.createElement("span");d.classList.add("reviewflag");d.appendChild(document.createTextNode("0"));this.el.appendChild(d)}else{if(a.classList.has("new")){a.classList.remove("new")}}var b=this._lineNumberForRow(this.currentRow);var i=this._sourceRow(b);if(this.currentRow.classList.has("selected")){this.currentRow.classList.remove("selected");this.sourceRow.classList.remove("selected")}i.classList.add("highlighted-line");this.currentRow.classList.add("highlighted-line");this.showCommentBox()},buildCommentBox:function(s){var o=this;this.overlay=document.createElement("div");this.overlay.id="overlay";this.overlay.setStyle({"z-index":"9999"});this.overlay.setOpacity("0");var m=document.createElement("div");m.classList.add("comment-box");m.classList.add("hidden");m.setStyle("z-index: 10000");m.setOpacity("0.9");this.divComment=this.rootLayers=m;document.body.appendChild(this.overlay);document.body.appendChild(this.divComment);var s=this._lineNumberForRow(this.currentRow);var h="/"+snippet_id+"/reviews/"+s;var t="/"+snippet_id+"/review/"+s;if(typeof revid!="undefined"){h+="?rev="+revid;t+="?rev="+revid}var a=document.createElement("form");a.action=t;a.id="freview";var i=document.createElement("h3");i.classList.add("wtitle");i.appendChild(document.createTextNode("Add your review to line "+s+" "));var r=document.createElement("a");r.href="#";r.innerHTML="(markdown syntax supported)";r.addEventListener("click",function(w){w.preventDefault();window.open("http://daringfireball.net/projects/markdown/dingus");w.stopPropagation();return false},false);i.appendChild(r);a.appendChild(i);var f=document.createElement("div");f.id="row-form";var n=document.createElement("textarea");n.id="new_review";n.name="new_review";n.setAttribute("cols",70);n.setAttribute("rows",5);f.appendChild(n);a.appendChild(f);var q=document.createElement("p");var v=document.createElement("span");v.classList.add("rby");var j=document.createElement("label");j.setAttribute("for","rpseudo");j.innerHTML="nickname: ";v.appendChild(j);var d=document.createElement("input");d.type="text";d.id="rpseudo";d.value="anonymous";v.appendChild(d);q.appendChild(v);var e=document.createElement("span");e.classList.add("ractions");var k=document.createElement("input");k.type="submit";k.name=k.id="sreview";k.value="save comment";e.appendChild(k);var l=document.createElement("input");l.type="submit";l.id=l.name="bclose";l.value="close";e.appendChild(l);q.appendChild(e);a.appendChild(q);m.appendChild(a);var u=document.createElement("h3");u.appendChild(document.createTextNode("All comments for this line"));m.appendChild(u);var b=document.createElement("div");b.id="reviews-list";b.classList.add("hidden");m.appendChild(b);var g=document.createElement("div");g.classList.add("loading");g.appendChild(document.createTextNode("loading comments for line"));m.appendChild(g);l.addEventListener("click",function(w){w.preventDefault();o.hideCommentBox();return false},false);k.addEventListener("click",this.add_review.bind(this),false);if(!base2.detect("webkit")){new Resizeable("#new_review",120)}new Ajax.request({url:h,dataType:"json",contentType:"application/json",method:"GET",success:function(A){if(A.ok){if(A.r.reviews){var z=document.createElement("ul");for(var x=0;x<A.r.reviews.length;x++){var w=document.createElement("li");var C=document.createElement("time");C.title="GMT";C.setAttribute("datetime",A.r.reviews[x]["created"]);C.textContent=A.r.reviews[x]["fcreated"];w.innerHTML=o.converter.makeHtml(A.r.reviews[x]["comment"]);var B=document.createElement("div");B.classList.add("metadata");B.appendChild(document.createTextNode(A.r.reviews[x]["nickname"]));B.appendChild(C);w.appendChild(B);z.appendChild(w)}b.appendChild(z);remove(g);b.classList.remove("hidden");localizeDates()}}}})},_make_reviews_list:function(h,d,e){if(!d){d=document.createElement("ul");for(var b=0;b<e.r.length;b++){var a=document.createElement("li");var g=document.createElement("time");g.title="GMT";g.setAttribute("datetime",e.r[b]["created"]);g.textContent=e.r[b]["fcreated"];a.innerHTML=this.converter.makeHtml(e.r[b]["comment"]);var f=document.createElement("div");f.classList.add("metadata");f.appendChild(document.createTextNode(e.r[b]["nickname"]));f.appendChild(g);a.appendChild(f);d.appendChild(a)}h.appendChild(d)}else{for(var b=0;b<e.r.length;b++){var a=document.createElement("li");var g=document.createElement("time");g.title="GMT";g.setAttribute("datetime",e.r[b]["created"]);g.textContent=e.r[b]["fcreated"];a.innerHTML=this.converter.makeHtml(e.r[b]["comment"]);var f=document.createElement("div");f.classList.add("metadata");f.appendChild(document.createTextNode(e.r[b]["nickname"]));f.appendChild(g);a.appendChild(f);d.insertBefore(a,d.firstChild)}}localizeDates()},add_review:function(i){i.preventDefault();var l=this;var a=this.divComment.querySelector("#freview").action;var k=this.divComment.querySelector("textarea");var b=k.value;var g=document.getElementById("rpseudo").value;if(b){var d=this._lineNumberForRow(this.currentRow);var f=this.divComment.querySelector("#reviews-list");var h=f.querySelector("ul");var j=0;if(h){j=h.querySelectorAll("li").length}this.latest_add={nb_line:d,reviews_count:j};new Ajax.request({url:a,dataType:"json",contentType:"application/json",data:this.toJSON({new_review:b,nickname:g,nb_lines:j}),method:"POST",success:function(e){if(e.ok){l._make_reviews_list(f,h,e);k.value="";k.focus()}else{l.latest_add=null}}})}},updateComments:function(f){var b=this;var f=f;if(f!=this.currentLineNumber){return}var g=this.divComment.querySelector("#reviews-list");var e=g.querySelector("ul");var a=0;if(e){a=e.querySelectorAll("li").length}var d="/"+snippet_id+"/reviewset/"+f+"?rev="+revid+"&f="+a;new Ajax.request({url:d,dataType:"json",contentType:"application/json",method:"GET",success:function(h){if(h.ok){if(f!=this.currentLineNumber&&(e&&a!=e.querySelectorAll("li").length)){return}b._make_reviews_list(g,e,h)}}})},hideCommentBox:function(){reviewflag=this.el.querySelector("span.reviewflag");var a=0;if(reviewflag){a=parseInt(reviewflag.innerHTML)}if(a==0){remove(reviewflag)}this.currentLineNumber=null;this.currentRow.classList.remove("highlighted-line");var b=this._lineNumberForRow(this.currentRow);var d=this._sourceRow(b);d.classList.remove("highlighted-line");this.divComment.classList.add("hidden");remove(this.divComment);remove(this.overlay);if(this.hideIfClickOutside){document.removeEventListener("click",this.hideIfClickOutside,false);this.hideIfClickOutside=null}this.isDragging=false;this.divComment.removeEventListener("mousedown",this.beginDragCB,false);document.removeEventListener("mousemove",this.dragCB,false);document.removeEventListener("mouseup",this.endDragCB,false)},setCommentBoxPosition:function(){var b=this.el.getOffsets();var a=[b.y+this.el.outerHeight()+5,b.x+this.el.offsetWidth+20];this.divComment.style.top=a[0]+"px";this.divComment.style.left=a[1]+"px";window.scrollTo(document.body.scrollLeft,b.y-64);this.divComment.classList.remove("hidden");this.divComment.querySelector("textarea").focus()},insideCommentBox:function(a){var b=this.divComment.getOffsets();b.right=b.x+this.divComment.outerWidth();b.bottom=b.y+this.divComment.outerHeight();point=pointer(a);return point.y<b.bottom&&point.y>b.y&&point.x<b.right&&point.x>b.x},currentDelta:function(){return([parseInt(this.divComment.getStyle("left")||"0"),parseInt(this.divComment.getStyle("top")||"0")])},beginDragCB:function(i){var b=this;if(this.isDragging){return false}base2.DOM.bind(i.target);if(!i.target.classList.has("wtitle")){return}var a=pointer(i);this.boxDimensions=this.divComment.getDimensions();if(i.target.getStyle("overflow")!="hidden"){var g=getScrollbarWidth();var f=this.divComment.getOffsets();var h=f.x+this.boxDimensions.width-g;if(a.x>h){return}}this.isDragging=true;this.old_cursor=this.divComment.getStyle("cursor");this.divComment.style.cursor="move";var j=this.divComment.cumulativeOffset();this.offset=[a.x-j.x,a.y-j.y];this.pointer=a;var d=this._getWindowScroll(window);this.scroll=[d.left,d.top];document.body.focus();if(base2.detect("MSIE")){this.old_onselectstart=document.onselectstart;document.onselectstart=function(k){return false}}i.preventDefault();i.stopPropagation();return false},dragCB:function(g){if(!this.isDragging){return}if(!g){g=window.event}var g=g;var a=pointer(g);var i=this.divComment.cumulativeOffset();var h=this.currentDelta();i.x-=h[0];i.y-=h[1];var f=[(a.x-i.x-this.offset[0]),(a.y-i.y-this.offset[1])];this.divComment.style.left=f[0]+"px";this.divComment.style.top=f[1]+"px";if(base2.detect("webkit")){window.scrollBy(0,0)}var b=this;setTimeout(function(){var d=f[1]+b.divComment.outerHeight();var j=f[0]+b.divComment.outerWidth();var e=b._getWindowScroll(window);var l=e.left;var k=e.top;if(j>e.width-15){l=j}if(d>e.height-15){k=d}if(l!=e.left||k!=e.top){window.scrollTo(l,k)}b.pointer=a},0);g.preventDefault();g.stopPropagation()},endDragCB:function(a){if(!this.isDragging){return}this.isDragging=false;if(base2.detect("MSIE")){document.onselectstart=this.old_onselectstart}this.divComment.style.cursor=this.old_cursor},showCommentBox:function(){this.buildCommentBox();this.divComment.classList.remove("hidden");this.setCommentBoxPosition();this.divComment.addEventListener("mousedown",this.beginDragCB.bind(this),false);document.addEventListener("mousemove",this.dragCB.bind(this),false);document.addEventListener("mouseup",this.endDragCB.bind(this),false);var a=this;this.hideIfClickOutside=function(b){var d=base2.DOM.bind(b.target);if(a.ghostReview&&d==a.ghostReview){return}if(d.tagName=="SPAN"){d=d.parentNode}if(d!=a.el&&!a.insideCommentBox(b)){a.hideCommentBox()}};document.addEventListener("click",this.hideIfClickOutside,false);document.addEventListener("keydown",this._handleKey.bind(this),false)},toJSON:function(a){return a!==null?base2.JSON.toString(a):null},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}return{top:T,left:L,width:W,height:H}}});var Home=base2.Base.extend({constructor:function(){if(!base2.detect("webkit")){new Resizeable("#paste_snippet")}new Editor("#paste_snippet");this.privacy=document.querySelector(".privacy");this.privacy.addEventListener("click",this.handlePrivacy.bind(this),false);this.showPrivacy=false;if(this.privacy.classList.has("setPrivacy")){this.showPrivacy=true}document.querySelector("#paste_snippet").focus()},handlePrivacy:function(h){var g=document.querySelector("#paste_privacy");var b=document.querySelector("#paste_password");var d=b.parentNode;base2.DOM.bind(d);if(this.showPrivacy&&b.value!=""&&g.options[g.options.selectedIndex].value!="open"){y=window.confirm("Are you sure you want to close privacy settings ? By doing this, you will allow everyone to view and edit paste. Click OK to continue.");if(!y){return}}var f=document.querySelector("#privacy");this.privacy.classList.toggle("setPrivacy");f.classList.toggle("hidden");this.showPrivacy=!this.showPrivacy;var a=function(i){if(d.classList.has("hidden")&&g.options[g.options.selectedIndex].value!="open"){d.classList.remove("hidden")}else{if(!d.classList.has("hidden")&&g.options[g.selectedIndex].value=="open"){d.classList.add("hidden")}}};if(this.showPrivacy){a();g.addEventListener("change",a,false)}else{b.value="";g.options.selectedIndex=0;if(d.classList.has("errors")){d.classList.remove("errors")}try{g.removeEventListener("change",a,false)}catch(h){}}}});var Friendpaste=base2.Base.extend({snippet:null,snippet_edit:null,constructor:function(){var b=this;var e=document.querySelector(".e");var d=document.querySelectorAll(".cancel");var f=document.querySelector(".show-history");if(e){e.addEventListener("click",this.do_edit.bindAsEventListener(this),false)}if(d){d.forEach(function(g){g.addEventListener("click",b.do_cancel.bindAsEventListener(b),false)})}if(f){f.addEventListener("click",this.do_history.bindAsEventListener(this),false)}this.snippet=document.querySelector("#view");this.snippet_edit=document.querySelector("#edit");this.revisions=document.querySelector("#revisions");this.bdelete=document.querySelector("#snippet_actions li.delete");if(this.bdelete!=null){this.block=document.querySelector("#snippet_actions li.lock");this.adelete=document.querySelector("#snippet_actions li.delete a");this.alock=document.querySelector("#snippet_actions li.lock a");this._deleteListener=function(g){g.preventDefault();this.removeEventListener("click",arguments.callee,false);b.alock.removeEventListener("click",b._lockListener,false);b.block.classList.add("disabled");b.deletePaste()};this._lockListener=function(g){g.preventDefault();this.removeEventListener("click",arguments.callee,false);b.adelete.removeEventListener("click",b._deleteListener,false);b.bdelete.classList.add("disabled");b.lockPaste()};this.listenPasteActions()}var a=/#(.+)$/.exec(window.location);if(a&&a[1]=="edit"){this.snippet.classList.add("hidden");this.snippet_edit.classList.remove("hidden")}else{this.editing=true}this.editing=false;this.show_history=false;if(!base2.detect("webkit")){new Resizeable("#paste_snippet")}new Editor("#paste_snippet");new Review();this.setSettings();document.querySelector("#change-theme").addEventListener("change",this.setTheme.bindAsEventListener(this),false);document.querySelector("#show-linenos").addEventListener("click",this.toggleLineNumber.bindAsEventListener(this),false)},listenPasteActions:function(){this.adelete.addEventListener("click",this._deleteListener,false);this.alock.addEventListener("click",this._lockListener,false)},deletePaste:function(){var b=this;var d=this.formPassword("delete","Delete paste");var a=base2.DOM.bind(this.adelete.parentNode);this.adelete.style.display="none";a.appendChild(d);a.querySelector(".password").focus();a.querySelector("input.ano").addEventListener("click",function(f){f.preventDefault();this.removeEventListener("click",arguments.callee,false);b.adelete.style.display="inline";b.block.classList.remove("disabled");remove(d);b.listenPasteActions()},false);return false},lockPaste:function(){var b=this;if(!this.snippet_edit){var d=this.formPassword("unlock","Unlock paste")}else{var d=this.formPassword("lock","Lock paste")}var a=base2.DOM.bind(this.alock.parentNode);a.appendChild(d);a.querySelector(".password").focus();this.alock.style.display="none";a.querySelector("input.ano").addEventListener("click",function(f){f.preventDefault();this.removeEventListener("click",arguments.callee,false);b.alock.style.display="inline";b.bdelete.classList.remove("disabled");remove(d);b.listenPasteActions()},false);return false},formPassword:function(a,b){url="/"+snippet_id+"/"+a;form=document.createElement("form");form.className="fsnippet_action";form.action=url;form.method="POST";h4=document.createElement("h4");h4.appendChild(document.createTextNode(b));form.appendChild(h4);p=document.createElement("p");p.appendChild(document.createTextNode("Enter code entered when you create the paste to confirm:"));form.appendChild(p);label=document.createElement("label");label.setAttribute("for","edit_code");label.appendChild(document.createTextNode("Code: "));form.appendChild(label);input=document.createElement("input");input.type="password";input.name="edit_code";input.className="password";form.appendChild(input);submit=document.createElement("input");submit.name="f"+a;submit.type="submit";submit.value=a.substring(0,1).toUpperCase()+a.substring(1,a.length);submit.className="ayes";form.appendChild(submit);cancel=document.createElement("input");cancel.type="submit";cancel.value="Cancel";cancel.className="ano";form.appendChild(cancel);return form},handleSnippetAction:function(a){},do_edit:function(a){a.preventDefault();this._edit();return false},_edit:function(){this.ghostReview=document.querySelector("#ghost-reviewflag");if(this.ghostReview){this.ghostReview.classList.add("hidden")}this.snippet.classList.add("hidden");this.snippet_edit.classList.remove("hidden");this.editing=true},do_cancel:function(a){a.preventDefault();this._cancel();return false},_cancel:function(){this.editing=false;if(this.ghostReview){this.ghostReview.classList.remove("hidden");this.ghostReview=null}if(this.snippet_edit&&!this.snippet_edit.classList.has("hidden")){this.snippet_edit.classList.add("hidden")}if(!this.revisions.classList.has("hidden")){this.revisions.classList.add("hidden")}this.snippet.classList.remove("hidden")},toggleLineNumber:function(a){document.querySelector("#paste").classList.toggle("hidenos");this.saveSettings()},setSettings:function(){new Ajax.request({url:"/settings",dataType:"json",contentType:"application/json",method:"GET",success:function(a){showlineos=a.settings["showlinenos"];if(typeof(showlineos)!="undefined"){document.querySelector("#show-linenos").checked=a.settings["showlinenos"];if(!a.settings["showlinenos"]){document.querySelector("#paste").classList.add("hidenos")}}if(typeof(a.settings["theme"])!="undefined"&&a.settings["theme"]){theme=a.settings["theme"]}else{theme="default"}document.querySelector("#change-theme").value=theme;document.querySelectorAll('link[rel="stylesheet"][title]').forEach(function(b){if(b.getAttribute("title")=="syntax_theme"){b.href="/static/css/"+theme+".css"}})}})},saveSettings:function(){var d=document.querySelector("#factions");var b=true;var a=document.querySelector("#show-linenos:checked");if(!a){b=false}new Ajax.request({url:d.action,dataType:"json",contentType:"application/json",method:"POST",data:this.toJSON({theme:document.querySelector("#change-theme").value,showlinenos:b}),success:function(e){}})},setTheme:function(b){var a=b.target.value;document.querySelectorAll('link[rel="stylesheet"][title]').forEach(function(d){if(d.getAttribute("title")=="syntax_theme"){d.href="/static/css/"+a+".css"}});this.saveSettings()},do_history:function(b){b.preventDefault();this.ghostReview=document.querySelector("#ghost-reviewflag");if(this.ghostReview){this.ghostReview.classList.add("hidden")}this.show_history=true;url="/"+snippet_id+"/revisions";if(typeof(revid)!="undefined"){url=url+"?rev="+revid}var a=this;new Ajax.get(url,null,function(f,d){document.querySelector(".pasteHistory").innerHTML="";var e="";f.forEach(function(h,g){e+='<tr><td><time title="GMT" datetime="'+h.updated+'">'+h.updated+'</time></td><td class="rev">rev. <a href=\'/'+h.pasteid+"?rev="+h.nb_revision+"'>"+h.nb_revision+'</a></td><td class="changeset"><a href=\'/'+h.pasteid+"/changeset?rev="+h.nb_revision+"'>Diff</a></td><td class=\"view-rev\"><a href='/"+h.pasteid+"?rev="+h.nb_revision+"'>View</a></td></tr>"});e='<table class="revisionstable">'+e+"</table>";document.querySelector(".pasteHistory").innerHTML=e;a.snippet.classList.add("hidden");a.revisions.classList.remove("hidden");localizeDates()},"json");return false},toJSON:function(a){return a!==null?base2.JSON.toString(a):null}});var Diff=base2.Base.extend({constructor:function(){this.sourcetable=document.querySelector(".sourceTable");this.difftabular=document.querySelector(".difftabular");this.switcher=document.querySelector("#switch");this.sourcetable.classList.add("hidden");this.switcher.innerHTML='<span class="stab active">Tabular</span><span class="suni">Unified</span>';this.stab=this.switcher.querySelector(".stab");this.suni=this.switcher.querySelector(".suni");var a=this;this.stab.addEventListener("click",this.setTabular.bindAsEventListener(this),false);this.suni.addEventListener("click",this.setUnified.bindAsEventListener(this),false);this.setSettings();document.querySelector("#show-linenos").addEventListener("click",this.toggleLineNumber.bindAsEventListener(this),false)},setTabular:function(a){a.preventDefault();if(!this.sourcetable.classList.has("hidden")){this.sourcetable.classList.add("hidden")}this.difftabular.classList.remove("hidden");this.suni.classList.remove("active");this.stab.classList.add("active")},setUnified:function(a){a.preventDefault();if(!this.difftabular.classList.has("hidden")){this.difftabular.classList.add("hidden")}this.sourcetable.classList.remove("hidden");this.stab.classList.remove("active");this.suni.classList.add("active")},toggleLineNumber:function(a){document.querySelector("#paste").classList.toggle("hidenos");this.saveSettings()},setSettings:function(){Ajax.request({url:"/settings",dataType:"json",contentType:"application/json",method:"GET",success:function(a){document.querySelector("#show-linenos").checked=a.settings["showlinenos"];if(!a.settings["showlinenos"]){document.querySelector("#paste").classList.add("hidenos")}}})},saveSettings:function(){var d=document.querySelector("#factions");var b=true;var a=document.querySelector("#show-linenos:checked");if(!a){b=false}Ajax.request({url:d.action,dataType:"json",contentType:"application/json",method:"POST",data:this.toJSON({showlinenos:b}),success:function(e){}})},toJSON:function(a){return a!==null?base2.JSON.toString(a):null}});

static/js/src/friendpaste.js

 
         var targets = /#(.+)$/.exec(window.location);
         
-        if (targets[1] == "edit") {
+        if (targets && targets[1] == "edit") {
             this.snippet.classList.add("hidden");
             this.snippet_edit.classList.remove("hidden");
         } else {