var Prototype={Version:"1.5.0",BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:"(?:)((\n|\r|.)*?)(?:)",emptyFunction:function(){ },K:function(x){ return x; }}; var Class={create:function(){ return function(){ this.initialize.apply(this,arguments); }; }}; var Abstract=new Object(); Object.extend=function(_2,_3){ for(var _4 in _3){ _2[_4]=_3[_4]; } return _2; }; Object.extend(Object,{inspect:function(_5){ try{ if(_5===undefined){ return "undefined"; } if(_5===null){ return "null"; } return _5.inspect?_5.inspect():_5.toString(); } catch(e){ if(e instanceof RangeError){ return "..."; } throw e; } },keys:function(_6){ var _7=[]; for(var _8 in _6){ _7.push(_8); } return _7; },values:function(_9){ var _a=[]; for(var _b in _9){ _a.push(_9[_b]); } return _a; },clone:function(_c){ return Object.extend({},_c); }}); Function.prototype.bind=function(){ var _d=this,args=$A(arguments),object=args.shift(); return function(){ return _d.apply(object,args.concat($A(arguments))); }; }; Function.prototype.bindAsEventListener=function(_e){ var _f=this,args=$A(arguments),_e=args.shift(); return function(_10){ return _f.apply(_e,[(_10||window.event)].concat(args).concat($A(arguments))); }; }; Object.extend(Number.prototype,{toColorPart:function(){ var _11=this.toString(16); if(this<16){ return "0"+_11; } return _11; },succ:function(){ return this+1; },times:function(_12){ $R(0,this,true).each(_12); return this; }}); var Try={these:function(){ var _13; for(var i=0,length=arguments.length;i0){ if(match=source.match(_19)){ _1b+=source.slice(0,match.index); _1b+=String.interpret(_1a(match)); source=source.slice(match.index+match[0].length); }else{ _1b+=source,source=""; } } return _1b; },sub:function(_1c,_1d,_1e){ _1d=this.gsub.prepareReplacement(_1d); _1e=_1e===undefined?1:_1e; return this.gsub(_1c,function(_1f){ if(--_1e<0){ return _1f[0]; } return _1d(_1f); }); },scan:function(_20,_21){ this.gsub(_20,_21); return this; },truncate:function(_22,_23){ _22=_22||30; _23=_23===undefined?"...":_23; return this.length>_22?this.slice(0,_22-_23.length)+_23:this; },strip:function(){ return this.replace(/^\s+/,"").replace(/\s+$/,""); },stripTags:function(){ return this.replace(/<\/?[^>]+>/gi,""); },stripScripts:function(){ return this.replace(new RegExp(Prototype.ScriptFragment,"img"),""); },extractScripts:function(){ var _24=new RegExp(Prototype.ScriptFragment,"img"); var _25=new RegExp(Prototype.ScriptFragment,"im"); return (this.match(_24)||[]).map(function(_26){ return (_26.match(_25)||["",""])[1]; }); },evalScripts:function(){ return this.extractScripts().map(function(_27){ return eval(_27); }); },escapeHTML:function(){ var div=document.createElement("div"); var _29=document.createTextNode(this); div.appendChild(_29); return div.innerHTML; },unescapeHTML:function(){ var div=document.createElement("div"); div.innerHTML=this.stripTags(); return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(_2b,_2c){ return _2b+_2c.nodeValue; }):div.childNodes[0].nodeValue):""; },toQueryParams:function(_2d){ var _2e=this.strip().match(/([^?#]*)(#.*)?$/); if(!_2e){ return {}; } return _2e[1].split(_2d||"&").inject({},function(_2f,_30){ if((_30=_30.split("="))[0]){ var _31=decodeURIComponent(_30[0]); var _32=_30[1]?decodeURIComponent(_30[1]):undefined; if(_2f[_31]!==undefined){ if(_2f[_31].constructor!=Array){ _2f[_31]=[_2f[_31]]; } if(_32){ _2f[_31].push(_32); } }else{ _2f[_31]=_32; } } return _2f; }); },toArray:function(){ return this.split(""); },succ:function(){ return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1); },camelize:function(){ var _33=this.split("-"),len=_33.length; if(len==1){ return _33[0]; } var _34=this.charAt(0)=="-"?_33[0].charAt(0).toUpperCase()+_33[0].substring(1):_33[0]; for(var i=1;i=_6e){ _6e=_6f; } }); return _6e; },min:function(_71){ var _72; this.each(function(_73,_74){ _73=(_71||Prototype.K)(_73,_74); if(_72==undefined||_73<_72){ _72=_73; } }); return _72; },partition:function(_75){ var _76=[],falses=[]; this.each(function(_77,_78){ ((_75||Prototype.K)(_77,_78)?_76:falses).push(_77); }); return [_76,falses]; },pluck:function(_79){ var _7a=[]; this.each(function(_7b,_7c){ _7a.push(_7b[_79]); }); return _7a; },reject:function(_7d){ var _7e=[]; this.each(function(_7f,_80){ if(!_7d(_7f,_80)){ _7e.push(_7f); } }); return _7e; },sortBy:function(_81){ return this.map(function(_82,_83){ return {value:_82,criteria:_81(_82,_83)}; }).sort(function(_84,_85){ var a=_84.criteria,b=_85.criteria; return ab?1:0; }).pluck("value"); },toArray:function(){ return this.map(); },zip:function(){ var _87=Prototype.K,args=$A(arguments); if(typeof args.last()=="function"){ _87=args.pop(); } var _88=[this].concat(args).map($A); return this.map(function(_89,_8a){ return _87(_88.pluck(_8a)); }); },size:function(){ return this.toArray().length; },inspect:function(){ return "#"; }}; Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray}); var $A=Array.from=function(_8b){ if(!_8b){ return []; } if(_8b.toArray){ return _8b.toArray(); }else{ var _8c=[]; for(var i=0,length=_8b.length;i1?this:this[0]; },uniq:function(){ return this.inject([],function(_98,_99){ return _98.include(_99)?_98:_98.concat([_99]); }); },clone:function(){ return [].concat(this); },size:function(){ return this.length; },inspect:function(){ return "["+this.map(Object.inspect).join(", ")+"]"; }}); Array.prototype.toArray=Array.prototype.clone; function $w(_9a){ _9a=_9a.strip(); return _9a?_9a.split(/\s+/):[]; } if(window.opera){ Array.prototype.concat=function(){ var _9b=[]; for(var i=0,length=this.length;i"; }}); function $H(_b0){ if(_b0&&_b0.constructor==Hash){ return _b0; } return new Hash(_b0); } ObjectRange=Class.create(); Object.extend(ObjectRange.prototype,Enumerable); Object.extend(ObjectRange.prototype,{initialize:function(_b1,end,_b3){ this.start=_b1; this.end=end; this.exclusive=_b3; },_each:function(_b4){ var _b5=this.start; while(this.include(_b5)){ _b4(_b5); _b5=_b5.succ(); } },include:function(_b6){ if(_b6-1?"&":"?")+_c6; } try{ Ajax.Responders.dispatch("onCreate",this,this.transport); this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous); if(this.options.asynchronous){ setTimeout(function(){ this.respondToReadyState(1); }.bind(this),10); } this.transport.onreadystatechange=this.onStateChange.bind(this); this.setRequestHeaders(); var _c7=this.method=="post"?(this.options.postBody||_c6):null; this.transport.send(_c7); if(!this.options.asynchronous&&this.transport.overrideMimeType){ this.onStateChange(); } } catch(e){ this.dispatchException(e); } },onStateChange:function(){ var _c8=this.transport.readyState; if(_c8>1&&!((_c8==4)&&this._complete)){ this.respondToReadyState(this.transport.readyState); } },setRequestHeaders:function(){ var _c9={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"}; if(this.method=="post"){ _c9["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:""); if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){ _c9["Connection"]="close"; } } if(typeof this.options.requestHeaders=="object"){ var _ca=this.options.requestHeaders; if(typeof _ca.push=="function"){ for(var i=0,length=_ca.length;i=200&&this.transport.status<300); },respondToReadyState:function(_ce){ var _cf=Ajax.Request.Events[_ce]; var _d0=this.transport,json=this.evalJSON(); if(_cf=="Complete"){ try{ this._complete=true; (this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(_d0,json); } catch(e){ this.dispatchException(e); } if((this.getHeader("Content-type")||"text/javascript").strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){ this.evalResponse(); } } try{ (this.options["on"+_cf]||Prototype.emptyFunction)(_d0,json); Ajax.Responders.dispatch("on"+_cf,this,_d0,json); } catch(e){ this.dispatchException(e); } if(_cf=="Complete"){ this.transport.onreadystatechange=Prototype.emptyFunction; } },getHeader:function(_d1){ try{ return this.transport.getResponseHeader(_d1); } catch(e){ return null; } },evalJSON:function(){ try{ var _d2=this.getHeader("X-JSON"); return _d2?eval("("+_d2+")"):null; } catch(e){ return null; } },evalResponse:function(){ try{ return eval(this.transport.responseText); } catch(e){ this.dispatchException(e); } },dispatchException:function(_d3){ (this.options.onException||Prototype.emptyFunction)(this,_d3); Ajax.Responders.dispatch("onException",this,_d3); }}); Ajax.Updater=Class.create(); Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_d4,url,_d6){ this.container={success:(_d4.success||_d4),failure:(_d4.failure||(_d4.success?null:_d4))}; this.transport=Ajax.getTransport(); this.setOptions(_d6); var _d7=this.options.onComplete||Prototype.emptyFunction; this.options.onComplete=(function(_d8,_d9){ this.updateContent(); _d7(_d8,_d9); }).bind(this); this.request(url); },updateContent:function(){ var _da=this.container[this.success()?"success":"failure"]; var _db=this.transport.responseText; if(!this.options.evalScripts){ _db=_db.stripScripts(); } if(_da=$(_da)){ if(this.options.insertion){ new this.options.insertion(_da,_db); }else{ _da.update(_db); } } if(this.success()){ if(this.onComplete){ setTimeout(this.onComplete.bind(this),10); } } }}); Ajax.PeriodicalUpdater=Class.create(); Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_dc,url,_de){ this.setOptions(_de); this.onComplete=this.options.onComplete; this.frequency=(this.options.frequency||2); this.decay=(this.options.decay||1); this.updater={}; this.container=_dc; this.url=url; this.start(); },start:function(){ this.options.onComplete=this.updateComplete.bind(this); this.onTimerEvent(); },stop:function(){ this.updater.options.onComplete=undefined; clearTimeout(this.timer); (this.onComplete||Prototype.emptyFunction).apply(this,arguments); },updateComplete:function(_df){ if(this.options.decay){ this.decay=(_df.responseText==this.lastText?this.decay*this.options.decay:1); this.lastText=_df.responseText; } this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000); },onTimerEvent:function(){ this.updater=new Ajax.Updater(this.container,this.url,this.options); }}); function $(_e0){ if(arguments.length>1){ for(var i=0,elements=[],length=arguments.length;i"; },recursivelyCollect:function(_101,_102){ _101=$(_101); var _103=[]; while(_101=_101[_102]){ if(_101.nodeType==1){ _103.push(Element.extend(_101)); } } return _103; },ancestors:function(_104){ return $(_104).recursivelyCollect("parentNode"); },descendants:function(_105){ return $A($(_105).getElementsByTagName("*")); },immediateDescendants:function(_106){ if(!(_106=$(_106).firstChild)){ return []; } while(_106&&_106.nodeType!=1){ _106=_106.nextSibling; } if(_106){ return [_106].concat($(_106).nextSiblings()); } return []; },previousSiblings:function(_107){ return $(_107).recursivelyCollect("previousSibling"); },nextSiblings:function(_108){ return $(_108).recursivelyCollect("nextSibling"); },siblings:function(_109){ _109=$(_109); return _109.previousSiblings().reverse().concat(_109.nextSiblings()); },match:function(_10a,_10b){ if(typeof _10b=="string"){ _10b=new Selector(_10b); } return _10b.match($(_10a)); },up:function(_10c,_10d,_10e){ return Selector.findElement($(_10c).ancestors(),_10d,_10e); },down:function(_10f,_110,_111){ return Selector.findElement($(_10f).descendants(),_110,_111); },previous:function(_112,_113,_114){ return Selector.findElement($(_112).previousSiblings(),_113,_114); },next:function(_115,_116,_117){ return Selector.findElement($(_115).nextSiblings(),_116,_117); },getElementsBySelector:function(){ var args=$A(arguments),element=$(args.shift()); return Selector.findChildElements(element,args); },getElementsByClassName:function(_119,_11a){ return document.getElementsByClassName(_11a,_119); },readAttribute:function(_11b,name){ _11b=$(_11b); if(document.all&&!window.opera){ var t=Element._attributeTranslations; if(t.values[name]){ return t.values[name](_11b,name); } if(t.names[name]){ name=t.names[name]; } var _11e=_11b.attributes[name]; if(_11e){ return _11e.nodeValue; } } return _11b.getAttribute(name); },getHeight:function(_11f){ return $(_11f).getDimensions().height; },getWidth:function(_120){ return $(_120).getDimensions().width; },classNames:function(_121){ return new Element.ClassNames(_121); },hasClassName:function(_122,_123){ if(!(_122=$(_122))){ return; } var _124=_122.className; if(_124.length==0){ return false; } if(_124==_123||_124.match(new RegExp("(^|\\s)"+_123+"(\\s|$)"))){ return true; } return false; },addClassName:function(_125,_126){ if(!(_125=$(_125))){ return; } Element.classNames(_125).add(_126); return _125; },removeClassName:function(_127,_128){ if(!(_127=$(_127))){ return; } Element.classNames(_127).remove(_128); return _127; },toggleClassName:function(_129,_12a){ if(!(_129=$(_129))){ return; } Element.classNames(_129)[_129.hasClassName(_12a)?"remove":"add"](_12a); return _129; },observe:function(){ Event.observe.apply(Event,arguments); return $A(arguments).first(); },stopObserving:function(){ Event.stopObserving.apply(Event,arguments); return $A(arguments).first(); },cleanWhitespace:function(_12b){ _12b=$(_12b); var node=_12b.firstChild; while(node){ var _12d=node.nextSibling; if(node.nodeType==3&&!/\S/.test(node.nodeValue)){ _12b.removeChild(node); } node=_12d; } return _12b; },empty:function(_12e){ return $(_12e).innerHTML.match(/^\s*$/); },descendantOf:function(_12f,_130){ _12f=$(_12f),_130=$(_130); while(_12f=_12f.parentNode){ if(_12f==_130){ return true; } } return false; },scrollTo:function(_131){ _131=$(_131); var pos=Position.cumulativeOffset(_131); window.scrollTo(pos[0],pos[1]); return _131; },getStyle:function(_133,_134){ _133=$(_133); if(["float","cssFloat"].include(_134)){ _134=(typeof _133.style.styleFloat!="undefined"?"styleFloat":"cssFloat"); } _134=_134.camelize(); var _135=_133.style[_134]; if(!_135){ if(document.defaultView&&document.defaultView.getComputedStyle){ var css=document.defaultView.getComputedStyle(_133,null); _135=css?css[_134]:null; }else{ if(_133.currentStyle){ _135=_133.currentStyle[_134]; } } } if((_135=="auto")&&["width","height"].include(_134)&&(_133.getStyle("display")!="none")){ _135=_133["offset"+_134.capitalize()]+"px"; } if(window.opera&&["left","top","right","bottom"].include(_134)){ if(Element.getStyle(_133,"position")=="static"){ _135="auto"; } } if(_134=="opacity"){ if(_135){ return parseFloat(_135); } if(_135=(_133.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){ if(_135[1]){ return parseFloat(_135[1])/100; } } return 1; } return _135=="auto"?null:_135; },setStyle:function(_137,_138){ _137=$(_137); for(var name in _138){ var _13a=_138[name]; if(name=="opacity"){ if(_13a==1){ _13a=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1; if(/MSIE/.test(navigator.userAgent)&&!window.opera){ _137.style.filter=_137.getStyle("filter").replace(/alpha\([^\)]*\)/gi,""); } }else{ if(_13a===""){ if(/MSIE/.test(navigator.userAgent)&&!window.opera){ _137.style.filter=_137.getStyle("filter").replace(/alpha\([^\)]*\)/gi,""); } }else{ if(_13a<0.00001){ _13a=0; } if(/MSIE/.test(navigator.userAgent)&&!window.opera){ _137.style.filter=_137.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_13a*100+")"; } } } }else{ if(["float","cssFloat"].include(name)){ name=(typeof _137.style.styleFloat!="undefined")?"styleFloat":"cssFloat"; } } _137.style[name.camelize()]=_13a; } return _137; },getDimensions:function(_13b){ _13b=$(_13b); var _13c=$(_13b).getStyle("display"); if(_13c!="none"&&_13c!=null){ return {width:_13b.offsetWidth,height:_13b.offsetHeight}; } var els=_13b.style; var _13e=els.visibility; var _13f=els.position; var _140=els.display; els.visibility="hidden"; els.position="absolute"; els.display="block"; var _141=_13b.clientWidth; var _142=_13b.clientHeight; els.display=_140; els.position=_13f; els.visibility=_13e; return {width:_141,height:_142}; },makePositioned:function(_143){ _143=$(_143); var pos=Element.getStyle(_143,"position"); if(pos=="static"||!pos){ _143._madePositioned=true; _143.style.position="relative"; if(window.opera){ _143.style.top=0; _143.style.left=0; } } return _143; },undoPositioned:function(_145){ _145=$(_145); if(_145._madePositioned){ _145._madePositioned=undefined; _145.style.position=_145.style.top=_145.style.left=_145.style.bottom=_145.style.right=""; } return _145; },makeClipping:function(_146){ _146=$(_146); if(_146._overflow){ return _146; } _146._overflow=_146.style.overflow||"auto"; if((Element.getStyle(_146,"overflow")||"visible")!="hidden"){ _146.style.overflow="hidden"; } return _146; },undoClipping:function(_147){ _147=$(_147); if(!_147._overflow){ return _147; } _147.style.overflow=_147._overflow=="auto"?"":_147._overflow; _147._overflow=null; return _147; }}; Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf}); Element._attributeTranslations={}; Element._attributeTranslations.names={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"}; Element._attributeTranslations.values={_getAttr:function(_148,_149){ return _148.getAttribute(_149,2); },_flag:function(_14a,_14b){ return $(_14a).hasAttribute(_14b)?_14b:null; },style:function(_14c){ return _14c.style.cssText.toLowerCase(); },title:function(_14d){ var node=_14d.getAttributeNode("title"); return node.specified?node.nodeValue:null; }}; Object.extend(Element._attributeTranslations.values,{href:Element._attributeTranslations.values._getAttr,src:Element._attributeTranslations.values._getAttr,disabled:Element._attributeTranslations.values._flag,checked:Element._attributeTranslations.values._flag,readonly:Element._attributeTranslations.values._flag,multiple:Element._attributeTranslations.values._flag}); Element.Methods.Simulated={hasAttribute:function(_14f,_150){ var t=Element._attributeTranslations; _150=t.names[_150]||_150; return $(_14f).getAttributeNode(_150).specified; }}; if(document.all&&!window.opera){ Element.Methods.update=function(_152,html){ _152=$(_152); html=typeof html=="undefined"?"":html.toString(); var _154=_152.tagName.toUpperCase(); if(["THEAD","TBODY","TR","TD"].include(_154)){ var div=document.createElement("div"); switch(_154){ case "THEAD": case "TBODY": div.innerHTML=""+html.stripScripts()+"
"; depth=2; break; case "TR": div.innerHTML=""+html.stripScripts()+"
"; depth=3; break; case "TD": div.innerHTML="
"+html.stripScripts()+"
"; depth=4; } $A(_152.childNodes).each(function(node){ _152.removeChild(node); }); depth.times(function(){ div=div.firstChild; }); $A(div.childNodes).each(function(node){ _152.appendChild(node); }); }else{ _152.innerHTML=html.stripScripts(); } setTimeout(function(){ html.evalScripts(); },10); return _152; }; } Object.extend(Element,Element.Methods); var _nativeExtensions=false; if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){ ["","Form","Input","TextArea","Select"].each(function(tag){ var _159="HTML"+tag+"Element"; if(window[_159]){ return; } var _15a=window[_159]={}; _15a.prototype=document.createElement(tag?tag.toLowerCase():"div").__proto__; }); } Element.addMethods=function(_15b){ Object.extend(Element.Methods,_15b||{}); function copy(_15c,_15d,_15e){ _15e=_15e||false; var _15f=Element.extend.cache; for(var _160 in _15c){ var _161=_15c[_160]; if(!_15e||!(_160 in _15d)){ _15d[_160]=_15f.findOrStore(_161); } } } if(typeof HTMLElement!="undefined"){ copy(Element.Methods,HTMLElement.prototype); copy(Element.Methods.Simulated,HTMLElement.prototype,true); copy(Form.Methods,HTMLFormElement.prototype); [HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(_162){ copy(Form.Element.Methods,_162.prototype); }); _nativeExtensions=true; } }; var Toggle=new Object(); Toggle.display=Element.toggle; Abstract.Insertion=function(_163){ this.adjacency=_163; }; Abstract.Insertion.prototype={initialize:function(_164,_165){ this.element=$(_164); this.content=_165.stripScripts(); if(this.adjacency&&this.element.insertAdjacentHTML){ try{ this.element.insertAdjacentHTML(this.adjacency,this.content); } catch(e){ var _166=this.element.tagName.toUpperCase(); if(["TBODY","TR"].include(_166)){ this.insertContent(this.contentFromAnonymousTable()); }else{ throw e; } } }else{ this.range=this.element.ownerDocument.createRange(); if(this.initializeRange){ this.initializeRange(); } this.insertContent([this.range.createContextualFragment(this.content)]); } setTimeout(function(){ _165.evalScripts(); },10); },contentFromAnonymousTable:function(){ var div=document.createElement("div"); div.innerHTML=""+this.content+"
"; return $A(div.childNodes[0].childNodes[0].childNodes); }}; var Insertion=new Object(); Insertion.Before=Class.create(); Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){ this.range.setStartBefore(this.element); },insertContent:function(_168){ _168.each((function(_169){ this.element.parentNode.insertBefore(_169,this.element); }).bind(this)); }}); Insertion.Top=Class.create(); Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){ this.range.selectNodeContents(this.element); this.range.collapse(true); },insertContent:function(_16a){ _16a.reverse(false).each((function(_16b){ this.element.insertBefore(_16b,this.element.firstChild); }).bind(this)); }}); Insertion.Bottom=Class.create(); Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){ this.range.selectNodeContents(this.element); this.range.collapse(this.element); },insertContent:function(_16c){ _16c.each((function(_16d){ this.element.appendChild(_16d); }).bind(this)); }}); Insertion.After=Class.create(); Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){ this.range.setStartAfter(this.element); },insertContent:function(_16e){ _16e.each((function(_16f){ this.element.parentNode.insertBefore(_16f,this.element.nextSibling); }).bind(this)); }}); Element.ClassNames=Class.create(); Element.ClassNames.prototype={initialize:function(_170){ this.element=$(_170); },_each:function(_171){ this.element.className.split(/\s+/).select(function(name){ return name.length>0; })._each(_171); },set:function(_173){ this.element.className=_173; },add:function(_174){ if(this.include(_174)){ return; } this.set($A(this).concat(_174).join(" ")); },remove:function(_175){ if(!this.include(_175)){ return; } this.set($A(this).without(_175).join(" ")); },toString:function(){ return $A(this).join(" "); }}; Object.extend(Element.ClassNames.prototype,Enumerable); var Selector=Class.create(); Selector.prototype={initialize:function(_176){ this.params={classNames:[]}; this.expression=_176.toString().strip(); this.parseExpression(); this.compileMatcher(); },parseExpression:function(){ function abort(_177){ throw "Parse error in selector: "+_177; } if(this.expression==""){ abort("empty expression"); } var _178=this.params,expr=this.expression,match,modifier,clause,rest; while(match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){ _178.attributes=_178.attributes||[]; _178.attributes.push({name:match[2],operator:match[3],value:match[4]||match[5]||""}); expr=match[1]; } if(expr=="*"){ return this.params.wildcard=true; } while(match=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){ modifier=match[1],clause=match[2],rest=match[3]; switch(modifier){ case "#": _178.id=clause; break; case ".": _178.classNames.push(clause); break; case "": case undefined: _178.tagName=clause.toUpperCase(); break; default: abort(expr.inspect()); } expr=rest; } if(expr.length>0){ abort(expr.inspect()); } },buildMatchExpression:function(){ var _179=this.params,conditions=[],clause; if(_179.wildcard){ conditions.push("true"); } if(clause=_179.id){ conditions.push("element.readAttribute(\"id\") == "+clause.inspect()); } if(clause=_179.tagName){ conditions.push("element.tagName.toUpperCase() == "+clause.inspect()); } if((clause=_179.classNames).length>0){ for(var i=0,length=clause.length;i=0?this.optionValue(_1ba.options[_1bb]):null; },selectMany:function(_1bc){ var _1bd,length=_1bc.length; if(!length){ return null; } for(var i=0,_1bd=[];i=this.offset[1]&&y=this.offset[0]&&x=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp