<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>Dj Wolfie</title>
  <link rel="alternate" href="http://maildist.mode3.com/cgi-bin/mail.cgi/list/djwolfie_list/"/>
  <link rel="self"      href="http://maildist.mode3.com/cgi-bin/mail.cgi/archive_atom/djwolfie_list/"/>
  
  <updated>2010-03-12T07:52:48Z</updated>
  <author>
    <name>Dj Wolfie List Owner</name>
     
    <email>&#x64;&#106;&#119;&#111;&#108;&#102;&#105;&#x65;&#x40;&#x64;&#106;&#119;&#x6F;&#108;&#x66;&#x69;&#101;&#x2E;&#x63;&#111;&#109;</email>
  </author>
  <id>http://maildist.mode3.com/cgi-bin/mail.cgi</id>
 
  <generator>Dada Mail 2.10.15</generator>
 

  <entry>
    <title>my bad... red loft party take two...</title>
    <link rel="alternate" href="http://maildist.mode3.com/cgi-bin/mail.cgi/archive/djwolfie_list/20100205193728/"/>
    <id>tag:maildist.mode3.com,2010-02-05:%2Fcgi-bin%2Fmail.cgi%2Farchive%2Fdjwolfie_list%2F20100205193728%2F</id>
    
    <published>2010-02-05T19:37:28Z</published>
    <updated>2010-02-05T19:37:28Z</updated>
    <content type="html">&lt;p&gt;first time I tried sending a webpage with the list. Yeah, didnt work so well. Heres the info in a more readable fashion:&lt;br /&gt;
&lt;br /&gt;
So Paynie just got a new loft, and we are christening it on saturday feb 6th, 9pm to laaaate.  &lt;br /&gt;
$10 bucks, RSVP at the following website to get the address.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://web.me.com/paynie/THE*RED*LOFT/101.html&quot;&gt;http://web.me.com/paynie/THE*RED*LOFT/101.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Dj Eevil&lt;br /&gt;
Dj Jesse Wright, &lt;br /&gt;
Dj Wolfie, &lt;br /&gt;
&lt;br /&gt;
and a live pianist to close out the evening. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------------------------------- &lt;br /&gt;
HTTP://WWW.DJWOLFIE.COM For photos, directions, and more information. &lt;br /&gt;
You are subscribed as: &amp;#x65;&amp;#120;&amp;#97;&amp;#109;&amp;#x70;&amp;#x6C;&amp;#x65;&amp;#64;&amp;#101;&amp;#x78;&amp;#x61;&amp;#x6D;&amp;#x70;&amp;#x6C;&amp;#x65;&amp;#46;&amp;#99;&amp;#x6F;&amp;#x6D; :: To Join click here: &amp;#60;&lt;a href=&quot;http://maildist.mode3.com/cgi-bin/mail.cgi/list/djwolfie_list&amp;#62;::to&quot;&gt;http://maildist.mode3.com/cgi-bin/mail.cgi/list/djwolfie_list&amp;#62;::to&lt;/a&gt; unsubscribe:&amp;#60;&lt;a href=&quot;http://maildist.mode3.com/cgi-bin/mail.cgi/u/djwolfie_list/&amp;gt&quot;&gt;http://maildist.mode3.com/cgi-bin/mail.cgi/u/djwolfie_list/&amp;gt&lt;/a&gt;;&lt;br /&gt;
-------------------------------&lt;br /&gt;
&lt;br /&gt;
Mailing List Powered by Dada Mail&lt;br /&gt;
&lt;a href=&quot;http://maildist.mode3.com/cgi-bin/mail.cgi/what_is_dada_mail/&quot;&gt;http://maildist.mode3.com/cgi-bin/mail.cgi/what_is_dada_mail/&lt;/a&gt;&lt;/p&gt;

    	&lt;!-- begin feed_subscription_form_widget.tmpl --&gt; 

	&lt;hr /&gt; 
	
	&lt;p&gt;
	 Subscribe to 
	  &lt;a href=&quot;http://maildist.mode3.com/cgi-bin/mail.cgi/list/djwolfie_list/&quot;&gt;
	   Dj Wolfie
	  &lt;/a&gt;
	 via email by entering your email address below:  
	&lt;/p&gt;
	
	&lt;!-- begin list_subscribe_form.tmpl --&gt;

&lt;form action=&quot;http://maildist.mode3.com/cgi-bin/mail.cgi&quot; method=&quot;post&quot;&gt;
 &lt;p&gt;
  
 
	  
	  
	   

	  		&lt;input type=&quot;radio&quot; name=&quot;f&quot; value=&quot;subscribe&quot; id=&quot;subscribe&quot; style=&quot;background-color:transparent&quot; checked=&quot;checked&quot; /&gt;
	  		&lt;label for=&quot;subscribe&quot;&gt;Subscribe&lt;/label&gt; | 
	  
	  
	        &lt;input type=&quot;radio&quot; name=&quot;f&quot; value=&quot;u&quot;         id=&quot;u&quot;         style=&quot;background-color:transparent&quot; /&gt;
	        &lt;label for=&quot;u&quot;&gt;Unsubscribe&lt;/label&gt;
	  
	  

  
  &lt;br /&gt;
  &lt;input type=&quot;text&quot;   name=&quot;email&quot; value=&quot;&quot; maxlength=&quot;1024&quot; /&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;list&quot;  value=&quot;djwolfie_list&quot;  /&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Submit&quot; class=&quot;processing&quot; /&gt;
 &lt;/p&gt;
&lt;/form&gt;



&lt;!-- end list_subscribe_form.tmpl --&gt;
 

&lt;!-- end feed_subscription_form_widget.tmpl --&gt; 

     
    </content>
  </entry>

 

  <entry>
    <title>the return of paynies red loft Saturday</title>
    <link rel="alternate" href="http://maildist.mode3.com/cgi-bin/mail.cgi/archive/djwolfie_list/20100205193318/"/>
    <id>tag:maildist.mode3.com,2010-02-05:%2Fcgi-bin%2Fmail.cgi%2Farchive%2Fdjwolfie_list%2F20100205193318%2F</id>
    
    <published>2010-02-05T19:33:18Z</published>
    <updated>2010-02-05T19:33:18Z</updated>
    <content type="html">
  &lt;div class=&quot;outerBackground&quot;&gt;
&lt;center&gt;
	&lt;table class=&quot;outstyletable&quot; cellpadding=0 cellspacing=0&gt;
&lt;tr&gt;
	&lt;td class=&quot;boxTop&quot; colspan=&quot;3&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td class=&quot;boxLeft&quot;&gt;&lt;/td&gt;
	&lt;td&gt;

			&lt;table class=&quot;centerTable&quot;&gt;
				&lt;tr&gt;&lt;td class=&quot;alert&quot;&gt;&lt;div class=&quot;dotmacWarning&quot;&gt;&lt;/div&gt;&lt;/td&gt;
					&lt;td&gt;&lt;div class=&quot;heading&quot;&gt;Looking for something on MobileMe?&lt;/div&gt;
						&lt;div class=&quot;textStyle&quot;&gt;We can't find the page you requested. Please make sure the URL is spelled and capitalized correctly, and try again.&lt;/div&gt;
						&lt;div class=&quot;textStyle languageLinks&quot;&gt;
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.me.com&quot;&gt;MobileMe Login
							&lt;/a&gt;&amp;#160;|&amp;#160;
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.apple.com&amp;#47;support&amp;#47;mobileme&amp;#47;ww&quot;&gt;MobileMe Support
							&lt;/a&gt;&amp;#160;|&amp;#160;				   		  					
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.apple.com&amp;#47;mobileme&quot;&gt;Learn more...&lt;/a&gt; 
						&lt;/div&gt;
					&lt;/td&gt;
				&lt;/tr&gt;
				&lt;tr&gt;
					&lt;td colspan=&quot;2&quot;&gt;&lt;div class=&quot;hrstyle&quot;/&gt;&lt;/td&gt;
				&lt;/tr&gt;
				&lt;tr&gt;&lt;td&gt;&amp;#160;&lt;/td&gt;
					&lt;td&gt;
						&lt;div class=&quot;subTitle&quot;&gt;Sie suchen etwas auf MobileMe?&lt;/div&gt;
						&lt;div class=&quot;textStyle&quot;&gt;Die angeforderte Seite kann nicht gefunden werden. Vergewissern Sie sich, dass die URL richtig geschrieben ist, und versuchen Sie es dann erneut. &lt;/div&gt;
						&lt;div class=&quot;textStyle languageLinks&quot;&gt;
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.me.com&quot;&gt;MobileMe-Anmeldung
							&lt;/a&gt;&amp;#160;|&amp;#160;
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.apple.com&amp;#47;support&amp;#47;mobileme&amp;#47;ww&quot;&gt;MobileMe-Support
							&lt;/a&gt;&amp;#160;|&amp;#160;				   		  					
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.apple.com&amp;#47;de&amp;#47;mobileme&quot;&gt;Weitere Informationen...&lt;/a&gt; 
						&lt;/div&gt;
					&lt;/td&gt;
				&lt;/tr&gt;
				&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;div class=&quot;hrstyle&quot;/&gt;&lt;/td&gt;&lt;/tr&gt;
				&lt;tr&gt;&lt;td&gt;&amp;#160;&lt;/td&gt;
					&lt;td&gt;
						&lt;div class=&quot;subTitle&quot;&gt;Que cherchez-vous dans MobileMe ?&lt;/div&gt;
						&lt;div class=&quot;textStyle&quot;&gt;Nous ne trouvons pas la page que vous avez demandée. Vérifiez que vous avez saisi correctement l'URL et utilisé la casse appropriée, puis réessayez.&lt;/div&gt;
						&lt;div class=&quot;textStyle languageLinks&quot;&gt;
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.me.com&quot;&gt;Connexion à MobileMe
							&lt;/a&gt;&amp;#160;|&amp;#160;
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.apple.com&amp;#47;support&amp;#47;mobileme&amp;#47;ww&quot;&gt;Support MobileMe
							&lt;/a&gt;&amp;#160;|&amp;#160;				   		  					
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.apple.com&amp;#47;fr&amp;#47;mobileme&quot;&gt;En savoir plus...&lt;/a&gt; 
						&lt;/div&gt;
					&lt;/td&gt;
				&lt;/tr&gt;
				&lt;tr &gt;&lt;td colspan=&quot;2&quot;&gt;&lt;div class=&quot;hrstyle&quot;/&gt;&lt;/td&gt;&lt;/tr&gt;
				&lt;tr&gt;&lt;td&gt;&amp;#160;&lt;/td&gt;
					&lt;td&gt;
						&lt;div class=&quot;subTitle&quot;&gt;MobileMeで何かお探しですか？&lt;/div&gt;
						&lt;div class=&quot;textStyle&quot;&gt;お探しのページが見つかりません。スペルや大文字・小文字などURLが正しく入力されているか確認し、再度お試しください。&lt;/div&gt;
						&lt;div class=&quot;textStyle languageLinks&quot;&gt;
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.me.com&quot;&gt;MobileMeログイン
							&lt;/a&gt;&amp;#160;|&amp;#160;
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.apple.com&amp;#47;support&amp;#47;mobileme&amp;#47;ww&quot;&gt;MobileMeサポート
							&lt;/a&gt;&amp;#160;|&amp;#160;				   		  					
							&lt;a href=&quot;http:&amp;#47;&amp;#47;www.apple.com&amp;#47;jp&amp;#47;mobileme&quot;&gt;詳細はこちら...&lt;/a&gt; 
						&lt;/div&gt;
					&lt;/td&gt;
				&lt;/tr&gt;
			&lt;/table&gt;
			&lt;/td&gt;
	&lt;td class=&quot;boxRight&quot;&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td class=&quot;boxBottom&quot; colspan=&quot;3&quot;&gt;&lt;/td&gt;
	&lt;/tr&gt;

			&lt;tr&gt;
		&lt;td height=&quot;50&quot; colspan=&quot;3&quot;&gt;
			&lt;div class=&quot;copyRight&quot;&gt;
				&amp;#169; Copyright 2009 Apple Inc.&lt;/div&gt;
				&lt;div class=&quot;footerAppleImage&quot;&gt;&lt;/div&gt;
			&lt;/div&gt;
		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;/table&gt;

	&lt;/center&gt;
&lt;/div&gt;


    &lt;!-- Include Site Javascript --&gt;
      
&lt;!-- http://www.me.com/my/prototype/en/rz6/javascript.js --&gt;
&lt;script  type=&quot;text/javascript&quot; &gt;
&lt;!--
var Prototype={Version:&quot;1.6.0.3&quot;,Browser:{IE:!!(window.attachEvent&amp;&amp;navigator.userAgent.indexOf(&quot;Opera&quot;)===-1),Opera:navigator.userAgent.indexOf(&quot;Opera&quot;)&gt;-1,WebKit:navigator.userAgent.indexOf(&quot;AppleWebKit/&quot;)&gt;-1,Gecko:navigator.userAgent.indexOf(&quot;Gecko&quot;)&gt;-1&amp;&amp;navigator.userAgent.indexOf(&quot;KHTML&quot;)===-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement(&quot;div&quot;)[&quot;__proto__&quot;]&amp;&amp;document.createElement(&quot;div&quot;)[&quot;__proto__&quot;]!==document.createElement(&quot;form&quot;)[&quot;__proto__&quot;]},ScriptFragment:&quot;&lt;script[^&gt;]*&gt;([\\S\\s]*?)&lt;\/script&gt;&quot;,JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class={create:function(){var e=null,d=$A(arguments);if(Object.isFunction(d[0])){e=d.shift()}funct
ion a(){this.initialize.apply(this,arguments)}Object.extend(a,Class.Methods);a.superclass=e;a.subclasses=[];if(e){var b=function(){};b.prototype=e.prototype;a.prototype=new b;e.subclasses.push(a)}for(var c=0;c&lt;d.length;c++){a.addMethods(d[c])}if(!a.prototype.initialize){a.prototype.initialize=Prototype.emptyFunction}a.prototype.constructor=a;return a}};Class.Methods={addMethods:function(g){var c=this.superclass&amp;&amp;this.superclass.prototype;var b=Object.keys(g);if(!Object.keys({toString:true}).length){b.push(&quot;toString&quot;,&quot;valueOf&quot;)}for(var a=0,d=b.length;a&lt;d;a++){var f=b[a],e=g[f];if(c&amp;&amp;Object.isFunction(e)&amp;&amp;e.argumentNames().first()==&quot;$super&quot;){var h=e;e=(function(i){return function(){return c[i].apply(this,arguments)}})(f).wrap(h);e.valueOf=h.valueOf.bind(h);e.toString=h.toString.bind(h)}this.prototype[f]=e}return this}};var Abstract={};Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};Object.extend(Object,{inspect:function(a){try{if(Object.isUndefined(a)){return&quot;undefined&quot;}if(a===null){return&quot;null&quot;}return a.inspect?a.inspect():String(a)}catch(b){if(b instanceof RangeError){return&quot;...&quot;}throw b}},toJSON:function(a){var c=typeof a;switch(c){case&quot;undefined&quot;:case&quot;function&quot;:case&quot;unknown&quot;:return;case&quot;boolean&quot;:return a.toString()}if(a===null){return&quot;null&quot;}if(a.toJSON){return a.toJSON()}if(Object.isElement(a)){return}var b=[];for(var e in a){var d=Object.toJSON(a[e]);if(!Object.isUndefined(d)){b.push(e.toJSON()+&quot;: &quot;+d)}}return&quot;{&quot;+b.join(&quot;, &quot;)+&quot;}&quot;},toQueryString:function(a){return $H(a).toQueryString()},toHTML:function(a){return a&amp;&amp;a.toHTML?a.toHTML():String.interpret(a)},keys:function(a){var b=[];for(var c in a){b.push(c)}return b},values:function(b){var a=[];for(var c in b){a.push(b[c])}return a},clone:function(a){return Object.extend({},a)},isElement:function(a){return !!(a&amp;&amp;a.nodeType==1)},isArray:function(a){return a!=null&amp;&amp;typeof a==&quot;object&quot;&amp;&amp;&quot;splice&quot; in a&amp;&amp;&quot;join&quot; in a},isHash:function(a){return a instanceof Hash},isFunction:function(a){return typeof a==&quot;function&quot;},isString:function(a){return typeof a==&quot;string&quot;},isNumber:function(a){return typeof a==&quot;number&quot;},isUndefined:function(a){return typeof a==&quot;undefined&quot;}});Object.extend(Function.prototype,{argumentNames:function(){var a=this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1].replace(/\s+/g,&quot;&quot;).split(&quot;,&quot;);return a.length==1&amp;&amp;!a[0]?[]:a},bind:function(){if(arguments.length&lt;2&amp;&amp;Object.isUndefined(arguments[0])){return this}var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}},bindAsEventListener:function(){var a=this,c=$A(arguments),b=c.shift();return function(d){return a.apply(b,[d||window.event].concat(c))}},curry:function(){if(!arguments.length){return this}var a=this,b=$A(arguments);return function(){return a.apply(this,b.concat($A(arguments)))}},delay:function(){var a=this,b=$A(arguments),c=b.shift()*1000;return window.setTimeout(function(){return a.apply(a,b)},c)},defer:function(){var a=[0.01].concat($A(arguments));return this.delay.apply(this,a)},wrap:function(b){var a=this;return function(){return b.apply(this,[a.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var a=this;return this._methodized=function(){return a.apply(null,[this].concat($A(arguments)))}}});Date.prototype.toJSON=function(){return'&quot;'+this.getUTCFullYear()+&quot;-&quot;+(this.getUTCMonth()+1).toPaddedString(2)+&quot;-&quot;+this.getUTCDate().toPaddedString(2)+&quot;T&quot;+this.getUTCHours().toPaddedString(2)+&quot;:&quot;+this.getUTCMinutes().toPaddedString(2)+&quot;:&quot;+this.getUTCSeconds().toPaddedString(2)+'Z&quot;'};var Try={these:function(){var c;for(var b=0,d=arguments.length;b&lt;d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,&quot;\\$1&quot;)};var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(a){return a==null?&quot;&quot;:String(a)},specialChar:{&quot;\b&quot;:&quot;\\b&quot;,&quot;\t&quot;:&quot;\\t&quot;,&quot;\n&quot;:&quot;\\n&quot;,&quot;\f&quot;:&quot;\\f&quot;,&quot;\r&quot;:&quot;\\r&quot;,&quot;\\&quot;:&quot;\\\\&quot;}});Object.extend(String.prototype,{gsub:function(e,c){var a=&quot;&quot;,d=this,b;c=arguments.callee.prepareReplacement(c);while(d.length&gt;0){if(b=d.match(e)){a+=d.slice(0,b.index);a+=String.interpret(c(b));d=d.slice(b.index+b[0].length)}else{a+=d,d=&quot;&quot;}}return a},sub:function(c,a,b){a=this.gsub.prepareReplacement(a);b=Object.isUndefined(b)?1:b;return this.gsub(c,function(d){if(--b&lt;0){return d[0]}return a(d)})},scan:function(b,a){this.gsub(b,a);return String(this)},truncate:function(b,a){b=b||30;a=Object.isUndefined(a)?&quot;...&quot;:a;return this.length&gt;b?this.slice(0,b-a.length)+a:String(this)},strip:function(){return this.replace(/^\s+/,&quot;&quot;).replace(/\s+$/,&quot;&quot;)},stripTags:function(){return this.replace(/&lt;\/?[^&gt;]+&gt;/gi,&quot;&quot;)},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,&quot;img&quot;),&quot;&quot;)},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,&quot;img&quot;);var a=new RegExp(Prototype.ScriptFragment,&quot;im&quot;);return(this.match(b)||[]).map(function(c){return(c.match(a)||[&quot;&quot;,&quot;&quot;])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var a=arguments.callee;a.text.data=this;return a.div.innerHTML},unescapeHTML:function(){var a=new Element(&quot;div&quot;);a.innerHTML=this.stripTags();return a.childNodes[0]?(a.childNodes.length&gt;1?$A(a.childNodes).inject(&quot;&quot;,function(b,c){return b+c.nodeValue}):a.childNodes[0].nodeValue):&quot;&quot;},toQueryParams:function(b){var a=this.strip().match(/([^?#]*)(#.*)?$/);if(!a){return{}}return a[1].split(b||&quot;&amp;&quot;).inject({},function(e,f){if((f=f.split(&quot;=&quot;))[0]){var c=decodeURIComponent(f.shift());var d=f.length&gt;1?f.join(&quot;=&quot;):f[0];if(d!=undefined){d=decodeURIComponent(d)}if(c in e){if(!Object.isArray(e[c])){e[c]=[e[c]]}e[c].push(d)}else{e[c]=d}}return e})},toArray:function(){return this.split(&quot;&quot;)},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(a){return a&lt;1?&quot;&quot;:new Array(a+1).join(this)},camelize:function(){var d=this.split(&quot;-&quot;),a=d.length;if(a==1){return d[0]}var c=this.charAt(0)==&quot;-&quot;?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];for(var b=1;b&lt;a;b++){c+=d[b].charAt(0).toUpperCase()+d[b].substring(1)}return c},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,&quot;/&quot;).gsub(/([A-Z]+)([A-Z][a-z])/,&quot;#{1}_#{2}&quot;).gsub(/([a-z\d])([A-Z])/,&quot;#{1}_#{2}&quot;).gsub(/-/,&quot;_&quot;).toLowerCase()},dasherize:function(){return this.gsub(/_/,&quot;-&quot;)},inspect:function(b){var a=this.gsub(/[\x00-\x1f\\]/,function(c){var d=String.specialChar[c[0]];return d?d:&quot;\\u00&quot;+c[0].charCodeAt().toPaddedString(2,16)});if(b){return'&quot;'+a.replace(/&quot;/g,'\\&quot;')+'&quot;'}return&quot;'&quot;+a.replace(/'/g,&quot;\\'&quot;)+&quot;'&quot;},toJSON:function(){return this.inspect(true)},unfilterJSON:function(a){return this.sub(a||Prototype.JSONFilter,&quot;#{1}&quot;)},isJSON:function(){var a=this;if(a.blank()){return false}a=this.replace(/\\./g,&quot;@&quot;).replace(/&quot;[^&quot;\\\n\r]*&quot;/g,&quot;&quot;);return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(a)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval(&quot;(&quot;+json+&quot;)&quot;)}}catch(e){}throw new SyntaxError(&quot;Badly formed JSON string: &quot;+this.inspect())},include:function(a){return this.indexOf(a)&gt;-1},startsWith:function(a){return this.indexOf(a)===0},endsWith:function(a){var b=this.length-a.length;return b&gt;=0&amp;&amp;this.lastIndexOf(a)===b},empty:function(){return this==&quot;&quot;},blank:function(){return/^\s*$/.test(this)},interpolate:function(a,b){return new Template(this,b).evaluate(a)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&amp;/g,&quot;&amp;#38;&quot;).replace(/&lt;/g,&quot;&amp;#60;&quot;).replace(/&gt;/g,&quot;&amp;#62;&quot;)},unescapeHTML:function(){return this.stripTags().replace(/&amp;#38;/g,&quot;&amp;&quot;).replace(/&amp;#60;/g,&quot;&lt;&quot;).replace(/&amp;#62;/g,&quot;&gt;&quot;)}})}String.prototype.gsub.prepareReplacement=function(b){if(Object.isFunction(b)){return b}var a=new Template(b);return function(c){return a.evaluate(c)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement(&quot;div&quot;),text:document.createTextNode(&quot;&quot;)});String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(d){if(a==null){return&quot;&quot;}var f=d[1]||&quot;&quot;;if(f==&quot;\\&quot;){return d[2]}var b=a,g=d[3];var e=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=e.exec(g);if(d==null){return f}while(d!=null){var c=d[1].startsWith(&quot;[&quot;)?d[2].gsub(&quot;\\\\]&quot;,&quot;]&quot;):d[1];b=b[c];if(null==b||&quot;&quot;==d[3]){break}g=g.substring(&quot;[&quot;==d[3]?d[1].length:d[0].length);d=e.exec(g)}return f+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(c,b){var a=0;try{this._each(function(e){c.call(b,e,a++)})}catch(d){if(d!=$break){throw d}}return this},eachSlice:function(d,c,b){var a=-d,e=[],f=this.toArray();if(d&lt;1){return f}while((a+=d)&lt;f.length){e.push(f.slice(a,a+d))}return e.collect(c,b)},all:function(c,b){c=c||Prototype.K;var a=true;this.each(function(e,d){a=a&amp;&amp;!!c.call(b,e,d);if(!a){throw $break}});return a},any:function(c,b){c=c||Prototype.K;var a=false;this.each(function(e,d){if(a=!!c.call(b,e,d)){throw $break}});return a},collect:function(c,b){c=c||Prototype.K;var a=[];this.each(function(e,d){a.push(c.call(b,e,d))});return a},detect:function(c,b){var a;this.each(function(e,d){if(c.call(b,e,d)){a=e;throw $break}});return a},findAll:function(c,b){var a=[];this.each(function(e,d){if(c.call(b,e,d)){a.push(e)}});return a},grep:function(d,c,b){c=c||Prototype.K;var a=[];if(Object.isString(d)){d=new RegExp(d)}this.each(function(f,e){if(d.match(f)){a.push(c.call(b,f,e))}});return a},include:function(a){if(Object.isFunction(this.indexOf)){if(this.indexOf(a)!=-1){return true}}var b=false;this.each(function(c){if(c==a){b=true;throw $break}});return b},inGroupsOf:function(b,a){a=Object.isUndefined(a)?null:a;return this.eachSlice(b,function(c){while(c.length&lt;b){c.push(a)}return c})},inject:function(a,c,b){this.each(function(e,d){a=c.call(b,a,e,d)});return a},invoke:function(b){var a=$A(arguments).slice(1);return this.map(function(c){return c[b].apply(c,a)})},max:function(c,b){c=c||Prototype.K;var a;this.each(function(e,d){e=c.call(b,e,d);if(a==null||e&gt;=a){a=e}});return a},min:function(c,b){c=c||Prototype.K;var a;this.each(function(e,d){e=c.call(b,e,d);if(a==null||e&lt;a){a=e}});return a},partition:function(d,b){d=d||Prototype.K;var c=[],a=[];this.each(function(f,e){(d.call(b,f,e)?c:a).push(f)});return[c,a]},pluck:function(b){var a=[];this.each(function(c){a.push(c[b])});return a},reject:function(c,b){var a=[];this.each(function(e,d){if(!c.call(b,e,d)){a.push(e)}});return a},sortBy:function(b,a){return this.map(function(d,c){return{value:d,criteria:b.call(a,d,c)}}).sort(function(f,e){var d=f.criteria,c=e.criteria;return d&lt;c?-1:d&gt;c?1:0}).pluck(&quot;value&quot;)},toArray:function(){return this.map()},zip:function(){var b=Prototype.K,a=$A(arguments);if(Object.isFunction(a.last())){b=a.pop()}var c=[this].concat(a).map($A);return this.map(function(e,d){return b(c.pluck(d))})},size:function(){return this.toArray().length},inspect:function(){return&quot;#&lt;Enumerable:&quot;+this.toArray().inspect()+&quot;&gt;&quot;}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(c){if(!c){return[]}if(c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}if(Prototype.Browser.WebKit){$A=function(c){if(!c){return[]}if(!(typeof c===&quot;function&quot;&amp;&amp;typeof c.length===&quot;number&quot;&amp;&amp;typeof c.item===&quot;function&quot;)&amp;&amp;c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(b){for(var a=0,c=this.length;a&lt;c;a++){b(this[a])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(b,a){return b.concat(Object.isArray(a)?a.flatten():[a])})},without:function(){var a=$A(arguments);return this.select(function(b){return !a.include(b)})},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length&gt;1?this:this[0]},uniq:function(a){return this.inject([],function(d,c,b){if(0==b||(a?d.last()!=c:!d.include(c))){d.push(c)}return d})},intersect:function(a){return this.uniq().findAll(function(b){return a.detect(function(c){return b===c})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return&quot;[&quot;+this.map(Object.inspect).join(&quot;, &quot;)+&quot;]&quot;},toJSON:function(){var a=[];this.each(function(b){var c=Object.toJSON(b);if(!Object.isUndefined(c)){a.push(c)}});return&quot;[&quot;+a.join(&quot;, &quot;)+&quot;]&quot;}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c,a){a||(a=0);var b=this.length;if(a&lt;0){a=b+a}for(;a&lt;b;a++){if(this[a]===c){return a}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(b,a){a=isNaN(a)?this.length:(a&lt;0?this.length+a:a)+1;var c=this.slice(0,a).reverse().indexOf(b);return(c&lt;0)?c:a-c-1}}Array.prototype.toArray=Array.prototype.clone;function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var e=[];for(var b=0,c=this.length;b&lt;c;b++){e.push(this[b])}for(var b=0,c=arguments.length;b&lt;c;b++){if(Object.isArray(arguments[b])){for(var a=0,d=arguments[b].length;a&lt;d;a++){e.push(arguments[b][a])}}else{e.push(arguments[b])}}return e}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(b,a){$R(0,this,true).each(b,a);return this},toPaddedString:function(c,b){var a=this.toString(b||10);return&quot;0&quot;.times(c-a.length)+a},toJSON:function(){return isFinite(this)?this.toString():&quot;null&quot;}});$w(&quot;abs round ceil floor&quot;).each(function(a){Number.prototype[a]=Math[a].methodize()});function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function a(b,c){if(Object.isUndefined(c)){return b}return b+&quot;=&quot;+encodeURIComponent(String.interpret(c))}return{initialize:function(b){this._object=Object.isHash(b)?b.toObject():Object.clone(b)},_each:function(c){for(var b in this._object){var d=this._object[b],e=[b,d];e.key=b;e.value=d;c(e)}},set:function(b,c){return this._object[b]=c},get:function(b){if(this._object[b]!==Object.prototype[b]){return this._object[b]}},unset:function(b){var c=this._object[b];delete this._object[b];return c},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck(&quot;key&quot;)},values:function(){return this.pluck(&quot;value&quot;)},index:function(c){var b=this.detect(function(d){return d.value===c});return b&amp;&amp;b.key},merge:function(b){return this.clone().update(b)},update:function(b){return new Hash(b).inject(this,function(c,d){c.set(d.key,d.value);return c})},toQueryString:function(){return this.inject([],function(d,e){var c=encodeURIComponent(e.key),b=e.value;if(b&amp;&amp;typeof b==&quot;object&quot;){if(Object.isArray(b)){return d.concat(b.map(a.curry(c)))}}else{d.push(a(c,b))}return d}).join(&quot;&amp;&quot;)},inspect:function(){return&quot;#&lt;Hash:{&quot;+this.map(function(b){return b.map(Object.inspect).join(&quot;: &quot;)}).join(&quot;, &quot;)+&quot;}&gt;&quot;},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(c,a,b){this.start=c;this.end=a;this.exclusive=b},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a&lt;this.start){return false}if(this.exclusive){return a&lt;this.end}return a&lt;=this.end}});var $R=function(c,a,b){return new ObjectRange(c,a,b)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;)},function(){return new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;)})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(d,b,c,a){this.each(function(f){if(Object.isFunction(f[d])){try{f[d].apply(f,[b,c,a])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:&quot;post&quot;,asynchronous:true,contentType:&quot;application/x-www-form-urlencoded&quot;,encoding:&quot;UTF-8&quot;,parameters:&quot;&quot;,evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,startBenchmark:function(a){if(window.SC&amp;&amp;SC.Benchmark){SC.Benchmark.start(a);return a}return&quot;&quot;},endBenchmark:function(a){if(window.SC&amp;&amp;SC.Benchmark){SC.Benchmark.end(a)}},initialize:function($super,b,a){$super(a);this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.startBenchmark(&quot;Request &quot;+b.replace(/\?.+/,&quot;&quot;));this.url=b;this.method=this.options.method;var d=Object.clone(this.options.parameters);if(![&quot;get&quot;,&quot;post&quot;].include(this.method)){d._method=this.method;this.method=&quot;post&quot;}this.parameters=d;if(d=Object.toQueryString(d)){if(this.method==&quot;get&quot;){this.url+=(this.url.include(&quot;?&quot;)?&quot;&amp;&quot;:&quot;?&quot;)+d}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){d+=&quot;&amp;_=&quot;}}}try{var a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch(&quot;onCreate&quot;,this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method==&quot;post&quot;?(this.options.postBody||d):null;this.transport.send(this.body);if(!this.options.asynchronous&amp;&amp;this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a&gt;1&amp;&amp;!((a==4)&amp;&amp;this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var e={&quot;X-Requested-With&quot;:&quot;XMLHttpRequest&quot;,&quot;X-Prototype-Version&quot;:Prototype.Version,Accept:&quot;text/javascript, text/html, application/xml, text/xml, */*&quot;};if(this.method==&quot;post&quot;){e[&quot;Content-type&quot;]=this.options.contentType+(this.options.encoding?&quot;; charset=&quot;+this.options.encoding:&quot;&quot;);if(this.transport.overrideMimeType&amp;&amp;(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]&lt;2005){e.Connection=&quot;close&quot;}}if(typeof this.options.requestHeaders==&quot;object&quot;){var c=this.options.requestHeaders;if(Object.isFunction(c.push)){for(var b=0,d=c.length;b&lt;d;b+=2){e[c[b]]=c[b+1]}}else{$H(c).each(function(f){e[f.key]=f.value})}}for(var a in e){this.transport.setRequestHeader(a,e[a])}},success:function(){var a=this.getStatus();return !a||(a&gt;=200&amp;&amp;a&lt;300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c==&quot;Complete&quot;){this.endBenchmark(&quot;Request &quot;+this.url.replace(/\?.+/,&quot;&quot;));try{this._complete=true;(this.options[&quot;on&quot;+b.status]||this.options[&quot;on&quot;+(this.success()?&quot;Success&quot;:&quot;Failure&quot;)]||Prototype.emptyFunction)(b,b.headerJSON)}catch(d){this.dispatchException(d)}var f=b.getHeader(&quot;Content-type&quot;);if(this.options.evalJS==&quot;force&quot;||(this.options.evalJS&amp;&amp;this.isSameOrigin()&amp;&amp;f&amp;&amp;f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options[&quot;on&quot;+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch(&quot;on&quot;+c,this,b,b.headerJSON)}catch(d){this.dispatchException(d)}if(c==&quot;Complete&quot;){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]==&quot;#{protocol}//#{domain}#{port}&quot;.interpolate({protocol:location.protocol,domain:document.domain,port:location.port?&quot;:&quot;+location.port:&quot;&quot;}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||&quot;&quot;).unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch(&quot;onException&quot;,this,a)}});Ajax.Request.Events=[&quot;Uninitialized&quot;,&quot;Loading&quot;,&quot;Loaded&quot;,&quot;Interactive&quot;,&quot;Complete&quot;];Ajax.Response=Class.create({initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a&gt;2&amp;&amp;!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:&quot;&quot;,getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||&quot;&quot;}catch(a){return&quot;&quot;}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader(&quot;X-JSON&quot;);if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!=&quot;force&quot;&amp;&amp;!(this.getHeader(&quot;Content-type&quot;)||&quot;&quot;).include(&quot;application/json&quot;))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(e,f){this.updateContent(e.responseText);if(Object.isFunction(d)){d(e,f)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?&quot;success&quot;:&quot;failure&quot;],a=this.options;if(!a.evalScripts){d=d.stripScripts()}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;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(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length&gt;1){for(var a=0,d=[],c=arguments.length;a&lt;c;a++){d.push($(arguments[a]))}return d}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(f,a){var c=[];var e=document.evaluate(f,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,d=e.snapshotLength;b&lt;d;b++){c.push(Element.extend(e.snapshotItem(b)))}return c}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(){var a=this.Element;this.Element=function(d,c){c=c||{};d=d.toLowerCase();var b=Element.cache;if(Prototype.Browser.IE&amp;&amp;c.name){d=&quot;&lt;&quot;+d+' name=&quot;'+c.name+'&quot;&gt;';delete c.name;return Element.writeAttribute(document.createElement(d),c)}if(!b[d]){b[d]=Element.extend(document.createElement(d))}return Element.writeAttribute(b[d].cloneNode(false),c)};Object.extend(this.Element,a||{});if(a){this.Element.prototype=a.prototype}}).call(window);Element.cache={};Element.Methods={visible:function(a){return $(a).style.display!=&quot;none&quot;},toggle:function(a){a=$(a);Element[Element.visible(a)?&quot;hide&quot;:&quot;show&quot;](a);return a},hide:function(a){a=$(a);a.style.display=&quot;none&quot;;return a},show:function(a){a=$(a);a.style.display=&quot;&quot;;return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(a,b){a=$(a);if(b&amp;&amp;b.toElement){b=b.toElement()}if(Object.isElement(b)){return a.update().insert(b)}b=Object.toHTML(b);a.innerHTML=b.stripScripts();b.evalScripts.bind(b).defer();return a},replace:function(b,c){b=$(b);if(c&amp;&amp;c.toElement){c=c.toElement()}else{if(!Object.isElement(c)){c=Object.toHTML(c);var a=b.ownerDocument.createRange();a.selectNode(b);c.evalScripts.bind(c).defer();c=a.createContextualFragment(c.stripScripts())}}b.parentNode.replaceChild(c,b);return b},insert:function(c,e){c=$(c);if(Object.isString(e)||Object.isNumber(e)||Object.isElement(e)||(e&amp;&amp;(e.toElement||e.toHTML))){e={bottom:e}}var d,f,b,g;for(var a in e){d=e[a];a=a.toLowerCase();f=Element._insertionTranslations[a];if(d&amp;&amp;d.toElement){d=d.toElement()}if(Object.isElement(d)){f(c,d);continue}d=Object.toHTML(d);b=((a==&quot;before&quot;||a==&quot;after&quot;)?c.parentNode:c).tagName.toUpperCase();g=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a==&quot;top&quot;||a==&quot;after&quot;){g.reverse()}g.each(f.curry(c));d.evalScripts.bind(d).defer()}return c},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element(&quot;div&quot;,c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(b){b=$(b);var a=&quot;&lt;&quot;+b.tagName.toLowerCase();$H({id:&quot;id&quot;,className:&quot;class&quot;}).each(function(f){var e=f.first(),c=f.last();var d=(b[e]||&quot;&quot;).toString();if(d){a+=&quot; &quot;+c+&quot;=&quot;+d.inspect(true)}});return a+&quot;&gt;&quot;},recursivelyCollect:function(a,c){a=$(a);var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}}return b},ancestors:function(a){return $(a).recursivelyCollect(&quot;parentNode&quot;)},descendants:function(a){return $(a).select(&quot;*&quot;)},firstDescendant:function(a){a=$(a).firstChild;while(a&amp;&amp;a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(a){if(!(a=$(a).firstChild)){return[]}while(a&amp;&amp;a.nodeType!=1){a=a.nextSibling}if(a){return[a].concat($(a).nextSiblings())}return[]},previousSiblings:function(a){return $(a).recursivelyCollect(&quot;previousSibling&quot;)},nextSiblings:function(a){return $(a).recursivelyCollect(&quot;nextSibling&quot;)},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(b,a){if(Object.isString(a)){a=new Selector(a)}return a.match($(b))},up:function(b,d,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var c=b.ancestors();return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},down:function(b,c,a){b=$(b);if(arguments.length==1){return b.firstDescendant()}return Object.isNumber(c)?b.descendants()[c]:Element.select(b,c)[a||0]},previous:function(b,d,a){b=$(b);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(b))}var c=b.previousSiblings();return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},next:function(c,d,b){c=$(c);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(c))}var a=c.nextSiblings();return Object.isNumber(d)?a[d]:Selector.findElement(a,d,b)},select:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b,a)},adjacent:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b.parentNode,a).without(b)},identify:function(b){b=$(b);var c=b.readAttribute(&quot;id&quot;),a=arguments.callee;if(c){return c}do{c=&quot;anonymous_element_&quot;+a.counter++}while($(c));b.writeAttribute(&quot;id&quot;,c);return c},readAttribute:function(c,a){c=$(c);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]}if(a.include(&quot;:&quot;)){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value}}return c.getAttribute(a)},writeAttribute:function(e,c,f){e=$(e);var b={},d=Element._attributeTranslations.write;if(typeof c==&quot;object&quot;){b=c}else{b[c]=Object.isUndefined(f)?true:f}for(var a in b){c=d.names[a]||a;f=b[a];if(d.values[a]){c=d.values[a](e,f)}if(f===false||f===null){e.removeAttribute(c)}else{if(f===true){e.setAttribute(c,c)}else{e.setAttribute(c,f)}}}return e},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var c=a.className;return(c.length&gt;0&amp;&amp;(c==b||new RegExp(&quot;(^|\\s)&quot;+b+&quot;(\\s|$)&quot;).test(c)))},addClassName:function(a,b){if(!(a=$(a))){return}if(!a.hasClassName(b)){a.className+=(a.className?&quot; &quot;:&quot;&quot;)+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp(&quot;(^|\\s+)&quot;+b+&quot;(\\s+|$)&quot;),&quot; &quot;).strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return a[a.hasClassName(b)?&quot;removeClassName&quot;:&quot;addClassName&quot;](b)},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&amp;&amp;!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&amp;8)===8}if(a.contains){return a.contains(b)&amp;&amp;a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=a.cumulativeOffset();window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c==&quot;float&quot;?&quot;cssFloat&quot;:c.camelize();var d=b.style[c];if(!d||d==&quot;auto&quot;){var a=document.defaultView.getComputedStyle(b,null);d=a?a[c]:null}if(c==&quot;opacity&quot;){return d?parseFloat(d):1}return d==&quot;auto&quot;?null:d},getOpacity:function(a){return $(a).getStyle(&quot;opacity&quot;)},setStyle:function(b,c){b=$(b);var e=b.style,a;if(Object.isString(c)){b.style.cssText+=&quot;;&quot;+c;return c.include(&quot;opacity&quot;)?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var d in c){if(d==&quot;opacity&quot;){b.setOpacity(c[d])}else{e[(d==&quot;float&quot;||d==&quot;cssFloat&quot;)?(Object.isUndefined(e.styleFloat)?&quot;cssFloat&quot;:&quot;styleFloat&quot;):d]=c[d]}}return b},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b===&quot;&quot;)?&quot;&quot;:(b&lt;0.00001)?0:b;return a},getDimensions:function(c){c=$(c);var g=c.getStyle(&quot;display&quot;);if(g!=&quot;none&quot;&amp;&amp;g!=null){return{width:c.offsetWidth,height:c.offsetHeight}}var b=c.style;var f=b.visibility;var d=b.position;var a=b.display;b.visibility=&quot;hidden&quot;;b.position=&quot;absolute&quot;;b.display=&quot;block&quot;;var h=c.clientWidth;var e=c.clientHeight;b.display=a;b.position=d;b.visibility=f;return{width:h,height:e}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,&quot;position&quot;);if(b==&quot;static&quot;||!b){a._madePositioned=true;a.style.position=&quot;relative&quot;;if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=&quot;&quot;}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,&quot;overflow&quot;)||&quot;auto&quot;;if(a._overflow!==&quot;hidden&quot;){a.style.overflow=&quot;hidden&quot;}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow==&quot;auto&quot;?&quot;&quot;:a._overflow;a._overflow=null;return a},cumulativeOffset:function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;b=b.offsetParent}while(b);return Element._returnOffset(c,a)},positionedOffset:function(b){var a=0,d=0;do{a+=b.offsetTop||0;d+=b.offsetLeft||0;b=b.offsetParent;if(b){if(b.tagName.toUpperCase()==&quot;BODY&quot;){break}var c=Element.getStyle(b,&quot;position&quot;);if(c!==&quot;static&quot;){break}}}while(b);return Element._returnOffset(d,a)},absolutize:function(b){b=$(b);if(b.getStyle(&quot;position&quot;)==&quot;absolute&quot;){return b}var d=b.positionedOffset();var f=d[1];var e=d[0];var c=b.clientWidth;var a=b.clientHeight;b._originalLeft=e-parseFloat(b.style.left||0);b._originalTop=f-parseFloat(b.style.top||0);b._originalWidth=b.style.width;b._originalHeight=b.style.height;b.style.position=&quot;absolute&quot;;b.style.top=f+&quot;px&quot;;b.style.left=e+&quot;px&quot;;b.style.width=c+&quot;px&quot;;b.style.height=a+&quot;px&quot;;return b},relativize:function(a){a=$(a);if(a.getStyle(&quot;position&quot;)==&quot;relative&quot;){return a}a.style.position=&quot;relative&quot;;var c=parseFloat(a.style.top||0)-(a._originalTop||0);var b=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=c+&quot;px&quot;;a.style.left=b+&quot;px&quot;;a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(b){var a=0,c=0;do{a+=b.scrollTop||0;c+=b.scrollLeft||0;b=b.parentNode}while(b);return Element._returnOffset(c,a)},getOffsetParent:function(a){if(a.offsetParent){return $(a.offsetParent)}if(a==document.body){return $(a)}while((a=a.parentNode)&amp;&amp;a!=document.body){if(Element.getStyle(a,&quot;position&quot;)!=&quot;static&quot;){return $(a)}}return $(document.body)},viewportOffset:function(d){var a=0,c=0;var b=d;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body&amp;&amp;Element.getStyle(b,&quot;position&quot;)==&quot;absolute&quot;){break}}while(b=b.offsetParent);b=d;do{if(!Prototype.Browser.Opera||(b.tagName&amp;&amp;(b.tagName.toUpperCase()==&quot;BODY&quot;))){a-=b.scrollTop||0;c-=b.scrollLeft||0}}while(b=b.parentNode);return Element._returnOffset(c,a)},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});d=$(d);var e=d.viewportOffset();b=$(b);var f=[0,0];var c=null;if(Element.getStyle(b,&quot;position&quot;)==&quot;absolute&quot;){c=b.getOffsetParent();f=c.viewportOffset()}if(c==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(e[0]-f[0]+a.offsetLeft)+&quot;px&quot;}if(a.setTop){b.style.top=(e[1]-f[1]+a.offsetTop)+&quot;px&quot;}if(a.setWidth){b.style.width=d.offsetWidth+&quot;px&quot;}if(a.setHeight){b.style.height=d.offsetHeight+&quot;px&quot;}return b}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:&quot;class&quot;,htmlFor:&quot;for&quot;},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,b,c){switch(c){case&quot;left&quot;:case&quot;top&quot;:case&quot;right&quot;:case&quot;bottom&quot;:if(d(b,&quot;position&quot;)===&quot;static&quot;){return null}case&quot;height&quot;:case&quot;width&quot;:if(!Element.visible(b)){return null}var e=parseInt(d(b,c),10);if(e!==b[&quot;offset&quot;+c.capitalize()]){return e+&quot;px&quot;}var a;if(c===&quot;height&quot;){a=[&quot;border-top-width&quot;,&quot;padding-top&quot;,&quot;padding-bottom&quot;,&quot;border-bottom-width&quot;]}else{a=[&quot;border-left-width&quot;,&quot;padding-left&quot;,&quot;padding-right&quot;,&quot;border-right-width&quot;]}return a.inject(e,function(f,g){var h=d(b,g);return h===null?f:f-parseInt(h,10)})+&quot;px&quot;;default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b===&quot;title&quot;){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(c,b){b=$(b);try{b.offsetParent}catch(f){return $(document.body)}var a=b.getStyle(&quot;position&quot;);if(a!==&quot;static&quot;){return c(b)}b.setStyle({position:&quot;relative&quot;});var d=c(b);b.setStyle({position:a});return d});$w(&quot;positionedOffset viewportOffset&quot;).each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(f,c){c=$(c);try{c.offsetParent}catch(h){return Element._returnOffset(0,0)}var b=c.getStyle(&quot;position&quot;);if(b!==&quot;static&quot;){return f(c)}var d=c.getOffsetParent();if(d&amp;&amp;d.getStyle(&quot;position&quot;)===&quot;fixed&quot;){d.setStyle({zoom:1})}c.setStyle({position:&quot;relative&quot;});var g=f(c);c.setStyle({position:b});return g})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(b,a){try{a.offsetParent}catch(c){return Element._returnOffset(0,0)}return b(a)});Element.Methods.getStyle=function(a,b){a=$(a);b=(b==&quot;float&quot;||b==&quot;cssFloat&quot;)?&quot;styleFloat&quot;:b.camelize();var c=a.style[b];if(!c&amp;&amp;a.currentStyle){c=a.currentStyle[b]}if(b==&quot;opacity&quot;){if(c=(a.getStyle(&quot;filter&quot;)||&quot;&quot;).match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c==&quot;auto&quot;){if((b==&quot;width&quot;||b==&quot;height&quot;)&amp;&amp;(a.getStyle(&quot;display&quot;)!=&quot;none&quot;)){return a[&quot;offset&quot;+b.capitalize()]+&quot;px&quot;}return null}return c};Element.Methods.setOpacity=function(b,e){function f(g){return g.replace(/alpha\([^\)]*\)/gi,&quot;&quot;)}b=$(b);var a=b.currentStyle;if((a&amp;&amp;!a.hasLayout)||(!a&amp;&amp;b.style.zoom==&quot;normal&quot;)){b.style.zoom=1}var d=b.getStyle(&quot;filter&quot;),c=b.style;if(e==1||e===&quot;&quot;){(d=f(d))?c.filter=d:c.removeAttribute(&quot;filter&quot;);return b}else{if(e&lt;0.00001){e=0}}c.filter=f(d)+&quot;alpha(opacity=&quot;+(e*100)+&quot;)&quot;;return b};Element._attributeTranslations={read:{names:{&quot;class&quot;:&quot;className&quot;,&quot;for&quot;:&quot;htmlFor&quot;},values:{_getAttr:function(a,b){return a.getAttribute(b,2)},_getAttrNode:function(a,c){var b=a.getAttributeNode(c);return b?b.value:&quot;&quot;},_getEv:function(a,b){b=a.getAttribute(b);return b?b.toString().slice(23,-2):null},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){return a.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:&quot;cellPadding&quot;,cellspacing:&quot;cellSpacing&quot;},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:&quot;&quot;}}};Element._attributeTranslations.has={};$w(&quot;colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder&quot;).each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr,src:a._getAttr,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values)}else{if(Prototype.Browser.Gecko&amp;&amp;/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b===&quot;&quot;)?&quot;&quot;:(b&lt;0.00001)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1||b===&quot;&quot;)?&quot;&quot;:(b&lt;0.00001)?0:b;if(b==1){if(a.tagName.toUpperCase()==&quot;IMG&quot;&amp;&amp;a.width){a.width++;a.width--}else{try{var d=document.createTextNode(&quot; &quot;);a.appendChild(d);a.removeChild(d)}catch(c){}}}return a};Element.Methods.cumulativeOffset=function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,&quot;position&quot;)==&quot;absolute&quot;){break}}b=b.offsetParent}while(b);return Element._returnOffset(c,a)}}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(b,c){b=$(b);if(c&amp;&amp;c.toElement){c=c.toElement()}if(Object.isElement(c)){return b.update().insert(c)}c=Object.toHTML(c);var a=b.tagName.toUpperCase();if(a in Element._insertionTranslations.tags){$A(b.childNodes).each(function(d){b.removeChild(d)});Element._getContentFromAnonymousElement(a,c.stripScripts()).each(function(d){b.appendChild(d)})}else{b.innerHTML=c.stripScripts()}c.evalScripts.bind(c).defer();return b}}if(&quot;outerHTML&quot; in document.createElement(&quot;div&quot;)){Element.Methods.replace=function(c,e){c=$(c);if(e&amp;&amp;e.toElement){e=e.toElement()}if(Object.isElement(e)){c.parentNode.replaceChild(e,c);return c}e=Object.toHTML(e);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var f=c.next();var a=Element._getContentFromAnonymousElement(b,e.stripScripts());d.removeChild(c);if(f){a.each(function(g){d.insertBefore(g,f)})}else{a.each(function(g){d.appendChild(g)})}}else{c.outerHTML=e.stripScripts()}e.evalScripts.bind(e).defer();return c}}Element._returnOffset=function(b,c){var a=[b,c];a.left=b;a.top=c;return a};Element._getContentFromAnonymousElement=function(c,b){var d=new Element(&quot;div&quot;),a=Element._insertionTranslations.tags[c];if(a){d.innerHTML=a[0]+b+a[1];a[2].times(function(){d=d.firstChild})}else{d.innerHTML=b}return $A(d.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:[&quot;&lt;table&gt;&quot;,&quot;&lt;/table&gt;&quot;,1],TBODY:[&quot;&lt;table&gt;&lt;tbody&gt;&quot;,&quot;&lt;/tbody&gt;&lt;/table&gt;&quot;,2],TR:[&quot;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&quot;,&quot;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&quot;,3],TD:[&quot;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&quot;,&quot;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&quot;,4],SELECT:[&quot;&lt;select&gt;&quot;,&quot;&lt;/select&gt;&quot;,1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;var b=$(a).getAttributeNode(c);return !!(b&amp;&amp;b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&amp;&amp;document.createElement(&quot;div&quot;)[&quot;__proto__&quot;]){window.HTMLElement={};window.HTMLElement.prototype=document.createElement(&quot;div&quot;)[&quot;__proto__&quot;];Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var a={},b=Element.Methods.ByTag;var c=Object.extend(function(f){if(!f||f._extendedByPrototype||f.nodeType!=1||f==window){return f}var d=Object.clone(a),e=f.tagName.toUpperCase(),h,g;if(b[e]){Object.extend(d,b[e])}for(h in d){g=d[h];if(Object.isFunction(g)&amp;&amp;!(h in f)){f[h]=g.methodize()}}f._extendedByPrototype=Prototype.emptyFunction;return f},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});c.refresh();return c})();Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b)}return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(c){var h=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})}else{if(Object.isArray(b)){b.each(g)}else{g(b)}}function g(j){j=j.toUpperCase();if(!Element.Methods.ByTag[j]){Element.Methods.ByTag[j]={}}Object.extend(Element.Methods.ByTag[j],c)}function a(l,k,j){j=j||false;for(var n in l){var m=l[n];if(!Object.isFunction(m)){continue}if(!j||!(n in k)){k[n]=m.methodize()}}}function e(l){var j;var k={OPTGROUP:&quot;OptGroup&quot;,TEXTAREA:&quot;TextArea&quot;,P:&quot;Paragraph&quot;,FIELDSET:&quot;FieldSet&quot;,UL:&quot;UList&quot;,OL:&quot;OList&quot;,DL:&quot;DList&quot;,DIR:&quot;Directory&quot;,H1:&quot;Heading&quot;,H2:&quot;Heading&quot;,H3:&quot;Heading&quot;,H4:&quot;Heading&quot;,H5:&quot;Heading&quot;,H6:&quot;Heading&quot;,Q:&quot;Quote&quot;,INS:&quot;Mod&quot;,DEL:&quot;Mod&quot;,A:&quot;Anchor&quot;,IMG:&quot;Image&quot;,CAPTION:&quot;TableCaption&quot;,COL:&quot;TableCol&quot;,COLGROUP:&quot;TableCol&quot;,THEAD:&quot;TableSection&quot;,TFOOT:&quot;TableSection&quot;,TBODY:&quot;TableSection&quot;,TR:&quot;TableRow&quot;,TH:&quot;TableCell&quot;,TD:&quot;TableCell&quot;,FRAMESET:&quot;FrameSet&quot;,IFRAME:&quot;IFrame&quot;};if(k[l]){j=&quot;HTML&quot;+k[l]+&quot;Element&quot;}if(window[j]){return window[j]}j=&quot;HTML&quot;+l+&quot;Element&quot;;if(window[j]){return window[j]}j=&quot;HTML&quot;+l.capitalize()+&quot;Element&quot;;if(window[j]){return window[j]}window[j]={};window[j].prototype=document.createElement(l)[&quot;__proto__&quot;];return window[j]}if(h.ElementExtensions){a(Element.Methods,HTMLElement.prototype);a(Element.Methods.Simulated,HTMLElement.prototype,true)}if(h.SpecificElementExtensions){for(var i in Element.Methods.ByTag){var f=e(i);if(Object.isUndefined(f)){continue}a(d[i],f.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var a={},b=Prototype.Browser;$w(&quot;width height&quot;).each(function(e){var c=e.capitalize();if(b.WebKit&amp;&amp;!document.evaluate){a[e]=self[&quot;inner&quot;+c]}else{if(b.Opera&amp;&amp;parseFloat(window.opera.version())&lt;9.5){a[e]=document.body[&quot;client&quot;+c]}else{a[e]=document.documentElement[&quot;client&quot;+c]}}});return a},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};var Selector=Class.create({initialize:function(a){this.expression=a.strip();if(this.shouldUseSelectorsAPI()){this.mode=&quot;selectorsAPI&quot;}else{if(this.shouldUseXPath()){this.mode=&quot;xpath&quot;;this.compileXPathMatcher()}else{this.mode=&quot;normal&quot;;this.compileMatcher()}}},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false}var a=this.expression;if(Prototype.Browser.WebKit&amp;&amp;(a.include(&quot;-of-type&quot;)||a.include(&quot;:empty&quot;))){return false}if((/(\[[\w-]*?:|:checked)/).test(a)){return false}return true},shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(!Selector._div){Selector._div=new Element(&quot;div&quot;)}try{Selector._div.querySelector(this.expression)}catch(a){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=[&quot;this.matcher = function(root) {&quot;,&quot;var r = root, h = Selector.handlers, c = false, n;&quot;];while(e&amp;&amp;le!=e&amp;&amp;(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],&quot;&quot;);break}}}this.matcher.push(&quot;return h.unique(n);\n}&quot;);eval(this.matcher.join(&quot;\n&quot;));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var f=this.expression,g=Selector.patterns,b=Selector.xpath,d,a;if(Selector._cache[f]){this.xpath=Selector._cache[f];return}this.matcher=[&quot;.//*&quot;];while(f&amp;&amp;d!=f&amp;&amp;(/\S/).test(f)){d=f;for(var c in g){if(a=f.match(g[c])){this.matcher.push(Object.isFunction(b[c])?b[c](a):new Template(b[c]).evaluate(a));f=f.replace(a[0],&quot;&quot;);break}}}this.xpath=this.matcher.join(&quot;&quot;);Selector._cache[this.expression]=this.xpath},findElements:function(a){a=a||document;var c=this.expression,b;switch(this.mode){case&quot;selectorsAPI&quot;:if(a!==document){var d=a.id,f=$(a).identify();c=&quot;#&quot;+f+&quot; &quot;+c}b=$A(a.querySelectorAll(c)).map(Element.extend);a.id=d;return b;case&quot;xpath&quot;:return document._getElementsByXPath(this.xpath,a);default:return this.matcher(a)}},match:function(j){this.tokens=[];var o=this.expression,a=Selector.patterns,f=Selector.assertions;var b,d,g;while(o&amp;&amp;b!==o&amp;&amp;(/\S/).test(o)){b=o;for(var k in a){d=a[k];if(g=o.match(d)){if(f[k]){this.tokens.push([k,Object.clone(g)]);o=o.replace(g[0],&quot;&quot;)}else{return this.findElements(document).include(j)}}}}var n=true,c,l;for(var k=0,h;h=this.tokens[k];k++){c=h[0],l=h[1];if(!Selector.assertions[c](j,l)){n=false;break}}return n},toString:function(){return this.expression},inspect:function(){return&quot;#&lt;Selector:&quot;+this.expression.inspect()+&quot;&gt;&quot;}});Object.extend(Selector,{_cache:{},xpath:{descendant:&quot;//*&quot;,child:&quot;/*&quot;,adjacent:&quot;/following-sibling::*[1]&quot;,laterSibling:&quot;/following-sibling::*&quot;,tagName:function(a){if(a[1]==&quot;*&quot;){return&quot;&quot;}return&quot;[local-name()='&quot;+a[1].toLowerCase()+&quot;' or local-name()='&quot;+a[1].toUpperCase()+&quot;']&quot;},className:&quot;[contains(concat(' ', @class, ' '), ' #{1} ')]&quot;,id:&quot;[@id='#{1}']&quot;,attrPresence:function(a){a[1]=a[1].toLowerCase();return new Template(&quot;[@#{1}]&quot;).evaluate(a)},attr:function(a){a[1]=a[1].toLowerCase();a[3]=a[5]||a[6];return new Template(Selector.xpath.operators[a[2]]).evaluate(a)},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]];if(!b){return&quot;&quot;}if(Object.isFunction(b)){return b(a)}return new Template(Selector.xpath.pseudos[a[1]]).evaluate(a)},operators:{&quot;=&quot;:&quot;[@#{1}='#{3}']&quot;,&quot;!=&quot;:&quot;[@#{1}!='#{3}']&quot;,&quot;^=&quot;:&quot;[starts-with(@#{1}, '#{3}')]&quot;,&quot;$=&quot;:&quot;[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']&quot;,&quot;*=&quot;:&quot;[contains(@#{1}, '#{3}')]&quot;,&quot;~=&quot;:&quot;[contains(concat(' ', @#{1}, ' '), ' #{3} ')]&quot;,&quot;|=&quot;:&quot;[contains(concat('-', @#{1}, '-'), '-#{3}-')]&quot;},pseudos:{&quot;first-child&quot;:&quot;[not(preceding-sibling::*)]&quot;,&quot;last-child&quot;:&quot;[not(following-sibling::*)]&quot;,&quot;only-child&quot;:&quot;[not(preceding-sibling::* or following-sibling::*)]&quot;,empty:&quot;[count(*) = 0 and (count(text()) = 0)]&quot;,checked:&quot;[@checked]&quot;,disabled:&quot;[(@disabled) and (@type!='hidden')]&quot;,enabled:&quot;[not(@disabled) and (@type!='hidden')]&quot;,not:function(b){var j=b[6],h=Selector.patterns,a=Selector.xpath,f,c;var g=[];while(j&amp;&amp;f!=j&amp;&amp;(/\S/).test(j)){f=j;for(var d in h){if(b=j.match(h[d])){c=Object.isFunction(a[d])?a[d](b):new Template(a[d]).evaluate(b);g.push(&quot;(&quot;+c.substring(1,c.length-1)+&quot;)&quot;);j=j.replace(b[0],&quot;&quot;);break}}}return&quot;[not(&quot;+g.join(&quot; and &quot;)+&quot;)]&quot;},&quot;nth-child&quot;:function(a){return Selector.xpath.pseudos.nth(&quot;(count(./preceding-sibling::*) + 1) &quot;,a)},&quot;nth-last-child&quot;:function(a){return Selector.xpath.pseudos.nth(&quot;(count(./following-sibling::*) + 1) &quot;,a)},&quot;nth-of-type&quot;:function(a){return Selector.xpath.pseudos.nth(&quot;position() &quot;,a)},&quot;nth-last-of-type&quot;:function(a){return Selector.xpath.pseudos.nth(&quot;(last() + 1 - position()) &quot;,a)},&quot;first-of-type&quot;:function(a){a[6]=&quot;1&quot;;return Selector.xpath.pseudos[&quot;nth-of-type&quot;](a)},&quot;last-of-type&quot;:function(a){a[6]=&quot;1&quot;;return Selector.xpath.pseudos[&quot;nth-last-of-type&quot;](a)},&quot;only-of-type&quot;:function(a){var b=Selector.xpath.pseudos;return b[&quot;first-of-type&quot;](a)+b[&quot;last-of-type&quot;](a)},nth:function(g,e){var h,i=e[6],d;if(i==&quot;even&quot;){i=&quot;2n+0&quot;}if(i==&quot;odd&quot;){i=&quot;2n+1&quot;}if(h=i.match(/^(\d+)$/)){return&quot;[&quot;+g+&quot;= &quot;+h[1]+&quot;]&quot;}if(h=i.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(h[1]==&quot;-&quot;){h[1]=-1}var f=h[1]?Number(h[1]):1;var c=h[2]?Number(h[2]):0;d=&quot;[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} &gt;= 0)]&quot;;return new Template(d).evaluate({fragment:g,a:f,b:c})}}}},criteria:{tagName:'n = h.tagName(n, r, &quot;#{1}&quot;, c);      c = false;',className:'n = h.className(n, r, &quot;#{1}&quot;, c);    c = false;',id:'n = h.id(n, r, &quot;#{1}&quot;, c);           c = false;',attrPresence:'n = h.attrPresence(n, r, &quot;#{1}&quot;, c); c = false;',attr:function(a){a[3]=(a[5]||a[6]);return new Template('n = h.attr(n, r, &quot;#{1}&quot;, &quot;#{3}&quot;, &quot;#{2}&quot;, c); c = false;').evaluate(a)},pseudo:function(a){if(a[6]){a[6]=a[6].replace(/&quot;/g,'\\&quot;')}return new Template('n = h.pseudo(n, &quot;#{1}&quot;, &quot;#{6}&quot;, r, c); c = false;').evaluate(a)},descendant:'c = &quot;descendant&quot;;',child:'c = &quot;child&quot;;',adjacent:'c = &quot;adjacent&quot;;',laterSibling:'c = &quot;laterSibling&quot;;'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*&gt;\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~&gt;]))/,attrPresence:/^\[((?:[\w]+:)?[\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['&quot;])([^\4]*?)\4|([^'&quot;][^\]]*?)))?\]/},assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()},className:function(a,b){return Element.hasClassName(a,b[1])},id:function(a,b){return a.id===b[1]},attrPresence:function(a,b){return Element.hasAttribute(a,b[1])},attr:function(b,c){var a=Element.readAttribute(b,c[1]);return a&amp;&amp;Selector.operators[c[2]](a,c[5]||c[6])}},handlers:{concat:function(d,c){for(var e=0,f;f=c[e];e++){d.push(f)}return d},mark:function(a){var d=Prototype.emptyFunction;for(var b=0,c;c=a[b];b++){c._countedByPrototype=d}return a},unmark:function(a){for(var b=0,c;c=a[b];b++){c._countedByPrototype=undefined}return a},index:function(a,d,g){a._countedByPrototype=Prototype.emptyFunction;if(d){for(var b=a.childNodes,e=b.length-1,c=1;e&gt;=0;e--){var f=b[e];if(f.nodeType==1&amp;&amp;(!g||f._countedByPrototype)){f.nodeIndex=c++}}}else{for(var e=0,c=1,b=a.childNodes;f=b[e];e++){if(f.nodeType==1&amp;&amp;(!g||f._countedByPrototype)){f.nodeIndex=c++}}}},unique:function(b){if(b.length==0){return b}var d=[],e;for(var c=0,a=b.length;c&lt;a;c++){if(!(e=b[c])._countedByPrototype){e._countedByPrototype=Prototype.emptyFunction;d.push(Element.extend(e))}}return Selector.handlers.unmark(d)},descendant:function(a){var d=Selector.handlers;for(var c=0,b=[],e;e=a[c];c++){d.concat(b,e.getElementsByTagName(&quot;*&quot;))}return b},child:function(a){var e=Selector.handlers;for(var d=0,c=[],f;f=a[d];d++){for(var b=0,g;g=f.childNodes[b];b++){if(g.nodeType==1&amp;&amp;g.tagName!=&quot;!&quot;){c.push(g)}}}return c},adjacent:function(a){for(var c=0,b=[],e;e=a[c];c++){var d=this.nextElementSibling(e);if(d){b.push(d)}}return b},laterSibling:function(a){var d=Selector.handlers;for(var c=0,b=[],e;e=a[c];c++){d.concat(b,Element.nextSiblings(e))}return b},nextElementSibling:function(a){while(a=a.nextSibling){if(a.nodeType==1){return a}}return null},previousElementSibling:function(a){while(a=a.previousSibling){if(a.nodeType==1){return a}}return null},tagName:function(a,j,c,b){var k=c.toUpperCase();var e=[],g=Selector.handlers;if(a){if(b){if(b==&quot;descendant&quot;){for(var f=0,d;d=a[f];f++){g.concat(e,d.getElementsByTagName(c))}return e}else{a=this[b](a)}if(c==&quot;*&quot;){return a}}for(var f=0,d;d=a[f];f++){if(d.tagName.toUpperCase()===k){e.push(d)}}return e}else{return j.getElementsByTagName(c)}},id:function(b,a,j,f){var g=$(j),d=Selector.handlers;if(!g){return[]}if(!b&amp;&amp;a==document){return[g]}if(b){if(f){if(f==&quot;child&quot;){for(var c=0,e;e=b[c];c++){if(g.parentNode==e){return[g]}}}else{if(f==&quot;descendant&quot;){for(var c=0,e;e=b[c];c++){if(Element.descendantOf(g,e)){return[g]}}}else{if(f==&quot;adjacent&quot;){for(var c=0,e;e=b[c];c++){if(Selector.handlers.previousElementSibling(g)==e){return[g]}}}else{b=d[f](b)}}}}for(var c=0,e;e=b[c];c++){if(e==g){return[g]}}return[]}return(g&amp;&amp;Element.descendantOf(g,a))?[g]:[]},className:function(b,a,c,d){if(b&amp;&amp;d){b=this[d](b)}return Selector.handlers.byClassName(b,a,c)},byClassName:function(c,b,f){if(!c){c=Selector.handlers.descendant([b])}var h=&quot; &quot;+f+&quot; &quot;;for(var e=0,d=[],g,a;g=c[e];e++){a=g.className;if(a.length==0){continue}if(a==f||(&quot; &quot;+a+&quot; &quot;).include(h)){d.push(g)}}return d},attrPresence:function(c,b,a,g){if(!c){c=b.getElementsByTagName(&quot;*&quot;)}if(c&amp;&amp;g){c=this[g](c)}var e=[];for(var d=0,f;f=c[d];d++){if(Element.hasAttribute(f,a)){e.push(f)}}return e},attr:function(a,j,h,k,c,b){if(!a){a=j.getElementsByTagName(&quot;*&quot;)}if(a&amp;&amp;b){a=this[b](a)}var l=Selector.operators[c],f=[];for(var e=0,d;d=a[e];e++){var g=Element.readAttribute(d,h);if(g===null){continue}if(l(g,k)){f.push(d)}}return f},pseudo:function(b,c,e,a,d){if(b&amp;&amp;d){b=this[d](b)}if(!b){b=a.getElementsByTagName(&quot;*&quot;)}return Selector.pseudos[c](b,e,a)}},pseudos:{&quot;first-child&quot;:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(Selector.handlers.previousElementSibling(e)){continue}c.push(e)}return c},&quot;last-child&quot;:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(Selector.handlers.nextElementSibling(e)){continue}c.push(e)}return c},&quot;only-child&quot;:function(b,g,a){var e=Selector.handlers;for(var d=0,c=[],f;f=b[d];d++){if(!e.previousElementSibling(f)&amp;&amp;!e.nextElementSibling(f)){c.push(f)}}return c},&quot;nth-child&quot;:function(b,c,a){return Selector.pseudos.nth(b,c,a)},&quot;nth-last-child&quot;:function(b,c,a){return Selector.pseudos.nth(b,c,a,true)},&quot;nth-of-type&quot;:function(b,c,a){return Selector.pseudos.nth(b,c,a,false,true)},&quot;nth-last-of-type&quot;:function(b,c,a){return Selector.pseudos.nth(b,c,a,true,true)},&quot;first-of-type&quot;:function(b,c,a){return Selector.pseudos.nth(b,&quot;1&quot;,a,false,true)},&quot;last-of-type&quot;:function(b,c,a){return Selector.pseudos.nth(b,&quot;1&quot;,a,true,true)},&quot;only-of-type&quot;:function(b,d,a){var c=Selector.pseudos;return c[&quot;last-of-type&quot;](c[&quot;first-of-type&quot;](b,d,a),d,a)},getIndices:function(d,c,e){if(d==0){return c&gt;0?[c]:[]}return $R(1,e).inject([],function(a,b){if(0==(b-c)%d&amp;&amp;(b-c)/d&gt;=0){a.push(b)}return a})},nth:function(c,s,u,r,e){if(c.length==0){return[]}if(s==&quot;even&quot;){s=&quot;2n+0&quot;}if(s==&quot;odd&quot;){s=&quot;2n+1&quot;}var q=Selector.handlers,p=[],d=[],g;q.mark(c);for(var o=0,f;f=c[o];o++){if(!f.parentNode._countedByPrototype){q.index(f.parentNode,r,e);d.push(f.parentNode)}}if(s.match(/^\d+$/)){s=Number(s);for(var o=0,f;f=c[o];o++){if(f.nodeIndex==s){p.push(f)}}}else{if(g=s.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(g[1]==&quot;-&quot;){g[1]=-1}var v=g[1]?Number(g[1]):1;var t=g[2]?Number(g[2]):0;var w=Selector.pseudos.getIndices(v,t,c.length);for(var o=0,f,k=w.length;f=c[o];o++){for(var n=0;n&lt;k;n++){if(f.nodeIndex==w[n]){p.push(f)}}}}}q.unmark(c);q.unmark(d);return p},empty:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.tagName==&quot;!&quot;||e.firstChild){continue}c.push(e)}return c},not:function(a,d,k){var g=Selector.handlers,l,c;var j=new Selector(d).findElements(k);g.mark(j);for(var f=0,e=[],b;b=a[f];f++){if(!b._countedByPrototype){e.push(b)}}g.unmark(j);return e},enabled:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(!e.disabled&amp;&amp;(!e.type||e.type!==&quot;hidden&quot;)){c.push(e)}}return c},disabled:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.disabled){c.push(e)}}return c},checked:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.checked){c.push(e)}}return c}},operators:{&quot;=&quot;:function(b,a){return b==a},&quot;!=&quot;:function(b,a){return b!=a},&quot;^=&quot;:function(b,a){return b==a||b&amp;&amp;b.startsWith(a)},&quot;$=&quot;:function(b,a){return b==a||b&amp;&amp;b.endsWith(a)},&quot;*=&quot;:function(b,a){return b==a||b&amp;&amp;b.include(a)},&quot;$=&quot;:function(b,a){return b.endsWith(a)},&quot;*=&quot;:function(b,a){return b.include(a)},&quot;~=&quot;:function(b,a){return(&quot; &quot;+b+&quot; &quot;).include(&quot; &quot;+a+&quot; &quot;)},&quot;|=&quot;:function(b,a){return(&quot;-&quot;+(b||&quot;&quot;).toUpperCase()+&quot;-&quot;).include(&quot;-&quot;+(a||&quot;&quot;).toUpperCase()+&quot;-&quot;)}},split:function(b){var a=[];b.scan(/(([\w#:.~&gt;+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(c){a.push(c[1].strip())});return a},matchElements:function(f,g){var e=$$(g),d=Selector.handlers;d.mark(e);for(var c=0,b=[],a;a=f[c];c++){if(a._countedByPrototype){b.push(a)}}d.unmark(e);return b},findElement:function(b,c,a){if(Object.isNumber(c)){a=c;c=false}return Selector.matchElements(b,c||&quot;*&quot;)[a||0]},findChildElements:function(e,g){g=Selector.split(g.join(&quot;,&quot;));var d=[],f=Selector.handlers;for(var c=0,b=g.length,a;c&lt;b;c++){a=new Selector(g[c].strip());f.concat(d,a.findElements(e))}return(b&gt;1)?f.unique(d):d}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(d,c){for(var e=0,f;f=c[e];e++){if(f.tagName!==&quot;!&quot;){d.push(f)}}return d},unmark:function(a){for(var b=0,c;c=a[b];b++){c.removeAttribute(&quot;_countedByPrototype&quot;)}return a}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(g,b){if(typeof b!=&quot;object&quot;){b={hash:!!b}}else{if(Object.isUndefined(b.hash)){b.hash=true}}var c,f,a=false,e=b.submit;var d=g.inject({},function(h,i){if(!i.disabled&amp;&amp;i.name){c=i.name;f=$(i).getValue();if(f!=null&amp;&amp;i.type!=&quot;file&quot;&amp;&amp;(i.type!=&quot;submit&quot;||(!a&amp;&amp;e!==false&amp;&amp;(!e||c==e)&amp;&amp;(a=true)))){if(c in h){if(!Object.isArray(h[c])){h[c]=[h[c]]}h[c].push(f)}else{h[c]=f}}}return h});return b.hash?d:Object.toQueryString(d)}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(a){return $A($(a).getElementsByTagName(&quot;*&quot;)).inject([],function(b,c){if(Form.Element.Serializers[c.tagName.toLowerCase()]){b.push(Element.extend(c))}return b})},getInputs:function(g,c,d){g=$(g);var a=g.getElementsByTagName(&quot;input&quot;);if(!c&amp;&amp;!d){return $A(a).map(Element.extend)}for(var e=0,h=[],f=a.length;e&lt;f;e++){var b=a[e];if((c&amp;&amp;b.type!=c)||(d&amp;&amp;b.name!=d)){continue}h.push(Element.extend(b))}return h},disable:function(a){a=$(a);Form.getElements(a).invoke(&quot;disable&quot;);return a},enable:function(a){a=$(a);Form.getElements(a).invoke(&quot;enable&quot;);return a},findFirstElement:function(b){var c=$(b).getElements().findAll(function(d){return&quot;hidden&quot;!=d.type&amp;&amp;!d.disabled});var a=c.findAll(function(d){return d.hasAttribute(&quot;tabIndex&quot;)&amp;&amp;d.tabIndex&gt;=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return[&quot;input&quot;,&quot;select&quot;,&quot;textarea&quot;].include(d.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(b,a){b=$(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute(&quot;action&quot;)||&quot;&quot;;if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute(&quot;method&quot;)&amp;&amp;!a.method){a.method=b.method}return new Ajax.Request(c,a)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&amp;&amp;a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return&quot;&quot;},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value=&quot;&quot;;return a},present:function(a){return $(a).value!=&quot;&quot;},activate:function(a){a=$(a);try{a.focus();if(a.select&amp;&amp;(a.tagName.toLowerCase()!=&quot;input&quot;||![&quot;button&quot;,&quot;reset&quot;,&quot;submit&quot;].include(a.type))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(a,b){switch(a.type.toLowerCase()){case&quot;checkbox&quot;:case&quot;radio&quot;:return Form.Element.Serializers.inputSelector(a,b);default:return Form.Element.Serializers.textarea(a,b)}},inputSelector:function(a,b){if(Object.isUndefined(b)){return a.checked?a.value:null}else{a.checked=!!b}},textarea:function(a,b){if(Object.isUndefined(b)){return a.value}else{a.value=b}},select:function(c,f){if(Object.isUndefined(f)){return this[c.type==&quot;select-one&quot;?&quot;selectOne&quot;:&quot;selectMany&quot;](c)}else{var b,d,g=!Object.isArray(f);for(var a=0,e=c.length;a&lt;e;a++){b=c.options[a];d=this.optionValue(b);if(g){if(d==f){b.selected=true;return}}else{b.selected=f.include(d)}}}},selectOne:function(b){var a=b.selectedIndex;return a&gt;=0?this.optionValue(b.options[a]):null},selectMany:function(d){var a,e=d.length;if(!e){return null}for(var c=0,a=[];c&lt;e;c++){var b=d.options[c];if(b.selected){a.push(this.optionValue(b))}}return a},optionValue:function(a){return Element.extend(a).hasAttribute(&quot;value&quot;)?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);this.element=$(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&amp;&amp;Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()==&quot;form&quot;){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case&quot;checkbox&quot;:case&quot;radio&quot;:Event.observe(a,&quot;click&quot;,this.onElementEvent.bind(this));break;default:Event.observe(a,&quot;change&quot;,this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event={}}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(b){var a;switch(b.type){case&quot;mouseover&quot;:a=b.fromElement;break;case&quot;mouseout&quot;:a=b.toElement;break;default:return null}return Element.extend(a)}});Event.Methods=(function(){var a;if(Prototype.Browser.IE){var b={0:1,1:4,2:2};a=function(d,c){return d.button==b[c]}}else{if(Prototype.Browser.WebKit){a=function(d,c){switch(c){case 0:return d.which==1&amp;&amp;!d.metaKey;case 1:return d.which==1&amp;&amp;d.metaKey;default:return false}}}else{a=function(d,c){return d.which?(d.which===c+1):(d.button===c)}}}return{isLeftClick:function(c){return a(c,0)},isMiddleClick:function(c){return a(c,1)},isRightClick:function(c){return a(c,2)},element:function(e){e=Event.extend(e);var d=e.target,c=e.type,f=e.currentTarget;if(f&amp;&amp;f.tagName){if(c===&quot;load&quot;||c===&quot;error&quot;||(c===&quot;click&quot;&amp;&amp;f.tagName.toLowerCase()===&quot;input&quot;&amp;&amp;f.type===&quot;radio&quot;)){d=f}}if(d.nodeType==Node.TEXT_NODE){d=d.parentNode}return Element.extend(d)},findElement:function(d,f){var c=Event.element(d);if(!f){return c}var e=[c].concat(c.ancestors());return Selector.findElement(e,f,0)},pointer:function(e){var d=document.documentElement,c=document.body||{scrollLeft:0,scrollTop:0};return{x:e.pageX||(e.clientX+(d.scrollLeft||c.scrollLeft)-(d.clientLeft||0)),y:e.pageY||(e.clientY+(d.scrollTop||c.scrollTop)-(d.clientTop||0))}},pointerX:function(c){return Event.pointer(c).x},pointerY:function(c){return Event.pointer(c).y},stop:function(c){Event.extend(c);c.preventDefault();c.stopPropagation();c.stopped=true}}})();Event.extend=(function(){var a=Object.keys(Event.Methods).inject({},function(b,c){b[c]=Event.Methods[c].methodize();return b});if(Prototype.Browser.IE){Object.extend(a,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return&quot;[object Event]&quot;}});return function(b){if(!b){return false}if(b._extendedByPrototype){return b}b._extendedByPrototype=Prototype.emptyFunction;var c=Event.pointer(b);Object.extend(b,{target:b.srcElement,relatedTarget:Event.relatedTarget(b),pageX:c.x,pageY:c.y});return Object.extend(b,a)}}else{Event.prototype=Event.prototype||document.createEvent(&quot;HTMLEvents&quot;)[&quot;__proto__&quot;];Object.extend(Event.prototype,a);return Prototype.K}})();Object.extend(Event,(function(){var b=Event.cache;function c(j){if(j._prototypeEventID){return j._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return j._prototypeEventID=[++arguments.callee.id]}function g(j){if(j&amp;&amp;j.include(&quot;:&quot;)){return&quot;dataavailable&quot;}return j}function a(j){return b[j]=b[j]||{}}function f(l,j){var k=a(l);return k[j]=k[j]||[]}function h(k,j,l){var o=c(k);var n=f(o,j);if(n.pluck(&quot;handler&quot;).include(l)){return false}var m=function(p){if(!Event||!Event.extend||(p.eventName&amp;&amp;p.eventName!=j)){return false}Event.extend(p);l.call(k,p)};m.handler=l;n.push(m);return m}function i(m,j,k){var l=f(m,j);return l.find(function(n){return n.handler==k})}function d(m,j,k){var l=a(m);if(!l[j]){return false}l[j]=l[j].without(i(m,j,k))}function e(){for(var k in b){for(var j in b[k]){b[k][j]=null}}}if(window.attachEvent){window.attachEvent(&quot;onunload&quot;,e)}if(Prototype.Browser.WebKit){window.addEventListener(&quot;unload&quot;,Prototype.emptyFunction,false)}return{observe:function(l,j,m){l=$(l);var k=g(j);var n=h(l,j,m);if(!n){return l}if(l.addEventListener){l.addEventListener(k,n,false)}else{l.attachEvent(&quot;on&quot;+k,n)}return l},stopObserving:function(l,j,m){l=$(l);var o=c(l),k=g(j);if(!m&amp;&amp;j){f(o,j).each(function(p){l.stopObserving(j,p.handler)});return l}else{if(!j){Object.keys(a(o)).each(function(p){l.stopObserving(p)});return l}}var n=i(o,j,m);if(!n){return l}if(l.removeEventListener){l.removeEventListener(k,n,false)}else{l.detachEvent(&quot;on&quot;+k,n)}d(o,j,m);return l},fire:function(l,k,j){l=$(l);if(l==document&amp;&amp;document.createEvent&amp;&amp;!l.dispatchEvent){l=document.documentElement}var m;if(document.createEvent){m=document.createEvent(&quot;HTMLEvents&quot;);m.initEvent(&quot;dataavailable&quot;,true,true)}else{m=document.createEventObject();m.eventType=&quot;ondataavailable&quot;}m.eventName=k;m.memo=j||{};if(document.createEvent){l.dispatchEvent(m)}else{l.fireEvent(m.eventType,m)}return Event.extend(m)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var b;function a(){if(document.loaded){return}if(b){window.clearInterval(b)}document.fire(&quot;dom:loaded&quot;);document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){b=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){a()}},0);Event.observe(window,&quot;load&quot;,a)}else{document.addEventListener(&quot;DOMContentLoaded&quot;,a,false)}}else{document.write(&quot;&lt;script id=__onDOMContentLoaded defer src=//:&gt;&lt;\/script&gt;&quot;);$(&quot;__onDOMContentLoaded&quot;).onreadystatechange=function(){if(this.readyState==&quot;complete&quot;){this.onreadystatechange=null;a()}}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}};var $continue=new Error('&quot;throw $continue&quot; is deprecated, use &quot;return&quot; instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;this.ycomp=c;this.offset=Element.cumulativeOffset(b);return(c&gt;=this.offset[1]&amp;&amp;c&lt;this.offset[1]+b.offsetHeight&amp;&amp;a&gt;=this.offset[0]&amp;&amp;a&lt;this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=Element.cumulativeOffset(b);return(this.ycomp&gt;=this.offset[1]&amp;&amp;this.ycomp&lt;this.offset[1]+b.offsetHeight&amp;&amp;this.xcomp&gt;=this.offset[0]&amp;&amp;this.xcomp&lt;this.offset[0]+b.offsetWidth)},overlap:function(b,a){if(!b){return 0}if(b==&quot;vertical&quot;){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b==&quot;horizontal&quot;){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};return Element.clonePosition(c,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:&quot;[contains(concat(' ', @class, ' '), ' &quot;+c+&quot; ')]&quot;}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,e){e=e.toString().strip();var d=/\s/.test(e)?$w(e).map(a).join(&quot;&quot;):a(e);return d?document._getElementsByXPath(&quot;.//*&quot;+d,c):[]}:function(e,f){f=f.toString().strip();var g=[],h=(/\s/.test(f)?$w(f):null);if(!h&amp;&amp;!f){return g}var c=$(e).getElementsByTagName(&quot;*&quot;);f=&quot; &quot;+f+&quot; &quot;;for(var d=0,k,j;k=c[d];d++){if(k.className&amp;&amp;(j=&quot; &quot;+k.className+&quot; &quot;)&amp;&amp;(j.include(f)||(h&amp;&amp;h.all(function(i){return !i.toString().blank()&amp;&amp;j.include(&quot; &quot;+i+&quot; &quot;)})))){g.push(Element.extend(k))}}return g};return function(d,c){return $(c||document.body).getElementsByClassName(d)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length&gt;0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(&quot; &quot;))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(&quot; &quot;))},toString:function(){return $A(this).join(&quot; &quot;)}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();
--&gt;
&lt;/script&gt;
&lt;/script&gt;
  
&lt;!-- http://www.me.com/my/page_assets/en/16dn/javascript.js --&gt;
&lt;script  type=&quot;text/javascript&quot; &gt;
&lt;!--
/*
 * IMPORTANT NOTE: This file is licensed only for use in providing the MobileMe service,
 * or any part thereof, and is subject to the MobileMe Terms and Conditions. You may not
 * port this file to another platform without Apple's written consent.
 */

String.English=String.English||{};Object.extend(String.English,{});
--&gt;
&lt;/script&gt;
&lt;/script&gt;
  
&lt;!-- http://www.me.com/my/sproutcore/en/wpw/javascript.js --&gt;
&lt;script  type=&quot;text/javascript&quot; &gt;
&lt;!--
/*
* ==========================================================================
* SproutCore -- JavaScript Application Framework
* copyright 2006-2008, Sprout Systems, Inc. and contributors.
*
* Permission is hereby granted, free of charge, to any person obtaining a 
* copy of this software and associated documentation files (the &quot;Software&quot;), 
* to deal in the Software without restriction, including without limitation 
* the rights to use, copy, modify, merge, publish, distribute, sublicense, 
* and/or sell copies of the Software, and to permit persons to whom the 
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in 
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
* DEALINGS IN THE SOFTWARE.
*
* For more information about SproutCore, visit http://www.sproutcore.com
*
*
* ==========================================================================
*/
var Prototype={Version:&quot;1.6.0.3&quot;,Browser:{IE:!!(window.attachEvent&amp;&amp;navigator.userAgent.indexOf(&quot;Opera&quot;)===-1),Opera:navigator.userAgent.indexOf(&quot;Opera&quot;)&gt;-1,WebKit:navigator.userAgent.indexOf(&quot;AppleWebKit/&quot;)&gt;-1,Gecko:navigator.userAgent.indexOf(&quot;Gecko&quot;)&gt;-1&amp;&amp;navigator.userAgent.indexOf(&quot;KHTML&quot;)===-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement(&quot;div&quot;)[&quot;__proto__&quot;]&amp;&amp;document.createElement(&quot;div&quot;)[&quot;__proto__&quot;]!==document.createElement(&quot;form&quot;)[&quot;__proto__&quot;]},ScriptFragment:&quot;&lt;script[^&gt;]*&gt;([\\S\\s]*?)&lt;\/script&gt;&quot;,JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class={create:function(){var e=null,d=$A(arguments);if(Object.isFunction(d[0])){e=d.shift()}funct
ion a(){this.initialize.apply(this,arguments)}Object.extend(a,Class.Methods);a.superclass=e;a.subclasses=[];if(e){var b=function(){};b.prototype=e.prototype;a.prototype=new b;e.subclasses.push(a)}for(var c=0;c&lt;d.length;c++){a.addMethods(d[c])}if(!a.prototype.initialize){a.prototype.initialize=Prototype.emptyFunction}a.prototype.constructor=a;return a}};Class.Methods={addMethods:function(h){var c=this.superclass&amp;&amp;this.superclass.prototype;var b=Object.keys(h);if(!Object.keys({toString:true}).length){b.push(&quot;toString&quot;,&quot;valueOf&quot;)}for(var a=0,d=b.length;a&lt;d;a++){var g=b[a],e=h[g];if(c&amp;&amp;Object.isFunction(e)&amp;&amp;e.argumentNames().first()==&quot;$super&quot;){var j=e;e=(function(k){return function(){return c[k].apply(this,arguments)}})(g).wrap(j);e.valueOf=j.valueOf.bind(j);e.toString=j.toString.bind(j)}this.prototype[g]=e}return this}};var Abstract={};Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};Object.extend(Object,{inspect:function(a){try{if(Object.isUndefined(a)){return&quot;undefined&quot;}if(a===null){return&quot;null&quot;}return a.inspect?a.inspect():String(a)}catch(b){if(b instanceof RangeError){return&quot;...&quot;}throw b}},toJSON:function(a){var c=typeof a;switch(c){case&quot;undefined&quot;:case&quot;function&quot;:case&quot;unknown&quot;:return;case&quot;boolean&quot;:return a.toString()}if(a===null){return&quot;null&quot;}if(a.toJSON){return a.toJSON()}if(Object.isElement(a)){return}var b=[];for(var e in a){var d=Object.toJSON(a[e]);if(!Object.isUndefined(d)){b.push(e.toJSON()+&quot;: &quot;+d)}}return&quot;{&quot;+b.join(&quot;, &quot;)+&quot;}&quot;},toQueryString:function(a){return $H(a).toQueryString()},toHTML:function(a){return a&amp;&amp;a.toHTML?a.toHTML():String.interpret(a)},keys:function(a){var b=[];for(var c in a){b.push(c)}return b},values:function(b){var a=[];for(var c in b){a.push(b[c])}return a},clone:function(a){return Object.extend({},a)},isElement:function(a){return !!(a&amp;&amp;a.nodeType==1)},isArray:function(a){return a!=null&amp;&amp;typeof a==&quot;object&quot;&amp;&amp;&quot;splice&quot; in a&amp;&amp;&quot;join&quot; in a},isHash:function(a){return a instanceof Hash},isFunction:function(a){return typeof a==&quot;function&quot;},isString:function(a){return typeof a==&quot;string&quot;},isNumber:function(a){return typeof a==&quot;number&quot;},isUndefined:function(a){return typeof a==&quot;undefined&quot;}});Object.extend(Function.prototype,{argumentNames:function(){var a=this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1].replace(/\s+/g,&quot;&quot;).split(&quot;,&quot;);return a.length==1&amp;&amp;!a[0]?[]:a},bind:function(){if(arguments.length&lt;2&amp;&amp;Object.isUndefined(arguments[0])){return this}var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}},bindAsEventListener:function(){var a=this,c=$A(arguments),b=c.shift();return function(d){return a.apply(b,[d||window.event].concat(c))}},curry:function(){if(!arguments.length){return this}var a=this,b=$A(arguments);return function(){return a.apply(this,b.concat($A(arguments)))}},delay:function(){var a=this,b=$A(arguments),c=b.shift()*1000;return window.setTimeout(function(){return a.apply(a,b)},c)},defer:function(){var a=[0.01].concat($A(arguments));return this.delay.apply(this,a)},wrap:function(b){var a=this;return function(){return b.apply(this,[a.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var a=this;return this._methodized=function(){return a.apply(null,[this].concat($A(arguments)))}}});Date.prototype.toJSON=function(){return'&quot;'+this.getUTCFullYear()+&quot;-&quot;+(this.getUTCMonth()+1).toPaddedString(2)+&quot;-&quot;+this.getUTCDate().toPaddedString(2)+&quot;T&quot;+this.getUTCHours().toPaddedString(2)+&quot;:&quot;+this.getUTCMinutes().toPaddedString(2)+&quot;:&quot;+this.getUTCSeconds().toPaddedString(2)+'Z&quot;'};var Try={these:function(){var c;for(var b=0,d=arguments.length;b&lt;d;b++){var a=arguments[b];try{c=a();break}catch(g){}}return c}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,&quot;\\$1&quot;)};var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(a){return a==null?&quot;&quot;:String(a)},specialChar:{&quot;\b&quot;:&quot;\\b&quot;,&quot;\t&quot;:&quot;\\t&quot;,&quot;\n&quot;:&quot;\\n&quot;,&quot;\f&quot;:&quot;\\f&quot;,&quot;\r&quot;:&quot;\\r&quot;,&quot;\\&quot;:&quot;\\\\&quot;}});Object.extend(String.prototype,{gsub:function(e,c){var a=&quot;&quot;,d=this,b;c=arguments.callee.prepareReplacement(c);while(d.length&gt;0){if(b=d.match(e)){a+=d.slice(0,b.index);a+=String.interpret(c(b));d=d.slice(b.index+b[0].length)}else{a+=d,d=&quot;&quot;}}return a},sub:function(c,a,b){a=this.gsub.prepareReplacement(a);b=Object.isUndefined(b)?1:b;return this.gsub(c,function(d){if(--b&lt;0){return d[0]}return a(d)})},scan:function(b,a){this.gsub(b,a);return String(this)},truncate:function(b,a){b=b||30;a=Object.isUndefined(a)?&quot;...&quot;:a;return this.length&gt;b?this.slice(0,b-a.length)+a:String(this)},strip:function(){return this.replace(/^\s+/,&quot;&quot;).replace(/\s+$/,&quot;&quot;)},stripTags:function(){return this.replace(/&lt;\/?[^&gt;]+&gt;/gi,&quot;&quot;)},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,&quot;img&quot;),&quot;&quot;)},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,&quot;img&quot;);var a=new RegExp(Prototype.ScriptFragment,&quot;im&quot;);return(this.match(b)||[]).map(function(c){return(c.match(a)||[&quot;&quot;,&quot;&quot;])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var a=arguments.callee;a.text.data=this;return a.div.innerHTML},unescapeHTML:function(){var a=new Element(&quot;div&quot;);a.innerHTML=this.stripTags();return a.childNodes[0]?(a.childNodes.length&gt;1?$A(a.childNodes).inject(&quot;&quot;,function(b,c){return b+c.nodeValue}):a.childNodes[0].nodeValue):&quot;&quot;},toQueryParams:function(b){var a=this.strip().match(/([^?#]*)(#.*)?$/);if(!a){return{}}return a[1].split(b||&quot;&amp;&quot;).inject({},function(e,g){if((g=g.split(&quot;=&quot;))[0]){var c=decodeURIComponent(g.shift());var d=g.length&gt;1?g.join(&quot;=&quot;):g[0];if(d!=undefined){d=decodeURIComponent(d)}if(c in e){if(!Object.isArray(e[c])){e[c]=[e[c]]}e[c].push(d)}else{e[c]=d}}return e})},toArray:function(){return this.split(&quot;&quot;)},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(a){return a&lt;1?&quot;&quot;:new Array(a+1).join(this)},camelize:function(){var d=this.split(&quot;-&quot;),a=d.length;if(a==1){return d[0]}var c=this.charAt(0)==&quot;-&quot;?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];for(var b=1;b&lt;a;b++){c+=d[b].charAt(0).toUpperCase()+d[b].substring(1)}return c},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,&quot;/&quot;).gsub(/([A-Z]+)([A-Z][a-z])/,&quot;#{1}_#{2}&quot;).gsub(/([a-z\d])([A-Z])/,&quot;#{1}_#{2}&quot;).gsub(/-/,&quot;_&quot;).toLowerCase()},dasherize:function(){return this.gsub(/_/,&quot;-&quot;)},inspect:function(b){var a=this.gsub(/[\x00-\x1f\\]/,function(c){var d=String.specialChar[c[0]];return d?d:&quot;\\u00&quot;+c[0].charCodeAt().toPaddedString(2,16)});if(b){return'&quot;'+a.replace(/&quot;/g,'\\&quot;')+'&quot;'}return&quot;'&quot;+a.replace(/'/g,&quot;\\'&quot;)+&quot;'&quot;},toJSON:function(){return this.inspect(true)},unfilterJSON:function(a){return this.sub(a||Prototype.JSONFilter,&quot;#{1}&quot;)},isJSON:function(){var a=this;if(a.blank()){return false}a=this.replace(/\\./g,&quot;@&quot;).replace(/&quot;[^&quot;\\\n\r]*&quot;/g,&quot;&quot;);return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(a)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval(&quot;(&quot;+json+&quot;)&quot;)}}catch(e){}throw new SyntaxError(&quot;Badly formed JSON string: &quot;+this.inspect())},include:function(a){return this.indexOf(a)&gt;-1},startsWith:function(a){return this.indexOf(a)===0},endsWith:function(a){var b=this.length-a.length;return b&gt;=0&amp;&amp;this.lastIndexOf(a)===b},empty:function(){return this==&quot;&quot;},blank:function(){return/^\s*$/.test(this)},interpolate:function(a,b){return new Template(this,b).evaluate(a)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&amp;/g,&quot;&amp;#38;&quot;).replace(/&lt;/g,&quot;&amp;#60;&quot;).replace(/&gt;/g,&quot;&amp;#62;&quot;)},unescapeHTML:function(){return this.stripTags().replace(/&amp;#38;/g,&quot;&amp;&quot;).replace(/&amp;#60;/g,&quot;&lt;&quot;).replace(/&amp;#62;/g,&quot;&gt;&quot;)}})}String.prototype.gsub.prepareReplacement=function(b){if(Object.isFunction(b)){return b}var a=new Template(b);return function(c){return a.evaluate(c)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement(&quot;div&quot;),text:document.createTextNode(&quot;&quot;)});String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(d){if(a==null){return&quot;&quot;}var g=d[1]||&quot;&quot;;if(g==&quot;\\&quot;){return d[2]}var b=a,h=d[3];var e=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=e.exec(h);if(d==null){return g}while(d!=null){var c=d[1].startsWith(&quot;[&quot;)?d[2].gsub(&quot;\\\\]&quot;,&quot;]&quot;):d[1];b=b[c];if(null==b||&quot;&quot;==d[3]){break}h=h.substring(&quot;[&quot;==d[3]?d[1].length:d[0].length);d=e.exec(h)}return g+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(c,b){var a=0;try{this._each(function(e){c.call(b,e,a++)})}catch(d){if(d!=$break){throw d}}return this},eachSlice:function(d,c,b){var a=-d,e=[],g=this.toArray();if(d&lt;1){return g}while((a+=d)&lt;g.length){e.push(g.slice(a,a+d))}return e.collect(c,b)},all:function(c,b){c=c||Prototype.K;var a=true;this.each(function(e,d){a=a&amp;&amp;!!c.call(b,e,d);if(!a){throw $break}});return a},any:function(c,b){c=c||Prototype.K;var a=false;this.each(function(e,d){if(a=!!c.call(b,e,d)){throw $break}});return a},collect:function(c,b){c=c||Prototype.K;var a=[];this.each(function(e,d){a.push(c.call(b,e,d))});return a},detect:function(c,b){var a;this.each(function(e,d){if(c.call(b,e,d)){a=e;throw $break}});return a},findAll:function(c,b){var a=[];this.each(function(e,d){if(c.call(b,e,d)){a.push(e)}});return a},grep:function(d,c,b){c=c||Prototype.K;var a=[];if(Object.isString(d)){d=new RegExp(d)}this.each(function(g,e){if(d.match(g)){a.push(c.call(b,g,e))}});return a},include:function(a){if(Object.isFunction(this.indexOf)){if(this.indexOf(a)!=-1){return true}}var b=false;this.each(function(c){if(c==a){b=true;throw $break}});return b},inGroupsOf:function(b,a){a=Object.isUndefined(a)?null:a;return this.eachSlice(b,function(c){while(c.length&lt;b){c.push(a)}return c})},inject:function(a,c,b){this.each(function(e,d){a=c.call(b,a,e,d)});return a},invoke:function(b){var a=$A(arguments).slice(1);return this.map(function(c){return c[b].apply(c,a)})},max:function(c,b){c=c||Prototype.K;var a;this.each(function(e,d){e=c.call(b,e,d);if(a==null||e&gt;=a){a=e}});return a},min:function(c,b){c=c||Prototype.K;var a;this.each(function(e,d){e=c.call(b,e,d);if(a==null||e&lt;a){a=e}});return a},partition:function(d,b){d=d||Prototype.K;var c=[],a=[];this.each(function(g,e){(d.call(b,g,e)?c:a).push(g)});return[c,a]},pluck:function(b){var a=[];this.each(function(c){a.push(c[b])});return a},reject:function(c,b){var a=[];this.each(function(e,d){if(!c.call(b,e,d)){a.push(e)}});return a},sortBy:function(b,a){return this.map(function(d,c){return{value:d,criteria:b.call(a,d,c)}}).sort(function(g,e){var d=g.criteria,c=e.criteria;return d&lt;c?-1:d&gt;c?1:0}).pluck(&quot;value&quot;)},toArray:function(){return this.map()},zip:function(){var b=Prototype.K,a=$A(arguments);if(Object.isFunction(a.last())){b=a.pop()}var c=[this].concat(a).map($A);return this.map(function(e,d){return b(c.pluck(d))})},size:function(){return this.toArray().length},inspect:function(){return&quot;#&lt;Enumerable:&quot;+this.toArray().inspect()+&quot;&gt;&quot;}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(c){if(!c){return[]}if(c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}if(Prototype.Browser.WebKit){$A=function(c){if(!c){return[]}if(!(typeof c===&quot;function&quot;&amp;&amp;typeof c.length===&quot;number&quot;&amp;&amp;typeof c.item===&quot;function&quot;)&amp;&amp;c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(b){for(var a=0,c=this.length;a&lt;c;a++){b(this[a])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(b,a){return b.concat(Object.isArray(a)?a.flatten():[a])})},without:function(){var a=$A(arguments);return this.select(function(b){return !a.include(b)})},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length&gt;1?this:this[0]},uniq:function(a){return this.inject([],function(d,c,b){if(0==b||(a?d.last()!=c:!d.include(c))){d.push(c)}return d})},intersect:function(a){return this.uniq().findAll(function(b){return a.detect(function(c){return b===c})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return&quot;[&quot;+this.map(Object.inspect).join(&quot;, &quot;)+&quot;]&quot;},toJSON:function(){var a=[];this.each(function(b){var c=Object.toJSON(b);if(!Object.isUndefined(c)){a.push(c)}});return&quot;[&quot;+a.join(&quot;, &quot;)+&quot;]&quot;}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c,a){a||(a=0);var b=this.length;if(a&lt;0){a=b+a}for(;a&lt;b;a++){if(this[a]===c){return a}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(b,a){a=isNaN(a)?this.length:(a&lt;0?this.length+a:a)+1;var c=this.slice(0,a).reverse().indexOf(b);return(c&lt;0)?c:a-c-1}}Array.prototype.toArray=Array.prototype.clone;function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var e=[];for(var b=0,c=this.length;b&lt;c;b++){e.push(this[b])}for(var b=0,c=arguments.length;b&lt;c;b++){if(Object.isArray(arguments[b])){for(var a=0,d=arguments[b].length;a&lt;d;a++){e.push(arguments[b][a])}}else{e.push(arguments[b])}}return e}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(b,a){$R(0,this,true).each(b,a);return this},toPaddedString:function(c,b){var a=this.toString(b||10);return&quot;0&quot;.times(c-a.length)+a},toJSON:function(){return isFinite(this)?this.toString():&quot;null&quot;}});$w(&quot;abs round ceil floor&quot;).each(function(a){Number.prototype[a]=Math[a].methodize()});function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function a(b,c){if(Object.isUndefined(c)){return b}return b+&quot;=&quot;+encodeURIComponent(String.interpret(c))}return{initialize:function(b){this._object=Object.isHash(b)?b.toObject():Object.clone(b)},_each:function(c){for(var b in this._object){var d=this._object[b],e=[b,d];e.key=b;e.value=d;c(e)}},set:function(b,c){return this._object[b]=c},get:function(b){if(this._object[b]!==Object.prototype[b]){return this._object[b]}},unset:function(b){var c=this._object[b];delete this._object[b];return c},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck(&quot;key&quot;)},values:function(){return this.pluck(&quot;value&quot;)},index:function(c){var b=this.detect(function(d){return d.value===c});return b&amp;&amp;b.key},merge:function(b){return this.clone().update(b)},update:function(b){return new Hash(b).inject(this,function(c,d){c.set(d.key,d.value);return c})},toQueryString:function(){return this.inject([],function(d,e){var c=encodeURIComponent(e.key),b=e.value;if(b&amp;&amp;typeof b==&quot;object&quot;){if(Object.isArray(b)){return d.concat(b.map(a.curry(c)))}}else{d.push(a(c,b))}return d}).join(&quot;&amp;&quot;)},inspect:function(){return&quot;#&lt;Hash:{&quot;+this.map(function(b){return b.map(Object.inspect).join(&quot;: &quot;)}).join(&quot;, &quot;)+&quot;}&gt;&quot;},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(c,a,b){this.start=c;this.end=a;this.exclusive=b},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a&lt;this.start){return false}if(this.exclusive){return a&lt;this.end}return a&lt;=this.end}});var $R=function(c,a,b){return new ObjectRange(c,a,b)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;)},function(){return new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;)})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(d,b,c,a){this.each(function(g){if(Object.isFunction(g[d])){try{g[d].apply(g,[b,c,a])}catch(h){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:&quot;post&quot;,asynchronous:true,contentType:&quot;application/x-www-form-urlencoded&quot;,encoding:&quot;UTF-8&quot;,parameters:&quot;&quot;,evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,startBenchmark:function(a){if(window.SC&amp;&amp;SC.Benchmark){SC.Benchmark.start(a);return a}return&quot;&quot;},endBenchmark:function(a){if(window.SC&amp;&amp;SC.Benchmark){SC.Benchmark.end(a)}},initialize:function($super,b,a){$super(a);this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.startBenchmark(&quot;Request &quot;+b.replace(/\?.+/,&quot;&quot;));this.url=b;this.method=this.options.method;var d=Object.clone(this.options.parameters);if(![&quot;get&quot;,&quot;post&quot;].include(this.method)){d._method=this.method;this.method=&quot;post&quot;}this.parameters=d;if(d=Object.toQueryString(d)){if(this.method==&quot;get&quot;){this.url+=(this.url.include(&quot;?&quot;)?&quot;&amp;&quot;:&quot;?&quot;)+d}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){d+=&quot;&amp;_=&quot;}}}try{var a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch(&quot;onCreate&quot;,this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method==&quot;post&quot;?(this.options.postBody||d):null;this.transport.send(this.body);if(!this.options.asynchronous&amp;&amp;this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a&gt;1&amp;&amp;!((a==4)&amp;&amp;this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var e={&quot;X-Requested-With&quot;:&quot;XMLHttpRequest&quot;,&quot;X-Prototype-Version&quot;:Prototype.Version,Accept:&quot;text/javascript, text/html, application/xml, text/xml, */*&quot;};if(this.method==&quot;post&quot;){e[&quot;Content-type&quot;]=this.options.contentType+(this.options.encoding?&quot;; charset=&quot;+this.options.encoding:&quot;&quot;);if(this.transport.overrideMimeType&amp;&amp;(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]&lt;2005){e.Connection=&quot;close&quot;}}if(typeof this.options.requestHeaders==&quot;object&quot;){var c=this.options.requestHeaders;if(Object.isFunction(c.push)){for(var b=0,d=c.length;b&lt;d;b+=2){e[c[b]]=c[b+1]}}else{$H(c).each(function(g){e[g.key]=g.value})}}for(var a in e){this.transport.setRequestHeader(a,e[a])}},success:function(){var a=this.getStatus();return !a||(a&gt;=200&amp;&amp;a&lt;300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c==&quot;Complete&quot;){this.endBenchmark(&quot;Request &quot;+this.url.replace(/\?.+/,&quot;&quot;));try{this._complete=true;(this.options[&quot;on&quot;+b.status]||this.options[&quot;on&quot;+(this.success()?&quot;Success&quot;:&quot;Failure&quot;)]||Prototype.emptyFunction)(b,b.headerJSON)}catch(d){this.dispatchException(d)}var g=b.getHeader(&quot;Content-type&quot;);if(this.options.evalJS==&quot;force&quot;||(this.options.evalJS&amp;&amp;this.isSameOrigin()&amp;&amp;g&amp;&amp;g.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options[&quot;on&quot;+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch(&quot;on&quot;+c,this,b,b.headerJSON)}catch(d){this.dispatchException(d)}if(c==&quot;Complete&quot;){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]==&quot;#{protocol}//#{domain}#{port}&quot;.interpolate({protocol:location.protocol,domain:document.domain,port:location.port?&quot;:&quot;+location.port:&quot;&quot;}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||&quot;&quot;).unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch(&quot;onException&quot;,this,a)}});Ajax.Request.Events=[&quot;Uninitialized&quot;,&quot;Loading&quot;,&quot;Loaded&quot;,&quot;Interactive&quot;,&quot;Complete&quot;];Ajax.Response=Class.create({initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a&gt;2&amp;&amp;!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:&quot;&quot;,getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||&quot;&quot;}catch(a){return&quot;&quot;}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader(&quot;X-JSON&quot;);if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!=&quot;force&quot;&amp;&amp;!(this.getHeader(&quot;Content-type&quot;)||&quot;&quot;).include(&quot;application/json&quot;))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(e,g){this.updateContent(e.responseText);if(Object.isFunction(d)){d(e,g)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?&quot;success&quot;:&quot;failure&quot;],a=this.options;if(!a.evalScripts){d=d.stripScripts()}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;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(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length&gt;1){for(var a=0,d=[],c=arguments.length;a&lt;c;a++){d.push($(arguments[a]))}return d}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(g,a){var c=[];var e=document.evaluate(g,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,d=e.snapshotLength;b&lt;d;b++){c.push(Element.extend(e.snapshotItem(b)))}return c}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(){var a=this.Element;this.Element=function(d,c){c=c||{};d=d.toLowerCase();var b=Element.cache;if(Prototype.Browser.IE&amp;&amp;c.name){d=&quot;&lt;&quot;+d+' name=&quot;'+c.name+'&quot;&gt;';delete c.name;return Element.writeAttribute(document.createElement(d),c)}if(!b[d]){b[d]=Element.extend(document.createElement(d))}return Element.writeAttribute(b[d].cloneNode(false),c)};Object.extend(this.Element,a||{});if(a){this.Element.prototype=a.prototype}}).call(window);Element.cache={};Element.Methods={visible:function(a){return $(a).style.display!=&quot;none&quot;},toggle:function(a){a=$(a);Element[Element.visible(a)?&quot;hide&quot;:&quot;show&quot;](a);return a},hide:function(a){a=$(a);a.style.display=&quot;none&quot;;return a},show:function(a){a=$(a);a.style.display=&quot;&quot;;return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(a,b){a=$(a);if(b&amp;&amp;b.toElement){b=b.toElement()}if(Object.isElement(b)){return a.update().insert(b)}b=Object.toHTML(b);a.innerHTML=b.stripScripts();b.evalScripts.bind(b).defer();return a},replace:function(b,c){b=$(b);if(c&amp;&amp;c.toElement){c=c.toElement()}else{if(!Object.isElement(c)){c=Object.toHTML(c);var a=b.ownerDocument.createRange();a.selectNode(b);c.evalScripts.bind(c).defer();c=a.createContextualFragment(c.stripScripts())}}b.parentNode.replaceChild(c,b);return b},insert:function(c,e){c=$(c);if(Object.isString(e)||Object.isNumber(e)||Object.isElement(e)||(e&amp;&amp;(e.toElement||e.toHTML))){e={bottom:e}}var d,g,b,h;for(var a in e){d=e[a];a=a.toLowerCase();g=Element._insertionTranslations[a];if(d&amp;&amp;d.toElement){d=d.toElement()}if(Object.isElement(d)){g(c,d);continue}d=Object.toHTML(d);b=((a==&quot;before&quot;||a==&quot;after&quot;)?c.parentNode:c).tagName.toUpperCase();h=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a==&quot;top&quot;||a==&quot;after&quot;){h.reverse()}h.each(g.curry(c));d.evalScripts.bind(d).defer()}return c},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element(&quot;div&quot;,c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(b){b=$(b);var a=&quot;&lt;&quot;+b.tagName.toLowerCase();$H({id:&quot;id&quot;,className:&quot;class&quot;}).each(function(g){var e=g.first(),c=g.last();var d=(b[e]||&quot;&quot;).toString();if(d){a+=&quot; &quot;+c+&quot;=&quot;+d.inspect(true)}});return a+&quot;&gt;&quot;},recursivelyCollect:function(a,c){a=$(a);var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}}return b},ancestors:function(a){return $(a).recursivelyCollect(&quot;parentNode&quot;)},descendants:function(a){return $(a).select(&quot;*&quot;)},firstDescendant:function(a){a=$(a).firstChild;while(a&amp;&amp;a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(a){if(!(a=$(a).firstChild)){return[]}while(a&amp;&amp;a.nodeType!=1){a=a.nextSibling}if(a){return[a].concat($(a).nextSiblings())}return[]},previousSiblings:function(a){return $(a).recursivelyCollect(&quot;previousSibling&quot;)},nextSiblings:function(a){return $(a).recursivelyCollect(&quot;nextSibling&quot;)},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(b,a){if(Object.isString(a)){a=new Selector(a)}return a.match($(b))},up:function(b,d,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var c=b.ancestors();return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},down:function(b,c,a){b=$(b);if(arguments.length==1){return b.firstDescendant()}return Object.isNumber(c)?b.descendants()[c]:Element.select(b,c)[a||0]},previous:function(b,d,a){b=$(b);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(b))}var c=b.previousSiblings();return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},next:function(c,d,b){c=$(c);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(c))}var a=c.nextSiblings();return Object.isNumber(d)?a[d]:Selector.findElement(a,d,b)},select:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b,a)},adjacent:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b.parentNode,a).without(b)},identify:function(b){b=$(b);var c=b.readAttribute(&quot;id&quot;),a=arguments.callee;if(c){return c}do{c=&quot;anonymous_element_&quot;+a.counter++}while($(c));b.writeAttribute(&quot;id&quot;,c);return c},readAttribute:function(c,a){c=$(c);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]}if(a.include(&quot;:&quot;)){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value}}return c.getAttribute(a)},writeAttribute:function(e,c,g){e=$(e);var b={},d=Element._attributeTranslations.write;if(typeof c==&quot;object&quot;){b=c}else{b[c]=Object.isUndefined(g)?true:g}for(var a in b){c=d.names[a]||a;g=b[a];if(d.values[a]){c=d.values[a](e,g)}if(g===false||g===null){e.removeAttribute(c)}else{if(g===true){e.setAttribute(c,c)}else{e.setAttribute(c,g)}}}return e},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var c=a.className;return(c.length&gt;0&amp;&amp;(c==b||new RegExp(&quot;(^|\\s)&quot;+b+&quot;(\\s|$)&quot;).test(c)))},addClassName:function(a,b){if(!(a=$(a))){return}if(!a.hasClassName(b)){a.className+=(a.className?&quot; &quot;:&quot;&quot;)+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp(&quot;(^|\\s+)&quot;+b+&quot;(\\s+|$)&quot;),&quot; &quot;).strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return a[a.hasClassName(b)?&quot;removeClassName&quot;:&quot;addClassName&quot;](b)},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&amp;&amp;!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&amp;8)===8}if(a.contains){return a.contains(b)&amp;&amp;a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=a.cumulativeOffset();window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c==&quot;float&quot;?&quot;cssFloat&quot;:c.camelize();var d=b.style[c];if(!d||d==&quot;auto&quot;){var a=document.defaultView.getComputedStyle(b,null);d=a?a[c]:null}if(c==&quot;opacity&quot;){return d?parseFloat(d):1}return d==&quot;auto&quot;?null:d},getOpacity:function(a){return $(a).getStyle(&quot;opacity&quot;)},setStyle:function(b,c){b=$(b);var e=b.style,a;if(Object.isString(c)){b.style.cssText+=&quot;;&quot;+c;return c.include(&quot;opacity&quot;)?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var d in c){if(d==&quot;opacity&quot;){b.setOpacity(c[d])}else{e[(d==&quot;float&quot;||d==&quot;cssFloat&quot;)?(Object.isUndefined(e.styleFloat)?&quot;cssFloat&quot;:&quot;styleFloat&quot;):d]=c[d]}}return b},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b===&quot;&quot;)?&quot;&quot;:(b&lt;0.00001)?0:b;return a},getDimensions:function(c){c=$(c);var h=c.getStyle(&quot;display&quot;);if(h!=&quot;none&quot;&amp;&amp;h!=null){return{width:c.offsetWidth,height:c.offsetHeight}}var b=c.style;var g=b.visibility;var d=b.position;var a=b.display;b.visibility=&quot;hidden&quot;;b.position=&quot;absolute&quot;;b.display=&quot;block&quot;;var j=c.clientWidth;var e=c.clientHeight;b.display=a;b.position=d;b.visibility=g;return{width:j,height:e}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,&quot;position&quot;);if(b==&quot;static&quot;||!b){a._madePositioned=true;a.style.position=&quot;relative&quot;;if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=&quot;&quot;}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,&quot;overflow&quot;)||&quot;auto&quot;;if(a._overflow!==&quot;hidden&quot;){a.style.overflow=&quot;hidden&quot;}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow==&quot;auto&quot;?&quot;&quot;:a._overflow;a._overflow=null;return a},cumulativeOffset:function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;b=b.offsetParent}while(b);return Element._returnOffset(c,a)},positionedOffset:function(b){var a=0,d=0;do{a+=b.offsetTop||0;d+=b.offsetLeft||0;b=b.offsetParent;if(b){if(b.tagName.toUpperCase()==&quot;BODY&quot;){break}var c=Element.getStyle(b,&quot;position&quot;);if(c!==&quot;static&quot;){break}}}while(b);return Element._returnOffset(d,a)},absolutize:function(b){b=$(b);if(b.getStyle(&quot;position&quot;)==&quot;absolute&quot;){return b}var d=b.positionedOffset();var g=d[1];var e=d[0];var c=b.clientWidth;var a=b.clientHeight;b._originalLeft=e-parseFloat(b.style.left||0);b._originalTop=g-parseFloat(b.style.top||0);b._originalWidth=b.style.width;b._originalHeight=b.style.height;b.style.position=&quot;absolute&quot;;b.style.top=g+&quot;px&quot;;b.style.left=e+&quot;px&quot;;b.style.width=c+&quot;px&quot;;b.style.height=a+&quot;px&quot;;return b},relativize:function(a){a=$(a);if(a.getStyle(&quot;position&quot;)==&quot;relative&quot;){return a}a.style.position=&quot;relative&quot;;var c=parseFloat(a.style.top||0)-(a._originalTop||0);var b=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=c+&quot;px&quot;;a.style.left=b+&quot;px&quot;;a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(b){var a=0,c=0;do{a+=b.scrollTop||0;c+=b.scrollLeft||0;b=b.parentNode}while(b);return Element._returnOffset(c,a)},getOffsetParent:function(a){if(a.offsetParent){return $(a.offsetParent)}if(a==document.body){return $(a)}while((a=a.parentNode)&amp;&amp;a!=document.body){if(Element.getStyle(a,&quot;position&quot;)!=&quot;static&quot;){return $(a)}}return $(document.body)},viewportOffset:function(d){var a=0,c=0;var b=d;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body&amp;&amp;Element.getStyle(b,&quot;position&quot;)==&quot;absolute&quot;){break}}while(b=b.offsetParent);b=d;do{if(!Prototype.Browser.Opera||(b.tagName&amp;&amp;(b.tagName.toUpperCase()==&quot;BODY&quot;))){a-=b.scrollTop||0;c-=b.scrollLeft||0}}while(b=b.parentNode);return Element._returnOffset(c,a)},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});d=$(d);var e=d.viewportOffset();b=$(b);var g=[0,0];var c=null;if(Element.getStyle(b,&quot;position&quot;)==&quot;absolute&quot;){c=b.getOffsetParent();g=c.viewportOffset()}if(c==document.body){g[0]-=document.body.offsetLeft;g[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(e[0]-g[0]+a.offsetLeft)+&quot;px&quot;}if(a.setTop){b.style.top=(e[1]-g[1]+a.offsetTop)+&quot;px&quot;}if(a.setWidth){b.style.width=d.offsetWidth+&quot;px&quot;}if(a.setHeight){b.style.height=d.offsetHeight+&quot;px&quot;}return b}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:&quot;class&quot;,htmlFor:&quot;for&quot;},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,b,c){switch(c){case&quot;left&quot;:case&quot;top&quot;:case&quot;right&quot;:case&quot;bottom&quot;:if(d(b,&quot;position&quot;)===&quot;static&quot;){return null}case&quot;height&quot;:case&quot;width&quot;:if(!Element.visible(b)){return null}var e=parseInt(d(b,c),10);if(e!==b[&quot;offset&quot;+c.capitalize()]){return e+&quot;px&quot;}var a;if(c===&quot;height&quot;){a=[&quot;border-top-width&quot;,&quot;padding-top&quot;,&quot;padding-bottom&quot;,&quot;border-bottom-width&quot;]}else{a=[&quot;border-left-width&quot;,&quot;padding-left&quot;,&quot;padding-right&quot;,&quot;border-right-width&quot;]}return a.inject(e,function(g,h){var j=d(b,h);return j===null?g:g-parseInt(j,10)})+&quot;px&quot;;default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b===&quot;title&quot;){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(c,b){b=$(b);try{b.offsetParent}catch(g){return $(document.body)}var a=b.getStyle(&quot;position&quot;);if(a!==&quot;static&quot;){return c(b)}b.setStyle({position:&quot;relative&quot;});var d=c(b);b.setStyle({position:a});return d});$w(&quot;positionedOffset viewportOffset&quot;).each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(g,c){c=$(c);try{c.offsetParent}catch(j){return Element._returnOffset(0,0)}var b=c.getStyle(&quot;position&quot;);if(b!==&quot;static&quot;){return g(c)}var d=c.getOffsetParent();if(d&amp;&amp;d.getStyle(&quot;position&quot;)===&quot;fixed&quot;){d.setStyle({zoom:1})}c.setStyle({position:&quot;relative&quot;});var h=g(c);c.setStyle({position:b});return h})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(b,a){try{a.offsetParent}catch(c){return Element._returnOffset(0,0)}return b(a)});Element.Methods.getStyle=function(a,b){a=$(a);b=(b==&quot;float&quot;||b==&quot;cssFloat&quot;)?&quot;styleFloat&quot;:b.camelize();var c=a.style[b];if(!c&amp;&amp;a.currentStyle){c=a.currentStyle[b]}if(b==&quot;opacity&quot;){if(c=(a.getStyle(&quot;filter&quot;)||&quot;&quot;).match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c==&quot;auto&quot;){if((b==&quot;width&quot;||b==&quot;height&quot;)&amp;&amp;(a.getStyle(&quot;display&quot;)!=&quot;none&quot;)){return a[&quot;offset&quot;+b.capitalize()]+&quot;px&quot;}return null}return c};Element.Methods.setOpacity=function(b,e){function g(h){return h.replace(/alpha\([^\)]*\)/gi,&quot;&quot;)}b=$(b);var a=b.currentStyle;if((a&amp;&amp;!a.hasLayout)||(!a&amp;&amp;b.style.zoom==&quot;normal&quot;)){b.style.zoom=1}var d=b.getStyle(&quot;filter&quot;),c=b.style;if(e==1||e===&quot;&quot;){(d=g(d))?c.filter=d:c.removeAttribute(&quot;filter&quot;);return b}else{if(e&lt;0.00001){e=0}}c.filter=g(d)+&quot;alpha(opacity=&quot;+(e*100)+&quot;)&quot;;return b};Element._attributeTranslations={read:{names:{&quot;class&quot;:&quot;className&quot;,&quot;for&quot;:&quot;htmlFor&quot;},values:{_getAttr:function(a,b){return a.getAttribute(b,2)},_getAttrNode:function(a,c){var b=a.getAttributeNode(c);return b?b.value:&quot;&quot;},_getEv:function(a,b){b=a.getAttribute(b);return b?b.toString().slice(23,-2):null},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){return a.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:&quot;cellPadding&quot;,cellspacing:&quot;cellSpacing&quot;},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:&quot;&quot;}}};Element._attributeTranslations.has={};$w(&quot;colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder&quot;).each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr,src:a._getAttr,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values)}else{if(Prototype.Browser.Gecko&amp;&amp;/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b===&quot;&quot;)?&quot;&quot;:(b&lt;0.00001)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1||b===&quot;&quot;)?&quot;&quot;:(b&lt;0.00001)?0:b;if(b==1){if(a.tagName.toUpperCase()==&quot;IMG&quot;&amp;&amp;a.width){a.width++;a.width--}else{try{var d=document.createTextNode(&quot; &quot;);a.appendChild(d);a.removeChild(d)}catch(c){}}}return a};Element.Methods.cumulativeOffset=function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,&quot;position&quot;)==&quot;absolute&quot;){break}}b=b.offsetParent}while(b);return Element._returnOffset(c,a)}}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(b,c){b=$(b);if(c&amp;&amp;c.toElement){c=c.toElement()}if(Object.isElement(c)){return b.update().insert(c)}c=Object.toHTML(c);var a=b.tagName.toUpperCase();if(a in Element._insertionTranslations.tags){$A(b.childNodes).each(function(d){b.removeChild(d)});Element._getContentFromAnonymousElement(a,c.stripScripts()).each(function(d){b.appendChild(d)})}else{b.innerHTML=c.stripScripts()}c.evalScripts.bind(c).defer();return b}}if(&quot;outerHTML&quot; in document.createElement(&quot;div&quot;)){Element.Methods.replace=function(c,e){c=$(c);if(e&amp;&amp;e.toElement){e=e.toElement()}if(Object.isElement(e)){c.parentNode.replaceChild(e,c);return c}e=Object.toHTML(e);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var g=c.next();var a=Element._getContentFromAnonymousElement(b,e.stripScripts());d.removeChild(c);if(g){a.each(function(h){d.insertBefore(h,g)})}else{a.each(function(h){d.appendChild(h)})}}else{c.outerHTML=e.stripScripts()}e.evalScripts.bind(e).defer();return c}}Element._returnOffset=function(b,c){var a=[b,c];a.left=b;a.top=c;return a};Element._getContentFromAnonymousElement=function(c,b){var d=new Element(&quot;div&quot;),a=Element._insertionTranslations.tags[c];if(a){d.innerHTML=a[0]+b+a[1];a[2].times(function(){d=d.firstChild})}else{d.innerHTML=b}return $A(d.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:[&quot;&lt;table&gt;&quot;,&quot;&lt;/table&gt;&quot;,1],TBODY:[&quot;&lt;table&gt;&lt;tbody&gt;&quot;,&quot;&lt;/tbody&gt;&lt;/table&gt;&quot;,2],TR:[&quot;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&quot;,&quot;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&quot;,3],TD:[&quot;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&quot;,&quot;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&quot;,4],SELECT:[&quot;&lt;select&gt;&quot;,&quot;&lt;/select&gt;&quot;,1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;var b=$(a).getAttributeNode(c);return !!(b&amp;&amp;b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&amp;&amp;document.createElement(&quot;div&quot;)[&quot;__proto__&quot;]){window.HTMLElement={};window.HTMLElement.prototype=document.createElement(&quot;div&quot;)[&quot;__proto__&quot;];Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var a={},b=Element.Methods.ByTag;var c=Object.extend(function(g){if(!g||g._extendedByPrototype||g.nodeType!=1||g==window){return g}var d=Object.clone(a),e=g.tagName.toUpperCase(),j,h;if(b[e]){Object.extend(d,b[e])}for(j in d){h=d[j];if(Object.isFunction(h)&amp;&amp;!(j in g)){g[j]=h.methodize()}}g._extendedByPrototype=Prototype.emptyFunction;return g},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});c.refresh();return c})();Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b)}return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(c){var j=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})}else{if(Object.isArray(b)){b.each(h)}else{h(b)}}function h(l){l=l.toUpperCase();if(!Element.Methods.ByTag[l]){Element.Methods.ByTag[l]={}}Object.extend(Element.Methods.ByTag[l],c)}function a(o,m,l){l=l||false;for(var q in o){var p=o[q];if(!Object.isFunction(p)){continue}if(!l||!(q in m)){m[q]=p.methodize()}}}function e(o){var l;var m={OPTGROUP:&quot;OptGroup&quot;,TEXTAREA:&quot;TextArea&quot;,P:&quot;Paragraph&quot;,FIELDSET:&quot;FieldSet&quot;,UL:&quot;UList&quot;,OL:&quot;OList&quot;,DL:&quot;DList&quot;,DIR:&quot;Directory&quot;,H1:&quot;Heading&quot;,H2:&quot;Heading&quot;,H3:&quot;Heading&quot;,H4:&quot;Heading&quot;,H5:&quot;Heading&quot;,H6:&quot;Heading&quot;,Q:&quot;Quote&quot;,INS:&quot;Mod&quot;,DEL:&quot;Mod&quot;,A:&quot;Anchor&quot;,IMG:&quot;Image&quot;,CAPTION:&quot;TableCaption&quot;,COL:&quot;TableCol&quot;,COLGROUP:&quot;TableCol&quot;,THEAD:&quot;TableSection&quot;,TFOOT:&quot;TableSection&quot;,TBODY:&quot;TableSection&quot;,TR:&quot;TableRow&quot;,TH:&quot;TableCell&quot;,TD:&quot;TableCell&quot;,FRAMESET:&quot;FrameSet&quot;,IFRAME:&quot;IFrame&quot;};if(m[o]){l=&quot;HTML&quot;+m[o]+&quot;Element&quot;}if(window[l]){return window[l]}l=&quot;HTML&quot;+o+&quot;Element&quot;;if(window[l]){return window[l]}l=&quot;HTML&quot;+o.capitalize()+&quot;Element&quot;;if(window[l]){return window[l]}window[l]={};window[l].prototype=document.createElement(o)[&quot;__proto__&quot;];return window[l]}if(j.ElementExtensions){a(Element.Methods,HTMLElement.prototype);a(Element.Methods.Simulated,HTMLElement.prototype,true)}if(j.SpecificElementExtensions){for(var k in Element.Methods.ByTag){var g=e(k);if(Object.isUndefined(g)){continue}a(d[k],g.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var a={},b=Prototype.Browser;$w(&quot;width height&quot;).each(function(e){var c=e.capitalize();if(b.WebKit&amp;&amp;!document.evaluate){a[e]=self[&quot;inner&quot;+c]}else{if(b.Opera&amp;&amp;parseFloat(window.opera.version())&lt;9.5){a[e]=document.body[&quot;client&quot;+c]}else{a[e]=document.documentElement[&quot;client&quot;+c]}}});return a},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};var Selector=Class.create({initialize:function(a){this.expression=a.strip();if(this.shouldUseSelectorsAPI()){this.mode=&quot;selectorsAPI&quot;}else{if(this.shouldUseXPath()){this.mode=&quot;xpath&quot;;this.compileXPathMatcher()}else{this.mode=&quot;normal&quot;;this.compileMatcher()}}},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false}var a=this.expression;if(Prototype.Browser.WebKit&amp;&amp;(a.include(&quot;-of-type&quot;)||a.include(&quot;:empty&quot;))){return false}if((/(\[[\w-]*?:|:checked)/).test(a)){return false}return true},shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(!Selector._div){Selector._div=new Element(&quot;div&quot;)}try{Selector._div.querySelector(this.expression)}catch(a){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=[&quot;this.matcher = function(root) {&quot;,&quot;var r = root, h = Selector.handlers, c = false, n;&quot;];while(e&amp;&amp;le!=e&amp;&amp;(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],&quot;&quot;);break}}}this.matcher.push(&quot;return h.unique(n);\n}&quot;);eval(this.matcher.join(&quot;\n&quot;));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var g=this.expression,h=Selector.patterns,b=Selector.xpath,d,a;if(Selector._cache[g]){this.xpath=Selector._cache[g];return}this.matcher=[&quot;.//*&quot;];while(g&amp;&amp;d!=g&amp;&amp;(/\S/).test(g)){d=g;for(var c in h){if(a=g.match(h[c])){this.matcher.push(Object.isFunction(b[c])?b[c](a):new Template(b[c]).evaluate(a));g=g.replace(a[0],&quot;&quot;);break}}}this.xpath=this.matcher.join(&quot;&quot;);Selector._cache[this.expression]=this.xpath},findElements:function(a){a=a||document;var c=this.expression,b;switch(this.mode){case&quot;selectorsAPI&quot;:if(a!==document){var d=a.id,g=$(a).identify();c=&quot;#&quot;+g+&quot; &quot;+c}b=$A(a.querySelectorAll(c)).map(Element.extend);a.id=d;return b;case&quot;xpath&quot;:return document._getElementsByXPath(this.xpath,a);default:return this.matcher(a)}},match:function(k){this.tokens=[];var r=this.expression,a=Selector.patterns,g=Selector.assertions;var b,d,h;while(r&amp;&amp;b!==r&amp;&amp;(/\S/).test(r)){b=r;for(var l in a){d=a[l];if(h=r.match(d)){if(g[l]){this.tokens.push([l,Object.clone(h)]);r=r.replace(h[0],&quot;&quot;)}else{return this.findElements(document).include(k)}}}}var q=true,c,o;for(var l=0,j;j=this.tokens[l];l++){c=j[0],o=j[1];if(!Selector.assertions[c](k,o)){q=false;break}}return q},toString:function(){return this.expression},inspect:function(){return&quot;#&lt;Selector:&quot;+this.expression.inspect()+&quot;&gt;&quot;}});Object.extend(Selector,{_cache:{},xpath:{descendant:&quot;//*&quot;,child:&quot;/*&quot;,adjacent:&quot;/following-sibling::*[1]&quot;,laterSibling:&quot;/following-sibling::*&quot;,tagName:function(a){if(a[1]==&quot;*&quot;){return&quot;&quot;}return&quot;[local-name()='&quot;+a[1].toLowerCase()+&quot;' or local-name()='&quot;+a[1].toUpperCase()+&quot;']&quot;},className:&quot;[contains(concat(' ', @class, ' '), ' #{1} ')]&quot;,id:&quot;[@id='#{1}']&quot;,attrPresence:function(a){a[1]=a[1].toLowerCase();return new Template(&quot;[@#{1}]&quot;).evaluate(a)},attr:function(a){a[1]=a[1].toLowerCase();a[3]=a[5]||a[6];return new Template(Selector.xpath.operators[a[2]]).evaluate(a)},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]];if(!b){return&quot;&quot;}if(Object.isFunction(b)){return b(a)}return new Template(Selector.xpath.pseudos[a[1]]).evaluate(a)},operators:{&quot;=&quot;:&quot;[@#{1}='#{3}']&quot;,&quot;!=&quot;:&quot;[@#{1}!='#{3}']&quot;,&quot;^=&quot;:&quot;[starts-with(@#{1}, '#{3}')]&quot;,&quot;$=&quot;:&quot;[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']&quot;,&quot;*=&quot;:&quot;[contains(@#{1}, '#{3}')]&quot;,&quot;~=&quot;:&quot;[contains(concat(' ', @#{1}, ' '), ' #{3} ')]&quot;,&quot;|=&quot;:&quot;[contains(concat('-', @#{1}, '-'), '-#{3}-')]&quot;},pseudos:{&quot;first-child&quot;:&quot;[not(preceding-sibling::*)]&quot;,&quot;last-child&quot;:&quot;[not(following-sibling::*)]&quot;,&quot;only-child&quot;:&quot;[not(preceding-sibling::* or following-sibling::*)]&quot;,empty:&quot;[count(*) = 0 and (count(text()) = 0)]&quot;,checked:&quot;[@checked]&quot;,disabled:&quot;[(@disabled) and (@type!='hidden')]&quot;,enabled:&quot;[not(@disabled) and (@type!='hidden')]&quot;,not:function(b){var k=b[6],j=Selector.patterns,a=Selector.xpath,g,c;var h=[];while(k&amp;&amp;g!=k&amp;&amp;(/\S/).test(k)){g=k;for(var d in j){if(b=k.match(j[d])){c=Object.isFunction(a[d])?a[d](b):new Template(a[d]).evaluate(b);h.push(&quot;(&quot;+c.substring(1,c.length-1)+&quot;)&quot;);k=k.replace(b[0],&quot;&quot;);break}}}return&quot;[not(&quot;+h.join(&quot; and &quot;)+&quot;)]&quot;},&quot;nth-child&quot;:function(a){return Selector.xpath.pseudos.nth(&quot;(count(./preceding-sibling::*) + 1) &quot;,a)},&quot;nth-last-child&quot;:function(a){return Selector.xpath.pseudos.nth(&quot;(count(./following-sibling::*) + 1) &quot;,a)},&quot;nth-of-type&quot;:function(a){return Selector.xpath.pseudos.nth(&quot;position() &quot;,a)},&quot;nth-last-of-type&quot;:function(a){return Selector.xpath.pseudos.nth(&quot;(last() + 1 - position()) &quot;,a)},&quot;first-of-type&quot;:function(a){a[6]=&quot;1&quot;;return Selector.xpath.pseudos[&quot;nth-of-type&quot;](a)},&quot;last-of-type&quot;:function(a){a[6]=&quot;1&quot;;return Selector.xpath.pseudos[&quot;nth-last-of-type&quot;](a)},&quot;only-of-type&quot;:function(a){var b=Selector.xpath.pseudos;return b[&quot;first-of-type&quot;](a)+b[&quot;last-of-type&quot;](a)},nth:function(h,e){var j,k=e[6],d;if(k==&quot;even&quot;){k=&quot;2n+0&quot;}if(k==&quot;odd&quot;){k=&quot;2n+1&quot;}if(j=k.match(/^(\d+)$/)){return&quot;[&quot;+h+&quot;= &quot;+j[1]+&quot;]&quot;}if(j=k.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(j[1]==&quot;-&quot;){j[1]=-1}var g=j[1]?Number(j[1]):1;var c=j[2]?Number(j[2]):0;d=&quot;[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} &gt;= 0)]&quot;;return new Template(d).evaluate({fragment:h,a:g,b:c})}}}},criteria:{tagName:'n = h.tagName(n, r, &quot;#{1}&quot;, c);      c = false;',className:'n = h.className(n, r, &quot;#{1}&quot;, c);    c = false;',id:'n = h.id(n, r, &quot;#{1}&quot;, c);           c = false;',attrPresence:'n = h.attrPresence(n, r, &quot;#{1}&quot;, c); c = false;',attr:function(a){a[3]=(a[5]||a[6]);return new Template('n = h.attr(n, r, &quot;#{1}&quot;, &quot;#{3}&quot;, &quot;#{2}&quot;, c); c = false;').evaluate(a)},pseudo:function(a){if(a[6]){a[6]=a[6].replace(/&quot;/g,'\\&quot;')}return new Template('n = h.pseudo(n, &quot;#{1}&quot;, &quot;#{6}&quot;, r, c); c = false;').evaluate(a)},descendant:'c = &quot;descendant&quot;;',child:'c = &quot;child&quot;;',adjacent:'c = &quot;adjacent&quot;;',laterSibling:'c = &quot;laterSibling&quot;;'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*&gt;\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~&gt;]))/,attrPresence:/^\[((?:[\w]+:)?[\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['&quot;])([^\4]*?)\4|([^'&quot;][^\]]*?)))?\]/},assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()},className:function(a,b){return Element.hasClassName(a,b[1])},id:function(a,b){return a.id===b[1]},attrPresence:function(a,b){return Element.hasAttribute(a,b[1])},attr:function(b,c){var a=Element.readAttribute(b,c[1]);return a&amp;&amp;Selector.operators[c[2]](a,c[5]||c[6])}},handlers:{concat:function(d,c){for(var e=0,g;g=c[e];e++){d.push(g)}return d},mark:function(a){var d=Prototype.emptyFunction;for(var b=0,c;c=a[b];b++){c._countedByPrototype=d}return a},unmark:function(a){for(var b=0,c;c=a[b];b++){c._countedByPrototype=undefined}return a},index:function(a,d,h){a._countedByPrototype=Prototype.emptyFunction;if(d){for(var b=a.childNodes,e=b.length-1,c=1;e&gt;=0;e--){var g=b[e];if(g.nodeType==1&amp;&amp;(!h||g._countedByPrototype)){g.nodeIndex=c++}}}else{for(var e=0,c=1,b=a.childNodes;g=b[e];e++){if(g.nodeType==1&amp;&amp;(!h||g._countedByPrototype)){g.nodeIndex=c++}}}},unique:function(b){if(b.length==0){return b}var d=[],e;for(var c=0,a=b.length;c&lt;a;c++){if(!(e=b[c])._countedByPrototype){e._countedByPrototype=Prototype.emptyFunction;d.push(Element.extend(e))}}return Selector.handlers.unmark(d)},descendant:function(a){var d=Selector.handlers;for(var c=0,b=[],e;e=a[c];c++){d.concat(b,e.getElementsByTagName(&quot;*&quot;))}return b},child:function(a){var e=Selector.handlers;for(var d=0,c=[],g;g=a[d];d++){for(var b=0,k;k=g.childNodes[b];b++){if(k.nodeType==1&amp;&amp;k.tagName!=&quot;!&quot;){c.push(k)}}}return c},adjacent:function(a){for(var c=0,b=[],e;e=a[c];c++){var d=this.nextElementSibling(e);if(d){b.push(d)}}return b},laterSibling:function(a){var d=Selector.handlers;for(var c=0,b=[],e;e=a[c];c++){d.concat(b,Element.nextSiblings(e))}return b},nextElementSibling:function(a){while(a=a.nextSibling){if(a.nodeType==1){return a}}return null},previousElementSibling:function(a){while(a=a.previousSibling){if(a.nodeType==1){return a}}return null},tagName:function(a,k,c,b){var l=c.toUpperCase();var e=[],j=Selector.handlers;if(a){if(b){if(b==&quot;descendant&quot;){for(var g=0,d;d=a[g];g++){j.concat(e,d.getElementsByTagName(c))}return e}else{a=this[b](a)}if(c==&quot;*&quot;){return a}}for(var g=0,d;d=a[g];g++){if(d.tagName.toUpperCase()===l){e.push(d)}}return e}else{return k.getElementsByTagName(c)}},id:function(b,a,k,g){var j=$(k),d=Selector.handlers;if(!j){return[]}if(!b&amp;&amp;a==document){return[j]}if(b){if(g){if(g==&quot;child&quot;){for(var c=0,e;e=b[c];c++){if(j.parentNode==e){return[j]}}}else{if(g==&quot;descendant&quot;){for(var c=0,e;e=b[c];c++){if(Element.descendantOf(j,e)){return[j]}}}else{if(g==&quot;adjacent&quot;){for(var c=0,e;e=b[c];c++){if(Selector.handlers.previousElementSibling(j)==e){return[j]}}}else{b=d[g](b)}}}}for(var c=0,e;e=b[c];c++){if(e==j){return[j]}}return[]}return(j&amp;&amp;Element.descendantOf(j,a))?[j]:[]},className:function(b,a,c,d){if(b&amp;&amp;d){b=this[d](b)}return Selector.handlers.byClassName(b,a,c)},byClassName:function(c,b,g){if(!c){c=Selector.handlers.descendant([b])}var j=&quot; &quot;+g+&quot; &quot;;for(var e=0,d=[],h,a;h=c[e];e++){a=h.className;if(a.length==0){continue}if(a==g||(&quot; &quot;+a+&quot; &quot;).include(j)){d.push(h)}}return d},attrPresence:function(c,b,a,h){if(!c){c=b.getElementsByTagName(&quot;*&quot;)}if(c&amp;&amp;h){c=this[h](c)}var e=[];for(var d=0,g;g=c[d];d++){if(Element.hasAttribute(g,a)){e.push(g)}}return e},attr:function(a,k,j,l,c,b){if(!a){a=k.getElementsByTagName(&quot;*&quot;)}if(a&amp;&amp;b){a=this[b](a)}var m=Selector.operators[c],g=[];for(var e=0,d;d=a[e];e++){var h=Element.readAttribute(d,j);if(h===null){continue}if(m(h,l)){g.push(d)}}return g},pseudo:function(b,c,e,a,d){if(b&amp;&amp;d){b=this[d](b)}if(!b){b=a.getElementsByTagName(&quot;*&quot;)}return Selector.pseudos[c](b,e,a)}},pseudos:{&quot;first-child&quot;:function(b,g,a){for(var d=0,c=[],e;e=b[d];d++){if(Selector.handlers.previousElementSibling(e)){continue}c.push(e)}return c},&quot;last-child&quot;:function(b,g,a){for(var d=0,c=[],e;e=b[d];d++){if(Selector.handlers.nextElementSibling(e)){continue}c.push(e)}return c},&quot;only-child&quot;:function(b,j,a){var e=Selector.handlers;for(var d=0,c=[],g;g=b[d];d++){if(!e.previousElementSibling(g)&amp;&amp;!e.nextElementSibling(g)){c.push(g)}}return c},&quot;nth-child&quot;:function(b,c,a){return Selector.pseudos.nth(b,c,a)},&quot;nth-last-child&quot;:function(b,c,a){return Selector.pseudos.nth(b,c,a,true)},&quot;nth-of-type&quot;:function(b,c,a){return Selector.pseudos.nth(b,c,a,false,true)},&quot;nth-last-of-type&quot;:function(b,c,a){return Selector.pseudos.nth(b,c,a,true,true)},&quot;first-of-type&quot;:function(b,c,a){return Selector.pseudos.nth(b,&quot;1&quot;,a,false,true)},&quot;last-of-type&quot;:function(b,c,a){return Selector.pseudos.nth(b,&quot;1&quot;,a,true,true)},&quot;only-of-type&quot;:function(b,d,a){var c=Selector.pseudos;return c[&quot;last-of-type&quot;](c[&quot;first-of-type&quot;](b,d,a),d,a)},getIndices:function(d,c,e){if(d==0){return c&gt;0?[c]:[]}return $R(1,e).inject([],function(a,b){if(0==(b-c)%d&amp;&amp;(b-c)/d&gt;=0){a.push(b)}return a})},nth:function(c,u,w,t,e){if(c.length==0){return[]}if(u==&quot;even&quot;){u=&quot;2n+0&quot;}if(u==&quot;odd&quot;){u=&quot;2n+1&quot;}var s=Selector.handlers,r=[],d=[],k;s.mark(c);for(var q=0,g;g=c[q];q++){if(!g.parentNode._countedByPrototype){s.index(g.parentNode,t,e);d.push(g.parentNode)}}if(u.match(/^\d+$/)){u=Number(u);for(var q=0,g;g=c[q];q++){if(g.nodeIndex==u){r.push(g)}}}else{if(k=u.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(k[1]==&quot;-&quot;){k[1]=-1}var x=k[1]?Number(k[1]):1;var v=k[2]?Number(k[2]):0;var y=Selector.pseudos.getIndices(x,v,c.length);for(var q=0,g,o=y.length;g=c[q];q++){for(var p=0;p&lt;o;p++){if(g.nodeIndex==y[p]){r.push(g)}}}}}s.unmark(c);s.unmark(d);return r},empty:function(b,g,a){for(var d=0,c=[],e;e=b[d];d++){if(e.tagName==&quot;!&quot;||e.firstChild){continue}c.push(e)}return c},not:function(a,d,l){var j=Selector.handlers,o,c;var k=new Selector(d).findElements(l);j.mark(k);for(var g=0,e=[],b;b=a[g];g++){if(!b._countedByPrototype){e.push(b)}}j.unmark(k);return e},enabled:function(b,g,a){for(var d=0,c=[],e;e=b[d];d++){if(!e.disabled&amp;&amp;(!e.type||e.type!==&quot;hidden&quot;)){c.push(e)}}return c},disabled:function(b,g,a){for(var d=0,c=[],e;e=b[d];d++){if(e.disabled){c.push(e)}}return c},checked:function(b,g,a){for(var d=0,c=[],e;e=b[d];d++){if(e.checked){c.push(e)}}return c}},operators:{&quot;=&quot;:function(b,a){return b==a},&quot;!=&quot;:function(b,a){return b!=a},&quot;^=&quot;:function(b,a){return b==a||b&amp;&amp;b.startsWith(a)},&quot;$=&quot;:function(b,a){return b==a||b&amp;&amp;b.endsWith(a)},&quot;*=&quot;:function(b,a){return b==a||b&amp;&amp;b.include(a)},&quot;$=&quot;:function(b,a){return b.endsWith(a)},&quot;*=&quot;:function(b,a){return b.include(a)},&quot;~=&quot;:function(b,a){return(&quot; &quot;+b+&quot; &quot;).include(&quot; &quot;+a+&quot; &quot;)},&quot;|=&quot;:function(b,a){return(&quot;-&quot;+(b||&quot;&quot;).toUpperCase()+&quot;-&quot;).include(&quot;-&quot;+(a||&quot;&quot;).toUpperCase()+&quot;-&quot;)}},split:function(b){var a=[];b.scan(/(([\w#:.~&gt;+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(c){a.push(c[1].strip())});return a},matchElements:function(g,j){var e=$$(j),d=Selector.handlers;d.mark(e);for(var c=0,b=[],a;a=g[c];c++){if(a._countedByPrototype){b.push(a)}}d.unmark(e);return b},findElement:function(b,c,a){if(Object.isNumber(c)){a=c;c=false}return Selector.matchElements(b,c||&quot;*&quot;)[a||0]},findChildElements:function(e,j){j=Selector.split(j.join(&quot;,&quot;));var d=[],g=Selector.handlers;for(var c=0,b=j.length,a;c&lt;b;c++){a=new Selector(j[c].strip());g.concat(d,a.findElements(e))}return(b&gt;1)?g.unique(d):d}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(d,c){for(var e=0,g;g=c[e];e++){if(g.tagName!==&quot;!&quot;){d.push(g)}}return d},unmark:function(a){for(var b=0,c;c=a[b];b++){c.removeAttribute(&quot;_countedByPrototype&quot;)}return a}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(h,b){if(typeof b!=&quot;object&quot;){b={hash:!!b}}else{if(Object.isUndefined(b.hash)){b.hash=true}}var c,g,a=false,e=b.submit;var d=h.inject({},function(j,k){if(!k.disabled&amp;&amp;k.name){c=k.name;g=$(k).getValue();if(g!=null&amp;&amp;k.type!=&quot;file&quot;&amp;&amp;(k.type!=&quot;submit&quot;||(!a&amp;&amp;e!==false&amp;&amp;(!e||c==e)&amp;&amp;(a=true)))){if(c in j){if(!Object.isArray(j[c])){j[c]=[j[c]]}j[c].push(g)}else{j[c]=g}}}return j});return b.hash?d:Object.toQueryString(d)}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(a){return $A($(a).getElementsByTagName(&quot;*&quot;)).inject([],function(b,c){if(Form.Element.Serializers[c.tagName.toLowerCase()]){b.push(Element.extend(c))}return b})},getInputs:function(h,c,d){h=$(h);var a=h.getElementsByTagName(&quot;input&quot;);if(!c&amp;&amp;!d){return $A(a).map(Element.extend)}for(var e=0,j=[],g=a.length;e&lt;g;e++){var b=a[e];if((c&amp;&amp;b.type!=c)||(d&amp;&amp;b.name!=d)){continue}j.push(Element.extend(b))}return j},disable:function(a){a=$(a);Form.getElements(a).invoke(&quot;disable&quot;);return a},enable:function(a){a=$(a);Form.getElements(a).invoke(&quot;enable&quot;);return a},findFirstElement:function(b){var c=$(b).getElements().findAll(function(d){return&quot;hidden&quot;!=d.type&amp;&amp;!d.disabled});var a=c.findAll(function(d){return d.hasAttribute(&quot;tabIndex&quot;)&amp;&amp;d.tabIndex&gt;=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return[&quot;input&quot;,&quot;select&quot;,&quot;textarea&quot;].include(d.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(b,a){b=$(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute(&quot;action&quot;)||&quot;&quot;;if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute(&quot;method&quot;)&amp;&amp;!a.method){a.method=b.method}return new Ajax.Request(c,a)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&amp;&amp;a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return&quot;&quot;},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value=&quot;&quot;;return a},present:function(a){return $(a).value!=&quot;&quot;},activate:function(a){a=$(a);try{a.focus();if(a.select&amp;&amp;(a.tagName.toLowerCase()!=&quot;input&quot;||![&quot;button&quot;,&quot;reset&quot;,&quot;submit&quot;].include(a.type))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(a,b){switch(a.type.toLowerCase()){case&quot;checkbox&quot;:case&quot;radio&quot;:return Form.Element.Serializers.inputSelector(a,b);default:return Form.Element.Serializers.textarea(a,b)}},inputSelector:function(a,b){if(Object.isUndefined(b)){return a.checked?a.value:null}else{a.checked=!!b}},textarea:function(a,b){if(Object.isUndefined(b)){return a.value}else{a.value=b}},select:function(c,g){if(Object.isUndefined(g)){return this[c.type==&quot;select-one&quot;?&quot;selectOne&quot;:&quot;selectMany&quot;](c)}else{var b,d,h=!Object.isArray(g);for(var a=0,e=c.length;a&lt;e;a++){b=c.options[a];d=this.optionValue(b);if(h){if(d==g){b.selected=true;return}}else{b.selected=g.include(d)}}}},selectOne:function(b){var a=b.selectedIndex;return a&gt;=0?this.optionValue(b.options[a]):null},selectMany:function(d){var a,e=d.length;if(!e){return null}for(var c=0,a=[];c&lt;e;c++){var b=d.options[c];if(b.selected){a.push(this.optionValue(b))}}return a},optionValue:function(a){return Element.extend(a).hasAttribute(&quot;value&quot;)?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);this.element=$(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&amp;&amp;Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()==&quot;form&quot;){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case&quot;checkbox&quot;:case&quot;radio&quot;:Event.observe(a,&quot;click&quot;,this.onElementEvent.bind(this));break;default:Event.observe(a,&quot;change&quot;,this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event={}}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(b){var a;switch(b.type){case&quot;mouseover&quot;:a=b.fromElement;break;case&quot;mouseout&quot;:a=b.toElement;break;default:return null}return Element.extend(a)}});Event.Methods=(function(){var a;if(Prototype.Browser.IE){var b={0:1,1:4,2:2};a=function(d,c){return d.button==b[c]}}else{if(Prototype.Browser.WebKit){a=function(d,c){switch(c){case 0:return d.which==1&amp;&amp;!d.metaKey;case 1:return d.which==1&amp;&amp;d.metaKey;default:return false}}}else{a=function(d,c){return d.which?(d.which===c+1):(d.button===c)}}}return{isLeftClick:function(c){return a(c,0)},isMiddleClick:function(c){return a(c,1)},isRightClick:function(c){return a(c,2)},element:function(e){e=Event.extend(e);var d=e.target,c=e.type,g=e.currentTarget;if(g&amp;&amp;g.tagName){if(c===&quot;load&quot;||c===&quot;error&quot;||(c===&quot;click&quot;&amp;&amp;g.tagName.toLowerCase()===&quot;input&quot;&amp;&amp;g.type===&quot;radio&quot;)){d=g}}if(d.nodeType==Node.TEXT_NODE){d=d.parentNode}return Element.extend(d)},findElement:function(d,g){var c=Event.element(d);if(!g){return c}var e=[c].concat(c.ancestors());return Selector.findElement(e,g,0)},pointer:function(e){var d=document.documentElement,c=document.body||{scrollLeft:0,scrollTop:0};return{x:e.pageX||(e.clientX+(d.scrollLeft||c.scrollLeft)-(d.clientLeft||0)),y:e.pageY||(e.clientY+(d.scrollTop||c.scrollTop)-(d.clientTop||0))}},pointerX:function(c){return Event.pointer(c).x},pointerY:function(c){return Event.pointer(c).y},stop:function(c){Event.extend(c);c.preventDefault();c.stopPropagation();c.stopped=true}}})();Event.extend=(function(){var a=Object.keys(Event.Methods).inject({},function(b,c){b[c]=Event.Methods[c].methodize();return b});if(Prototype.Browser.IE){Object.extend(a,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return&quot;[object Event]&quot;}});return function(b){if(!b){return false}if(b._extendedByPrototype){return b}b._extendedByPrototype=Prototype.emptyFunction;var c=Event.pointer(b);Object.extend(b,{target:b.srcElement,relatedTarget:Event.relatedTarget(b),pageX:c.x,pageY:c.y});return Object.extend(b,a)}}else{Event.prototype=Event.prototype||document.createEvent(&quot;HTMLEvents&quot;)[&quot;__proto__&quot;];Object.extend(Event.prototype,a);return Prototype.K}})();Object.extend(Event,(function(){var b=Event.cache;function c(l){if(l._prototypeEventID){return l._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return l._prototypeEventID=[++arguments.callee.id]}function h(l){if(l&amp;&amp;l.include(&quot;:&quot;)){return&quot;dataavailable&quot;}return l}function a(l){return b[l]=b[l]||{}}function g(o,l){var m=a(o);return m[l]=m[l]||[]}function j(m,l,o){var r=c(m);var q=g(r,l);if(q.pluck(&quot;handler&quot;).include(o)){return false}var p=function(s){if(!Event||!Event.extend||(s.eventName&amp;&amp;s.eventName!=l)){return false}Event.extend(s);o.call(m,s)};p.handler=o;q.push(p);return p}function k(p,l,m){var o=g(p,l);return o.find(function(q){return q.handler==m})}function d(p,l,m){var o=a(p);if(!o[l]){return false}o[l]=o[l].without(k(p,l,m))}function e(){for(var m in b){for(var l in b[m]){b[m][l]=null}}}if(window.attachEvent){window.attachEvent(&quot;onunload&quot;,e)}if(Prototype.Browser.WebKit){window.addEventListener(&quot;unload&quot;,Prototype.emptyFunction,false)}return{observe:function(o,l,p){o=$(o);var m=h(l);var q=j(o,l,p);if(!q){return o}if(o.addEventListener){o.addEventListener(m,q,false)}else{o.attachEvent(&quot;on&quot;+m,q)}return o},stopObserving:function(o,l,p){o=$(o);var r=c(o),m=h(l);if(!p&amp;&amp;l){g(r,l).each(function(s){o.stopObserving(l,s.handler)});return o}else{if(!l){Object.keys(a(r)).each(function(s){o.stopObserving(s)});return o}}var q=k(r,l,p);if(!q){return o}if(o.removeEventListener){o.removeEventListener(m,q,false)}else{o.detachEvent(&quot;on&quot;+m,q)}d(r,l,p);return o},fire:function(o,m,l){o=$(o);if(o==document&amp;&amp;document.createEvent&amp;&amp;!o.dispatchEvent){o=document.documentElement}var p;if(document.createEvent){p=document.createEvent(&quot;HTMLEvents&quot;);p.initEvent(&quot;dataavailable&quot;,true,true)}else{p=document.createEventObject();p.eventType=&quot;ondataavailable&quot;}p.eventName=m;p.memo=l||{};if(document.createEvent){o.dispatchEvent(p)}else{o.fireEvent(p.eventType,p)}return Event.extend(p)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var b;function a(){if(document.loaded){return}if(b){window.clearInterval(b)}document.fire(&quot;dom:loaded&quot;);document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){b=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){a()}},0);Event.observe(window,&quot;load&quot;,a)}else{document.addEventListener(&quot;DOMContentLoaded&quot;,a,false)}}else{document.write(&quot;&lt;script id=__onDOMContentLoaded defer src=//:&gt;&lt;\/script&gt;&quot;);$(&quot;__onDOMContentLoaded&quot;).onreadystatechange=function(){if(this.readyState==&quot;complete&quot;){this.onreadystatechange=null;a()}}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}};var $continue=new Error('&quot;throw $continue&quot; is deprecated, use &quot;return&quot; instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;this.ycomp=c;this.offset=Element.cumulativeOffset(b);return(c&gt;=this.offset[1]&amp;&amp;c&lt;this.offset[1]+b.offsetHeight&amp;&amp;a&gt;=this.offset[0]&amp;&amp;a&lt;this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=Element.cumulativeOffset(b);return(this.ycomp&gt;=this.offset[1]&amp;&amp;this.ycomp&lt;this.offset[1]+b.offsetHeight&amp;&amp;this.xcomp&gt;=this.offset[0]&amp;&amp;this.xcomp&lt;this.offset[0]+b.offsetWidth)},overlap:function(b,a){if(!b){return 0}if(b==&quot;vertical&quot;){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b==&quot;horizontal&quot;){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};return Element.clonePosition(c,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:&quot;[contains(concat(' ', @class, ' '), ' &quot;+c+&quot; ')]&quot;}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,e){e=e.toString().strip();var d=/\s/.test(e)?$w(e).map(a).join(&quot;&quot;):a(e);return d?document._getElementsByXPath(&quot;.//*&quot;+d,c):[]}:function(e,g){g=g.toString().strip();var h=[],j=(/\s/.test(g)?$w(g):null);if(!j&amp;&amp;!g){return h}var c=$(e).getElementsByTagName(&quot;*&quot;);g=&quot; &quot;+g+&quot; &quot;;for(var d=0,l,k;l=c[d];d++){if(l.className&amp;&amp;(k=&quot; &quot;+l.className+&quot; &quot;)&amp;&amp;(k.include(g)||(j&amp;&amp;j.all(function(m){return !m.toString().blank()&amp;&amp;k.include(&quot; &quot;+m+&quot; &quot;)})))){h.push(Element.extend(l))}}return h};return function(d,c){return $(c||document.body).getElementsByClassName(d)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length&gt;0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(&quot; &quot;))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(&quot; &quot;))},toString:function(){return $A(this).join(&quot; &quot;)}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();require(&quot;prototype&quot;);SproutCore={};SC=SproutCore;var YES=true;var NO=false;function require(a){return null}if(!window.console){window.console={_output:[],log:function(a){this._output.push(a)},tail:function(a){if(!a){a=1}var c=this._output.length-a;if(c&lt;0){c=0}var b=[];while(c&lt;this._output.length){b.push(this._output[c]);c++}return b.join(&quot;\n&quot;)}}}window.logCount=0;Object.extend(SC,{_downloadFrames:0,download:function(e){var a=document.createElement(&quot;iframe&quot;);var d=&quot;DownloadFrame_&quot;+this._downloadFrames;a.setAttribute(&quot;id&quot;,d);a.style.border=&quot;10px&quot;;a.style.width=&quot;0px&quot;;a.style.height=&quot;0px&quot;;a.style.position=&quot;absolute&quot;;a.style.top=&quot;-10000px&quot;;a.style.left=&quot;-10000px&quot;;if(!(SC.isSafari())){a.setAttribute(&quot;src&quot;,e)}document.getElementsByTagName(&quot;body&quot;)[0].appendChild(a);if(SC.isSafari()){a.setAttribute(&quot;src&quot;,e)}this._downloadFrames=this._downloadFrames+1;if(!(SC.isSafari())){var c=function(){document.body.removeChild(document.getElementById(d));d=null};var b=c.invokeLater(null,2000)}a=null},callOnLoad:function(b){if(SC._onloadQueueFlushed){b.call(document)}var a=SC._onloadQueue||[];a.push(b);SC._onloadQueue=a;a=null},didLoad:function(){SC.app=SC.Application.create();SC.app.run();var c=$tag(&quot;body&quot;);Element.addClassName(c,String.currentLanguage().toLowerCase());var a;SC.runLoop.beginRunLoop();if(window.callOnLoad){if(window.callOnLoad instanceof Array){a=window.callOnLoad}else{if(window.callOnLoad instanceof Function){a=[window.callOnLoad]}}}else{a=[]}a=a.concat(SC._onloadQueue);var d=null;while(d=a.shift()){d.call(document)}SC._onloadQueueFlushed=true;if(window.main&amp;&amp;(main instanceof Function)){main()}if(typeof Routes!=&quot;undefined&quot;){Routes.doRoutes()}else{if(typeof SC.Routes!=&quot;undefined&quot;){SC.Routes.ping()}}SC.runLoop.endRunLoop();c=null;a=null;d=null},normalizeURL:function(a){if(a.slice(0,1)==&quot;/&quot;){a=window.location.protocol+&quot;//&quot;+window.location.host+a}else{if((a.slice(0,5)==&quot;http:&quot;)||(a.slice(0,6)==&quot;https:&quot;)){}else{a=window.location.href+&quot;/&quot;+a}}return a},typeOf:function(b){if(b===undefined){return T_UNDEFINED}if(b===null){return T_NULL}var a=typeof(b);if(a==&quot;object&quot;){if(b instanceof Array){a=T_ARRAY}else{if(b instanceof Function){a=(b.isClass)?T_CLASS:T_FUNCTION}else{if(b instanceof SC.Error){a=T_ERROR}else{if(b.isObject===true){a=T_OBJECT}else{a=T_HASH}}}}}else{if(a===T_FUNCTION){a=(b.isClass)?T_CLASS:T_FUNCTION}}return a},isEqual:function(d,c){if(d===null){return c===null}else{if(d===undefined){return c===undefined}else{if(typeof(d)==typeof(c)){return d==c}}}},isArray:function(a){return($type(a)===T_ARRAY)||(a&amp;&amp;a.objectAt)},_nextGUID:0,guidFor:function(a){if(a==null){return 0}return a._guid?a._guid:(a._guid=SC._nextGUID++)},inspect:function(a){return $H(a).inspect()},Platform:{IE:function(){if(Prototype.Browser.IE){return(navigator.appVersion.match(/\bMSIE.*7\.\b/))?7:6}else{return 0}}(),IE8:function(){if(Prototype.Browser.IE){return(navigator.appVersion.match(/\bMSIE.*8\.\b/))?8:5}else{return 0}}(),Safari:function(){if(Prototype.Browser.WebKit){var a=parseInt(navigator.appVersion.replace(/^.*?AppleWebKit\/(\d+).*?$/,&quot;$1&quot;),0);return(a&gt;420)?3:2}return 0}(),Firefox:function(){var a=0;if(Prototype.Browser.Gecko){if(navigator.userAgent.indexOf(&quot;Firefox&quot;)!=-1){a=parseFloat((navigator.userAgent.match(/Firefox\/(.)/)[1])||0)}if(a&lt;1){a=2}}return a}(),Opera:function(){var a=0;if(Prototype.Browser.Opera){var b=navigator.userAgent;a=parseFloat(b.substring(b.lastIndexOf(&quot;/&quot;)+1))}return a}(),isWindows:function(){return !!(navigator.appVersion.match(/(Windows)/))}(),isMac:function(){if(Prototype.Browser.Gecko){return !!(navigator.appVersion.match(/(Macintosh)/))}else{return !!(navigator.appVersion.match(/(Mac OS X)/))}}()},isIE:function(){return SC.Platform.IE&gt;0},isSafari:function(){return SC.Platform.Safari&gt;0},isSafari3:function(){return SC.Platform.Safari&gt;=3},isIE7:function(){return SC.Platform.IE==7},isIE6:function(){return(SC.Platform.IE&gt;=6)&amp;&amp;(SC.Platform.IE&lt;7)},isWindows:function(){return SC.Platform.isWindows},isMacOSX:function(){return SC.Platform.isMac},isFireFox:function(){return SC.Platform.Firefox&gt;0},isFireFox2:function(){return SC.Platform.Firefox&gt;=2}});SC.getGUID=SC.guidFor;SC.Platform.Browser=function(){if(SC.Platform.IE&gt;0){if(SC.Platform.IE8==8){return&quot;IE8&quot;}return&quot;IE&quot;}else{if(SC.Platform.Safari&gt;0){return&quot;Safari&quot;}else{if(SC.Platform.Firefox&gt;0){return&quot;Firefox&quot;}else{if(SC.Platform.Opera&gt;0){return&quot;Opera&quot;}}}}}();T_ERROR=&quot;error&quot;;T_OBJECT=&quot;object&quot;;T_NULL=&quot;null&quot;;T_CLASS=&quot;class&quot;;T_HASH=&quot;hash&quot;;T_FUNCTION=&quot;function&quot;;T_UNDEFINED=&quot;undefined&quot;;T_NUMBER=&quot;number&quot;;T_BOOL=&quot;boolean&quot;;T_ARRAY=&quot;array&quot;;T_STRING=&quot;string&quot;;$type=SC.typeOf;$I=SC.inspect;Object.extend(Object,{serialize:function(d){var a=[];for(var b in d){var c=d[b];if(typeof c==&quot;number&quot;){c=&quot;&quot;+c}if(!(typeof c==&quot;string&quot;)){c=c.join(&quot;,&quot;)}a.push(encodeURIComponent(b)+&quot;=&quot;+encodeURIComponent(c))}return a.join(&quot;&amp;&quot;)}});Element.setClassName=function(b,c,a){if(SC.isIE()){if(a){Element.addClassName(b,c)}else{Element.removeClassName(b,c)}}else{if(a){b.addClassName(c)}else{b.removeClassName(c)}}};Object.extend(Event,{getCharCode:function(a){return(a.keyCode)?a.keyCode:((a.which)?a.which:0)},getCharString:function(a){return String.fromCharCode(Event.getCharCode(a))},pointerLocation:function(b){var a={x:b.pageX||(b.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:b.pageY||(b.clientY+(document.documentElement.scrollTop||document.body.scrollTop))};return a},ALT_KEY:&quot;_ALT&quot;,CTRL_KEY:&quot;_CTRL&quot;,SHIFT_KEY:&quot;_SHIFT&quot;});require(&quot;core&quot;);String.English={};Object.extend(String.English,{&quot;Invalid.CreditCard(%@)&quot;:&quot;%@ is not a valid credit card number&quot;,&quot;Invalid.Email(%@)&quot;:&quot;%@ is not a valid email address&quot;,&quot;Invalid.NotEmpty(%@)&quot;:&quot;%@ must not be empty&quot;,&quot;Invalid.Password&quot;:&quot;Your passwords do not match.  Please try typing them again.&quot;,&quot;Invalid.General(%@)&quot;:&quot;%@ is invalid.  Please try again.&quot;,&quot;Invalid.Number(%@)&quot;:&quot;%@ is not a number.&quot;});SC.DelegateSupport={invokeDelegateMethod:function(c,a,b){b=$A(arguments);b=b.slice(2,b.length);if(!c||!c[a]){c=this}return c[a].apply(c,b)},getDelegateProperty:function(b,a){return(b&amp;&amp;(b[a]!=null))?b.get(a):this.get(a)}};var MONTH_NAMES=new Array(&quot;January&quot;,&quot;February&quot;,&quot;March&quot;,&quot;April&quot;,&quot;May&quot;,&quot;June&quot;,&quot;July&quot;,&quot;August&quot;,&quot;September&quot;,&quot;October&quot;,&quot;November&quot;,&quot;December&quot;,&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;,&quot;Sep&quot;,&quot;Oct&quot;,&quot;Nov&quot;,&quot;Dec&quot;);var DAY_NAMES=new Array(&quot;Sunday&quot;,&quot;Monday&quot;,&quot;Tuesday&quot;,&quot;Wednesday&quot;,&quot;Thursday&quot;,&quot;Friday&quot;,&quot;Saturday&quot;,&quot;Sun&quot;,&quot;Mon&quot;,&quot;Tue&quot;,&quot;Wed&quot;,&quot;Thu&quot;,&quot;Fri&quot;,&quot;Sat&quot;);function LZ(a){return(a&lt;0||a&gt;9?&quot;&quot;:&quot;0&quot;)+a}Object.extend(Date,{now:function(){return new Date().getTime()},isDate:function(c,b){var a=Date.getDateFromFormat(c,b);if(a==0){return false}return true},compareDates:function(e,g,c,d){var b=Date.getDateFromFormat(e,g);var a=Date.getDateFromFormat(c,d);if(b==0||a==0){return -1}else{if(b&gt;a){return 1}}return 0},getDateFromFormat:function(A,r){A=A+&quot;&quot;;r=r+&quot;&quot;;var z=0;var m=0;var t=&quot;&quot;;var g=&quot;&quot;;var w=&quot;&quot;;var j,h;var b=new Date();var k=b.getFullYear();var v=b.getMonth()+1;var u=1;var d=b.getHours();var s=b.getMinutes();var p=b.getSeconds();var l=&quot;&quot;;while(m&lt;r.length){t=r.charAt(m);g=&quot;&quot;;while((r.charAt(m)==t)&amp;&amp;(m&lt;r.length)){g+=r.charAt(m++)}if(g==&quot;yyyy&quot;||g==&quot;yy&quot;||g==&quot;y&quot;){if(g==&quot;yyyy&quot;){j=4;h=4}if(g==&quot;yy&quot;){j=2;h=2}if(g==&quot;y&quot;){j=2;h=4}k=Date._getInt(A,z,j,h);if(k==null){return 0}z+=k.length;if(k.length==2){if(k&gt;70){k=1900+(k-0)}else{k=2000+(k-0)}}}else{if(g==&quot;MMM&quot;||g==&quot;NNN&quot;){v=0;for(var q=0;q&lt;MONTH_NAMES.length;q++){var e=MONTH_NAMES[q];if(A.substring(z,z+e.length).toLowerCase()==e.toLowerCase()){if(g==&quot;MMM&quot;||(g==&quot;NNN&quot;&amp;&amp;q&gt;11)){v=q+1;if(v&gt;12){v-=12}z+=e.length;break}}}if((v&lt;1)||(v&gt;12)){return 0}}else{if(g==&quot;EE&quot;||g==&quot;E&quot;){for(var q=0;q&lt;DAY_NAMES.length;q++){var o=DAY_NAMES[q];if(A.substring(z,z+o.length).toLowerCase()==o.toLowerCase()){z+=o.length;break}}}else{if(g==&quot;MM&quot;||g==&quot;M&quot;){v=Date._getInt(A,z,g.length,2);if(v==null||(v&lt;1)||(v&gt;12)){return 0}z+=v.length}else{if(g==&quot;dd&quot;||g==&quot;d&quot;){u=Date._getInt(A,z,g.length,2);if(u==null||(u&lt;1)||(u&gt;31)){return 0}z+=u.length}else{if(g==&quot;hh&quot;||g==&quot;h&quot;){d=Date._getInt(A,z,g.length,2);if(d==null||(d&lt;1)||(d&gt;12)){return 0}z+=d.length}else{if(g==&quot;HH&quot;||g==&quot;H&quot;){d=Date._getInt(A,z,g.length,2);if(d==null||(d&lt;0)||(d&gt;23)){return 0}z+=d.length}else{if(g==&quot;KK&quot;||g==&quot;K&quot;){d=Date._getInt(A,z,g.length,2);if(d==null||(d&lt;0)||(d&gt;11)){return 0}z+=d.length}else{if(g==&quot;kk&quot;||g==&quot;k&quot;){d=Date._getInt(A,z,g.length,2);if(d==null||(d&lt;1)||(d&gt;24)){return 0}z+=d.length;d--}else{if(g==&quot;mm&quot;||g==&quot;m&quot;){s=Date._getInt(A,z,g.length,2);if(s==null||(s&lt;0)||(s&gt;59)){return 0}z+=s.length}else{if(g==&quot;ss&quot;||g==&quot;s&quot;){p=Date._getInt(A,z,g.length,2);if(p==null||(p&lt;0)||(p&gt;59)){return 0}z+=p.length}else{if(g==&quot;a&quot;){if(A.substring(z,z+2).toLowerCase()==&quot;am&quot;){l=&quot;AM&quot;}else{if(A.substring(z,z+2).toLowerCase()==&quot;pm&quot;){l=&quot;PM&quot;}else{return 0}}z+=2}else{if(A.substring(z,z+g.length)!=g){return 0}else{z+=g.length}}}}}}}}}}}}}}if(z!=A.length){return 0}if(v==2){if(((k%4==0)&amp;&amp;(k%100!=0))||(k%400==0)){if(u&gt;29){return 0}}else{if(u&gt;28){return 0}}}if((v==4)||(v==6)||(v==9)||(v==11)){if(u&gt;30){return 0}}if(d&lt;12&amp;&amp;l==&quot;PM&quot;){d=d-0+12}else{if(d&gt;11&amp;&amp;l==&quot;AM&quot;){d-=12}}var a=new Date(k,v-1,u,d,s,p);return a.getTime()},parseDate:function(m){var h=(arguments.length==2)?arguments[1]:false;generalFormats=new Array(&quot;E NNN dd HH:mm:ss UTC yyyy&quot;,&quot;y/M/d&quot;,&quot;y-M-d&quot;,&quot;MMM d, y&quot;,&quot;MMM d,y&quot;,&quot;y-MMM-d&quot;,&quot;d-MMM-y&quot;,&quot;MMM d&quot;,&quot;d MMM y&quot;,&quot;d.MMM.y&quot;,&quot;y MMM d&quot;,&quot;y.MMM.d&quot;);monthFirst=new Array(&quot;M/d/y&quot;,&quot;M-d-y&quot;,&quot;M.d.y&quot;,&quot;MMM-d&quot;,&quot;M/d&quot;,&quot;M-d&quot;);dateFirst=new Array(&quot;d/M/y&quot;,&quot;d-M-y&quot;,&quot;d.M.y&quot;,&quot;d-MMM&quot;,&quot;d/M&quot;,&quot;d-M&quot;);var b=new Array(&quot;generalFormats&quot;,h?&quot;dateFirst&quot;:&quot;monthFirst&quot;,h?&quot;monthFirst&quot;:&quot;dateFirst&quot;);var k=null;k=0;var e=new Date().getTime();switch(m.toLowerCase()){case&quot;yesterday&quot;.loc():k=e-(24*60*60*1000);break;case&quot;today&quot;.loc():case&quot;now&quot;.loc():k=e;break;case&quot;tomorrow&quot;.loc():k=e+(24*60*60*1000);break}if(k&gt;0){return new Date(k)}for(var g=0;g&lt;b.length;g++){var a=window[b[g]];for(var c=0;c&lt;a.length;c++){k=Date.getDateFromFormat(m,a[c]);if(k==0){k=Date.getDateFromFormat(m,a[c]+&quot; H:m:s&quot;)}if(k==0){k=Date.getDateFromFormat(m,a[c]+&quot; h:m:s a&quot;)}if(k!=0){return new Date(k)}}}return null},_isInteger:function(c){var b=&quot;1234567890&quot;;for(var a=0;a&lt;c.length;a++){if(b.indexOf(c.charAt(a))==-1){return false}}return true},_getInt:function(g,d,e,c){for(var a=c;a&gt;=e;a--){var b=g.substring(d,d+a);if(b.length&lt;e){return null}if(Date._isInteger(b)){return b}}return null}});Object.extend(Date.prototype,{format:function(I){I=I+&quot;&quot;;var N=this;var p=&quot;&quot;;var z=0;var L=&quot;&quot;;var g=&quot;&quot;;var o=N.getFullYear()+&quot;&quot;;var j=N.getMonth()+1;var J=N.getDate();var r=N.getDay();var q=N.getHours();var B=N.getMinutes();var u=N.getSeconds();var w,x,b,v,O,e,G,F,C,t,Q,q,P,l,a,D;var A=new Object();if(o.length&lt;4){o=&quot;&quot;+(o-0+1900)}A.y=&quot;&quot;+o;A.yyyy=o;A.yy=o.substring(2,4);A.M=j;A.MM=LZ(j);A.MMM=MONTH_NAMES[j-1];A.NNN=MONTH_NAMES[j+11];A.d=J;A.dd=LZ(J);A.E=DAY_NAMES[r+7];A.EE=DAY_NAMES[r];A.H=q;A.HH=LZ(q);if(q==0){A.h=12}else{if(q&gt;12){A.h=q-12}else{A.h=q}}A.hh=LZ(A.h);if(q&gt;11){A.K=q-12}else{A.K=q}A.k=q+1;A.KK=LZ(A.K);A.kk=LZ(A.k);if(q&gt;11){A.a=&quot;PM&quot;}else{A.a=&quot;AM&quot;}A.m=B;A.mm=LZ(B);A.s=u;A.ss=LZ(u);while(z&lt;I.length){L=I.charAt(z);g=&quot;&quot;;while((I.charAt(z)==L)&amp;&amp;(z&lt;I.length)){g+=I.charAt(z++)}if(A[g]!=null){p=p+A[g]}else{p=p+g}}return p},utcFormat:function(){return(new Date(this.getTime()+(this.getTimezoneOffset()*60*1000))).format(&quot;E NNN dd HH:mm:ss UTC yyyy&quot;)}});Object.extend(String.prototype,{capitalize:function(b){var a=(b==&quot;first&quot;)?this:this.split(&quot; &quot;);a=a.map(function(c){if(c.length==0){return c}return c.charAt(0).toUpperCase()+c.substring(1)});return a.join(&quot; &quot;)},format:function(){var c=$A(arguments);var g=this.gsub(/%@([0-9]+)/,function(h){return(c[parseInt(h[1],0)-1]||&quot;&quot;).toString()});var b=[];var a=-1;var e=0;while((a=g.indexOf(&quot;%@&quot;,e))&gt;=0){b.push(g.slice(e,a));e=a+2;var d=c.shift();if(d&amp;&amp;d.toString){d=d.toString()}b.push(d)}if(e&lt;g.length){b.push(g.slice(e,g.length))}return(b.length&gt;1)?b.join(&quot;&quot;):b[0]},loc:function(){var a=String[String.currentLanguage()];var b=a[this];if(!b){b=String.English[this]||this}return b.format.apply(b,arguments)},locWithDefault:function(c){var b=String[String.currentLanguage()];var d=b[this];if(!d){d=String.English[this]||c}var a=$A(arguments);a.shift();return d.format.apply(d,a)},classify:function(){return this.camelize().capitalize()},decamelize:function(){return this.replace(/([a-z])([A-Z])/g,&quot;$1_$2&quot;).toLowerCase()},dasherize:function(){return this.decamelize().replace(/[ _]/g,&quot;-&quot;)},humanize:function(){return this.decamelize().replace(/[-_]/g,&quot; &quot;)},toHref:function(){if(this.match(/.+@.+\...+/)){return&quot;mailto:&quot;+this}else{if(this.indexOf(&quot;http://&quot;)!=0&amp;&amp;this.indexOf(&quot;https://&quot;)!=0&amp;&amp;this.match(/[^.]+\.[^.]+/)){return&quot;http://&quot;+this}else{return this}}},trim:function(){return this.replace(/^\s+|\s+$/g,&quot;&quot;)},strip:function(){return this.trim()}});String.prototype.fmt=String.prototype.format;Object.extend(String,{browserLanguage:((navigator.language||navigator.browserLanguage).split(&quot;-&quot;,1)[0]),useAutodetectedLanguage:NO,preferredLanguage:null,currentLanguage:function(){var a=(this.useAutodetectedLanguage)?(this.browserLanguage||this.preferredLanguage||&quot;en&quot;):(this.preferredLanguage||this.browserLanguage||&quot;en&quot;);if(!this[a]){switch(a){case&quot;fr&quot;:a=&quot;French&quot;;break;case&quot;de&quot;:a=&quot;German&quot;;break;case&quot;ja&quot;:case&quot;jp&quot;:a=&quot;Japanese&quot;;break;case&quot;en&quot;:a=&quot;English&quot;;break;default:a=&quot;English&quot;;break}}return a}});String.English=String.English||{};String.French=String.French||{};String.German=String.German||{};String.Japanese=String.Japanese||{};require(&quot;core&quot;);require(&quot;foundation/date&quot;);require(&quot;foundation/string&quot;);SC.Benchmark={verbose:NO,enabled:YES,stats:{},globalStartTime:null,start:function(b,a,e,d){if(!this.enabled){return}var g=(e||Date.now());if(a){var c=this._subStatFor(b,a)}else{var c=this._statFor(b)}if(d&amp;&amp;c._starts.length&gt;0){c._starts.push(&quot;ignore&quot;)}else{c._starts.push(g)}c._times.push({start:g,_subStats:{}});return b},end:function(c,b,g){if(!this.enabled){return}if(b){var e=this._subStatFor(c,b)}else{var e=this._statFor(c)}var h=e._starts.pop();if(!h){console.log('SC.Benchmark &quot;%@&quot; ended without a matching start.  No information was saved.'.fmt(c));return}if(h==&quot;ignore&quot;){return}var a=(g||Date.now());var d=a-h;e._times[e._times.length-1].end=a;e._times[e._times.length-1].dur=d;e.amt+=d;e.runs++;if(this.verbose){this.log(c)}},setGlobalStartTime:function(a){this.globalStartTime=a},bench:function(e,d,a){if(!d){d=&quot;bench%@&quot;.fmt(this._benchCount++)}if(!a){a=1}var b;while(--a&gt;=0){var c=SC.Benchmark.start(d);b=e();SC.Benchmark.end(c)}return b},install:function(a,d,b){var c=a[&quot;b__&quot;+d]=a[d];a[d]=function(){var g=&quot;%@(%@)&quot;.fmt(d,$A(arguments).join(&quot;, &quot;));SC.Benchmark.start(g,b);var e=c.apply(this,arguments);SC.Benchmark.end(g);return e}},restore:function(a,b){a[b]=a[&quot;b__&quot;+b]},report:function(b){if(b){return this._genReport(b)}var a=[];for(var b in this.stats){if(!this.stats.hasOwnProperty(b)){continue}a.push(this._genReport(b))}return a.join(&quot;\n&quot;)},timelineReport:function(a){a=(a)?&quot;SproutCore Application&quot;:a;var b=[a,&quot;User-Agent: %@&quot;.fmt(navigator.userAgent),&quot;Report Generated: %@ (%@)&quot;.fmt(new Date().toString(),Date.now()),&quot;&quot;];var d=this._compileChartData(true);for(var c=0;c&lt;d.length;c++){if(d[c][4]){b.push(this._timelineGenSubReport(d[c]))}else{b.push(this._timelineGenReport(d[c]))}}return b.join(&quot;\n&quot;)},timelineChart:function(u){this.hideChart();var o=this._compileChartData(false);var k=o.length;if(k==0){return}var b=(this.globalStartTime)?this.globalStartTime:o[0][1];var d=o[k-1][2]-b;var p=50+k*30;var r=Math.ceil(d/200)+1;var t=r*50;var c=document.createElement(&quot;div&quot;);c.className=&quot;sc-benchmark-graph&quot;;document.body.appendChild(c);var v=document.createElement(&quot;div&quot;);v.innerHTML=((u)?u:&quot;SproutCore Application&quot;)+(&quot; - Total Captured Time: &quot;+d+&quot; ms - Points Captured: &quot;+k)+' [&lt;a href=&quot;javascript:SC.Benchmark.hideChart();&quot;&gt;Hide Chart&lt;/a&gt;]';v.className=&quot;sc-benchmark-title&quot;;c.appendChild(v);var g=document.createElement(&quot;div&quot;);g.className=&quot;sc-benchmark-top&quot;;g.style.width=t+&quot;px&quot;;c.appendChild(g);for(var q=0;q&lt;r;q++){var s=document.createElement(&quot;div&quot;);s.className=&quot;sc-benchmark-tick&quot;;s.style.left=(q*50)+&quot;px&quot;;s.style.height=p+&quot;px&quot;;var e=document.createElement(&quot;div&quot;);e.className=&quot;sc-benchmark-tick-label&quot;;e.style.left=(q*50)+&quot;px&quot;;e.innerHTML=q*200+&quot; ms&quot;;c.appendChild(s);c.appendChild(e)}for(var q=0;q&lt;k;q++){var l=document.createElement(&quot;div&quot;);l.style.top=(75+(q*30))+&quot;px&quot;;l.style.width=t+&quot;px&quot;;l.className=(q%2==0)?&quot;sc-benchmark-row even&quot;:&quot;sc-benchmark-row&quot;;c.appendChild(l);var m=document.createElement(&quot;div&quot;);var j=o[q][1];var h=o[q][2];var a=o[q][3];m.innerHTML=&quot;&amp;#160;&quot;+(o[q][0]+&quot; &lt;span class='sc-benchmark-emphasis'&gt;&quot;+a+&quot;ms&lt;/span&gt;&quot;);m.className=&quot;sc-benchmark-bar&quot;;m.style.cssText=&quot;left:&quot;+(((j-b)/4))+&quot;px; width: &quot;+((a/4))+&quot;px; top: &quot;+(53+(q*30))+&quot;px;&quot;;m.title=&quot;start: &quot;+(j-b)+&quot; ms, end: &quot;+(h-b)+&quot; ms, duration: &quot;+a+&quot; ms&quot;;c.appendChild(m)}this._graph=c},hideChart:function(){if(this._graph){document.body.removeChild(this._graph)}},log:function(a){console.log(this.report(a))},startProfile:function(a){if(!this.enabled){return}if(console&amp;&amp;console.profile){console.profile(a)}},endProfile:function(a){if(!this.enabled){return}if(console&amp;&amp;console.profileEnd){console.profileEnd(a)}},_compileChartData:function(h){var m=[];for(var o in this.stats){var e=this.stats[o];for(var g=0;g&lt;e._times.length;g++){var p=e._times[g];var a=(e._times.length&gt;1)?(g+1)+&quot; - &quot;+o:o;m.push([a,p.start,p.end,p.dur,false]);if(h){var b=p._subStats;for(var c in b){var l=b[c];for(var d=0;d&lt;l._times.length;d++){var q=l._times[d];var a=(l._times.length&gt;1)?(d+1)+&quot; - &quot;+c:c;m.push([a,q.start,q.end,q.dur,true])}}}}}m.sort(function(k,j){if(k[1]&lt;j[1]){return -1}else{if(k[1]==j[1]){if(k[3]&amp;&amp;!j[3]){return -1}if(!k[3]&amp;&amp;j[3]){return 1}return 0}}return 1});return m},_genReport:function(a){var b=this._statFor(a);var c=(b.runs&gt;0)?(Math.floor(b.amt*1000/b.runs)/1000):0;return&quot;BENCH %@ msec: %@ (%@x)&quot;.fmt(c,(b.name||a),b.runs)},_timelineGenReport:function(a){if(this.globalStartTime){return&quot;BENCH start: %@ msec, duration: %@ msec,  %@&quot;.fmt((a[1]-this.globalStartTime),a[3],a[0])}else{return&quot;BENCH duration: %@ msec, %@&quot;.fmt(a[3],a[0])}},_timelineGenSubReport:function(a){if(this.globalStartTime){return&quot;   CHECKPOINT BENCH start: %@ msec, duration: %@ msec,  %@&quot;.fmt((a[1]-this.globalStartTime),a[3],a[0])}else{return&quot;   CHECKPOINT BENCH duration: %@ msec, %@&quot;.fmt(a[3],a[0])}},_subStatFor:function(d,c){var e=this.stats[c]._times.length;if(e==0){return}var a=this.stats[c]._times[this.stats[c]._times.length-1]._subStats;var b=a[d];if(!b){b=a[d]={runs:0,amt:0,name:d,_starts:[],_times:[]}}return b},_statFor:function(b){var a=this.stats[b];if(!a){a=this.stats[b]={runs:0,amt:0,name:b,_starts:[],_times:[]}}return a},reset:function(){this.stats={}},_bench:function(b,a){SC.Benchmark.bench(b,a,1)},_benchCount:1};SC.Observable={bind:function(a,g){var d=SC.idt.active;var h;var c={to:[this,a]};var e=$type(g);if(e==T_STRING||e==T_ARRAY){h=this[a+&quot;BindingDefault&quot;]||SC.Binding.From;h=h(g)}else{h=g}var b=h.prototype.from;if($type(b)==T_STRING){switch(b.slice(0,1)){case&quot;*&quot;:case&quot;.&quot;:b=[this,b.slice(1,b.length)]}}if(d){bt=new Date().getTime()}h=h.create(c,{from:b});this.bindings.push(h);if(d){SC.idt.b1_t+=(new Date().getTime())-bt}return h},didChangeFor:function(b){var j=$A(arguments);b=j.shift();var g=false;if(!this._didChangeCache){this._didChangeCache={}}if(!this._didChangeRevisionCache){this._didChangeRevisionCache={}}var a=this._didChangeCache[b]||{};var k=this._didChangeRevisionCache[b]||{};var e=j.length;var d=this._kvo().revision;while(--e&gt;=0){var h=j[e];if(k[h]!=d){var c=this.get(h);if(a[h]!==c){g=true}a[h]=c}k[h]=d}this._didChangeCache[b]=a;this._didChangeRevisionCache[b]=k;return g},get:function(b){var a=this[b];if(a===undefined){return this.unknownProperty(b)}else{if(a&amp;&amp;(a instanceof Function)&amp;&amp;a.isProperty){return a.call(this,b)}else{return a}}},set:function(b,d){var c=this[b];var a=d;this.propertyWillChange(b);if(c&amp;&amp;(c instanceof Function)&amp;&amp;(c.isProperty)){a=c.call(this,b,d)}else{if(c===undefined){a=this.unknownProperty(b,d)}else{a=this[b]=d}}this.propertyDidChange(b,a);return a},setIfChanged:function(a,b){return(this.get(a)!==b)?this.set(a,b):b},getPath:function(b){var a=SC.Object.tupleForPropertyPath(b,this);if(a[0]==null){return null}return a[0].get(a[1])},setPath:function(c,b){var a=SC.Object.tupleForPropertyPath(c,this);if(a[0]==null){return null}return a[0].set(a[1],b)},getEach:function(){var c=$A(arguments).flatten();var b=[];for(var a=0;a&lt;c.length;a++){b[b.length]=this.getPath(c[a])}return b},incrementProperty:function(a){return this.set(a,(this.get(a)||0)+1)},decrementProperty:function(a){return this.set(a,(this.get(a)||0)-1)},toggleProperty:function(a,b,c){if(b===undefined){b=true}if(c==undefined){c=false}b=(this.get(a)==b)?c:b;return this.set(a,b)},unknownProperty:function(a,b){if(!(b===undefined)){this[a]=b}return b},propertyObserver:function(a,d,b,c){},beginPropertyChanges:function(){this._kvo().changes++},endPropertyChanges:function(){var a=this._kvo();a.changes--;if(a.changes&lt;=0){this._notifyPropertyObservers()}},propertyWillChange:function(a){this._kvo().changes++},propertyDidChange:function(b,c){this._kvo().changed[b]=c;var a=this._kvo();a.changes--;a.revision++;if(a.changes&lt;=0){this._notifyPropertyObservers()}},notifyPropertyChange:function(a,b){this.propertyWillChange(a);this.propertyDidChange(a,b)},allPropertiesDidChange:function(){this._notifyPropertyObservers(true)},addObserver:function(j,a){var c=this._kvo();j=j.toString();var b=j.split(&quot;.&quot;);if(b.length&gt;1){var h=SC._ChainObserver.createChain(this,b,a);h.masterFunc=a;var g=c.chainObservers[j]||[];g.push(h);c.chainObservers[j]=g}else{var d=c.observers[j]=(c.observers[j]||[]);var k=false;var e=d.length;while(!k&amp;&amp;--e&gt;=0){k=(d[e]==a)}if(!k){d.push(a)}}},removeObserver:function(d,e){var c=this._kvo();d=d.toString();var g=d.split(&quot;.&quot;);if(g.length&gt;1){var b=c.chainObserver[d]||[];var a=[];b.each(function(j){if(j.masterFunc!=e){a.push(j)}});c.chainObservers[d]=a}else{var h=c.observers[d]||[];h=h.without(e);c.observers[d]=h}},addProbe:function(a){this.addObserver(a,logChange)},removeProbe:function(a){this.removeObserver(a,logChange)},logProperty:function(){var b=$A(arguments);for(var a=0;a&lt;b.length;a++){var c=b[a];console.log(&quot;%@:%@: &quot;.fmt(this._guid,c),this.get(c))}},observeOnce:function(a,c,d){var g=null;var e=this;var b=function(h,k,l,j){c(h,k,l,j);e.removeObserver(a,b);if(g){g.invalidate()}};e.addObserver(a,b);if(d){g=function(){b(e,a,e.get(a),true)}.invokeLater(this,d)}b.cancel=function(){e.removeObserver(a,b)};return b},registerDependentKey:function(b){var d=$A(arguments);var c=d.shift();var a=this._kvo();for(var e=0;e&lt;d.length;e++){var b=d[e];if(b instanceof Array){b.push(c);this.registerDependentKey.apply(this,b)}else{var g=a.dependents[b]||[];g.push(c);a.dependents[b]=g}}},_kvo:function(){if(!this._kvod){this._kvod={changes:0,changed:{},observers:{},dependents:{},chainObservers:{},revision:0}}return this._kvod},propertyRevision:1,_notifyPropertyObservers:function(g){var s;var e;var t=[];var j;var l;var r;var c=this._kvo();SC.Observers.flush();this.propertyRevision++;var b=(g)?c.observers:c.changed;var p={};var a=function(u){if(p[u]!==undefined){return}p[u]=u;if(g){return}var x=c.dependents[u];if(x&amp;&amp;x.length&gt;0){var w=x.length;while(--w&gt;=0){var v=x[w];a(v)}}};for(s in b){if(!b.hasOwnProperty(s)){continue}a(s)}for(s in p){if(!p.hasOwnProperty(s)){continue}t.push(s)}var h=c.observers[&quot;*&quot;];var d=c.changed;c.changed={};var k=this;j=t.length;var q={};while(--j&gt;=0){s=t[j];e=c.observers[s];if(!q[s]){q[s]=s;r=(g||(!d[s]))?this.get(s):d[s];if(h){e=(e)?e.concat(h):h}if(e){l=e.length;var o=[k,s,r,this.propertyRevision];while(--l&gt;=0){var m=e[l];SC.NotificationQueue.add(null,m,o)}}if(this.propertyObserver!=SC.Object.prototype.propertyObserver){SC.NotificationQueue.add(this,this.propertyObserver,[null,k,s,r,this.propertyRevision])}}}SC.NotificationQueue.flush()}};Object.extend(Function.prototype,{property:function(){this.dependentKeys=$A(arguments);this.isProperty=true;return this},observes:function(a){this.propertyPaths=$A(arguments);return this},typeConverter:function(){this.isTypeConverter=true;return this},invokeLater:function(d,a){if(a===undefined){a=1}var c=this;if(arguments.length&gt;2){var b=$A(arguments).slice(2,arguments.length);b.unshift(d);c=c.bind.apply(c,b)}return SC.Timer.schedule({target:d,action:c,interval:a})}});SC.Observers={queue:{},addObserver:function(d,c){if(typeof(d)==&quot;string&quot;){var a=SC.Object.tupleForPropertyPath(d)}else{var a=d}if(a){a[0].addObserver(a[1],c)}else{var b=this.queue[d]||[];b.push(c);this.queue[d]=b}},removeObserver:function(d,c){var a=SC.Object.tupleForPropertyPath(d);if(a){a[0].removeObserver(a[1],c)}var b=this.queue[d];if(b){b=b.without(c);this.queue[d]=b}},flush:function(){var b={};for(var e in this.queue){var c=this.queue[e];var a=SC.Object.tupleForPropertyPath(e);if(a){var g=c.length;while(--g&gt;=0){var d=c[g];a[0].addObserver(a[1],d)}}else{b[e]=c}}this.queue=b}};SC.NotificationQueue={queue:[],maxFlush:5000,_flushing:false,add:function(c,b,a){this.queue.push([c,b,a])},flush:function(c){if(this._flushing&amp;&amp;!c){return}this._flushing=true;var e=new Date().getTime();var a=e;var d=null;while(((a-e)&lt;this.maxFlush)&amp;&amp;(d=this.queue.pop())){var b=d[0]||d[1];d[1].apply(b,d[2]);a=Date.now()}this._flushing=false;if(this.queue.length&gt;0){SC.NotificationQueue.flush.invokeLater(SC.NotificationQueue,1)}}};require(&quot;mixins/observable&quot;);Object.extend(Array.prototype,SC.Observable);SC.OUT_OF_RANGE_EXCEPTION=&quot;Index out of range&quot;;SC.Array={replace:function(a,c,b){throw&quot;replace() must be implemented to support SC.Array&quot;},objectAt:function(a){if(a&lt;0){return undefined}if(a&gt;=this.get(&quot;length&quot;)){return undefined}return this.get(a)},_each:function(c){var a;for(var b=0,a=this.get(&quot;length&quot;);b&lt;a;b++){c(this.objectAt(b))}},arrayContentDidChange:function(){var a=(this._kvo)?this._kvo().changes:&quot;(null)&quot;;this.notifyPropertyChange(&quot;[]&quot;)},&quot;[]&quot;:function(a,b){if(b!==undefined){this.replace(0,this.get(&quot;length&quot;),b)}return this}.property(),insertAt:function(a,b){if(a&gt;this.get(&quot;length&quot;)){throw SC.OUT_OF_RANGE_EXCEPTION}this.replace(a,0,[b]);return this},removeAt:function(a){if((a&lt;0)||(a&gt;=this.get(&quot;length&quot;))){throw SC.OUT_OF_RANGE_EXCEPTION}var b=this.objectAt(a);this.replace(a,1,[]);return b},removeObject:function(b){var c=this.get(&quot;length&quot;)||0;while(--c&gt;=0){var a=this.objectAt(c);if(a==b){this.removeAt(c)}}return this},pushObject:function(a){this.insertAt(this.get(&quot;length&quot;),a);return a},popObject:function(){var a=this.get(&quot;length&quot;);if(a==0){return null}var b=this.objectAt(a-1);this.removeAt(a-1);return b},shiftObject:function(){if(this.get(&quot;length&quot;)==0){return null}var a=this.objectAt(0);this.removeAt(0);return a},unshiftObject:function(a){this.insertAt(0,a);return a},isEqual:function(a){if(!a){return false}if(a==this){return true}var b=a.get(&quot;length&quot;);if(b!=this.get(&quot;length&quot;)){return false}while(--b&gt;=0){if(a.objectAt(b)!=this.objectAt(b)){return false}}return true},invokeWhile:function(g,a){var c;var b=$A(arguments);g=b.shift();a=b.shift();try{this._each(function(h){var e=(h)?h[a]:null;c=e.apply(h,b);if(c!=g){throw $break}})}catch(d){if(d!=$break){throw d}}return c}};Object.extend(Array.prototype,SC.Array);Object.extend(SC.Array,Enumerable);Object.extend(SC.Array,{slice:function(b,d){var a=[];var c=this.get(&quot;length&quot;);if(b==null){b=0}if((d==null)||(d&gt;c)){d=c}while(b&lt;d){a[a.length]=this.objectAt(b++)}return a}});Object.extend(Array.prototype,{replace:function(a,d,c){if(!c||c.length==0){this.splice(a,d)}else{var b=[a,d].concat(c);this.splice.apply(this,b)}this.arrayContentDidChange();return this},each:function(b){try{for(var a=0;a&lt;this.length;a++){var c=this[a];b.call(c,c,a)}}catch(d){if(d!=$break){throw d}}return this},invoke:function(g){var d=$A(arguments);var a=d.shift();var c=[];try{for(var b=0;b&lt;this.length;b++){var h=this[b];c.push(h[a].apply(h,d))}}catch(j){if(j!=$break){throw j}}return c},invokeWhile:function(k,a){var d;var c=$A(arguments);k=c.shift();a=c.shift();try{for(var b=0;b&lt;this.length;b++){var h=this[b];var g=(h)?h[a]:null;d=g.apply(h,c);if(d!=k){return k}}}catch(j){if(j!=$break){throw j}}return d},map:function(c){var b=[];try{for(var a=0;a&lt;this.length;a++){var d=this[a];b.push((c||Prototype.K).call(d,d,a))}}catch(g){if(g!=$break){throw g}}return b},unknownProperty:function(a,b){if(b!==undefined){return null}return this.invoke(&quot;get&quot;,a)}});Array.prototype.collect=Array.prototype.map;Array.asArray=function(a){if(a&amp;&amp;((a.length===undefined)||($type(a)==T_FUNCTION))){return[a]}return(a)?a:[]};Array.from=Array.asArray;Object.extend(Enumerable,{invokeWhile:function(h,a){var c;var b=$A(arguments);h=b.shift();a=b.shift();try{var g=this;this._each(function(j){var e=(j)?j[a]:null;c=e.apply(j,b);if(c!=h){$break}})}catch(d){if(d!=$break){throw d}}return c}});require(&quot;core&quot;);require(&quot;foundation/benchmark&quot;);require(&quot;mixins/observable&quot;);require(&quot;mixins/array&quot;);SC.BENCHMARK_OBJECTS=NO;SC.Object=function(b){if(b===SC.Object._noinit_){return}var a=SC.Object._init.apply(this,$A(arguments));return a};Object.extend(SC.Object,{_noinit_:&quot;__noinit__&quot;,mixin:function(b){var a=$A(arguments);for(var c=0;c&lt;a.length;c++){Object.extend(this,a[c])}return this},extend:function(c){if(SC.BENCHMARK_OBJECTS){SC.Benchmark.start(&quot;SC.Object.extend&quot;)}var a=function(j){if(j&amp;&amp;(typeof(j)==&quot;string&quot;)&amp;&amp;(j==SC.Object._noinit_)){return}var h=SC.Object._init.apply(this,$A(arguments));return h};for(var g in this){a[g]=this[g]}var d=new this(SC.Object._noinit_);var b=$A(arguments);for(var e=0;e&lt;b.length;e++){d=SC.Object._extend(d,b[e])}a.prototype=d;a._guid=SC._nextGUID++;a._type=this;if(SC.BENCHMARK_OBJECTS){SC.Benchmark.end(&quot;SC.Object.extend&quot;)}return a},create:function(b){var a=new this($A(arguments),this);return a},createArray:function(b){var a=this;return b.map(function(c){return a.create(c)})},outlet:function(){var a=this;return function(){var b=a.create();b.owner=this;return b}},isClass:YES,objectClassName:function(){if(!this._objectClassName){this._findObjectClassNames()}if(this._objectClassName){return this._objectClassName}var a=this;while(a&amp;&amp;!a._objectClassName){a=a._type}return(a&amp;&amp;a._objectClassName)?a._objectClassName:&quot;Anonymous&quot;},_findObjectClassNames:function(){if(SC._foundObjectClassNames){return}SC._foundObjectClassNames=true;var b=[];var a=function(c,d,h){h--;if(b.indexOf(d)&gt;=0){return}b.push(d);for(var e in d){if(e==&quot;__scope__&quot;){continue}if(e==&quot;_type&quot;){continue}if(!e.match(/^[A-Z0-9]/)){continue}var j=(c)?[c,e].join(&quot;.&quot;):e;var g=d[e];switch($type(g)){case T_CLASS:if(!g._objectClassName){g._objectClassName=j}if(h&gt;=0){a(j,g,h)}break;case T_OBJECT:if(h&gt;=0){a(j,g,h)}break;case T_HASH:if(((c!=null)||(j==&quot;SC&quot;))&amp;&amp;(h&gt;=0)){a(j,g,h)}break;default:break}}};a(null,window,2)},toString:function(){return this.objectClassName()},tupleForPropertyPath:function(e,a){if(e.constructor==Array){return e}var d=e.split(&quot;*&quot;);var b=null;if(d&amp;&amp;d.length&gt;1){b=d.pop();e=d.join(&quot;*&quot;)}d=e.split(&quot;.&quot;);if(!b){b=d.pop()}var c=this.objectForPropertyPath(d,a);return(c&amp;&amp;b)?[c,b]:null},objectForPropertyPath:function(d,a){var c=(typeof(d)==&quot;string&quot;)?d.split(&quot;.&quot;):d;if(!a){a=window}var b=c.shift();while(b&amp;&amp;a){a=(a.get)?a.get(b):a[b];b=c.shift()}return(c.length&gt;0)?undefined:a},_init:function(c,b){var a=this;for(var d=0;d&lt;c.length;d++){a=SC.Object._extend(a,c[d])}a._guid=SC._nextGUID++;a._type=b;a.init();return a},_extend:function(b,a){return this._extendAllProps(false,b,a)},_extendAllProps:function(r,g,h){var b=g._cprops;var l=Prototype.emptyFunction;var d={};if(b){for(var o=0;o&lt;b.length;o++){var e=b[o];var u=g[e];var t=h[e];u=(u&amp;&amp;t)?Array.from(u).concat(t):(u||t);d[e]=u}}var c=(h._bindings)?null:(g._bindings||[]).slice();var k=(h._observers)?null:(g._observers||[]).slice();var m=(h._properties)?null:(g._properties||[]).slice();var j=(h.outlets)?null:(g.outlets||[]).slice();for(var s in h){if(!r&amp;&amp;!h.hasOwnProperty(s)){continue}var q=(d.hasOwnProperty(s)?d[s]:null)||h[s];if(q&amp;&amp;(q instanceof Function)&amp;&amp;(!q.base)){if(q!=g[s]){q.base=g[s]||l}}var a=s.length;if(c&amp;&amp;(s.slice(a-7,a)==&quot;Binding&quot;)){c.push(s)}else{if(q&amp;&amp;(q instanceof Function)){if(k&amp;&amp;q.propertyPaths){k.push(s)}else{if(m&amp;&amp;q.dependentKeys){m.push(s)}else{if(j&amp;&amp;q.autoconfiguredOutlet){j.push(s)}}}}}g[s]=q}if(c){g._bindings=c}if(k){g._observers=k}if(m){g._properties=m}if(j&amp;&amp;j.length&gt;0){g.outlets=j}return g},subclassOf:function(b){if(this==b){return false}var a=this._type;while(a){if(a==b){return true}a=a._type}return false},kindOf:function(a){if(this==a){return true}return this.subclassOf(a)}});SC.idt={count:0,t:0,keys:0,observers:0,bindings:0,pv:0,observers_t:0,bindings_t:0,pv_t:0,conf_t:0,b1_t:0,b2_t:0,b3_t:0,e_count:0,e_t:0,v_count:0,v_t:0,vc_t:0,active:false};SC.report=function(){var g=SC.idt.count;var d=SC.idt.e_count;var a=SC.idt.v_count;var b=[];b.push(&quot;CREATED: &quot;+g+&quot; (avg time: &quot;+(Math.floor(SC.idt.t*100/g)/100)+&quot; msec)&quot;);b.push(&quot;EXTENDED: &quot;+d+&quot; (avg time: &quot;+(Math.floor(SC.idt.e_t*100/d)/100)+&quot; msec)&quot;);b.push(&quot;AVG KEYS: &quot;+(Math.floor(SC.idt.keys*100/g)/100));b.push(&quot;AVG OBSERVERS: &quot;+(Math.floor(SC.idt.observers*100/g)/100)+&quot; (&quot;+(Math.floor(SC.idt.observers_t*100/g)/100)+&quot; msec)&quot;);b.push(&quot;AVG BINDINGS: &quot;+(Math.floor(SC.idt.bindings*100/g)/100)+&quot; (&quot;+(Math.floor(SC.idt.bindings_t*100/g)/100)+&quot; msec)&quot;);b.push(&quot;AVG PV: &quot;+(Math.floor(SC.idt.pv*100/g)/100)+&quot; (&quot;+(Math.floor(SC.idt.pv_t*100/g)/100)+&quot; msec)&quot;);b.push(&quot;AVG CONFIGURE OUTLETS: &quot;+(Math.floor(SC.idt.conf_t*100/g)/100)+&quot; msec&quot;);b.push(&quot;AVG B1: &quot;+(Math.floor(SC.idt.b1_t*100/g)/100)+&quot; msec&quot;);b.push(&quot;EXT: &quot;+SC.idt.ext_c+&quot; (avg time: &quot;+(Math.floor(SC.idt.ext_t*100/SC.idt.ext_c)/100)+&quot; msec)&quot;);b.push(&quot;VIEWS: &quot;+a+&quot; (avg time: &quot;+(Math.floor(SC.idt.v_t*100/a)/100)+&quot; msec)&quot;);b.push(&quot;VIEW CREATE: &quot;+(Math.floor(SC.idt.vc_t*100/a)/100)+&quot; msec)&quot;);console.log(b.join(&quot;\n&quot;));return b.join(&quot;\n&quot;)};SC.Object.prototype={isObject:true,respondsTo:function(a){return !!(a&amp;&amp;this[a]&amp;&amp;($type(this[a])==T_FUNCTION))},tryToPerform:function(a,c){if(!a){return false}var c=$A(arguments);var b=c.shift();if(this.respondsTo(b)){return this[b].apply(this,c)}return false},init:function(){var c=this.viewType||this;var l;var q;var p;var o;var a=SC.idt.active;var s;var b;if(a){SC.idt.count++;s=new Date().getTime()}if(q=c._observers){for(l=0;l&lt;q.length;l++){p=q[l];o=this[p];if(a){SC.idt.keys++;SC.idt.observers++;b=new Date().getTime()}var k=null;if((o instanceof Function)&amp;&amp;o.propertyPaths){k=o.propertyPaths;o=o.bind(this)}else{if(typeof(o)==&quot;string&quot;){k=[o];o=this.propertyObserver.bind(this,p.slice(0,-8))}}if(k){for(var g=0;g&lt;k.length;g++){var j=k[g];var e=null;if(j.indexOf(&quot;.&quot;)==-1){this.addObserver(j,o)}else{switch(j.slice(0,1)){case&quot;*&quot;:case&quot;.&quot;:j=j.slice(1,j.length);this.addObserver(j,o);break;default:SC.Observers.addObserver(j,o)}}}}if(a){SC.idt.observers_t+=(new Date().getTime())-b}}}this.bindings=[];if(q=c._bindings){for(l=0;l&lt;q.length;l++){p=q[l];o=this[p];if(a){SC.idt.keys++;SC.idt.bindings++;b=new Date().getTime()}var h=p.slice(0,-7);this[p]=this.bind(h,o);if(a){SC.idt.bindings_t+=(new Date().getTime())-b}}}if(q=c._properties){for(l=0;l&lt;q.length;l++){p=q[l];o=this[p];if(o&amp;&amp;o.dependentKeys&amp;&amp;(o.dependentKeys.length&gt;0)){args=o.dependentKeys.slice();args.unshift(p);this.registerDependentKey.apply(this,args)}}}if(this.initMixin){var d=Array.from(this.initMixin);for(var m=0;m&lt;d.length;m++){d[m].call(this)}}if(a){SC.idt.t+=((new Date().getTime())-s)}},$super:function(b){var a=SC.Object.prototype.$super.caller;if(!a){throw&quot;$super cannot determine the caller method&quot;}if(a.base){a.base.apply(this,arguments)}},mixin:function(){return SC.Object.mixin.apply(this,arguments)},keys:function(c){var a=[];for(var b in this){if(c||a.hasOwnProperty(b)){a.push(b)}}return a},instanceOf:function(a){return this._type==a},kindOf:function(b){var a=this._type;while(a){if(a==b){return true}a=a._type}return false},toString:function(){if(!this.__toString){this.__toString=&quot;%@:%@&quot;.fmt(this._type.objectClassName(),this._guid)}return this.__toString},awake:function(c){if(c!==undefined){var e=this.outlet(c);if(e){e.awake()}return}if(this._awake){return}this._awake=true;this.bindings.invoke(&quot;relay&quot;);if(this.outlets&amp;&amp;this.outlets.length){var b=[];var a=[this,this.outlets.slice()];while(a){var d=a[1].pop();var e=a[0];if(d){d=e[d];if(d){if(d.bindings){d.bindings.invoke(&quot;relay&quot;)}if(d.outlets&amp;&amp;d.outlets.length&gt;0){b.push(a);a=[d,d.outlets.slice()]}}}else{a=b.pop()}}}},outlets:[],outlet:function(a){var b=this[a];if(b&amp;&amp;(b instanceof Function)&amp;&amp;b.isOutlet==true){if(!this._originalOutlets){this._originalOutlets={}}this._originalOutlets[a]=b;b=b.call(this);this.set(a,b)}else{if(typeof(b)==&quot;string&quot;){if(!this._originalOutlets){this._originalOutlets={}}this._originalOutlets[a]=b;b=(this.$$sel)?this.$$sel(b):$$sel(b);if(b){b=(b.length&gt;0)?((b.length==1)?b[0]:b):null}this.set(a,b)}}return b},invokeLater:function(b,a){if(a===undefined){a=1}var d=b;if(arguments.length&gt;2){var c=$A(arguments).slice(2,arguments.length);c.unshift(this);if($type(d)===T_STRING){d=this[b]}d=d.bind.apply(d,c)}return SC.Timer.schedule({target:this,action:d,interval:a})},_cprops:[&quot;_cprops&quot;,&quot;outlets&quot;,&quot;_bindings&quot;,&quot;_observers&quot;,&quot;_properties&quot;,&quot;initMixin&quot;]};Object.extend(SC.Object.prototype,SC.Observable);function logChange(c,a,b){console.log(&quot;CHANGE: &quot;+c+&quot;[&quot;+a+&quot;]=&quot;+b)}SC._ChainObserver=SC.Object.extend({isChainObserver:true,target:null,property:null,next:null,func:null,propertyObserver:function(e,d,a,c){if((a==&quot;target&quot;)&amp;&amp;(c!=this._target)){var b=this.boundObserver();if(this._target&amp;&amp;this._target.removeObserver){this._target.removeObserver(this.property,b)}this._target=c;if(this._target&amp;&amp;this._target.addObserver){this._target.addObserver(this.property,b)}if(!(e==&quot;init&quot;)){this.targetPropertyObserver()}}},boundObserver:function(){if(!this._boundObserver){this._boundObserver=this.targetPropertyObserver.bind(this)}return this._boundObserver},targetPropertyObserver:function(){var a=(this.target&amp;&amp;this.target.get&amp;&amp;this.property)?this.target.get(this.property):null;if(a!==this._lastTargetProperty){this._lastTargetProperty=a;if(this.next){this.next.set(&quot;target&quot;,a)}else{if(this.func){this.func(this.target,this.property,a)}}}},init:function(){arguments.callee.base.call(this);this.propertyObserver(&quot;init&quot;,this,&quot;target&quot;,this.get(&quot;target&quot;))}});SC._ChainObserver.mixin({createChain:function(g,d,c){var e=d.shift();var a=(g&amp;&amp;e&amp;&amp;g.get)?g.get(e):null;var b=(d&amp;&amp;d.length&gt;0)?this.createChain(a,d,c):null;return this.create({target:g,property:e,next:b,func:((b)?null:c)})}});require(&quot;foundation/object&quot;);SC.Validator=SC.Object.extend({fieldValueForObject:function(b,c,a){return b},objectForFieldValue:function(c,b,a){return c},validate:function(a,b){return true},validateError:function(a,b){return $error(&quot;Invalid.General(%@)&quot;.loc(b.get(&quot;fieldValue&quot;)),b.get(&quot;fieldKey&quot;))},validateChange:function(b,c,a){return(this.validate(b,c))?SC.Validator.OK:this.validateError(b,c)},validateSubmit:function(a,b){return(this.validate(a,b))?SC.Validator.OK:this.validateError(a,b)},validatePartial:function(a,b){if(!b.get(&quot;isValid&quot;)){return(this.validate(a,b))?SC.Validator.OK:this.validateError(a,b)}else{return SC.Validator.NO_CHANGE}},validateKeypress:function(b,c,a){return true},attachTo:function(a,b){},detachFrom:function(a,b){}});SC.Validator.mixin({OK:true,NO_CHANGE:false,findFor:function(e,h,g){var c;if(!g){return}if(g instanceof SC.Validator){c=g}else{if(g.isClass){c=g.create()}else{if($type(g)==T_STRING){var b=null;var a=g.match(/^(.+)\[(.*)\]/);if(a){g=a[1];b=a[2]}g=(&quot;-&quot;+g).camelize();var d=SC.Validator[g];if(d==null){throw&quot;validator %@ not found for %@&quot;.fmt(g,h);return null}else{if(b){if(!e){throw&quot;named validator (%@) could not be found for field %@ because the field does not belong to a form&quot;.fmt(b,h);return null}if(!e._validatorHash){e._validatorHash={}}var c=(b)?e._validatorHash[b]:null;if(!c){c=d.create()}if(b){e._validatorHash[b]=c}}else{c=d.create()}}}}}return c},fieldValueForObject:function(a,b,c){return this.prototype.fieldValueForObject(a,b,c)},objectForFieldValue:function(b,a,c){return this.prototype.objectForFieldValue(b,a,c)}});require(&quot;validators/validator&quot;);SC.Validator.Number=SC.Validator.extend({places:0,fieldValueForObject:function(a,b,c){switch($type(a)){case T_NUMBER:a=a.toFixed(this.get(&quot;places&quot;));break;case T_NULL:case T_UNDEFINED:a=&quot;&quot;;break}return a},objectForFieldValue:function(b,a,c){switch($type(b)){case T_STRING:if(b.length==&quot;&quot;){b=null}else{if(this.get(&quot;places&quot;)&gt;0){b=parseFloat(b)}else{b=parseInt(b,0)}}break;case T_NULL:case T_UNDEFINED:b=null;break}return b},validate:function(a,c){var b=c.get(&quot;fieldValue&quot;);return(b==&quot;&quot;)||!(isNaN(b)||isNaN(parseFloat(b)))},validateError:function(b,c){var a=c.get(&quot;errorLabel&quot;)||&quot;Field&quot;;return $error(&quot;Invalid.Number(%@)&quot;.loc(a),a)}});require(&quot;foundation/object&quot;);SC.Record=SC.Object.extend({properties:[&quot;guid&quot;],primaryKey:&quot;guid&quot;,newRecord:false,changeCount:0,isDeleted:false,resourceURL:null,dataSource:SC.Store,init:function(){arguments.callee.base.apply(this,arguments);var a=this.get(&quot;primaryKey&quot;);if(!this.get(a)){var b=this.generateTempPrimaryKey();if(b){this.set(a,b)}}},generateTempPrimaryKey:function(){return&quot;@&quot;+SC.getGUID(this)},refresh:function(){if(!this.get(&quot;newRecord&quot;)){this.dataSource.refreshRecords([this])}},commit:function(){if(this.get(&quot;newRecord&quot;)){this.dataSource.createRecords([this])}else{this.dataSource.commitRecords([this])}},destroy:function(){this.dataSource.destroyRecords([this])},readAttribute:function(c){if(!this._cachedAttributes){this._cachedAttributes={}}var b=this._cachedAttributes[c];if(b===undefined){var a=this._attributes;b=(a)?a[c]:undefined;if(b!==undefined){var d=this._getRecordType(c+&quot;Type&quot;);b=this._propertyFromAttribute(b,d)}this._cachedAttributes[c]=b}return(b===undefined)?null:b},writeAttribute:function(b,c){var d=this._getRecordType(b+&quot;Type&quot;);var a=this._attributeFromProperty(c,d);if(!this._attributes){this._attributes={}}this._attributes[b]=a;if(this._cachedAttributes){delete this._cachedAttributes[b]}this.incrementProperty(&quot;changeCount&quot;);if(SC.Store){SC.Store.recordDidChange(this)}return c},updateAttributes:function(d,c,a){var e=false;if(this._attributes&amp;&amp;(c!==true)){for(var b in d){if(!d.hasOwnProperty(b)){continue}if(!e){e=(this._attributes[b]!=d[b])}this._attributes[b]=d[b]}}else{this._attributes=d;e=true}this._cachedAttributes={};if(e){this.beginPropertyChanges();this.set(&quot;changeCount&quot;,0);this.set(&quot;isLoaded&quot;,a);this.allPropertiesDidChange();this.endPropertyChanges();if(SC.Store){SC.Store.recordDidChange(this)}}},attributes:function(){return Object.clone(this._attributes)}.property(),unknownProperty:function(c,d){if(d!==undefined){var b=this.get(&quot;primaryKey&quot;);if(c==b){var a=this.get(c);var e=d}this.writeAttribute(c,d);if((c==b)&amp;&amp;a){SC.Store.relocateRecord(a,e,this)}}else{d=this.readAttribute(c)}return d},_attributeFromProperty:function(c,d){if(c&amp;&amp;c instanceof Array){var b=this;return c.map(function(e){return b._attributeFromProperty(e,d)})}else{var a=this._pickTypeConverter(d);if(a){return a(c,&quot;out&quot;)}if(d){return(c)?c.get(d.primaryKey()):null}else{return c}}},_propertyFromAttribute:function(c,d){if(c&amp;&amp;c instanceof Array){var b=this;return c.map(function(e){return b._propertyFromAttribute(e,d)})}else{var a=this._pickTypeConverter(d);if(a){return a(c,&quot;in&quot;)}if(d){if(!c){return null}return SC.Store.getRecordFor(c,d)}else{return c}}},_getRecordType:function(recordTypeKey){var type=this[recordTypeKey];if(type&amp;&amp;(typeof(type)==&quot;string&quot;)){type=eval(type);if(type){this[recordTypeKey]=type}}return type},valueForSortKey:function(a){return this.get(a)},compareTo:function(c,h){if(!h){h=[this.get(&quot;primaryKey&quot;)]}var e=SC.Record.SORT_SAME;var d;for(d=0;(e==SC.Record.SORT_SAME&amp;&amp;d&lt;h.length);d++){var l=h[d];var j=true;if(l.match(/ DESC$/)){j=false;l=l.slice(0,-5)}else{if(l.match(/ ASC$/)){j=true;l=l.slice(0,-4)}}var m=l.split(&quot;.&quot;);l=m.shift();var k=this.valueForSortKey(l);var g=c.valueForSortKey(l);k=this._comparableValueFor(k,m);g=this._comparableValueFor(g,m);if(j){e=(k&lt;g)?SC.Record.SORT_BEFORE:((k&gt;g)?SC.Record.SORT_AFTER:SC.Record.SORT_SAME)}else{e=(k&gt;g)?SC.Record.SORT_BEFORE:((k&lt;g)?SC.Record.SORT_AFTER:SC.Record.SORT_SAME)}}return e},_comparableValueFor:function(c,b){if(b&amp;&amp;b.length&gt;0){var a;var d=0;while(c&amp;&amp;(d&lt;b.length)){a=b[d];c=(c.get)?c.get(a):c[a];d++}}else{c=(c&amp;&amp;c._guid)?c._guid:c}return c},matchConditions:function(d){for(var a in d){var c=d[a];if(c instanceof Array){var e=c.length;var b=false;while(--e&gt;=0){if(this.matchCondition(a,c[e])){b=true}}if(!b){return false}}else{if(!this.matchCondition(a,c)){return false}}}return true},matchCondition:function(b,d){var a=this.get(b);var c;if(d&amp;&amp;d.primaryKey){d=d.get(d.primaryKey)}if(a instanceof Array){var e=a.length;while(--e&gt;=0){if(this._matchValue(a[e],d)){return true}}}else{return this._matchValue(a,d)}return false},_matchValue:function(a,b){if(a&amp;&amp;a.primaryKey&amp;&amp;typeof(b)==&quot;string&quot;){a=a.get(a.primaryKey)}var c=(b instanceof RegExp);return(c)?a.toString().match(b):a==b},toString:function(){var b=this;var a=this.get(&quot;properties&quot;).map(function(c){var d=b.get(c);if(typeof(d)==&quot;string&quot;){d='&quot;'+d+'&quot;'}if(d===undefined){d=&quot;(undefined)&quot;}if(d===null){d=&quot;(null)&quot;}return[c,d].join(&quot;=&quot;)});return&quot;Record({ &quot;+a.join(&quot;, &quot;)+&quot; })&quot;},propertyObserver:function(d,c,a,b){},_cprops:[&quot;properties&quot;],updateProperties:function(l,b){var k=this;this.beginPropertyChanges();if(b){this.set(&quot;isLoaded&quot;,true)}try{var m=this.properties.length;while(--m&gt;=0){var c=this.properties[m];var d=l[c];if(d===null){if(k.get(c)!=null){k.set(c,null)}}else{if(d!==undefined){var a=k.get(c);var j=k.get(c+&quot;Type&quot;);var g=this._pickTypeConverter(j);if(g){j=null}var h;var k=this;if(d instanceof Array){d=d.map(function(e){return k._convertValueIn(e,g,j)});h=d.isEqual(a)}else{d=this._convertValueIn(d,g,j);h=d==a}if(!h){this.set(c,d)}}}}}catch(o){console.log(this._guid+&quot;: Exception raised on UPDATE: &quot;+o)}this.endPropertyChanges();this.set(&quot;changeCount&quot;,0)},getPropertyData:function(){var e={};var g=this.get(&quot;properties&quot;)||[];var d=g.length;while(--d&gt;=0){var l=g[d];var j=this.get(l);var c=this[l+&quot;Type&quot;];var b=this._pickTypeConverter(c);if(b){c=null}if(j instanceof Array){var a=[];for(var h=0;h&lt;j.length;h++){var k=j[h];a.push(this._convertValueOut(k,b,c))}j=a}else{j=this._convertValueOut(j,b,c)}e[l]=j}return e},_pickTypeConverter:function(b){var a=null;if(b&amp;&amp;b.isTypeConverter){a=b;b=null}else{if(b){switch(b){case Date:a=SC.Record.Date;b=null;break;case Number:a=SC.Record.Number;b=null;break;case String:a=null;b=null;break}}}return a},_convertValueOut:function(b,a,c){if(a){return a(b,&quot;out&quot;)}if(c){return(b)?b.get(c.primaryKey):null}else{return b}},_convertValueIn:function(b,a,c){if(a){return a(b,&quot;in&quot;)}if(c){return SC.Store.getRecordFor(b,c)}else{return b}},_storeKey:function(){return this._type._storeKey()}});SC.Record.mixin({SORT_BEFORE:-1,SORT_AFTER:1,SORT_SAME:0,find:function(c){var b;if(typeof(c)==&quot;object&quot;){b=$A(arguments);b.push(this);var a=SC.Store.findRecords.apply(SC.Store,b);return(a&amp;&amp;a.length&gt;0)?a[0]:null}else{return SC.Store._getRecordFor(c,this)}},findOrCreate:function(b){var a=this.find(b);if(!a){var c=(typeof(b)==&quot;object&quot;)?b:{guid:b};a=this.create(c);SC.Store.addRecord(a)}return a},findAll:function(a){if(!a){a={}}args=$A(arguments);args.push(this);return SC.Store.findRecords.apply(SC.Store,args)},collection:function(a){if(!a){a={}}a.recordType=this;return SC.Collection.create(a)},extend:function(){var a=SC.Object.extend.apply(this,arguments);if(a.coreRecordType==null){a.coreRecordType=a}return a},_storeKey:function(){return(this.coreRecordType)?this.coreRecordType._guid:this._guid},primaryKey:function(){return this.prototype.primaryKey},coreRecordType:null,resourceURL:function(){return this.prototype.resourceURL},hasMany:function(recordTypeString,conditionKey,opts){opts=(opts===undefined)?{}:Object.clone(opts);var conditions=opts.conditions||{};opts.conditions=conditions;var privateKey=&quot;_&quot;+conditionKey;return function(){if(!this[privateKey]){var recordType=eval(recordTypeString);conditions[conditionKey]=this;this[privateKey]=recordType.collection(opts);this[privateKey].refresh()}return this[privateKey]}.property()},newRecord:function(a,d){if(!d){d=SC.Store}var c=this.create({dataSource:d});c.beginPropertyChanges();c.set(&quot;newRecord&quot;,true);for(var b in a){if(a.hasOwnProperty(b)){c.set(b,a[b])}}c.endPropertyChanges();SC.Store.addRecord(c);return c}});SC.Record.Date=function(b,c){if(c==&quot;out&quot;){if(b instanceof Date){b=b.utcFormat()}}else{if(typeof(b)==&quot;string&quot;){var a=Date.parseDate(b.replace(/\.\d+$/,&quot;&quot;));if(a){b=a}}}return b}.typeConverter();SC.Record.Number=function(b,c){if(c==&quot;out&quot;){if(typeof(b)==&quot;number&quot;){b=b.toString()}}else{if(typeof(b)==&quot;string&quot;){var a=(b.match(&quot;.&quot;))?parseFloat(b):parseInt(b,0);if(a){b=a}}}return b}.typeConverter();SC.Record.Flag=function(a,b){if(b==&quot;out&quot;){return a=(a)?&quot;t&quot;:&quot;f&quot;}else{if(typeof(a)==&quot;string&quot;){return !(&quot;false0&quot;.match(a.toLowerCase()))}else{return(a)?true:false}}}.typeConverter();SC.Record.Bool=SC.Record.Flag;require(&quot;foundation/object&quot;);SC.Routes=SC.Object.create({location:function(b,c){if(c!==undefined){if(c===null){c=&quot;&quot;}if(typeof(c)==&quot;object&quot;){var d=(c.route)?c.route.split(&quot;&amp;&quot;):[&quot;&quot;];var a=d.shift();var e={};d.each(function(h){var g=h.split(&quot;=&quot;);e[g[0]]=g[1]});for(var b in c){if(!c.hasOwnProperty(b)){continue}if(b!=&quot;route&quot;){e[b]=encodeURIComponent(&quot;&quot;+c[b])}}d=[a];for(var b in e){if(!e.hasOwnProperty(b)){continue}d.push([b,e[b]].join(&quot;=&quot;))}c=d.join(&quot;&amp;&quot;)}if(this._location!=c){this._location=c;this._setWindowLocation(c)}}return this._location}.property(),ping:function(){if(!this._didSetupHistory){this._didSetupHistory=true;this._setupHistory()}this._checkWindowLocation()},addRoute:function(a,b){var c=a.split(&quot;/&quot;);if(!this._routes){this._routes=SC.Routes._Route.create()}this._routes.addRoute(c,b)},gotoRoute:function(a){var d={};var c,a,b;this._lastRoute=a;var c=a.split(&quot;&amp;&quot;);if(c&amp;&amp;c.length&gt;0){a=c.shift();c.each(function(e){var g=e.split(&quot;=&quot;);if(g&amp;&amp;g.length&gt;1){d[g[0]]=decodeURIComponent(g[1])}})}else{a=&quot;&quot;}c=a.split(&quot;/&quot;);if(!this._routes){this._routes=SC.Routes._Route.create()}b=this._routes.functionForRoute(c,d);if(b){b(d)}},init:function(){arguments.callee.base.call(this);if(SC.isSafari()&amp;&amp;!SC.isSafari3()){Object.extend(this,this.browserFuncs.safari)}else{if(SC.isIE()){Object.extend(this,this.browserFuncs.ie)}}this._didSetupHistory=false},browserFuncs:{safari:{_setupHistory:function(){var a=location.hash;a=(a&amp;&amp;a.length&gt;0)?a.slice(1,a.length):&quot;&quot;;this._cloc=a;this._backStack=[];this._backStack.length=history.length;this._backStack.push(a);this._forwardStack=[];this.invokeLater(this._checkWindowLocation,1000)},_checkWindowLocation:function(){var b=(history.length-this._lastLength)!=0;var e=(b)?(history.length-this._backStack.length):0;this._lastLength=history.length;if(b){console.log(&quot;historyDidChange&quot;)}if(e){if(e&lt;0){this._forwardStack.push(this._cloc);for(var a=0;a&lt;Math.abs(e+1);a++){this._forwardStack.push(this._backStack.pop())}this._cloc=this._backStack.pop()}else{this._backStack.push(this._cloc);for(var a=0;a&lt;(e-1);a++){this._backStack.push(this._forwardStack.pop())}this._cloc=this._forwardStack.pop()}}else{if(b&amp;&amp;this._locationDidChange){this.gotoRoute(this._cloc);this._locationDidChange=false}}var d=this._cloc;var c=this.get(&quot;location&quot;);if(d!=c){this.set(&quot;location&quot;,(d)?d:&quot;&quot;);this.gotoRoute(d)}this.invokeLater(this._checkWindowLocation,50)},_setWindowLocation:function(b){var a=this._cloc;if(a!=b){this._backStack.push(this._cloc);this._forwardStack.length=0;this._cloc=b;location.hash=(b&amp;&amp;b.length&gt;0)?b:&quot;&quot;;this._locationDidChange=true}}},ie:{_setupHistory:function(){this.invokeLater(this._checkWindowLocation,1000)},_checkWindowLocation:function(){var b=this.get(&quot;location&quot;);var a=location.hash;a=(a&amp;&amp;a.length&gt;0)?a.slice(1,a.length):&quot;&quot;;if(a!=b){this.set(&quot;location&quot;,(a)?a:&quot;&quot;)}this.invokeLater(this._checkWindowLocation,100)},_setWindowLocation:function(b){var a=location.hash;a=(a&amp;&amp;a.length&gt;0)?a.slice(1,a.length):&quot;&quot;;if(a!=b){location.hash=(b&amp;&amp;b.length&gt;0)?b:&quot;#&quot;}this.gotoRoute(b)}}},_setupHistory:function(){this.invokeLater(this._checkWindowLocation,1000)},_checkWindowLocation:function(){var b=this.get(&quot;location&quot;);var a=location.hash;a=(a&amp;&amp;a.length&gt;0)?a.slice(1,a.length):&quot;&quot;;if(a!=b){this.set(&quot;location&quot;,(a)?a:&quot;&quot;)}this.invokeLater(this._checkWindowLocation,100)},_setWindowLocation:function(b){var a=location.hash;a=(a&amp;&amp;a.length&gt;0)?a.slice(1,a.length):&quot;&quot;;if(a!=b){location.hash=(b&amp;&amp;b.length&gt;0)?b:&quot;#&quot;}this.gotoRoute(b)},_routes:null,_Route:SC.Object.extend({_func:null,_static:null,_dynamic:null,_wildcard:null,addRoute:function(d,c){if(!d||d.length==0){this._func=c}else{var b=d.shift();var e=null;switch(b.slice(0,1)){case&quot;:&quot;:b=b.slice(1,b.length);var a=this._dynamic[b]||[];e=SC.Routes._Route.create();a.push(e);this._dynamic[b]=a;break;case&quot;*&quot;:b=b.slice(1,b.length);this._wildcard=b;this._func=c;break;default:var a=this._static[b]||[];e=SC.Routes._Route.create();a.push(e);this._static[b]=a}if(e){e.addRoute(d,c)}}},functionForRoute:function(c,b){if(!c||c.length==0){return this._func}else{var a=c.shift();var k,h,e,d;k=this._static[a];if(k){for(d=0;(d&lt;k.length)&amp;&amp;(e==null);d++){var g=c.slice();e=k[d].functionForRoute(g,b)}}if(e==null){for(var j in this._dynamic){k=this._dynamic[j];if(k){for(d=0;(d&lt;k.length)&amp;&amp;(e==null);d++){var g=c.slice();e=k[d].functionForRoute(g,b);if(e&amp;&amp;b){b[j]=a}}}if(e){break}}}if((e==null)&amp;&amp;this._wildcard){c.unshift(a);if(b){b[this._wildcard]=c.join(&quot;/&quot;)}e=this._func}return e}},init:function(){arguments.callee.base.call(this);this._static={};this._dynamic={}}})});require(&quot;core&quot;);require(&quot;foundation/object&quot;);SC.InputManager=SC.Object.extend({interpretKeyEvents:function(e,c){var b=this.codesForEvent(e);var g=b[0];var d=b[1];if(!g&amp;&amp;!d){return false}if(g){var a=SC.MODIFIED_COMMAND_MAP[g]||SC.BASE_COMMAND_MAP[g.split(&quot;_&quot;).last()];if(a&amp;&amp;c.respondsTo(a)){return c[a](e)}}if(d&amp;&amp;c.respondsTo(&quot;insertText&quot;)){return c.insertText(d)}return false},codesForEvent:function(h){var g=h.keyCode;var b=null;var c=null;var a=&quot;&quot;;if(g){b=SC.FUNCTION_KEYS[g];if(!b&amp;&amp;(h.altKey||h.ctrlKey)){b=SC.PRINTABLE_KEYS[g]}if(b){if(h.altKey){a+=&quot;alt_&quot;}if(h.ctrlKey){a+=&quot;ctrl_&quot;}if(h.shiftKey){a+=&quot;shift_&quot;}}}if(!b){var g=h.charCode||h.keyCode;c=b=String.fromCharCode(g);var d=b.toLowerCase();if(b!=d){a=&quot;shift_&quot;;b=d}else{b=null}}if(b){b=a+b}return[b,c]}});SC.MODIFIED_COMMAND_MAP={&quot;ctrl_.&quot;:&quot;cancel&quot;,shift_tab:&quot;insertBacktab&quot;,shift_left:&quot;moveLeftAndModifySelection&quot;,shift_right:&quot;moveRightAndModifySelection&quot;,shift_up:&quot;moveUpAndModifySelection&quot;,shift_down:&quot;moveDownAndModifySelection&quot;,alt_left:&quot;moveLeftAndModifySelection&quot;,alt_right:&quot;moveRightAndModifySelection&quot;,alt_up:&quot;moveUpAndModifySelection&quot;,alt_down:&quot;moveDownAndModifySelection&quot;,ctrl_a:&quot;selectAll&quot;};SC.BASE_COMMAND_MAP={escape:&quot;cancel&quot;,backspace:&quot;deleteBackward&quot;,&quot;delete&quot;:&quot;deleteForward&quot;,&quot;return&quot;:&quot;insertNewline&quot;,tab:&quot;insertTab&quot;,left:&quot;moveLeft&quot;,right:&quot;moveRight&quot;,up:&quot;moveUp&quot;,down:&quot;moveDown&quot;,home:&quot;moveToBeginningOfDocument&quot;,end:&quot;moveToEndOfDocument&quot;,pagedown:&quot;pageDown&quot;,pageup:&quot;pageUp&quot;};SC.MODIFIER_KEYS={16:&quot;shift&quot;,17:&quot;ctrl&quot;,18:&quot;alt&quot;};SC.FUNCTION_KEYS={8:&quot;backspace&quot;,9:&quot;tab&quot;,13:&quot;return&quot;,19:&quot;pause&quot;,27:&quot;escape&quot;,33:&quot;pageup&quot;,34:&quot;pagedown&quot;,35:&quot;end&quot;,36:&quot;home&quot;,37:&quot;left&quot;,38:&quot;up&quot;,39:&quot;right&quot;,40:&quot;down&quot;,44:&quot;printscreen&quot;,45:&quot;insert&quot;,46:&quot;delete&quot;,112:&quot;f1&quot;,113:&quot;f2&quot;,114:&quot;f3&quot;,115:&quot;f4&quot;,116:&quot;f5&quot;,117:&quot;f7&quot;,119:&quot;f8&quot;,120:&quot;f9&quot;,121:&quot;f10&quot;,122:&quot;f11&quot;,123:&quot;f12&quot;,144:&quot;numlock&quot;,145:&quot;scrolllock&quot;};SC.PRINTABLE_KEYS={32:&quot; &quot;,48:&quot;0&quot;,49:&quot;1&quot;,50:&quot;2&quot;,51:&quot;3&quot;,52:&quot;4&quot;,53:&quot;5&quot;,54:&quot;6&quot;,55:&quot;7&quot;,56:&quot;8&quot;,57:&quot;9&quot;,59:&quot;;&quot;,61:&quot;=&quot;,65:&quot;a&quot;,66:&quot;b&quot;,67:&quot;c&quot;,68:&quot;d&quot;,69:&quot;e&quot;,70:&quot;f&quot;,71:&quot;g&quot;,72:&quot;h&quot;,73:&quot;i&quot;,74:&quot;j&quot;,75:&quot;k&quot;,76:&quot;l&quot;,77:&quot;m&quot;,78:&quot;n&quot;,79:&quot;o&quot;,80:&quot;p&quot;,81:&quot;q&quot;,82:&quot;r&quot;,83:&quot;s&quot;,84:&quot;t&quot;,85:&quot;u&quot;,86:&quot;v&quot;,87:&quot;w&quot;,88:&quot;x&quot;,89:&quot;y&quot;,90:&quot;z&quot;,107:&quot;+&quot;,109:&quot;-&quot;,110:&quot;.&quot;,188:&quot;,&quot;,190:&quot;.&quot;,191:&quot;/&quot;,192:&quot;`&quot;,219:&quot;[&quot;,220:&quot;\\&quot;,221:&quot;]&quot;,222:'&quot;'};SC.KEY_CODES={};for(var i=0,n=256;i&lt;n;i++){if(SC.MODIFIER_KEYS[i]!==undefined){SC.KEY_CODES[SC.MODIFIER_KEYS[i]]=i}else{if(SC.FUNCTION_KEYS[i]!==undefined){SC.KEY_CODES[SC.FUNCTION_KEYS[i]]=i}else{if(SC.PRINTABLE_KEYS[i]!==undefined){SC.KEY_CODES[SC.PRINTABLE_KEYS[i]]=i}}}}require(&quot;core&quot;);require(&quot;foundation/object&quot;);require(&quot;foundation/input_manager&quot;);SC.Responder=SC.Object.extend({acceptsFirstResponder:false,nextResponder:null,isFirstResponder:false,pane:null,becomeFirstResponder:function(){if(!this.get(&quot;acceptsFirstResponder&quot;)){return false}var a=this.get(&quot;pane&quot;);if(!a){return false}if(a.get(&quot;firstResponder&quot;)==this){return true}a.set(&quot;firstResponder&quot;,this);return true},resignFirstResponder:function(){var a=this.get(&quot;pane&quot;);if(!a){return false}if(a.get(&quot;firstResponder&quot;)!=this){return false}a.set(&quot;firstResponder&quot;,null);return true},noResponderFor:function(){},didBecomeFirstResponder:function(){},willLoseFirstResponder:function(){},inputManager:function(){return SC.Responder.inputManager}.property(),keyDown:function(a){var b=this.get(&quot;nextResponder&quot;);return(b&amp;&amp;b.keyDown)?b.keyDown(a):false},keyUp:function(a){var b=this.get(&quot;nextResponder&quot;);return(b&amp;&amp;b.keyUp)?b.keyUp(a):false},flagsChanged:function(b,a){var c=this.get(&quot;nextResponder&quot;);return(c&amp;&amp;c.flagsChanges)?c.flagsChanges(b,a):false},performKeyEquivalent:function(b,a){return false},interpretKeyEvents:function(a){var b=this.get(&quot;inputManager&quot;);if(b){return b.interpretKeyEvents(a,this)}return false},doCommand:function(h){var b=this;var c=$A(arguments);var h=c.shift();var a=this._commandAliases[h];var e=false;do{if(this._responderHandledCommand(b,h,c)){return b}if(a){for(var d=0,g=a.length;d&lt;g;d++){if(this._responderHandledCommand(b,a[d],c)){return b}}}}while(b=b.get(&quot;nextResponder&quot;));return false},_responderHandledCommand:function(a,c,b){return(a.respondsTo(c)&amp;&amp;(a[c].apply(a,b)!=false))},_commandAliases:{mouseDown:[&quot;didMouseDown&quot;],mouseUp:[&quot;didMouseUp&quot;],doubleClick:[&quot;didDoubleClick&quot;],click:[&quot;didClick&quot;],mouseDown:[&quot;didMouseDown&quot;]}});SC.Responder.mixin({inputManager:SC.InputManager.create()});require(&quot;core&quot;);SC.NodeDescriptor={create:function(c,a){if(!a){a={}}var o=a.tag||c.tag||&quot;div&quot;;var k=a.cssClass||c.cssClass;var e=a.id||c.id;var d=a.style||c.style;var l=a.innerHTML||c.innerHTML;if(!l){var m=a.childNodes||c.childNodes}var j=$(document.createElement(o));if(k){j.className=k}if(e){j.id=e}if(d){for(var b in d){element.style[b.camelize()]=d[b]}}for(var h in c){if(this.ignoredProperties.indexOf(h)==-1){j.setAttribute(h,c[h])}}if(l){j.innerHTML=l}else{if(m){var g=this;m.each(function(p){j.appendChild(g.create(p))});g=null;m=null}}try{return j}finally{o=null;k=null;e=null;d=null;l=null;j=null}},ignoredProperties:[&quot;tag&quot;,&quot;cssClass&quot;,&quot;id&quot;,&quot;style&quot;,&quot;childNodes&quot;,&quot;innerHTML&quot;]};require(&quot;foundation/object&quot;);SC.Binding=SC.Object.extend({from:&quot;&quot;,to:&quot;&quot;,oneWay:false,emptyPlaceholder:null,nullPlaceholder:null,multiplePlaceholder:null,transform:null,connect:function(){if(this._connected){return}var a=this._boundObservers();SC.Observers.addObserver(this.get(&quot;from&quot;),a.from);SC.Observers.addObserver(this.get(&quot;to&quot;),a.to);this._connected=true;return this},disconnect:function(){if(!this._connected){return}var a=this._boundObservers();SC.Observers.removeObserver(this.get(&quot;from&quot;),a.from);SC.Observers.removeObserver(this.get(&quot;to&quot;),a.to);this._connected=false;return this},relay:function(){var a=SC.Object.tupleForPropertyPath(this.get(&quot;from&quot;));if(a){a=this._walkTuple(a)}if(a){this._fromObserver(a[0],a[1],a[0].get(a[1]))}},init:function(){arguments.callee.base.call(this);this.connect()},_boundObservers:function(){var a=this._boundObserverFuncs;if(!a){this._boundObserverFuncs=a={from:this._fromObserver.bind(this),to:this._toObserver.bind(this)}}return a},_fromObserver:function(h,d,g,c){if(c&lt;=this._lastFromPropertyRevision){return}this._lastFromPropertyRevision=c;if(!this._didChange(this._lastFromValue,g)){return}this._lastFromValue=g;var a=SC.Object.tupleForPropertyPath(this.get(&quot;to&quot;));if(a){a=this._walkTuple(a)}if(a){var e=this.transform;if(e){g=e(&quot;to&quot;,d,g)}this._lastToValue=g;var b;if(g&amp;&amp;(g==[])&amp;&amp;(b=this.get(&quot;emptyPlaceholder&quot;))){g=b}else{if(g&amp;&amp;(g instanceof Array)&amp;&amp;(b=this.get(&quot;multiplePlaceholder&quot;))){g=(g.length==1)?g[0]:b}}if((g==null)&amp;&amp;(b=this.get(&quot;nullPlaceholder&quot;)||this.get(&quot;emptyPlaceholder&quot;))){g=b}a[0].set(a[1],g);this._lastToPropertyRevision=a[0].propertyRevision}},_toObserver:function(h,d,g,c){if(this.get(&quot;oneWay&quot;)){return}if(c&lt;=this._lastToPropertyRevision){return}this._lastToPropertyRevision=c;if(!this._didChange(this._lastToValue,g)){return}this._lastToValue=g;var b=SC.Object.tupleForPropertyPath(this.get(&quot;from&quot;));if(b){b=this._walkTuple(b)}if(b){var e=this.get(&quot;transform&quot;);if(e){g=e(&quot;from&quot;,d,g)}this._lastFromValue=g;var a=b[0].set(b[1],g);if(a){this._lastFromPropertyRevision=a.propertyRevision}if(a!=g){h.set(d,a);this._lastToPropertyRevision=h.propertyRevision}}},_didChange:function(a,b){if(b&amp;&amp;a){if(typeof(b)==typeof(a)){if(a==b){return false}}}else{if(((b===null)&amp;&amp;(a===null))||((b===undefined)&amp;&amp;(a===undefined))){return false}}return true},_lastToPropertyRevision:0,_lastFromPropertyRevision:0,_walkTuple:function(a){var c=a[1].split(&quot;.&quot;);if(c.length&gt;1){a=a.slice();var b=a[0];a[1]=c.pop();for(var d=0;(b&amp;&amp;(d&lt;c.length));d++){b=b.get(c[d])}a[0]=b}return(a[0]&amp;&amp;a[1])?a:null}});SC.Binding.mixin({MULTIPLE_PLACEHOLDER:&quot;@@MULT@@&quot;,NULL_PLACEHOLDER:&quot;@@NULL@@&quot;,EMPTY_PLACEHOLDER:&quot;@@EMPTY@@&quot;});SC.Binding.From=function(c,b){if(!b){b={}}if(($type(c)==T_STRING)||($type(c)==T_ARRAY)){b.from=c}else{Object.extend(b,c)}var a=SC.Binding.extend(b);return a};SC.Binding.build=function(a){return function(b){return SC.Binding.From(b,{transform:a})}};SC.Binding.NoChange=SC.Binding.From;SC.Binding.NoError=SC.Binding.build(function(a,b,c){return($type(c)==T_ERROR)?null:c});SC.Binding.NoError.ext=function(a){return function(e,c,b){return($type(value)==T_ERROR)?null:a(e,c,b)}};SC.Binding.Single=SC.Binding.build(function(c,b,a){if($type(a)==T_ARRAY){switch(a.length){case 0:a=null;break;case 1:a=a[0];break;default:a=SC.Binding.MULTIPLE_PLACEHOLDER}}return a});SC.Binding.SingleNull=SC.Binding.build(function(c,b,a){if($type(a)==T_ARRAY){switch(a.length){case 0:a=null;break;case 1:a=a[0];break;default:a=null}}return a});SC.Binding.SingleNoError=SC.Binding.NoError.ext(SC.Binding.Single);SC.Binding.SingleNullNoError=SC.Binding.NoError.ext(SC.Binding.SingleNull);SC.Binding.Multiple=SC.Binding.build(function(e,b,a){var c=$type(a);if(c!=T_ARRAY){if(c==null){a=[]}else{if(c!=T_ERROR){a=[a]}}}return a});SC.Binding.MultipleNoError=SC.Binding.NoError.ext(SC.Binding.Multiple);SC.Binding.Bool=SC.Binding.build(function(c,b,a){return($type(a)==T_ARRAY)?(a.length&gt;0):!!a});SC.Binding.NotNull=SC.Binding.build(function(c,b,a){return(a!=null)});SC.Binding.Not=SC.Binding.build(function(c,b,a){return !(($type(a)==T_ARRAY)?(a.length&gt;0):!!a)});SC.Binding.IsNull=SC.Binding.build(function(c,b,a){return(a==null)});SC.Binding.BoolNoError=SC.Binding.NoError.ext(SC.Binding.Bool);SC.Binding.NotNullNoError=SC.Binding.NoError.ext(SC.Binding.NotNull);SC.Binding.NotNoError=SC.Binding.NoError.ext(SC.Binding.Not);SC.Binding.IsNullNoError=SC.Binding.NoError.ext(SC.Binding.IsNull);SC.Binding.Multiple=function(a){return SC.Binding.From(a,{transform:function(b,c,d){return(d)?(SC.isArray(d)?d:[d]):d}})};SC.Binding.MultipleNotEmpty=function(a){return SC.Binding.From(a,{transform:function(b,c,d){return(d)?(SC.isArray(d)?d:[d]):[]}})};SC.Binding.SingleNotEmpty=function(a){return SC.Binding.From(a,{multiplePlaceholder:SC.Binding.MULTIPLE_PLACEHOLDER,emptyPlaceholder:SC.Binding.EMPTY_PLACEHOLDER,nullPlaceholder:SC.Binding.NULL_PLACEHOLDER})};SC.Binding.OneWay=function(a){return SC.Binding.From(a,{oneWay:true})};SC.Binding.Flag=function(a){return SC.Binding.From(a,{transform:function(b,c,d){return(d&amp;&amp;(d instanceof Array))?(d.length==0):!!d}})};SC.Binding.OneWayFlag=function(b){var a=SC.Binding.Flag(b);a.oneWay=true;return a};require(&quot;core&quot;);require(&quot;foundation/benchmark&quot;);SC.BENCHMARK_SELECTOR=NO;NO_LIMIT=10000;SC.PathModule={$$func:function(d,e,a,c){var b=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$$func(b,d,e,a,c)},$$C:function(c,e,a,d){var b=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$$C(b,c,e,a,d)},$$T:function(b,e,a,d){var c=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$$T(c,b,e,a,d)},$$P:function(g,e,d,a,c){var b=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$$P(b,g,e,d,a,c)},$$S:function(b,e,a,d){var c=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$$S(c,b,e,a,d)},$func:function(b,c){var a=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$func(a,b,c)},$C:function(b,c){var a=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$C(a,b,c)},$T:function(a,c){var b=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$T(b,a,c)},$P:function(a,d,c){var b=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$P(b,a,d,c)},$S:function(a,c){var b=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$S(b,a,c)},$$view:function(b,g,e,a,d){var c=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$$view(c,b,g,e,a,d)},$view:function(a,d,c){var b=(this.rootElement)?this.rootElement:(this===document)?document:null;return SC._PathModule.$view(b,a,d,c)}};SC._PathModule={$$func:function(c,e,g,a,d){g=g||NO_LIMIT;a=a||NO_LIMIT;d=d||false;var b=function(l,o,p,h){var k=[];var j=(h)?e(l):false;if(j){k.push(l);p--}o--;if((j&amp;&amp;!d)||(p&lt;=0)||(o&lt;=0)){return k}l=l.firstChild;while(l&amp;&amp;(p&gt;0)){var m=b(l,o,p,true);p-=m.length;k=k.concat(m);l=l.nextSibling}return k};return b(c||document,g+1,a,false)},$$C:function(c,b,e,a,d){return SC._PathModule.$$func(c,function(g){return Element.hasClassName(g,b)},e,a,d)},$$T:function(c,b,e,a,d){b=b.toUpperCase();return SC._PathModule.$$func(c,function(g){return g.tagName==b},e,a,d)},$$P:function(b,g,e,d,a,c){return SC._PathModule.$$func(b,function(h){var j=(h.getAttribute)?h.getAttribute(g):h[g];return j==e},d,a,c)},$$S:function(c,e,o,l,d){var h=e.split(&quot; &quot;);var j=[c];var k=null;var m;var p;var b;var a;var g;h.each(function(q){if(q==&quot;?&quot;){k=1;return}p=o;b=(k)?k:l;k=null;if(q.slice(q.length-1,q.length)==&quot;]&quot;){m=q.split(&quot;[&quot;);q=m.shift();g=m.map(function(u){return parseInt(u.slice(0,-1),0)})}else{g=null}m=q.split(&quot;?&quot;);q=m[0];if(m.length&gt;1){b=(m[1].length==0)?1:parseInt(m[1],0)}m=q.split(&quot;:&quot;);q=m[0];if(m.length&gt;1){p=(m[1]==&quot;*&quot;)?&quot;*&quot;:parseInt(m[1],0)}if(m.length&gt;2){b=(m[2]==&quot;*&quot;)?&quot;*&quot;:parseInt(m[2],0)}if(p==&quot;*&quot;){p=NO_LIMIT}if(b==&quot;*&quot;){bmac=NO_LIMIT}if(q&amp;&amp;q.length&gt;0){a=q.slice(0,1);if([&quot;.&quot;,&quot;#&quot;].indexOf(a)&gt;=0){q=q.slice(1,q.length)}m=q.split(&quot;.&quot;);q=m[0];m=m.slice(1,m.length);var s=null;if(a==&quot;#&quot;){s=$(q);s=(s)?[s]:null;if(s){j=s}}if(s==null){s=[];for(var r=0;r&lt;j.length;r++){var t=SC._PathModule.$$func(j[r],function(x){var u;switch(a){case&quot;.&quot;:NODE=x;var y=x.className;if(y&amp;&amp;(y.length&gt;0)){u=(y==q||y.match(new RegExp(&quot;(^|\\s)&quot;+q+&quot;(\\s|$)&quot;)))}else{u=false}break;case&quot;#&quot;:u=x.id==q;break;default:if(x.tagName){u=(x.tagName.toLowerCase()==q.toLowerCase())}else{u=false}}for(var w=0,v=m.length;u&amp;&amp;w&lt;v;w++){if(!Element.hasClassName(x,m[w])){u=false}}return u},p,b,d);s=s.concat(t)}j=s}}else{if($type(j)!=T_ARRAY){j=[j]}}if(g&amp;&amp;g.length&gt;0&amp;&amp;j){j=j.map(function(v){for(var u=0,w=g.length;v&amp;&amp;(u&lt;w);u++){v=v.childNodes[g[u]]}return v})}});return j},$func:function(b,c,d){var a=SC._PathModule.$$func(b,c,d,1,false);return(a.length&gt;0)?a[0]:null},$C:function(c,b,d){var a=SC._PathModule.$$C(c,b,d,1,false);return(a.length&gt;0)?a[0]:null},$T:function(c,b,d){var a=SC._PathModule.$$T(c,b,d,1,false);return(a.length&gt;0)?a[0]:null},$P:function(c,a,e,d){var b=SC._PathModule.$$A(c,a,e,d,1,false);return(b.length&gt;0)?b[0]:null},$S:function(c,a,d){var b=SC._PathModule.$$S(c,a,d,1,false);return(b.length&gt;0)?b[0]:null},$$view:function(d,b,h,g,a,e){var c;if(b&amp;&amp;(typeof(b)!=&quot;string&quot;)){c=[b]}else{c=SC._PathModule.$$S(d,b,g,a,e)}if(c){c=c.map(function(j){return(h)?h.viewFor(j):SC.View.findViewForElement(j)})}return c},$view:function(c,a,e,d){var b=SC._PathModule.$$view(c,a,e,d,1,false);return(b.length&gt;0)?b[0]:null}};if(SC.BENCHMARK_SELECTOR){[&quot;$$S&quot;,&quot;$$C&quot;,&quot;$$T&quot;,&quot;$S&quot;,&quot;$C&quot;,&quot;$T&quot;].each(function(a){SC.Benchmark.install(SC._PathModule,a)});SC.Benchmark.install(window,&quot;$$$&quot;)}Object.extend(SC._PathModule,{$$class:SC._PathModule.$$C,$$tag:SC._PathModule.$$T,$$sel:SC._PathModule.$$S,$$prop:SC._PathModule.$$P,$class:SC._PathModule.$C,$tag:SC._PathModule.$T,$sel:SC._PathModule.$S,$prop:SC._PathModule.$P});Object.extend(SC.PathModule,{$$class:SC.PathModule.$$C,$$tag:SC.PathModule.$$T,$$sel:SC.PathModule.$$S,$$prop:SC.PathModule.$$P,$class:SC.PathModule.$C,$tag:SC.PathModule.$T,$sel:SC.PathModule.$S,$prop:SC.PathModule.$P});Object.extend(Element.Methods,SC._PathModule);Object.extend(Element,SC._PathModule);if(typeof HTMLElement!=&quot;undefined&quot;){Object.extend(HTMLElement.prototype,SC.PathModule)}Object.extend(document,SC.PathModule);Object.extend(Object.extend(window,SC.PathModule),{$$func:function(c,d,a,b){return document.$$func(c,d,a,b)}});Object.extend(Object.extend(Array.prototype,SC.PathModule),{$$func:function(d,e,a,c){var b=[];for(var g=0;g&lt;this.length;g++){b=b.concat(this[g].$$func(d,e,a,c))}return b}});require(&quot;foundation/object&quot;);require(&quot;foundation/responder&quot;);require(&quot;foundation/node_descriptor&quot;);require(&quot;foundation/binding&quot;);require(&quot;foundation/path_module&quot;);require(&quot;mixins/delegate_support&quot;);SC.BENCHMARK_OUTLETS=NO;SC.BENCHMARK_CONFIGURE_OUTLETS=NO;SC.View=SC.Responder.extend(SC.PathModule,SC.DelegateSupport,{insertBefore:function(a,b){this._insertBefore(a,b,true)},_insertBefore:function(a,d,b){if(d){if(d.parentNode!=this){throw&quot;insertBefore() beforeView must belong to the receiver&quot;}if(d==a){throw&quot;insertBefore() views cannot be the same&quot;}}if(a.parentNode){a.removeFromParent()}this.willAddChild(this,d);a.willAddToParent(this,d);if(d){a.set(&quot;previousSibling&quot;,d.previousSibling);a.set(&quot;nextSibling&quot;,d);d.set(&quot;previousSibling&quot;,a)}else{a.set(&quot;previousSibling&quot;,this.lastChild);a.set(&quot;nextSibling&quot;,null);this.set(&quot;lastChild&quot;,a)}if(a.previousSibling){a.previousSibling.set(&quot;nextSibling&quot;,a)}if(a.previousSibling==null){this.set(&quot;firstChild&quot;,a)}a.set(&quot;parentNode&quot;,this);if(b){var c=(d)?d.rootElement:null;(this.containerElement||this.rootElement).insertBefore(a.rootElement,c);this._rebuildChildNodes()}a._updateIsVisibleInWindow();a._flushInternalCaches();a._invalidateClippingFrame();a.didAddToParent(this,d);this.didAddChild(a,d);try{return this}finally{if(c){c=null}}},removeChild:function(a){if(!a){return}if(a.parentNode!=this){throw&quot;removeChild: view must belong to parent&quot;}a.willRemoveFromParent();this.willRemoveChild(a);if(a.previousSibling){a.previousSibling.set(&quot;nextSibling&quot;,a.nextSibling)}else{this.set(&quot;firstChild&quot;,a.nextSibling)}if(a.nextSibling){a.nextSibling.set(&quot;previousSibling&quot;,a.previousSibling)}else{this.set(&quot;lastChild&quot;,a.previousSibling)}var b=(this.containerElement||this.rootElement);if(b&amp;&amp;(a.rootElement.parentNode==b)&amp;&amp;(b!=document)){b.removeChild(a.rootElement)}this._rebuildChildNodes();a.set(&quot;nextSibling&quot;,null);a.set(&quot;previousSibling&quot;,null);a.set(&quot;parentNode&quot;,null);a._updateIsVisibleInWindow();a._flushInternalCaches();a._invalidateClippingFrame();a.didRemoveFromParent(this);this.didRemoveChild(a);try{return this}finally{b=null}},replaceChild:function(a,b){this.insertBefore(a,b);this.removeChild(b);return this},removeFromParent:function(){if(this.parentNode){this.parentNode.removeChild(this)}return null},destroy:function(){this.removeFromParent();delete SC.View._view[SC.guidFor(this)];return null},appendChild:function(a){this.insertBefore(a,null);return this},childNodes:[],firstChild:null,lastChild:null,nextSibling:null,previousSibling:null,parentNode:null,pane:function(){var a=this;while(a=a.get(&quot;parentNode&quot;)){if(a.get(&quot;isPane&quot;)){break}}return a}.property(),clear:function(){while(this.firstChild){this.removeChild(this.firstChild)}},willAddToParent:function(a,b){},didAddToParent:function(a,b){},willRemoveFromParent:function(){},didRemoveFromParent:function(a){},willAddChild:function(b,a){},didAddChild:function(b,a){},willRemoveChild:function(a){},didRemoveChild:function(a){},nextKeyView:null,previousKeyView:null,nextValidKeyView:function(){var a=this;while(a=a.get(&quot;nextKeyView&quot;)){if(a.get(&quot;isVisible&quot;)&amp;&amp;a.get(&quot;acceptsFirstResponder&quot;)){return a}}return null},previousValidKeyView:function(){var a=this;while(a=a.get(&quot;previousKeyView&quot;)){if(a.get(&quot;isVisible&quot;)&amp;&amp;a.get(&quot;acceptsFirstResponder&quot;)){return a}}return null},_flushInternalCaches:function(){if((this._needsClippingFrame!=null)||(this._needsFrameChanges!=null)){this._needsClippingFrame=this._needsFrameChanges=null;if(this.parentNode){this.parentNode._flushInternalCaches()}}},nextResponder:function(){return this.parentNode}.property(&quot;parentNode&quot;),performKeyEquivalent:function(b,a){var c=this.get(&quot;firstChild&quot;);while(c){if(c.performKeyEquivalent(b,a)){return true}c=c.get(&quot;nextSibling&quot;)}return false},classNames:function(a,b){if(b!==undefined){b=Array.from(b);if(this.rootElement){this.rootElement.className=b.join(&quot; &quot;)}this._classNames=b.slice()}if(!this._classNames){var c=this.rootElement.className;this._classNames=(c&amp;&amp;c.length&gt;0)?c.split(&quot; &quot;):[]}return this._classNames}.property(),hasClassName:function(a){return(this._classNames||this.get(&quot;classNames&quot;)).indexOf(a)&gt;=0},addClassName:function(a){if(this.hasClassName(a)){return}var b=this._classNames||this.get(&quot;classNames&quot;);b.push(a);this.set(&quot;classNames&quot;,b);return a},removeClassName:function(a){if(!this.hasClassName(a)){return}var b=this._classNames||this.get(&quot;classNames&quot;);b=this._classNames=b.without(a);this.set(&quot;classNames&quot;,b);return a},setClassName:function(b,a){return(!!a)?this.addClassName(b):this.removeClassName(b)},toggleClassName:function(a){return this.setClassName(a,!this.hasClassName(a))},getStyle:function(b){var a=this.rootElement;if(!this._computedStyle){this._computedStyle=document.defaultView.getComputedStyle(a,null)}b=(b===&quot;float&quot;)?&quot;cssFloat&quot;:b.camelize();var c=a.style[b];if(!c){c=this._computedStyle?this._computedStyle[b]:null}if(b===&quot;opacity&quot;){c=c?parseFloat(c):1}if(c===&quot;auto&quot;){c=null}return c},setStyle:function(b,a){return Element.setStyle(this.rootElement,b,a)},update:function(a){Element.update((this.containerElement||this.rootElement),a);this.propertyDidChange(&quot;innerHTML&quot;)},getAttribute:function(a){return Element.readAttribute(this.rootElement,a)},setAttribute:function(a,b){this.rootElement.setAttribute(a,b)},hasAttribute:function(a){return Element.hasAttribute(this.rootElement,a)},unknownProperty:function(b,d){if(b&amp;&amp;b.match&amp;&amp;b.match(/^style/)){b=b.slice(5,b.length).replace(/^./,function(e){return e.toLowerCase()});var a=null;if(b.match(/height$|width$|top$|bottom$|left$|right$/i)){if(d!==undefined){this.viewFrameWillChange();var c={};c[b]=(d)?d+&quot;px&quot;:&quot;auto&quot;;this.setStyle(c);this.viewFrameDidChange()}a=this.getStyle(b);a=(a===&quot;auto&quot;)?null:parseInt(a,0)}else{if(d!==undefined){var c={};c[b]=d;this.setStyle(c)}a=this.getStyle(b)}return a}else{return arguments.callee.base.call(this,b,d)}},rootElement:null,containerElement:null,needsClippingFrame:function(){if(this._needsClippingFrame==null){var b=this.clippingFrameDidChange!=SC.View.prototype.clippingFrameDidChange;var a=this.get(&quot;firstChild&quot;);while(!b&amp;&amp;a){b=a.get(&quot;needsClippingFrame&quot;);a=a.get(&quot;nextSibling&quot;)}this._needsClippingFrame=b}return this._needsClippingFrame}.property(),needsFrameChanges:function(){if(this._needsFrameChanges==null){var b=this.get(&quot;needsClippingFrame&quot;)||this.get(&quot;hasManualLayout&quot;);var a=this.get(&quot;firstChild&quot;);while(!b&amp;&amp;a){b=a.get(&quot;needsFrameChanges&quot;);a=a.get(&quot;nextSibling&quot;)}this._needsFrameChanges=b}return this._needsFrameChanges}.property(),hasManualLayout:function(){return(this.resizeChildrenWithOldSize!=SC.View.prototype.resizeChildrenWithOldSize)||(this.resizeWithOldParentSize!=SC.View.prototype.resizeWithOldParentSize)||(this.clippingFrameDidChange!=SC.View.prototype.clippingFrameDidChange)}.property(),convertFrameFromView:function(e,d){var g=SC.viewportOffset(this.get(&quot;offsetParent&quot;));var c=(d)?SC.viewportOffset(d.get(&quot;offsetParent&quot;)):SC.ZERO_POINT;var b=c.x-g.x;var a=c.y-g.y;return{x:(e.x+b),y:(e.y+a),width:e.width,height:e.height}},convertFrameToView:function(e,b){var g=SC.viewportOffset(this.get(&quot;offsetParent&quot;));var d=(b)?SC.viewportOffset(b.get(&quot;offsetParent&quot;)):SC.ZERO_POINT;var c=g.x-d.x;var a=g.y-d.y;return{x:(e.x+c),y:(e.y+a),width:e.width,height:e.height}},offsetParent:function(){var b=this.rootElement;if(!b||b===document.body){return b}if(b.offsetParent){return b.offsetParent}var a=null;while(!a&amp;&amp;(b=b.parentNode)&amp;&amp;(b.nodeType!==11)&amp;&amp;(b!==document.body)){if(Element.getStyle(b,&quot;position&quot;)!==&quot;static&quot;){a=b}}if(!a&amp;&amp;(b===document.body)){a=b}return a}.property(),innerFrame:function(k,h){var d;if(this._innerFrame==null){var a=this.rootElement;d=this._collectFrame(SC.View._collectInnerFrame);if(SC.Platform.Firefox){var j=a.offsetParent;if(j&amp;&amp;(Element.getStyle(j,&quot;overflow&quot;)!=&quot;visible&quot;)){var b=parseInt(Element.getStyle(j,&quot;borderLeftWidth&quot;),0)||0;var g=parseInt(Element.getStyle(j,&quot;borderTopWidth&quot;),0)||0;d.x+=b;d.y+=g}}var e,c;if(a.clientLeft==null){e=parseInt(this.getStyle(&quot;border-left-width&quot;),0)||0}else{e=a.clientLeft}if(a.clientTop==null){c=parseInt(this.getStyle(&quot;border-top-width&quot;),0)||0}else{c=a.clientTop}d.x+=e;d.y+=c;this._innerFrame=SC.cloneRect(d)}else{d=SC.cloneRect(this._innerFrame)}return d}.property(&quot;frame&quot;),frame:function(l,j){if(j!==undefined){this.viewFrameWillChange();var d=j;var a={};var m=false;if(j.x!==undefined){a.left=Math.floor(d.x)+&quot;px&quot;;a.right=&quot;auto&quot;}if(j.y!==undefined){a.top=Math.floor(d.y)+&quot;px&quot;;a.bottom=&quot;auto&quot;}if(j.width!==undefined){m=true;var g=0;var k=SC.View.WIDTH_PADDING_STYLES.length;while(--k&gt;=0){g+=parseInt(this.getStyle(SC.View.WIDTH_PADDING_STYLES[k]),0)||0}a.width=(Math.floor(d.width)-g).toString()+&quot;px&quot;}if(j.height!==undefined){m=true;var g=0;var k=SC.View.HEIGHT_PADDING_STYLES.length;while(--k&gt;=0){g+=parseInt(this.getStyle(SC.View.HEIGHT_PADDING_STYLES[k]),0)||0}a.height=(Math.floor(d.height)-g).toString()+&quot;px&quot;}this.setStyle(a);this.viewFrameDidChange()}var d;if(this._frame==null){var b=this.rootElement;d=this._collectFrame(function(){return{x:b.offsetLeft,y:b.offsetTop,width:b.offsetWidth,height:b.offsetHeight}});if(SC.Platform.Firefox){var h=b.offsetParent;if(h&amp;&amp;(Element.getStyle(h,&quot;overflow&quot;)!=&quot;visible&quot;)){var c=parseInt(Element.getStyle(h,&quot;borderLeftWidth&quot;),0)||0;var e=parseInt(Element.getStyle(h,&quot;borderTopWidth&quot;),0)||0;d.x+=c;d.y+=e}}this._frame=SC.cloneRect(d)}else{d=SC.cloneRect(this._frame)}return d}.property(),size:function(a,b){if(b!==undefined){this.set(&quot;frame&quot;,{width:b.width,height:b.height})}return this.get(&quot;frame&quot;)}.property(&quot;frame&quot;),origin:function(a,b){if(b!==undefined){this.set(&quot;frame&quot;,{x:b.x,y:b.y})}return this.get(&quot;frame&quot;)}.property(&quot;frame&quot;),viewFrameWillChange:function(){if(this._frameChangeLevel++&lt;=0){this._frameChangeLevel=1;if(this.get(&quot;needsFrameChanges&quot;)){this._cachedFrames=this.getEach(&quot;innerFrame&quot;,&quot;clippingFrame&quot;,&quot;frame&quot;)}else{this._cachedFrames=null}this.beginPropertyChanges()}},viewFrameDidChange:function(c){this.recacheFrames();if(--this._frameChangeLevel&lt;=0){this._frameChangeLevel=0;if(this._cachedFrames){var e=this.getEach(&quot;innerFrame&quot;,&quot;clippingFrame&quot;);var b=e[1];var d=this._cachedFrames[1];if(c||(b.width!=d.width)||(b.height!=d.height)){this._invalidateClippingFrame()}var b=e[0];var d=this._cachedFrames[0];if(c||(b.width!=d.width)||(b.height!=d.height)){this.resizeChildrenWithOldSize(this._cachedFrames.last())}var a=this.parentNode;while(a&amp;&amp;a!=SC.window){if(a._scrollFrame){a._scrollFrame=null}a=a.parentNode}this.notifyPropertyChange(&quot;frame&quot;)}this.endPropertyChanges()}},recacheFrames:function(){this._innerFrame=this._frame=this._clippingFrame=this._scrollFrame=null},isScrollable:false,scrollFrame:function(a,d){if(d!=undefined){var b=this.rootElement;if(d.x!=null){b.scrollLeft=0-d.x}if(d.y!=null){b.scrollTop=0-d.y}this._scrollFrame=null;this._invalidateClippingFrame()}var c;if(this._scrollFrame==null){var b=this.rootElement;c=this._collectFrame(function(){return{x:0-b.scrollLeft,y:0-b.scrollTop,width:b.scrollWidth,height:b.scrollHeight}});this._scrollFrame=SC.cloneRect(c)}else{c=SC.cloneRect(this._scrollFrame)}return c}.property(&quot;frame&quot;),clippingFrame:function(){var d;if(this._clippingFrame==null){d=this.get(&quot;frame&quot;);if(this.parentNode){var a=this.parentNode;var c=SC.intersectRects(a.get(&quot;clippingFrame&quot;),a.get(&quot;innerFrame&quot;));c=this.convertFrameFromView(c,a);if(this.parentNode.get(&quot;isScrollable&quot;)){var b=this.get(&quot;scrollFrame&quot;);c.x-=b.x;c.y-=b.y}d=SC.intersectRects(d,c)}else{d.width=d.height=0}this._clippingFrame=SC.cloneRect(d)}else{d=SC.cloneRect(this._clippingFrame)}return d}.property(&quot;frame&quot;,&quot;scrollFrame&quot;),clippingFrameDidChange:function(){},resizeChildrenWithOldSize:function(a){var b=this.get(&quot;firstChild&quot;);while(b){b.resizeWithOldParentSize(a);b=b.get(&quot;nextSibling&quot;)}},resizeWithOldParentSize:function(a){this.viewFrameWillChange();this.viewFrameDidChange(YES)},_onscroll:function(){this._scrollFrame=null;this.notifyPropertyChange(&quot;scrollFrame&quot;);SC.Benchmark.start(&quot;%@.onscroll&quot;.fmt(this));this._invalidateClippingFrame();SC.Benchmark.end(&quot;%@.onscroll&quot;.fmt(this))},_frameChangeLevel:0,_collectFrame:function(d){var c=this.rootElement;var m=this.get(&quot;isVisibleInWindow&quot;);if(!m){var e=c.parentNode||c;if(e===SC.window.rootElement){e=c}var j=e.parentNode;var o=e.nextSibling;SC.window.rootElement.insertBefore(e,null)}var l=this.getStyle(&quot;display&quot;);var b=!(l!=&quot;none&quot;&amp;&amp;l!=null);if(b){var g=this.rootElement.style;var p=g.visibility;var h=g.position;var a=g.display;g.visibility=&quot;hidden&quot;;g.position=&quot;absolute&quot;;g.display=&quot;block&quot;}var k=d.call(this);if(b){g.display=a;g.position=h;g.visibility=p}if(!m){if(j){j.insertBefore(e,o)}else{if(e.parentNode){SC.window.rootElement.removeChild(e)}}}return k},_invalidateChildrenClippingFrames:function(){var a=this.get(&quot;firstChild&quot;);while(a){a._invalidateClippingFrame();a=a.get(&quot;nextSibling&quot;)}},_invalidateClippingFrame:function(){if(this.get(&quot;needsClippingFrame&quot;)){this._clippingFrame=null;this.clippingFrameDidChange();this.notifyPropertyChange(&quot;clippingFrame&quot;);this._invalidateChildrenClippingFrames()}},isVisible:true,isVisibleBindingDefault:SC.Binding.Bool,displayIsVisible:true,isVisibleInWindow:NO,localize:false,toolTip:&quot;&quot;,emptyElement:&quot;&lt;div&gt;&lt;/div&gt;&quot;,isPanel:false,isModal:true,isAnimationEnabled:true,transitionTo:function(e,a,b){var d=b||{};if(a&amp;&amp;!a._isAnimator){var c=a;if(!this.get(&quot;isAnimationEnabled&quot;)){d=Object.clone(d);d.duration=1}if(d.duration){d.duration=parseInt(d.duration,0)}a=Animator.apply(this.rootElement,c,d);a._isAnimator=true}if(a){a.jumpTo(a.state);a.seekTo(e)}return a},innerHTML:function(b,e){if(e!==undefined){this._textNode=null;if(SC.isSafari()&amp;&amp;!SC.isSafari3()){var c=(this.containerElement||this.rootElement);var a=0;var d=function(){c.innerHTML=&quot;&quot;;c.innerHTML=e;if((a++&lt;5)&amp;&amp;(e.length&gt;0)&amp;&amp;(c.innerHTML==&quot;&quot;)){d.invokeLater()}};d()}else{(this.containerElement||this.rootElement).innerHTML=e}}else{e=(this.containerElement||this.rootElement).innerHTML}return e}.property(),innerText:function(a,c){if(c!==undefined){if(c==null){c=&quot;&quot;}if(this._textNode==null){this._textNode=document.createTextNode(c);var b=this.rootElement||this.containerElement;while(b.firstChild){b.removeChild(b.firstChild)}b.appendChild(this._textNode)}else{this._textNode.data=c}}return(this._textNode)?this._textNode.data:this.innerHTML().unescapeHTML()}.property(),init:function(){arguments.callee.base.call(this);if(SC.BENCHMARK_CONFIGURE_OUTLETS){SC.Benchmark.start(&quot;SC.View.configureOutlets&quot;)}this.configureOutlets();if(SC.BENCHMARK_CONFIGURE_OUTLETS){SC.Benchmark.end(&quot;SC.View.configureOutlets&quot;)}var a=this.get(&quot;toolTip&quot;);if(a&amp;&amp;(a!=&quot;&quot;)){this._updateToolTipObserver()}if(this.containerElement&amp;&amp;($type(this.containerElement)===T_STRING)){this.containerElement=this.$sel(this.containerElement)}if(this.get(&quot;isDropTarget&quot;)){SC.Drag.addDropTarget(this)}if(this.get(&quot;isScrollable&quot;)){SC.Drag.addScrollableView(this)}if(this.isScrollable){this.rootElement.onscroll=SC.View._onscroll}this.isVisibleInWindow=(this.parentNode)?this.parentNode.get(&quot;isVisibleInWindow&quot;):NO},configureOutlets:function(){if(!this.outlets||(this.outlets.length&lt;=0)){return}this.beginPropertyChanges();for(var b=0;b&lt;this.outlets.length;b++){var a=this.outlet(this.outlets[b])}this.endPropertyChanges()},show:function(){Element.show(this.rootElement);this.removeClassName(&quot;hidden&quot;);this.set(&quot;displayIsVisible&quot;,true)},hide:function(){Element.hide(this.rootElement);this.addClassName(&quot;hidden&quot;);this.set(&quot;displayIsVisible&quot;,false)},animateVisible:function(a,b){if(b!==undefined){return this.set(&quot;isAnimationEnabled&quot;,b)}return this.get(&quot;isAnimationEnabled&quot;)}.property(&quot;isAnimationEnabled&quot;),_attachRootElement:function(a){if(this.rootElement){this.rootElement._configured=null}this.rootElement=a;a._configured=this._guid},_rebuildChildNodes:function(){var b=[];var a=this.firstChild;while(a){b.push(a);a=a.nextSibling}this.set(&quot;childNodes&quot;,b)},_toolTipObserver:function(){var a=this.get(&quot;toolTip&quot;);if(this.get(&quot;localize&quot;)){a=a.loc()}this.rootElement.title=a}.observes(&quot;toolTip&quot;),_isVisibleObserver:function(){var a=this.get(&quot;isVisible&quot;);if((this._isVisible===undefined)||(a!=this._isVisible)){this._isVisible=a;if(a){this._show()}else{this._hide()}this._updateIsVisibleInWindow()}}.observes(&quot;isVisible&quot;),_updateIsVisibleInWindow:function(c){if(c===undefined){var a=this.get(&quot;parentNode&quot;);c=(a)?a.get(&quot;isVisibleInWindow&quot;):false}var b=c&amp;&amp;this.get(&quot;isVisible&quot;);if(b!=this.get(&quot;isVisibleInWindow&quot;)){this.set(&quot;isVisibleInWindow&quot;,b);this.recacheFrames();var d=this.get(&quot;firstChild&quot;);while(d){d._updateIsVisibleInWindow(b);d=d.get(&quot;nextSibling&quot;)}}},_show:function(c,b){if(this.showView){return this.showView()}var a=this.get(&quot;paneType&quot;);if(this.get(&quot;isPanel&quot;)){a=SC.PANEL_PANE}if(a){if(c===undefined){c=null}if(b===undefined){b=null}SC.PaneManager.manager().showPaneView(this,a,c,b);this.set(&quot;displayIsVisible&quot;,true)}else{if(this.visibleAnimation&amp;&amp;this.get(&quot;isAnimationEnabled&quot;)){this._transitionVisibleTo(1);this.show()}else{this._visibleAnimator=null;this.show()}}return this},_hide:function(){if(this.hideView){return this.hideView()}var a=(!!this.get(&quot;paneType&quot;))||this.get(&quot;isPanel&quot;);if(a){SC.PaneManager.manager().hidePaneView(this);this.set(&quot;displayIsVisible&quot;,false)}else{if(this.visibleAnimation&amp;&amp;this.get(&quot;isAnimationEnabled&quot;)){this._transitionVisibleTo(0)}else{this._visibleAnimator=null;this.hide()}}return this},_transitionVisibleTo:function(e){var b;if(this._visibleAnimator){this.transitionTo(e,this._visibleAnimator)}else{var d=this.visibleAnimation;var c=[d.hidden,d.visible];d.onComplete=this._animateVisibleDidComplete.bind(this,d.onComplete);this._visibleAnimator=this.transitionTo(e,c,d)}},_animateVisibleDidComplete:function(a){if(!this.get(&quot;isVisible&quot;)){this.hide()}if(a){a(this)}},_firstResponderObserver:function(c,a,b){this.setClassName(&quot;focus&quot;,b)}.observes(&quot;isFirstResponder&quot;),_dropTargetObserver:function(){if(this.get(&quot;isDropTarget&quot;)){SC.Drag.addDropTarget(this)}else{SC.Drag.removeDropTarget(this)}}.observes(&quot;isDropTarget&quot;),popup:function(b,a){this._isVisible=true;this._show(b,a);this.set(&quot;isVisible&quot;,true)},configureObserverMethods:function(c){for(var a in c){if(!c.hasOwnProperty(a)){continue}if(this[a]){var b=this[a].bindAsEventListener(this);Event.observe(this.rootElement,c[a],b)}}}});SC.View.mixin({_view:{},findViewForElement:function(b){var a=b._configured;return(a)?SC.View._view[a]:null},viewFor:function(e,d){if(e){e=$(e)}var g=SC.idt.active;var j;if(g){SC.idt.v_count++}if(g){j=new Date().getTime()}if(!e){var h=this.prototype._cachedEmptyElement||this.prototype.emptyElement;var a=typeof(h)==&quot;string&quot;;if(a&amp;&amp;(h.slice(0,1)!=&quot;&lt;&quot;)){var e=$sel(h);if(e){this.prototype.emptyElement=h=e;a=false}}if(a){SC._ViewCreator.innerHTML=h;e=$(SC._ViewCreator.firstChild);SC.NodeCache.appendChild(e);this.prototype._cachedEmptyElement=e.cloneNode(true)}else{if(typeof(h)==&quot;object&quot;){if(h.tagName){e=h.cloneNode(true)}else{e=SC.NodeDescriptor.create(h)}}}}if(g){SC.idt.vc_t+=(new Date().getTime())-j}if(e&amp;&amp;e._configured){return SC.View.findViewForElement(e)}var c=$A(arguments);c[0]={rootElement:e};if(g){j=new Date().getTime()}var b=new this(c,this);if(g){SC.idt.v_t+=(new Date().getTime())-j}e._configured=b._guid;SC.View._view[b._guid]=b;return b},create:function(b){var a=$A(arguments);a.unshift(null);return this.viewFor.apply(this,a)},extend:function(b){var a=SC.Object.extend.apply(this,arguments);a.prototype._cachedEmptyElement=null;return a},outletFor:function(c){var b=this;var a=function(){if(SC.BENCHMARK_OUTLETS){SC.Benchmark.start(&quot;OUTLET(%@)&quot;.format(c))}if(c==null){var h=b.viewFor(null)}else{var h=(this.$$sel)?this.$$sel(c):$$sel(c);if(h){var d=this;var g=[];for(var l=0;l&lt;h.length;l++){var e=b.viewFor(h[l],{owner:d});if(e&amp;&amp;e.rootElement&amp;&amp;e.rootElement.parentNode){var k=e.rootElement.parentNode;var j=null;while(k&amp;&amp;!j){switch(k){case this.rootElement:j=this;break;case SC.page.rootElement:j=SC.page;break;case SC.window.rootElement:j=SC.window;default:k=k.parentNode}}if(j){j._insertBefore(e,null,false);j._rebuildChildNodes();e._updateIsVisibleInWindow()}}g[g.length]=e}h=g;h=(h.length==0)?null:((h.length==1)?h[0]:h)}}if(SC.BENCHMARK_OUTLETS){SC.Benchmark.end(&quot;OUTLET(%@)&quot;.format(c))}return h};a.isOutlet=true;return a},automaticOutletFor:function(){var a=this.outletFor.apply(this,arguments);a.autoconfiguredOutlet=YES;return a}});if(SC.Platform.IE){SC.View.prototype.getStyle=function(b){var h=this.rootElement;b=(b==&quot;float&quot;||b==&quot;cssFloat&quot;)?&quot;styleFloat&quot;:b.camelize();var k=h.style[b];if(!k&amp;&amp;h.currentStyle){k=h.currentStyle[b]}if(b===&quot;opacity&quot;){if(k=(this.getStyle(&quot;filter&quot;)||&quot;&quot;).match(/alpha\(opacity=(.*)\)/)){if(k[1]){k=parseFloat(k[1])/100}}k=1}if(k===&quot;auto&quot;){switch(b){case&quot;width&quot;:if(this.getStyle(&quot;display&quot;)===&quot;none&quot;){k=null}else{if(h.currentStyle){var g=parseInt(h.currentStyle.paddingLeft,0)||0;var e=parseInt(h.currentStyle.paddingRight,0)||0;var l=parseInt(h.currentStyle.borderLeftWidth,0)||0;var a=parseInt(h.currentStyle.borderRightWidth,0)||0;k=(h.offsetWidth-g-e-l-a)+&quot;px&quot;}}break;case&quot;height&quot;:if(this.getStyle(&quot;display&quot;)===&quot;none&quot;){k=null}else{if(h.currentStyle){var m=parseInt(h.currentStyle.paddingTop,0)||0;var d=parseInt(h.currentStyle.paddingBottom,0)||0;var j=parseInt(h.currentStyle.borderTopWidth,0)||0;var c=parseInt(h.currentStyle.borderBottomWidth,0)||0;k=(h.offsetHeight-m-d-j-c)+&quot;px&quot;}}break;default:k=null}}return k};SC.View._collectInnerFrame=function(){var d=this.rootElement;var a=(d.currentStyle)?d.currentStyle.hasLayout:NO;var e=parseInt(d.currentStyle.borderTopWidth,0)||0;var b=parseInt(d.currentStyle.borderBottomWidth,0)||0;var c=d.offsetHeight-e-b;if(d.clientWidth&gt;d.scrollWidth){c-15}return{x:d.offsetLeft,y:d.offsetTop,width:(a)?Math.min(d.scrollWidth,d.clientWidth):d.scrollWidth,height:(a)?Math.min(c,d.clientHeight):c}}}else{SC.View._collectInnerFrame=function(){var a=this.rootElement;return{x:a.offsetLeft,y:a.offsetTop,width:Math.min(a.scrollWidth,a.clientWidth),height:Math.min(a.scrollHeight,a.clientHeight)}}}SC.View._onscroll=function(a){$view(this)._onscroll(a)};SC.View.WIDTH_PADDING_STYLES=[&quot;paddingLeft&quot;,&quot;paddingRight&quot;,&quot;borderLeftWidth&quot;,&quot;borderRightWidth&quot;];SC.View.HEIGHT_PADDING_STYLES=[&quot;paddingTop&quot;,&quot;paddingBottom&quot;,&quot;borderTopWidth&quot;,&quot;borderBottomWidth&quot;];SC.View.SCROLL_WIDTH_PADDING_STYLES=[&quot;borderLeftWidth&quot;,&quot;borderRightWidth&quot;];SC.View.SCROLL_HEIGHT_PADDING_STYLES=[&quot;borderTopWidth&quot;,&quot;borderBottomWidth&quot;];SC.View.elementFor=SC.View.viewFor;SC._ViewCreator=document.createElement(&quot;div&quot;);SC.NodeCache=document.createElement(&quot;div&quot;);require(&quot;views/view&quot;);SC.KEYVIEW_SELECTING_NONE=0;SC.KEYVIEW_SELECTING_NEXT=1;SC.KEYVIEW_SELECTING_PREVIOUS=2;SC.PaneView=SC.View.extend({pane:null,isPane:true,isModal:false,canBecomeKeyPane:true,isKeyPane:false,makeKeyPane:function(){if(!this.get(&quot;canBecomeKeyPane&quot;)){return false}if(this.get(&quot;isKeyPane&quot;)){return false}SC.app.set(&quot;keyPane&quot;,this);return true},didBecomeKeyPane:function(){},willResignKeyPane:function(){},canBecomeMainPane:true,isMainPane:false,makeMainPane:function(){if(!this.get(&quot;canBecomeMainPane&quot;)){return false}if(this.get(&quot;isMainPane&quot;)){return false}SC.app.set(&quot;mainPane&quot;,this);return true},didBecomeMainPane:function(){},willResignMainPane:function(){},performKeyInterfaceControl:function(b,a){return false},keyViewSelectionDirection:SC.KEYVIEW_SELECTING_NONE,selectPreviousKeyView:function(){},selectNextKeyView:function(){},autorecalculatesKeyViewLoop:false,recalculateKeyViewLoop:function(){},nextResponder:null,_firstResponder:null,firstResponder:function(a,b){if(b!==undefined){if(this._firstResponder){this._firstResponder.willLoseFirstResponder()}if(this._firstResponder){this._firstResponder.set(&quot;isFirstResponder&quot;,false)}this._firstResponder=b;if(this._firstResponder){this._firstResponder.set(&quot;isFirstResponder&quot;,true)}if(this._firstResponder){this._firstResponder.didBecomeFirstResponder()}}return this._firstResponder}.property(),defaultResponder:null});require(&quot;views/view&quot;);SC.ContainerView=SC.View.extend({content:null,contentBindingDefault:SC.Binding.Single,rootView:null,replaceContent:function(a){var b=this.get(&quot;rootView&quot;)||this;b.clear();var c=a;if(c){c.viewFrameWillChange();b.appendChild(c);c.viewFrameDidChange()}},_contentObserver:function(){this.replaceContent(this.get(&quot;content&quot;))}.observes(&quot;content&quot;)});require(&quot;panes/pane&quot;);require(&quot;views/container&quot;);SC.OverlayPaneView=SC.PaneView.extend({content:null,layer:0,anchorView:null,triggerEvent:null,isModal:true,positionPane:function(){},fitPositionToScreen:function(h,c,d){var e=c.get(&quot;frame&quot;);e.x=h.x;e.y=h.y;e=c.convertFrameToView(e,null);var b=d.convertFrameToView(d.get(&quot;frame&quot;),null);var a=SC.window.get(&quot;frame&quot;);if(SC.maxX(e)&gt;a.width){var g=Math.max(SC.maxX(b),e.width);e.x=Math.min(g,a.width)-e.width}if(SC.minX(e)&lt;0){e.x=SC.minX(Math.max(b,0));if(SC.maxX(e)&gt;a.width){e.x=Math.max(0,a.width-e.width)}}if(SC.maxY(e)&gt;a.height){var g=Math.max((b.y-e.height),0);if(g&gt;a.height){e.y=Math.max(0,a.height-e.height)}else{e.y=g}}if(SC.minY(e)&lt;0){var g=Math.min(SC.maxY(b),(a.height-b.height));e.y=Math.max(g,0)}return e},resizeWithOldParentSize:function(a){this.positionPane()},acceptsFirstResponder:true,keyDown:function(a){if(!this.interpretKeyEvents(a)){return arguments.callee.base.apply(this,arguments)}},insertNewline:function(c,a){var b=this._findViewWithKeyIn(&quot;isDefault&quot;,SC.ButtonView,this);if(b){b.triggerAction(a);return true}else{return false}},cancel:function(c,a){var b=this._findViewWithKeyIn(&quot;isCancel&quot;,SC.ButtonView,this);if(b){b.triggerAction(a);return true}else{return false}},_findViewWithKeyIn:function(c,b,d,g){if(!g){if((d instanceof b)&amp;&amp;d.get(c)){return d}}var e=d.get(&quot;firstChild&quot;);while(e){var a=this._findViewWithKeyIn(c,b,e);if(a){return a}e=e.get(&quot;nextSibling&quot;)}return null},focusFirstKeyView:function(){var a=this._findViewWithKeyIn(&quot;acceptsFirstResponder&quot;,SC.Responder,this,true);if(!a){a=this}a.becomeFirstResponder()},click:function(a){if(!this.get(&quot;isModal&quot;)){var b=this.containerView.get(&quot;content&quot;);if(b){b.set(&quot;isVisible&quot;,false)}}return true},_contentDidChange:function(){var a=this.get(&quot;containerView&quot;);if(a){a.set(&quot;content&quot;,this.get(&quot;content&quot;))}}.observes(&quot;content&quot;),outlets:[&quot;containerView&quot;],containerView:SC.ContainerView.extend({outlets:[&quot;rootView&quot;],rootView:SC.View.extend({click:function(){return true}}).outletFor(&quot;.pane-root?&quot;),_fixWidth:function(){var a=this.get(&quot;content&quot;);if(a){a.resizeWithOldParentSize(this.get(&quot;size&quot;));var b=0;this.getEach(&quot;styleBorderLeftWidth&quot;,&quot;styleBorderRightWidth&quot;,&quot;stylePaddingLeft&quot;,&quot;stylePaddingRight&quot;).each(function(c){b+=c||0});this.recacheFrames();a.recacheFrames();this.set(&quot;size&quot;,{width:(a.get(&quot;size&quot;).width+b)});this.owner.positionPane();this.owner.setStyle({visibility:&quot;visible&quot;})}if(this.get(&quot;isVisibleInWindow&quot;)){this.owner.focusFirstKeyView()}}.observes(&quot;content&quot;),init:function(){arguments.callee.base.apply(this,arguments);if(SC.isSafari()){this.visibleAnimation={visible:&quot;opacity: 1.0&quot;,hidden:&quot;opacity: 0.0&quot;,duration:100}}},click:function(a){return false}}).outletFor(&quot;.pane-wrapper?&quot;),show:function(){this.containerView._fixWidth();arguments.callee.base.apply(this,arguments)}});require(&quot;panes/overlay&quot;);SC.PANEL_PANE=&quot;panel&quot;;SC.PanelPaneView=SC.OverlayPaneView.extend({emptyElement:'&lt;div class=&quot;pane panel-pane&quot;&gt;&lt;div class=&quot;shadow pane-wrapper&quot;&gt;&lt;div class=&quot;pane-root&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-left-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-left-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;left-edge&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;',layer:100});require(&quot;views/view&quot;);require(&quot;mixins/delegate_support&quot;);SC.HORIZONTAL=&quot;horizontal&quot;;SC.VERTICAL=&quot;vertical&quot;;SC.SplitView=SC.View.extend(SC.DelegateSupport,{emptyElement:'&lt;div class=&quot;sc-split-view&quot;&gt;&lt;/div&gt;',delegate:null,layoutDirection:SC.HORIZONTAL,canCollapseViews:YES,canCollapseView:function(a){if(!this.get(&quot;canCollapseViews&quot;)){return NO}if(a.get(&quot;canCollapse&quot;)===NO){return NO}return this.invokeDelegateMethod(this.delegate,&quot;splitViewCanCollapse&quot;,this,a)},flexibleView:null,setThicknessForView:function(g,k){if(g.get(&quot;parentNode&quot;)!=this){throw&quot;view must belong to reciever (view: %@)&quot;.fmt(g)}var j=this.get(&quot;layoutDirection&quot;);var h=g.get(&quot;maxThickness&quot;);var b=g.get(&quot;minThickness&quot;);if(h!=null){k=Math.min(h,k)}if(b!=null){k=Math.max(b,k)}k=this.invokeDelegateMethod(this.delegate,&quot;splitViewConstrainThickness&quot;,this,g,k);var e=this.get(&quot;innerFrame&quot;);available=(j==SC.HORIZONTAL)?e.width:e.height;var m=this.get(&quot;childNodes&quot;);var l=g.length;var a=this.get(&quot;flexibleView&quot;);while(--l&gt;=0){var d=m[l];if((d!=g)&amp;&amp;(d!=a)){available-=this.thicknessForView(d)}}k=Math.min(k,available);k=Math.max(0,k);if(k!=this.thicknessForView(g)){g.set(&quot;isCollapsed&quot;,(k&lt;=0));var c=(j===SC.HORIZONTAL)?{width:k}:{height:k};g.set(&quot;frame&quot;,c);this.layout()}},thicknessForView:function(a){var c=this.get(&quot;layoutDirection&quot;);var b=a.get(&quot;frame&quot;);return(c===SC.HORIZONTAL)?b.width:b.height},computeFlexibleView:function(){var b=this.get(&quot;flexibleView&quot;);if(!b){var a=this.get(&quot;childNodes&quot;);b=a[Math.ceil(a.length/2)]}while(b&amp;&amp;(b instanceof SC.SplitDividerView)){b=b.get(&quot;nextSibling&quot;)}return b},layout:function(){var b=this.get(&quot;childNodes&quot;);var h=this.computeFlexibleView();var g=this.get(&quot;layoutDirection&quot;);var a=b[0];var j=0;while(a&amp;&amp;(a!==h)){var c=a.get(&quot;isCollapsed&quot;)||NO;a.setIfChanged(&quot;isVisible&quot;,!c);if(!c){a.viewFrameWillChange();if(g==SC.HORIZONTAL){a.setIfChanged(&quot;styleLeft&quot;,j);a.setIfChanged(&quot;styleRight&quot;,null)}else{a.setIfChanged(&quot;styleTop&quot;,j);a.setIfChanged(&quot;styleBottom&quot;,null)}a.viewFrameDidChange();j+=this.thicknessForView(a)}a=a.get(&quot;nextSibling&quot;)}var e=j;var a=b.last();var j=0;while(a&amp;&amp;(a!==h)){var c=a.get(&quot;isCollapsed&quot;)||NO;a.setIfChanged(&quot;isVisible&quot;,!c);if(!c){a.viewFrameWillChange();if(g==SC.HORIZONTAL){a.setIfChanged(&quot;styleLeft&quot;,null);a.setIfChanged(&quot;styleRight&quot;,j)}else{a.setIfChanged(&quot;styleTop&quot;,null);a.setIfChanged(&quot;styleBottom&quot;,j)}a.viewFrameDidChange();j+=this.thicknessForView(a)}a=a.get(&quot;previousSibling&quot;)}var d=j;if(h){a=h;a.viewFrameWillChange();if(g==SC.HORIZONTAL){a.setIfChanged(&quot;styleLeft&quot;,e);a.setIfChanged(&quot;styleRight&quot;,d);a.setIfChanged(&quot;styleWidth&quot;,null)}else{a.setIfChanged(&quot;styleTop&quot;,e);a.setIfChanged(&quot;styleBottom&quot;,d);a.setIfChanged(&quot;styleHeight&quot;,null)}a.viewFrameDidChange()}},splitViewCanCollapse:function(b,a){return YES},splitViewConstrainThickness:function(c,a,b){return b},init:function(){arguments.callee.base.apply(this,arguments);this.addClassName(this.get(&quot;layoutDirection&quot;))}});require(&quot;views/view&quot;);require(&quot;views/split&quot;);SC.SplitDividerView=SC.View.extend({emptyElement:'&lt;div class=&quot;sc-split-divider-view&quot;&gt;&lt;/div&gt;',targetView:function(){var d=this.get(&quot;parentNode&quot;);if(!d){return null}var e=d.computeFlexibleView();var c=d.get(&quot;childNodes&quot;);var b=c.indexOf(this);var a=c.indexOf(e);if(b&lt;0){throw&quot;SplitDividerView must belong to the SplitView&quot;}return(b&lt;=a)?this.get(&quot;previousSibling&quot;):this.get(&quot;nextSibling&quot;)}.property(),mouseDown:function(a){var b=this.get(&quot;parentNode&quot;);if(!b){return}this._mouseDownLocation=Event.pointerLocation(a);this._targetView=this.get(&quot;targetView&quot;);this._originalThickness=b.thicknessForView(this._targetView);this._direction=b.get(&quot;layoutDirection&quot;);return true},mouseDragged:function(a){var e=Event.pointerLocation(a);if(this._direction==SC.HORIZONTAL){var d=e.x-this._mouseDownLocation.x}else{var d=e.y-this._mouseDownLocation.y}var b=this._originalThickness+d;var c=this.get(&quot;parentNode&quot;);c.setThicknessForView(this._targetView,b);return true},mouseUp:function(a){this._targetView=this._originalThickness=this._direction=this._mouseDownLocation=null},doubleClick:function(a){var d=this.get(&quot;parentNode&quot;);if(!d){return}var c=this.get(&quot;targetView&quot;);var b=c.get(&quot;isCollapsed&quot;)||NO;if(!b&amp;&amp;!d.canCollapseView(c)){return}c.set(&quot;isCollapsed&quot;,!b);d.layout();return true}});require(&quot;views/view&quot;);SC.PopupMenuView=SC.View.extend({emptyElement:&quot;&lt;ul&gt;&lt;/ul&gt;&quot;,acceptsFirstResponder:true,keyDown:function(a){return this.interpretKeyEvents(a)},cancel:function(){this.set(&quot;currentSelectedMenuItem&quot;,null);this.set(&quot;isVisible&quot;,false)},moveUp:function(){this.selectPreviousMenuItem()},moveDown:function(){this.selectNextMenuItem()},_currentSelectedMenuItem:null,currentSelectedMenuItem:function(a,b){if(b!==undefined){if(this._currentSelectedMenuItem){this._currentSelectedMenuItem.set(&quot;isDefault&quot;,false)}this._currentSelectedMenuItem=b;if(this._currentSelectedMenuItem){this._currentSelectedMenuItem.set(&quot;isDefault&quot;,true)}}return this._currentSelectedMenuItem}.property(),selectPreviousMenuItem:function(){var a=this.previousValidMenuItem();if(!a){return false}this.set(&quot;currentSelectedMenuItem&quot;,a)},selectNextMenuItem:function(){var a=this.nextValidMenuItem();if(!a){return false}this.set(&quot;currentSelectedMenuItem&quot;,a)},previousValidMenuItem:function(){return this._validMenuItemInDirection(&quot;previousSibling&quot;,&quot;lastChild&quot;)},nextValidMenuItem:function(){return this._validMenuItemInDirection(&quot;nextSibling&quot;,&quot;firstChild&quot;)},_validMenuItemInDirection:function(d,b){var c=this.get(&quot;currentSelectedMenuItem&quot;);var a=c?c.get(d):this.get(b);if(!a){return null}do{if(a.get(&quot;isEnabled&quot;)){return a}}while(a=a.get(d));return null},_show:function(){this.set(&quot;currentSelectedMenuItem&quot;,null);this._validateMenuItems();arguments.callee.base.apply(this,arguments)},_validateMenuItems:function(){var c=this.get(&quot;childNodes&quot;);for(var b=0,g=c.length;b&lt;g;b++){var a=c[b];if(a._hasLegacyActionHandler()){continue}var d=a.get(&quot;action&quot;);var e=SC.app.targetForAction(d,a.get(&quot;target&quot;),a);if(e&amp;&amp;e.respondsTo(&quot;validateMenuItem&quot;)){a.set(&quot;isEnabled&quot;,e.validateMenuItem(a))}if(e&amp;&amp;!e.respondsTo(&quot;validateMenuItem&quot;)){a.set(&quot;isEnabled&quot;,true)}if(!e){a.set(&quot;isEnabled&quot;,false)}}},performKeyEquivalent:function(b,a){this._validateMenuItems();return arguments.callee.base.apply(this,arguments)},resizeWithOldParentSize:function(){var a=0;var e=this.get(&quot;firstChild&quot;);while(e){var c=(e.computedRequiredWidth)?e.computedRequiredWidth():0;if(c&gt;a){a=c}e=e.get(&quot;nextSibling&quot;)}var b=this.get(&quot;size&quot;).width;if(a!=b){var d={width:a};this.set(&quot;size&quot;,d)}}});SC.MIXED_STATE=&quot;__MIXED__&quot;;SC.Control={initMixin:function(){this._contentObserver();this.isSelectedObserver();this.isEnabledObserver();this.isFocusedObserver()},isSelected:false,isSelectedBindingDefault:SC.Binding.OneWayBool,isEnabled:true,isEnabledBindingDefault:SC.Binding.OneWayBool,value:null,content:null,contentValueKey:null,contentPropertyDidChange:function(d,a){if(!!this._contentValueKey&amp;&amp;((a==this._contentValueKey)||(a==&quot;*&quot;))){var b=this.get(&quot;content&quot;);var c=(b)?b.get(this._contentValueKey):null;if(c!=this._contentValue){this._contentValue=c;this.set(&quot;value&quot;,c)}}},updateContentWithValueObserver:function(){if(!this._contentValueKey){return}var b=this.get(&quot;value&quot;);if(b==this._contentValue){return}var a=this.get(&quot;content&quot;);if(!a){return}this._contentValue=b;a.set(this._contentValueKey,b)}.observes(&quot;value&quot;),isSelectedObserver:function(){var a=this.get(&quot;isSelected&quot;);this.setClassName(&quot;mixed&quot;,a==SC.MIXED_STATE);this.setClassName(&quot;sel&quot;,a&amp;&amp;(a!=SC.MIXED_STATE))}.observes(&quot;isSelected&quot;),isEnabledObserver:function(){var a=!this.get(&quot;isEnabled&quot;);this.setClassName(&quot;disabled&quot;,a);if(this.rootElement&amp;&amp;(this.rootElement.disabled!==undefined)&amp;&amp;(this.rootElement.disabled!=a)){this.rootElement.disabled=a}}.observes(&quot;isEnabled&quot;),isFocusedObserver:function(){this.setClassName(&quot;focus&quot;,!!this.get(&quot;isFirstResponder&quot;))}.observes(&quot;isFirstResponder&quot;),_content:null,_contentObserver:function(){var b=this.get(&quot;content&quot;);if(this._content==b){return}if(!this._boundContentPropertyDidChangeObserver){this._boundContentPropertyDidChangeObserver=this.contentPropertyDidChange.bind(this)}var c=this._boundContentPropertyDidChangeObserver;if(this._content&amp;&amp;this._content.removeObserver){this._content.removeObserver(&quot;*&quot;,c)}var a=this.displayDelegate;this._contentValueKey=this.getDelegateProperty(a,&quot;contentValueKey&quot;);this._content=b;if(this._content&amp;&amp;this._content.addObserver){this._content.addObserver(&quot;*&quot;,c)}this.contentPropertyDidChange(this._content,&quot;*&quot;)}.observes(&quot;content&quot;)};SC.Validatable={initMixin:function(){this._validatorObserver()},validator:null,errorLabel:null,isValid:function(){return $type(this.get(&quot;value&quot;))!=T_ERROR}.property(&quot;value&quot;),ownerForm:null,performValidate:function(c){var a=SC.Validator.OK;if(this._validator){var b=this.get(&quot;ownerForm&quot;);if(c){a=this._validator.validatePartial(b,this);if((a==SC.Validator.NO_CHANGE)&amp;&amp;(this._validator.validateChange(b,this)==SC.Validator.OK)){a=SC.Validator.OK}}else{a=this._validator.validateChange(b,this)}}return a},performValidateSubmit:function(){return(this._validator)?this._validator.validateSubmit(this.get(&quot;ownerForm&quot;),this):SC.Validator.OK},validateSubmit:function(){return this.performValidateSubmit()},objectForFieldValue:function(a){return(this._validator)?this._validator.objectForFieldValue(a,this.get(&quot;ownerForm&quot;),this):a},fieldValueForObject:function(a){return(this._validator)?this._validator.fieldValueForObject(a,this.get(&quot;ownerForm&quot;),this):a},isValidObserver:function(){var a=!this.get(&quot;isValid&quot;);this.setClassName(&quot;invalid&quot;,a)}.observes(&quot;isValid&quot;),_validatorObserver:function(){var a=this.get(&quot;ownerForm&quot;);var b=SC.Validator.findFor(a,this,this.get(&quot;validator&quot;));if(b!=this._validator){if(this._validator){this._validator.detachFrom(a,this)}this._validator=b;if(this._validator){this._validator.attachTo(a,this)}}}.observes(&quot;validator&quot;,&quot;ownerForm&quot;)};require(&quot;views/view&quot;);require(&quot;mixins/control&quot;);require(&quot;mixins/validatable&quot;);SC.FieldView=SC.View.extend(SC.Control,SC.Validatable,{value:null,fieldKey:null,fieldLabel:null,errorLabel:function(){var a=this.get(&quot;fieldLabel&quot;);if(a){return a}var c=this.get(&quot;fieldKey&quot;);var b=(c||&quot;&quot;).humanize().capitalize();return&quot;FieldKey.%@&quot;.fmt(c).locWithDefault(b)}.property(&quot;fieldLabel&quot;,&quot;fieldKey&quot;),fieldValue:function(a,b){if(b!==undefined){this._setFieldValue(b)}return this._getFieldValue()}.property(&quot;value&quot;),validateSubmit:function(){var a=this.performValidateSubmit();var b=($ok(a))?this._getFieldValue():a;if(b!=this.get(&quot;value&quot;)){this.set(&quot;value&quot;,b)}return a},setFieldValue:function(a){if(this.rootElement.value!=a){this.rootElement.value=a}},getFieldValue:function(){return this.rootElement.value},fieldValueDidChange:function(b){var a=this.performValidate(b);if(a==SC.Validator.NO_CHANGE){return a}var c=($ok(a))?this._getFieldValue():a;if(!b&amp;&amp;$ok(a)){this._setFieldValue(c)}if(c!=this.get(&quot;value&quot;)){this.set(&quot;value&quot;,c)}return a},enableField:function(){this.rootElement.disabled=NO},disableField:function(){this.rootElement.disabled=YES},isEnabledObserver:function(){isEnabled=this.get(&quot;isEnabled&quot;);arguments.callee.base.apply(this,arguments);(isEnabled)?this.enableField():this.disableField()}.observes(&quot;isEnabled&quot;),init:function(){arguments.callee.base.call(this);if(this.rootElement){this._setFieldValue(this.get(&quot;value&quot;))}},_valueObserver:function(){var b=this.get(&quot;value&quot;);var a=$type(b)==T_ERROR;if(!a&amp;&amp;(b!=this._getFieldValue())){this._setFieldValue(b)}}.observes(&quot;value&quot;),_setFieldValue:function(a){return this.setFieldValue(this.fieldValueForObject(a))},_getFieldValue:function(){return this.objectForFieldValue(this.getFieldValue())}});SC.Editable={isEditable:NO,isEditing:NO,beginEditing:function(){if(!this.get(&quot;isEditable&quot;)){return NO}if(this.get(&quot;isEditing&quot;)){return YES}this.set(&quot;isEditing&quot;,YES);this.becomeFirstResponder();return YES},discardEditing:function(){return !this.get(&quot;isEditing&quot;)},commitEditing:function(){if(!this.get(&quot;isEditing&quot;)){return YES}this.set(&quot;isEditing&quot;,NO);this.resignFirstResponder();return YES}};require(&quot;views/field/field&quot;);require(&quot;mixins/editable&quot;);SC.TextFieldView=SC.FieldView.extend(SC.Editable,{emptyElement:'&lt;input type=&quot;text&quot; value=&quot;&quot; /&gt;',hint:null,isHintShowing:false,isEditing:NO,init:function(){if(this.hint==null){this.hint=this.rootElement.getAttribute(&quot;hint&quot;)}if(this.validator==null){this.validator=this.rootElement.getAttribute(&quot;validate&quot;)}arguments.callee.base.call(this);var a=this._fieldDidFocus.bindAsEventListener(this);Event.observe(this.rootElement,&quot;focus&quot;,a);var b=this._fieldDidBlur.bindAsEventListener(this);Event.observe(this.rootElement,&quot;blur&quot;,b);this._updateFieldHint()},_fieldDidFocus:function(){if(!this._isFocused&amp;&amp;!this._fieldIsFocusing){this._fieldIsFocusing=YES;this.becomeFirstResponder();this._isFocused=YES;this._fieldIsFocusing=NO}},_fieldDidBlur:function(){if(this._isFocused){this._isFocused=false;this.resignFirstResponder()}},acceptsFirstResponder:function(){return this.get(&quot;isEnabled&quot;)}.property(&quot;isEnabled&quot;),didBecomeFirstResponder:function(){if(!this._isFocused){this._isFocused=true;if(this.get(&quot;isVisibleInWindow&quot;)){this.rootElement.focus();this.invokeLater(this._selectRootElement,1)}}this._updateFieldHint()},_selectRootElement:function(){this.rootElement.select()},willLoseFirstResponder:function(){if(this._isFocused){this._isFocused=false;this._updateFieldHint();return this.rootElement.blur()}else{this._value=this.rootElement.value;this.fieldValueDidChange();this._updateFieldHint();return true}},_isFocused:false,_fieldIsFocusing:false,_updateFieldHint:function(){var b=this.get(&quot;hint&quot;);var a=!!(!this._isFocused&amp;&amp;((this._value==null)||this._value==&quot;&quot;)&amp;&amp;(b));this.setClassName(&quot;show-hint&quot;,a);this.rootElement.value=(a)?b:(this._value||&quot;&quot;);this.set(&quot;isHintShowing&quot;,a)},getFieldValue:function(){return this._value},setFieldValue:function(a){if(this._value==a){return}this._value=a;this._updateFieldHint()},mouseDown:function(a){a._stopWhenHandled=false;return false},keyDown:function(a){var b=this._validator?this._validator.validateKeypress(this.get(&quot;form&quot;),this,a):true;if(b){if(this._value!=this.rootElement.value){this._value=this.rootElement.value;this.fieldValueDidChange(true)}return this.interpretKeyEvents(a)}else{return true}},keyUp:function(){if(this._value!=this.rootElement.value){this._value=this.rootElement.value;this.fieldValueDidChange(true)}},_focusOnVisible:function(){if(this.get(&quot;isVisibleInWindow&quot;)&amp;&amp;this._isFocused){this.rootElement.focus();if(SC.isIE()){var a=function(){Element.select(arguments.callee.it)};a.it=this.rootElement;setTimeout(a,0.05)}else{this.rootElement.select.bind(this.rootElement).delay(0.05)}}}.observes(&quot;isVisibleInWindow&quot;),deleteBackward:function(a){a._stopWhenHandled=false;return true},deleteForward:function(a){a._stopWhenHandled=false;return true},moveLeft:function(a){a._stopWhenHandled=false;return true},moveRight:function(a){a._stopWhenHandled=false;return true},moveUp:function(a){a._stopWhenHandled=false;return true},moveDown:function(a){a._stopWhenHandled=false;return true},moveLeftAndModifySelection:function(a){a._stopWhenHandled=false;return true},moveRightAndModifySelection:function(a){a._stopWhenHandled=false;return true},moveUpAndModifySelection:function(a){a._stopWhenHandled=false;return true},moveDownAndModifySelection:function(a){a._stopWhenHandled=false;return true},moveToBeginningOfDocument:function(a){a._stopWhenHandled=false;return true},moveToEndOfDocument:function(a){a._stopWhenHandled=false;return true},selectAll:function(a){a._stopWhenHandled=false;return true}});SC.InlineEditorDelegate={inlineEditorClassName:&quot;&quot;,inlineEditorWillBeginEditing:function(a){},inlineEditorDidBeginEditing:function(a){},inlineEditorShouldEndEditing:function(a,b){return YES},inlineEditorDidEndEditing:function(a,b){}};require(&quot;views/view&quot;);require(&quot;mixins/delegate_support&quot;);require(&quot;views/field/text_field&quot;);require(&quot;mixins/inline_editor_delegate&quot;);SC.InlineTextFieldView=SC.View.extend(SC.DelegateSupport,SC.InlineEditorDelegate,{beginEditing:function(b){this.beginPropertyChanges();if(this.get(&quot;isEditing&quot;)&amp;&amp;!this.blurEditor()){this.endPropertyChanges();return NO}this._optframe=b.frame;this._exampleElement=b.exampleElement;this._delegate=b.delegate;if(!this._optframe||!this._delegate){throw&quot;At least frame and delegate options are required for inline editor&quot;}this._originalValue=b.value||&quot;&quot;;this._multiline=(b.multiline!==undefined)?b.multiline:NO;this._commitOnBlur=(b.commitOnBlur!==undefined)?b.commitOnBlur:YES;var c=this.outlet(&quot;field&quot;);c.set(&quot;validator&quot;,b.validator);c.set(&quot;value&quot;,this._originalValue);c.set(&quot;selectedRange&quot;,b.selectedRange||{start:this._originalValue.length,length:0});this.set(&quot;isEditing&quot;,YES);SC.app.get(&quot;keyPane&quot;).appendChild(this);this.updateViewStyle();var a=this._delegate;this._className=this.getDelegateProperty(a,&quot;inlineEditorClassName&quot;);if(this._className&amp;&amp;!this.hasClassName(this._className)){this.setClassName(this._className,true)}this.invokeDelegateMethod(a,&quot;inlineEditorWillBeginEditing&quot;,this);this.resizeToFit(c.getFieldValue());this.endPropertyChanges();this.field.becomeFirstResponder();this.invokeDelegateMethod(a,&quot;inlineEditorDidBeginEditing&quot;,this)},commitEditing:function(){var a=this.outlet(&quot;field&quot;);if(!$ok(a.validateSubmit())){return NO}return this._endEditing(a.get(&quot;value&quot;))},discardEditing:function(){return this._endEditing(this._originalValue)},blurEditor:function(){if(!this.get(&quot;isEditing&quot;)){return YES}return(this._commitOnBlur)?this.commitEditing():this.discardEditing()},_endEditing:function(b){if(!this.get(&quot;isEditing&quot;)){return YES}var a=this._delegate;if(!this.invokeDelegateMethod(a,&quot;inlineEditorShouldEndEditing&quot;,this,b)){return NO}this.invokeDelegateMethod(a,&quot;inlineEditorDidEndEditing&quot;,this,b);if(this._className){this.setClassName(this._className,false)}this._originalValue=this._delegate=this._exampleElement=this._optframe=this._className=null;this.set(&quot;isEditing&quot;,NO);if(this.field.get(&quot;isFirstResponder&quot;)){this.field.resignFirstResponder()}if(this.get(&quot;parentNode&quot;)){this.removeFromParent()}return YES},isEditing:NO,emptyElement:['&lt;div class=&quot;sc-inline-text-field-view&quot;&gt;','&lt;div class=&quot;sizer&quot;&gt;&lt;/div&gt;','&lt;textarea class=&quot;inner-field&quot; wrap=&quot;virtual&quot;&gt;&lt;/textarea&gt;',&quot;&lt;/div&gt;&quot;].join(&quot;&quot;),updateViewStyle:function(){var d=this._optframe;var a=this._exampleElement;var b={fontSize:Element.getStyle(a,&quot;font-size&quot;),fontFamily:Element.getStyle(a,&quot;font-family&quot;),fontWeight:Element.getStyle(a,&quot;font-weight&quot;),paddingLeft:Element.getStyle(a,&quot;padding-left&quot;),paddingRight:Element.getStyle(a,&quot;padding-right&quot;),paddingTop:Element.getStyle(a,&quot;padding-top&quot;),paddingBottom:Element.getStyle(a,&quot;padding-bottom&quot;),lineHeight:Element.getStyle(a,&quot;line-height&quot;),textAlign:Element.getStyle(a,&quot;text-align&quot;)};var e=this.outlet(&quot;field&quot;);var c=this.outlet(&quot;sizer&quot;);e.setStyle(b);b.opacity=0;c.setStyle(b);c.recacheFrames();this.set(&quot;frame&quot;,d)},resizeToFit:function(d){var b=this.outlet(&quot;sizer&quot;);var c=this.outlet(&quot;field&quot;);var e=(d||&quot;&quot;).escapeHTML();e=e.replace(/  /g,&quot;&amp;#160; &quot;).replace(/\n/g,&quot;&lt;br /&gt;&amp;#160;&quot;);b.set(&quot;innerHTML&quot;,e||&quot;&amp;#160;&quot;);b.recacheFrames();var a=b.get(&quot;frame&quot;).height;this.set(&quot;frame&quot;,{height:a})},field:SC.TextFieldView.extend({mouseDown:function(a){arguments.callee.base.call(this,a);return this.owner.get(&quot;isEditing&quot;)},willRemoveFromParent:function(){this.get(&quot;rootElement&quot;).blur()},willLoseFirstResponder:function(){this.get(&quot;rootElement&quot;).blur();return this.owner.blurEditor()},cancel:function(){this.owner.discardEditing();return YES},fieldValueDidChange:function(a){arguments.callee.base.call(this,a);this.owner.resizeToFit(this.getFieldValue())},insertNewline:function(a){if(this.owner_multiline){return arguments.callee.base.call(this,a)}else{this.owner.commitEditing();return YES}},insertTab:function(a){var b=this.get(&quot;owner&quot;)._delegate.nextValidKeyView();this.owner.commitEditing();if(b){b.beginEditing()}return YES},insertBacktab:function(a){var b=this.get(&quot;owner&quot;)._delegate.previousValidKeyView();this.owner.commitEditing();if(b){b.beginEditing()}return YES}}).outletFor(&quot;.inner-field?&quot;),sizer:SC.View.outletFor(&quot;.sizer?&quot;)});SC.InlineTextFieldView.mixin({beginEditing:function(a){if(!this.sharedEditor||SC.isIE()||SC.window.hasClassName(&quot;ie8&quot;)){this.sharedEditor=this.create()}return this.sharedEditor.beginEditing(a)},commitEditing:function(){return(this.sharedEditor)?this.sharedEditor.commitEditing():YES},discardEditing:function(){return(this.sharedEditor)?this.sharedEditor.discardEditing():YES},sharedEditor:null});require(&quot;views/view&quot;);require(&quot;mixins/control&quot;);require(&quot;mixins/delegate_support&quot;);require(&quot;views/inline_text_field&quot;);require(&quot;mixins/inline_editor_delegate&quot;);SC.LabelView=SC.View.extend(SC.DelegateSupport,SC.Control,SC.InlineEditorDelegate,{emptyElement:'&lt;span class=&quot;sc-label-view&quot;&gt;&lt;/span&gt;',escapeHTML:true,localize:false,formatter:null,value:&quot;&quot;,displayValue:function(){var g=this.get(&quot;value&quot;);var d=this.getDelegateProperty(this.displayDelegate,&quot;formatter&quot;);if(d){var e=($type(d)==T_FUNCTION)?d(g,this):d.fieldValueForObject(g,this);if(e!=null){g=e}}if($type(g)==T_ARRAY){var c=[];for(var b=0;b&lt;g.get(&quot;length&quot;);b++){var a=g.objectAt(b);if(a!=null&amp;&amp;a.toString){a=a.toString()}c.push(a)}g=c.join(&quot;,&quot;)}if(g!=null&amp;&amp;g.toString){g=g.toString()}if(g&amp;&amp;this.getDelegateProperty(this.displayDelegate,&quot;localize&quot;)){g=g.loc()}return g}.property(&quot;value&quot;),isEditable:NO,isEditing:NO,localize:false,validator:null,doubleClick:function(a){return this.beginEditing()},beginEditing:function(){if(this.get(&quot;isEditing&quot;)){return YES}if(!this.get(&quot;isEditable&quot;)){return NO}var c=this.get(&quot;value&quot;)||&quot;&quot;;var b=this.convertFrameToView(this.get(&quot;frame&quot;),null);var a=this.rootElement;SC.InlineTextFieldView.beginEditing({frame:b,delegate:this,exampleElement:a,value:c,multiline:NO,validator:this.get(&quot;validator&quot;)})},discardEditing:function(){if(!this.get(&quot;isEditing&quot;)){return YES}return SC.InlineTextFieldView.discardEditing()},commitEditing:function(){if(!this.get(&quot;isEditing&quot;)){return YES}return SC.InlineTextFieldView.commitEditing()},inlineEditorWillBeginEditing:function(a){this.set(&quot;isEditing&quot;,YES)},inlineEditorDidBeginEditing:function(a){this._oldOpacity=this.getStyle(&quot;opacity&quot;);this.setStyle({opacity:0})},inlineEditorShouldEndEditing:function(a,b){return YES},inlineEditorDidEndEditing:function(a,b){this.setIfChanged(&quot;value&quot;,b);this.setStyle({opacity:this._oldOpacity});this._oldOpacity=null;this.set(&quot;isEditing&quot;,NO)},_valueDidChange:function(){var a=this.get(&quot;value&quot;);if(a===this._value){return}this._value=a;a=this.get(&quot;displayValue&quot;);if(this.getDelegateProperty(this.displayDelegate,&quot;escapeHTML&quot;)){this.set(&quot;innerText&quot;,a||&quot;&quot;)}else{this.set(&quot;innerHTML&quot;,a||&quot;&quot;)}}.observes(&quot;value&quot;)});SC.DROP_ON=1;SC.DROP_BEFORE=2;SC.DROP_ANY=3;SC.CollectionViewDelegate={collectionViewSelectionForProposedSelection:function(a,b){return b},collectionViewShouldBeginDrag:function(a){return YES},collectionViewDragDataTypes:function(a){return[]},collectionViewDragDataForType:function(a,b,c){return null},collectionViewValidateDrop:function(a,d,e,c,b){return b},collectionViewAcceptDrop:function(b,d,e,c,a){return SC.DRAG_NONE},collectionViewShouldDeleteContent:function(a,b){return b},collectionViewDeleteContent:function(a,b){return NO}};require(&quot;views/view&quot;);require(&quot;views/label&quot;);require(&quot;mixins/collection_view_delegate&quot;);SC.BENCHMARK_UPDATE_CHILDREN=NO;SC.VALIDATE_COLLECTION_CONSISTANCY=NO;SC.DRAG_REORDER=268369921;SC.HORIZONTAL_ORIENTATION=&quot;horizontal&quot;;SC.VERTICAL_ORIENTATION=&quot;vertical&quot;;SC.ZOMBIE_GROUPS_ENABLED=YES;SC.REMOVE_COLLECTION_ROOT_ELEMENT_DURING_RENDER=NO;SC.CollectionView=SC.View.extend(SC.CollectionViewDelegate,{content:[],contentBindingDefault:SC.Binding.MultipleNotEmpty,selection:[],selectionBindingDefault:SC.Binding.Multiple,delegate:null,isSelectable:true,isSelectableBindingDefault:SC.Binding.Bool,isEnabled:true,isEnabledBindingDefault:SC.Binding.Bool,isEditable:true,isEditableBindingDefault:SC.Binding.Bool,canReorderContent:false,canReorderContentBindingDefault:SC.Binding.Bool,canDeleteContent:NO,canDeleteContentBindingDefault:SC.Binding.Bool,isDropTarget:NO,useToggleSelection:NO,actOnSelect:false,selectOnMouseDown:true,groupBy:null,exampleView:SC.View,exampleGroupView:SC.View.extend({emptyElement:'&lt;div&gt;&lt;h1&gt;&lt;/h1&gt;&lt;div class=&quot;well&quot;&gt;&lt;/div&gt;&lt;/div&gt;',outlets:[&quot;labelView&quot;,&quot;itemView&quot;],labelView:SC.LabelView.outletFor(&quot;h1?&quot;),itemView:SC.View.outletFor(&quot;.well?&quot;)}),action:null,target:null,isDirty:false,maxRenderTime:0,contentValueKey:null,acceptsFirstResponder:false,itemsPerRow:1,itemViews:function(){if(!this._itemViews){var b=this.get(&quot;nowShowingRange&quot;);var c=this.get(&quot;content&quot;)||[];this._itemViews=[];for(var a=0;a&lt;b.length;a++){var d=c.objectAt(a);this._itemViews.push(this.itemViewForContent(d))}}return this._itemViews}.property(),groupViews:function(){if(!this._groupViews){var d=this.get(&quot;groupBy&quot;);if(d){var c=this.get(&quot;nowShowingRange&quot;);var g=this.get(&quot;content&quot;)||[];var b=undefined;this._groupViews=[];for(var a=0;a&lt;c.length;a++){var h=g.objectAt(a);var e=(h)?h.get(d):null;if(e!=b){b=e;this._groupViews.push(this.groupViewForGroupValue(b))}}}}return this._groupViews}.property(),hasItemView:function(a){if(!this._itemViewsByGuid){this._itemViewsByGuid={}}return !!this._itemViewsByGuid[SC.guidFor(a)]},itemViewAtLocation:function(c){var a=this._itemViewRoot;while(a){var b=a.get(&quot;frame&quot;);if(SC.pointInRect(c,b)){return a}}return null},itemViewForEvent:function(b){var a=SC.window.firstViewForEvent(b);do{if(a==this){return null}if(this.hasItemView(a)&amp;&amp;(!a.hitTest||a.hitTest(b))){return a}}while(a=a.get(&quot;parentNode&quot;));return null},itemViewForContent:function(b){var a=(b)?SC.guidFor(b):&quot;0&quot;;return this._itemViewsByContent[a]},groupViewForGroupValue:function(a){return this._groupViewsByValue[a]},groupValueForGroupView:function(b){if(!b){return null}var a;if(b.groupValue===undefined){a=b.get(&quot;content&quot;)}else{a=b.get(&quot;groupValue&quot;)}return a},groupRangeForContentIndex:function(c){var g=Array.from(this.get(&quot;content&quot;));var e=g.get(&quot;length&quot;);var k=this.get(&quot;groupBy&quot;);if(!k){return{start:0,length:e}}var b=c,h=c;var j=g.objectAt(c);var a=(j)?j.get(k):null;while(--b&gt;=0){var j=g.objectAt(b);var d=(j)?j.get(k):null;if(d!==a){break}}b++;while(++h&lt;e){var j=g.objectAt(h);var d=(j)?j.get(k):null;if(d!==a){break}}return{start:b,length:h-b}},groupValueAtContentIndex:function(c){var a=this.get(&quot;groupBy&quot;);var b=Array.from(this.get(&quot;content&quot;)).objectAt(c);return(a&amp;&amp;b&amp;&amp;b.get)?b.get(a):null},updateChildren:function(d){var j;if(!this.get(&quot;isVisibleInWindow&quot;)){this.set(&quot;isDirty&quot;,true);this._needsFullUpdate=this._needsFullUpdate||d;return}if(SC.BENCHMARK_UPDATE_CHILDREN){var e=&quot;%@.updateChildren(%@)&quot;.fmt(this,(d)?&quot;FULL&quot;:&quot;FAST&quot;);SC.Benchmark.start(e)}this.beginPropertyChanges();var j;if((j=this.computeFrame())&amp;&amp;!SC.rectsEqual(j,this.get(&quot;frame&quot;))){var r=this.get(&quot;parentNode&quot;);if(r){r.viewFrameWillChange()}this.set(&quot;frame&quot;,j);if(r){r.viewFrameDidChange()}if((j=this.computeFrame())&amp;&amp;!SC.rectsEqual(j,this.get(&quot;frame&quot;))){this.set(&quot;frame&quot;,j)}}var p=this._lastClippingFrame=this.get(&quot;clippingFrame&quot;);var g=this.contentRangeInFrame(p);var l=Array.from(this.get(&quot;content&quot;));g.length=Math.min(SC.maxRange(g),l.get(&quot;length&quot;))-g.start;var u=this.get(&quot;nowShowingRange&quot;);d=d||(SC.intersectRanges(g,u).length&lt;=0);this.set(&quot;nowShowingRange&quot;,g);var t=this.get(&quot;groupBy&quot;);var h=false;if(d){var k={};var q=SC.maxRange(g);while(--q&gt;=g.start){var o=l.objectAt(q);var s=SC.guidFor(o);var m=this._insertItemViewFor(o,t,q);if(m){k[s]=m;delete this._itemViewsByContent[s]}}for(var s in this._itemViewsByContent){if(!this._itemViewsByContent.hasOwnProperty(s)){continue}var m=this._itemViewsByContent[s];this._removeItemView(m,t)}this._itemViewsByContent=k;h=true}else{var a=g.start;var b=(u.start-a);if(b!=0){this._insertOrRemoveItemViewsInRange(a,b,t);h=true}var a=SC.maxRange(u);var b=SC.maxRange(g)-a;if(b!=0){this._insertOrRemoveItemViewsInRange(a,b,t);h=true}}this.recacheFrames();this._hasChildren=g.length&gt;0;this.set(&quot;isDirty&quot;,false);if(h){this._flushZombieGroupViews();this.updateSelectionStates();this._itemViews=null;this.notifyPropertyChange(&quot;itemViews&quot;);this._groupViews=null;this.notifyPropertyChange(&quot;groupViews&quot;)}this.endPropertyChanges();if(SC.BENCHMARK_UPDATE_CHILDREN){SC.Benchmark.end(e)}},rebuildChildren:function(){this.beginPropertyChanges();while(this._itemViewRoot){this._removeItemViewFromChain(this._itemViewRoot)}while(this._groupViewRoot){this._removeGroupView(this._groupViewRoot)}this._hasChildren=false;this.updateChildren();this.endPropertyChanges()},updateSelectionStates:function(){if(!this._hasChildren){return}var e=this.get(&quot;selection&quot;)||[];var g=this._selectionHash;if(!g){g={};var a=e.get(&quot;length&quot;);while(--a&gt;=0){var h=e.objectAt(a);var c=SC.guidFor(h);g[c]=true}this._selectionHash=g}for(var c in this._itemViewsByContent){if(!this._itemViewsByContent.hasOwnProperty(c)){continue}var d=this._itemViewsByContent[c];var b=(c)?g[c]:false;if(d.get(&quot;isSelected&quot;)!=b){d.set(&quot;isSelected&quot;,b)}}},resizeChildrenWithOldSize:function(a){if(!this._hasChildren){return}this.updateChildren();this.layoutResize()},clippingFrameDidChange:function(){if(!this._hasChildren){return}SC.Benchmark.start(&quot;%@.clippingFrameDidChange&quot;.fmt(this.toString()));if(!SC.rectsEqual(this._lastClippingFrame,this.get(&quot;clippingFrame&quot;))){if(this._hasChildren){this.updateChildren()}}SC.Benchmark.end(&quot;%@.clippingFrameDidChange&quot;.fmt(this.toString()))},computeFrame:function(){return null},contentRangeInFrame:function(c){var b=this.get(&quot;content&quot;);var a=((b&amp;&amp;b.get)?b.get(&quot;length&quot;):0)||0;return{start:0,length:a}},layoutGroupView:function(c,a,b,d){},layoutItemView:function(a,c,b){},layoutResize:function(){if(!this._hasChildren){return}var g=this.get(&quot;nowShowingRange&quot;);var c=this.get(&quot;groupBy&quot;);var b=undefined;var e=this.get(&quot;content&quot;)||[];var a=SC.maxRange(g);while(--a&gt;=g.start){var j=e.objectAt(a);var d=this.itemViewForContent(j);if(!d){continue}if(c&amp;&amp;((curGroupValue=(j)?j.get(c):null)!==b)){var h=this.groupViewForGroupValue(b);if(h){this.layoutGroupView(h,b,a,false)}}this.layoutItemView(d,a,false)}},_itemViews:null,_groupViews:null,_visibleContentRange:null,_itemViewsByContent:null,_groupViewsByValue:null,_groupViewCounts:null,_itemViewPool:null,_groupViewPool:null,_zombieGroupViews:null,_insertItemViewFor:function(e,k,d){var j=SC.guidFor(e);var g=this._itemViewsByContent[j];var h=false;if(!g){g=this._itemViewPool.pop()||this.get(&quot;exampleView&quot;).create({owner:this,displayDelegate:this});g.addClassName(&quot;sc-collection-item&quot;);g.set(&quot;content&quot;,e);this._itemViewsByContent[j]=g;this._itemViewsByGuid[SC.guidFor(g)]=g;h=true}if(!g){throw&quot;Could not create itemView for content: %@&quot;.fmt(e)}var a=!!(k&amp;&amp;e);var b=(a)?e.get(k):null;var l=(a)?this._insertGroupViewFor(b,d):this;var c=g.get(&quot;parentNode&quot;);if(c!=l){if(k&amp;&amp;c){if(--this._groupViewCounts[SC.guidFor(c)]&lt;=0){this._removeGroupView(c,b)}}l.appendChild(g);if(k){this._groupViewCounts[SC.guidFor(l)]++}}this.layoutItemView(g,d,h);return g},_removeItemView:function(d,b){var g=null;var a;if(b&amp;&amp;(g=d.get(&quot;parentNode&quot;))){if(--this._groupViewCounts[SC.guidFor(g)]&gt;0){g=null}if(g){var e=d.get(&quot;content&quot;);a=(e)?e.get(b):null}}var e=d.get(&quot;content&quot;);var c=SC.guidFor(e);delete this._itemViewsByContent[c];delete this._itemViewsByGuid[SC.guidFor(d)];d.removeFromParent();d.set(&quot;content&quot;,null);this._itemViewPool.push(d);if(g){this._removeGroupView(g,a)}return d},_insertOrRemoveItemViewsInRange:function(h,e,b){if(e==0){return}var d=this.get(&quot;content&quot;)||[];if(e&lt;0){}else{if(e&gt;0){while(--e&gt;=0){var a=h+e;var g=d.objectAt(a);this._insertItemViewFor(g,b,a)}}}},_insertGroupViewFor:function(a,d){var b=this._groupViewsByValue[a];if(b&amp;&amp;!(b.get(&quot;content&quot;)==a||b.get(&quot;groupValue&quot;)==a)){b=null;this._groupViewsByValue[a]=null}var c=false;if(!b&amp;&amp;this._zombieGroupViews){b=this._zombieGroupViews[a];if(b){delete this._zombieGroupViews[a];this._groupViewsByValue[a]=b;this._groupViewCounts[SC.guidFor(b)]=0}}if(!b){b=this._groupViewPool.pop()||this.get(&quot;exampleGroupView&quot;).create({owner:this,displayDelegate:this});b.addClassName(&quot;sc-collection-group&quot;);if(b.groupValue!==undefined){b.set(&quot;groupValue&quot;,a)}else{b.set(&quot;content&quot;,a)}this._groupViewsByValue[a]=b;this._groupViewCounts[SC.guidFor(b)]=0;c=true}if(!b){throw&quot;Could not create a groupView for value: %@&quot;.fmt(a)}if(b.get(&quot;parentNode&quot;)!=this){this.appendChild(b)}this.layoutGroupView(b,a,d,c);return b},_removeGroupView:function(b,a){if(SC.ZOMBIE_GROUPS_ENABLED){this._zombieGroupViews[a]=b}else{this._finalRemoveGroupView(b)}delete this._groupViewsByValue[a];delete this._groupViewCounts[SC.guidFor(b)];return b},_flushZombieGroupViews:function(){if(!SC.ZOMBIE_GROUPS_ENABLED){return}for(var a in this._zombieGroupViews){if(!this._zombieGroupViews.hasOwnProperty(a)){continue}var b=this._zombieGroupViews[a];this._finalRemoveGroupView(b)}this._zombieGroupViews={}},_finalRemoveGroupView:function(a){a.removeFromParent();if(a.groupValue!==undefined){a.set(&quot;groupValue&quot;,null)}else{a.set(&quot;content&quot;,null)}this._groupViewPool.push(a);return a},_removeRootElementFromDom:function(){if(!SC.REMOVE_COLLECTION_ROOT_ELEMENT_DURING_RENDER){return}if(this._cachedRootElementParent===undefined){var a=this._cachedRootElementParent=this.rootElement.parentNode;this._cachedRootElementNextSibling=this.rootElement.nextSibling;if(a){a.removeChild(this.rootElement)}}},_restoreRootElementInDom:function(){if(!SC.REMOVE_COLLECTION_ROOT_ELEMENT_DURING_RENDER){return}if(this._cachedRootElementParent){this._cachedRootElementParent.insertBefore(this.rootElement,this._cachedRootElementNextSibling)}this._cachedRootElementParent=this._cachedRootElementNextSibling=null},_indexOfSelectionTop:function(){var e=this.get(&quot;content&quot;);var g=this.get(&quot;selection&quot;);if(!e||!g){return -1}var b=e.get(&quot;length&quot;);var d=b;var a=g.length;while(--a&gt;=0){var c=e.indexOf(g[a]);if((c&gt;=0)&amp;&amp;(c&lt;d)){d=c}}return(d&gt;=b)?-1:d},_indexOfSelectionBottom:function(){var d=this.get(&quot;content&quot;);var e=this.get(&quot;selection&quot;);if(!d||!e){return -1}var c=-1;var a=e.length;while(--a&gt;=0){var b=d.indexOf(e[a]);if(b&gt;c){c=b}}return(c&lt;0)?-1:c},selectPreviousItem:function(j,c){if(c==null){c=1}if(j==null){j=false}var g=this.get(&quot;content&quot;);var b=g.get(&quot;length&quot;);var h,a,e;if(j){h=this._indexOfSelectionTop();a=this._indexOfSelectionBottom();e=(this._selectionAnchor==null)?h:this._selectionAnchor;this._selectionAnchor=e;if(a&gt;e){a=a-c}else{h=h-c}if(h&lt;0){h=0}if(a&lt;h){a=h}}else{h=this._indexOfSelectionTop()-c;if(h&lt;0){h=0}a=h;e=null}var d=[];while(h&lt;=a){d[d.length]=g.objectAt(h++)}if(d.length&gt;0){this.scrollToContent(d.first());this.selectItems(d)}this._selectionAnchor=e},selectNextItem:function(j,c){if(c==null){c=1}if(j==null){j=false}var g=this.get(&quot;content&quot;);var b=g.get(&quot;length&quot;);var h,a,e;if(j){h=this._indexOfSelectionTop();a=this._indexOfSelectionBottom();e=(this._selectionAnchor==null)?h:this._selectionAnchor;this._selectionAnchor=e;if(h&lt;e){h=h+c}else{a=a+c}if(a&gt;=b){a=b-1}if(h&gt;a){h=a}}else{a=this._indexOfSelectionBottom()+c;if(a&gt;=b){a=b-1}h=a;e=null}var d=[];while(h&lt;=a){d[d.length]=g.objectAt(h++)}if(d.length&gt;0){this.scrollToContent(d.first());this.selectItems(d)}this._selectionAnchor=e},scrollToContent:function(a){var d=Array.from(this.get(&quot;content&quot;));if(d.indexOf(a)&lt;0){return}var c=this.itemViewForContent(a);if(!c){var d=Array.from(this.get(&quot;content&quot;));var e=d.indexOf(a);var b=this.get(&quot;groupBy&quot;);c=this._insertItemViewFor(a,b,e)}if(c){this.scrollToItemView(c)}},scrollToItemView:function(a){var b=this;while(b&amp;&amp;(b!=SC.window)&amp;&amp;(!b.get(&quot;isScrollable&quot;))){b=b.get(&quot;parentNode&quot;)}if(!b||(b==SC.window)){return}b.scrollToVisible(a)},selectItems:function(a,d){var c=(d)?this.get(&quot;selection&quot;):[];var b=[a].concat(c).flatten().uniq();this._selectionAnchor=null;this.set(&quot;selection&quot;,b)},deselectItems:function(a){a=[a].flatten();var c=this.get(&quot;selection&quot;)||[];var b=c.map(function(d){return(a.include(d))?null:d});b=b.compact();this.set(&quot;selection&quot;,b)},deleteSelection:function(){if(!this.get(&quot;canDeleteContent&quot;)){return NO}var a=Array.from(this.get(&quot;selection&quot;));if(!a||a.get(&quot;length&quot;)===0){return NO}a=this.invokeDelegateMethod(this.delegate,&quot;collectionViewShouldDeleteContent&quot;,this,a);a=Array.from(a);if(!a||a.get(&quot;length&quot;)===0){return YES}this.invokeDelegateMethod(this.delegate,&quot;collectionViewDeleteContent&quot;,this,a);return YES},collectionViewDeleteContent:function(b,e){var d=this.get(&quot;content&quot;);if(!d||!d.removeObject){return NO}if(d.beginPropertyChanges){d.beginPropertyChanges()}var a=e.get(&quot;length&quot;);while(--a&gt;=0){var c=e.objectAt(a);d.removeObject(c)}if(d.endPropertyChanges){d.endPropertyChanges()}return YES},keyDown:function(a){return this.interpretKeyEvents(a)},keyUp:function(){return true},selectAll:function(a){var b=(this.get(&quot;content&quot;)||[]).slice();this.selectItems(b,NO);return YES},deleteBackward:function(a){return this.deleteSelection()},deleteForward:function(a){return this.deleteSelection()},moveDown:function(b,a){this.selectNextItem(false,this.get(&quot;itemsPerRow&quot;)||1);return true},moveUp:function(b,a){this.selectPreviousItem(false,this.get(&quot;itemsPerRow&quot;)||1);return true},moveLeft:function(b,a){if((this.get(&quot;itemsPerRow&quot;)||1)&gt;1){this.selectPreviousItem(false,1)}return true},moveRight:function(b,a){if((this.get(&quot;itemsPerRow&quot;)||1)&gt;1){this.selectNextItem(false,1)}return true},moveDownAndModifySelection:function(b,a){this.selectNextItem(true,this.get(&quot;itemsPerRow&quot;)||1);return true},moveUpAndModifySelection:function(b,a){this.selectPreviousItem(true,this.get(&quot;itemsPerRow&quot;)||1);return true},moveLeftAndModifySelection:function(b,a){if((this.get(&quot;itemsPerRow&quot;)||1)&gt;1){this.selectPreviousItem(true,1)}return true},moveRightAndModifySelection:function(b,a){if((this.get(&quot;itemsPerRow&quot;)||1)&gt;1){this.selectNextItem(true,1)}return true},mouseDown:function(g){this._mouseDownEvent=g;if(this.useToggleSelection){return true}this._mouseDownAt=this._shouldSelect=this._shouldDeselect=this._shouldReselect=this._refreshSelection=false;var d=this._mouseDownView=this.itemViewForEvent(g);var c=this._mouseDownContent=(d)?d.get(&quot;content&quot;):null;this.becomeFirstResponder();if(!d){if(this.get(&quot;allowDeselectAll&quot;)){this.selectItems([],false)}return true}var e=this.get(&quot;selection&quot;)||[];var b=e.include(c);var a=g.ctrlKey||g.metaKey;if(d.checkboxView&amp;&amp;(Event.element(g)==el.checkboxView.rootElement)){a=true}this._modifierKeyPressed=a;this._mouseDownAt=Date.now();if(a&amp;&amp;b){this._shouldDeselect=c}else{if(g.shiftKey&amp;&amp;e.get(&quot;length&quot;)&gt;0){e=this._findSelectionExtendedByShift(e,c);this.selectItems(e)}else{if(!a&amp;&amp;b){this._shouldReselect=c}else{if(this.get(&quot;selectOnMouseDown&quot;)){this.selectItems(c,a)}else{this._shouldSelect=c}}}}this._previousMouseDownContent=c;return true},mouseUp:function(g){var k=this.get(&quot;actOnSelect&quot;);var h=this.itemViewForEvent(g);if(this.useToggleSelection){if(!h){return}var j=this.get(&quot;selection&quot;)||[];var d=(h)?h.get(&quot;content&quot;):null;var a=j.include(d);if(a){this.deselectItems([d])}else{this.selectItems([d],true)}}else{var d=(h)?h.get(&quot;content&quot;):null;if(this._shouldSelect){this.selectItems(this._shouldSelect,this._modifierKeyPressed)}if(this._shouldDeselect){this.deselectItems(this._shouldDeselect)}if(this._shouldReselect){var b=this.get(&quot;contentValueIsEditable&quot;);if(b){var c=this.get(&quot;selection&quot;);b=c&amp;&amp;(c.get(&quot;length&quot;)===1)&amp;&amp;(c.objectAt(0)===this._shouldReselect)}if(b){var e=this.itemViewForContent(this._shouldReselect);b=e&amp;&amp;(!e.contentHitTest||e.contentHitTest(g));b=(b&amp;&amp;e.beginEditing)?e.beginEditing():NO}if(!b){this.selectItems(this._shouldReselect,false)}}this._cleanupMouseDown()}this._mouseDownEvent=null;if(k){this._action(g,h)}return false},_cleanupMouseDown:function(){this._mouseDownAt=this._shouldDeselect=this._shouldReselect=this._refreshSelection=this._shouldSelect=false;this._mouseDownEvent=this._mouseDownContent=this._mouseDownView=null},mouseMoved:function(b){var a=this.itemViewForEvent(b);if(this._lastHoveredItem&amp;&amp;((a===null)||(a!=this._lastHoveredItem))&amp;&amp;this._lastHoveredItem.mouseOut){this._lastHoveredItem.mouseOut(b)}this._lastHoveredItem=a;if(a&amp;&amp;a.mouseOver){a.mouseOver(b)}},mouseOut:function(b){var a=this._lastHoveredItem;this._lastHoveredItem=null;if(a&amp;&amp;a.didMouseOut){a.didMouseOut(b)}},doubleClick:function(b){var a=this.itemViewForEvent(b);if(a){this._action(a,b);return true}else{return false}},_findSelectionExtendedByShift:function(j,b){var a=this.get(&quot;content&quot;);var e=0;var d=(a.get(&quot;length&quot;)-1);var k=a.indexOf(j.first());var h=a.indexOf(j.last());var g=a.indexOf(this._previousMouseDownContent);if(g==-1){g=k}var c=a.indexOf(b);if(c==-1){throw&quot;Unable to extend selection to an item that's not in the content array!&quot;}if(c&lt;k){k=c}if(c&gt;h){h=c}if((c&gt;k)&amp;&amp;(c&lt;h)){if(c===g){k=c;h=c}else{if(c&gt;g){k=g;h=c}else{if(c&lt;g){k=c;h=g}}}}h++;return a.slice(k,h)},insertNewline:function(){if(this.get(&quot;contentValueIsEditable&quot;)){var b=this.get(&quot;selection&quot;);if(b&amp;&amp;b.get(&quot;length&quot;)===1){var a=this.itemViewForContent(b.objectAt(0));if(a&amp;&amp;a.beginEditing){this.scrollToItemView(a);a.beginEditing()}}}else{var b=this.get(&quot;selection&quot;);var a=(b&amp;&amp;b.get(&quot;length&quot;)===1)?this.itemViewForContent(b.objectAt(0)):null;this._action(a,null)}return YES},didBecomeFirstResponder:function(){this.addClassName(&quot;focus&quot;)},willLoseFirstResponder:function(){this.removeClassName(&quot;focus&quot;)},reorderDataType:function(){if(!this._reorderDataTypeKey){this._reorderDataTypeKey=&quot;SC.CollectionView.Reorder.%@&quot;.fmt(SC.guidFor(this))}return this._reorderDataTypeKey}.property(),_reorderDataType:function(){return this.get(&quot;reorderDataType&quot;)},dragContent:null,proposedInsertionIndex:null,proposedDropOperation:null,mouseDragged:function(d){if(this._mouseDownEvent===null){return YES}if((Date.now()-this._mouseDownAt)&lt;123){return YES}if(this.invokeDelegateMethod(this.delegate,&quot;collectionViewShouldBeginDrag&quot;,this)){var c=this.get(&quot;content&quot;)||[];var b;if(!this.get(&quot;selectOnMouseDown&quot;)){b=[this._mouseDownContent]}else{b=this.get(&quot;selection&quot;).sort(function(g,e){g=c.indexOf(g);e=c.indexOf(e);return(g&lt;e)?-1:((g&gt;e)?1:0)})}this.set(&quot;dragContent&quot;,b);if(this.get(&quot;dragDataTypes&quot;).get(&quot;length&quot;)&gt;0){var a=this.ghostViewFor(b);SC.Drag.start({event:this._mouseDownEvent,source:this,dragView:a,ghost:NO,slideBack:YES,dataSource:this});this._cleanupMouseDown();this._lastInsertionIndex=null}else{this.set(&quot;dragContent&quot;,null)}return YES}},dragDataTypes:function(){var b=this.invokeDelegateMethod(this.delegate,&quot;collectionViewDragDataTypes&quot;,this);var a=this.get(&quot;canReorderContent&quot;);if((!b||b.get(&quot;length&quot;)===0)&amp;&amp;!a){return[]}if(a){b=(b)?b.slice():[];var c=this.get(&quot;reorderDataType&quot;);if(b.indexOf(c)&lt;0){b.push(c)}}return b}.property(),dragDataForType:function(a,b){if(this.get(&quot;canReorderContent&quot;)){if(a===this.get(&quot;reorderDataType&quot;)){return this.get(&quot;dragContent&quot;)}}return this.invokeDelegateMethod(this.delegate,&quot;collectionViewDragDataForType&quot;,this,a,b)},dragEntered:function(c,a){var d=SC.DRAG_NONE;if(this.get(&quot;canReorderContent&quot;)){var b=c.get(&quot;dataTypes&quot;);if(b.indexOf(this.get(&quot;reorderDataType&quot;))&gt;=0){d=SC.DRAG_REORDER}}d=this.invokeDelegateMethod(this.delegate,&quot;collectionViewValidateDrop&quot;,this,c,SC.DROP_ANY,-1,d);if(d===SC.DRAG_REORDER){d=SC.DRAG_MOVE}return d},_computeDropOperationState:function(c,m){var e=c.get(&quot;location&quot;);e=this.convertFrameFromView(e,null);var k=SC.DROP_BEFORE;var d=SC.DRAG_NONE;var l=this.insertionIndexForLocation(e,SC.DROP_ON);if($type(l)===T_ARRAY){k=l[1];l=l[0]}if(k===SC.DROP_ON){this.set(&quot;proposedInsertionIndex&quot;,l);this.set(&quot;proposedDropOperation&quot;,k);d=this.invokeDelegateMethod(this.delegate,&quot;collectionViewValidateDrop&quot;,this,c,k,l,d);l=this.get(&quot;proposedInsertionIndex&quot;);k=this.get(&quot;proposedDropOperation&quot;);this._dropInsertionIndex=this._dropOperation=null;if(d!==SC.DRAG_NONE){return[l,k,d]}else{k=SC.DROP_BEFORE;l=this.insertionIndexForLocation(e,SC.DROP_BEFORE);if($type(l)===T_ARRAY){k=l[1];l=l[0]}}}if((l&gt;=0)&amp;&amp;this.get(&quot;canReorderContent&quot;)&amp;&amp;(k===SC.DROP_BEFORE)){var o=c.dataForType(this.get(&quot;reorderDataType&quot;));if(o){var g=this.get(&quot;content&quot;)||[];var j=(l&gt;0)?g.objectAt(l-1):null;var a=(l&lt;g.get(&quot;length&quot;))?g.objectAt(l):null;var b=(j)?o.indexOf(j)&gt;=0:NO;var h=(a)?o.indexOf(a)&gt;=0:NO;if(b&amp;&amp;h){if(this._lastInsertionIndex==null){while((l&gt;=0)&amp;&amp;(o.indexOf(g.objectAt(l))&gt;=0)){l--}}else{l=this._lastInsertionIndex}}if(l&gt;=0){d=SC.DRAG_REORDER}}}this.set(&quot;proposedInsertionIndex&quot;,l);this.set(&quot;proposedDropOperation&quot;,k);d=this.invokeDelegateMethod(this.delegate,&quot;collectionViewValidateDrop&quot;,this,c,k,l,d);l=this.get(&quot;proposedInsertionIndex&quot;);k=this.get(&quot;proposedDropOperation&quot;);this._dropInsertionIndex=this._dropOperation=null;return[l,k,d]},dragUpdated:function(g,b){var h=this._computeDropOperationState(g,b);var a=h[0],c=h[1],e=h[2];if(e!==SC.DRAG_NONE){if((this._lastInsertionIndex!==a)||(this._lastDropOperation!==c)){var d=this.itemViewForContent(this.get(&quot;content&quot;).objectAt(a));this.showInsertionPoint(d,c)}this._lastInsertionIndex=a;this._lastDropOperation=c}else{this.hideInsertionPoint();this._lastInsertionIndex=this._lastDropOperation=null}return(e===SC.DRAG_REORDER)?SC.DRAG_MOVE:e},dragExited:function(){this.hideInsertionPoint();this._lastInsertionIndex=this._lastDropOperation=null},dragEnded:function(){this.hideInsertionPoint();this._lastInsertionIndex=this._lastDropOperation=null},prepareForDragOperation:function(b,a){return YES},performDragOperation:function(g,e){var a=this._computeDropOperationState(e,null,g);var l=a[0],k=a[1],h=a[2];if(h===SC.DRAG_REORDER){g=(g&amp;SC.DRAG_MOVE)?SC.DRAG_REORDER:SC.DRAG_NONE}else{g=g&amp;h}if(g===SC.DRAG_NONE){return g}var c=this.invokeDelegateMethod(this.delegate,&quot;collectionViewAcceptDrop&quot;,this,e,k,l,g);if((c===SC.DRAG_NONE)&amp;&amp;(g===SC.DRAG_REORDER)){var o=e.dataForType(this.get(&quot;reorderDataType&quot;));if(!o){return SC.DRAG_NONE}var j=this.get(&quot;content&quot;);j.beginPropertyChanges();var m=o.get(&quot;length&quot;);while(--m&gt;=0){var d=o.objectAt(m);var b=j.indexOf(d);if(b&gt;=0){j.removeAt(b)}if((b&gt;=0)&amp;&amp;(b&lt;l)){l--}}j.replace(l,0,o);j.endPropertyChanges();g=SC.DRAG_MOVE}return g},collectionViewShouldBeginDrag:function(a){return this.get(&quot;canReorderContent&quot;)},concludeDragOperation:function(b,a){this.hideInsertionPoint();this._lastInsertionIndex=null},insertionOrientation:SC.HORIZONTAL_ORIENTATION,insertionIndexForLocation:function(c,h){var g=this.get(&quot;content&quot;);var d,j,k,b=null;var a=this.get(&quot;insertionOrientation&quot;);var e=null;for(var l=0;((e==null)&amp;&amp;(l&lt;g.length));l++){j=this.itemViewForContent(g.objectAt(l));d=this.convertFrameFromView(j.get(&quot;frame&quot;),j);if(a==SC.HORIZONTAL_ORIENTATION){if(SC.maxY(d)&gt;c.y){k=(SC.maxX(d)&lt;c.x)?-1:1}else{k=null}}else{if(SC.minX(d)&lt;c.x){k=(SC.maxY(d)&lt;c.y)?-1:1}else{k=null}}if(k!==null){if((b!==null)&amp;&amp;(k!=b)){e=l;if(a==SC.HORIZONTAL_ORIENTATION){if(SC.midX(d)&lt;c.x){e++}}else{if(SC.midY(d)&lt;c.y){e++}}}b=k}}if((e==null)||(e&lt;0)){e=0}if(e&gt;g.length){e=g.length}return e},showInsertionPoint:function(a,b){return(b===SC.DROP_BEFORE)?this.showInsertionPointBefore(a):this.hideInsertionPoint()},showInsertionPointBefore:function(a){},hideInsertionPoint:function(){},ghostViewFor:function(h){var m=SC.View.create();m.setStyle({position:&quot;absolute&quot;,overflow:&quot;hidden&quot;});var j=this.convertFrameToView(this.get(&quot;frame&quot;),null);m.set(&quot;frame&quot;,j);var o=h.length;var c=0;var a=0;var e=100000;var d=100000;while(--o&gt;=0){var l=this.itemViewForContent(h[o]);if(!l){continue}var k=l.get(&quot;frame&quot;);k=this.convertFrameFromView(k,l);var g=l.rootElement;if(!g){continue}if(SC.maxX(k)&gt;c){c=SC.maxX(k)}if(SC.maxY(k)&gt;a){a=SC.maxY(k)}if(SC.minX(k)&lt;e){e=SC.minX(k)}if(SC.minY(k)&lt;d){d=SC.minY(k)}g=g.cloneNode(true);Element.setStyle(g,{position:&quot;absolute&quot;,left:&quot;%@px&quot;.fmt(k.x),top:&quot;%@px&quot;.fmt(k.y),width:&quot;%@px&quot;.fmt(k.width),height:&quot;%@px&quot;.fmt(k.height)});m.rootElement.appendChild(g)}var b=SC.View.create();b.setStyle({position:&quot;absolute&quot;,overflow:&quot;hidden&quot;});b.set(&quot;frame&quot;,{x:j.x+e,y:j.y+d,width:(c-e+1),height:(a-d+1)});b.appendChild(m);m.set(&quot;frame&quot;,{x:0-e,y:0-d});return b},init:function(){this._itemViewsByContent={};this._groupViewsByValue={};this._groupViewCounts={};this._zombieGroupViews={};this._itemViewsByGuid={};this._itemViewPool=[];this._groupViewPool=[];arguments.callee.base.apply(this,arguments);this._dropTargetObserver()},_action:function(b,a){var c=this.get(&quot;action&quot;);var d=this.get(&quot;target&quot;)||null;if(c){if($type(c)==T_FUNCTION){return this.action(b,a)}SC.app.sendAction(c,d,this)}else{if(!b){return}else{if($type(b._action)==T_FUNCTION){return b._action(a)}else{if($type(b.action)==T_FUNCTION){return b.action(a)}}}}},_dropTargetObserver:function(){var a=this.get(&quot;canReorderContent&quot;)||this.get(&quot;isDropTarget&quot;);if(a){SC.Drag.addDropTarget(this)}else{SC.Drag.removeDropTarget(this)}}.observes(&quot;canReorderContent&quot;,&quot;isDropTarget&quot;),_contentObserver:function(){var c=this.get(&quot;content&quot;);if(SC.isEqual(c,this._content)){return}if(!this._boundContentPropertyObserver){this._boundContentPropertyObserver=this._contentPropertyObserver.bind(this)}var b=this._boundContentPropertyObserver;if(this._content){this._content.removeObserver(&quot;[]&quot;,b)}if(c){c.addObserver(&quot;[]&quot;,b)}this._content=c;this._contentPropertyRevision=null;var a=(c)?c.propertyRevision:-1;this._contentPropertyObserver(this,&quot;[]&quot;,c,a)}.observes(&quot;content&quot;),_selectionObserver:function(){var c=this.get(&quot;selection&quot;);if(SC.isEqual(c,this._selection)){return}if(!this._boundSelectionPropertyObserver){this._boundSelectionPropertyObserver=this._selectionPropertyObserver.bind(this)}var b=this._boundSelectionPropertyObserver;if(this._selection){this._selection.removeObserver(&quot;[]&quot;,b)}if(c){c.addObserver(&quot;[]&quot;,b)}this._selection=c;this._selectionPropertyRevision=null;var a=(c)?c.propertyRevision:null;this._selectionPropertyObserver(this,&quot;[]&quot;,c,a)}.observes(&quot;selection&quot;),_contentPropertyObserver:function(d,b,c,a){if(!this._updatingContent&amp;&amp;(!a||(a!=this._contentPropertyRevision))){this._contentPropertyRevision=a;this._updatingContent=true;this._hasChildren=false;this.updateChildren(true);this._updatingContent=false}},_selectionPropertyObserver:function(d,b,c,a){if(!this._updatingSel&amp;&amp;(!a||(a!=this._selectionPropertyRevision))){this._selectionPropertyRevision=a;this._updatingSel=true;this._selectionHash=null;this.updateSelectionStates();this._updatingSel=false}},_isVisibleInWindowObserver:function(){if(this.get(&quot;isDirty&quot;)){this.updateChildren()}}.observes(&quot;isVisibleInWindow&quot;),allowDeselectAll:true,itemExistsInCollection:function(a){return this.hasItemView(a)},viewForContentRecord:function(a){return this.itemViewForContent(a)}});require(&quot;views/collection/collection&quot;);require(&quot;views/label&quot;);SC.TableView=SC.CollectionView.extend({emptyElement:'&lt;div class=&quot;sc-table-view&quot;&gt;&lt;/div&gt;',rowHeight:20,exampleView:SC.LabelView,insertionOrientation:SC.VERTICAL_ORIENTATION,contentRangeInFrame:function(e){var d=this.get(&quot;rowHeight&quot;)||0;var c=Math.max(0,Math.floor(SC.minY(e)/d)-1);var a=Math.ceil(SC.maxY(e)/d);var b={start:c,length:a-c};return b},layoutItemView:function(a,g,e){SC.Benchmark.start(&quot;SC.TableView.layoutItemViewsFor&quot;);var c=this.get(&quot;rowHeight&quot;)||0;var b=a.get(&quot;parentView&quot;);var d={x:0,y:g*c,height:c,width:(b||this).get(&quot;innerFrame&quot;).width};if(e||!SC.rectsEqual(a.get(&quot;frame&quot;),d)){a.set(&quot;frame&quot;,d)}SC.Benchmark.end(&quot;SC.TableView.layoutItemViewsFor&quot;)},computeFrame:function(){var c=this.get(&quot;content&quot;);var e=(c)?c.get(&quot;length&quot;):0;var b=this.get(&quot;rowHeight&quot;)||20;var a=this.get(&quot;parentNode&quot;);var d=(a)?a.get(&quot;innerFrame&quot;):{width:100,height:100};d.x=d.y=0;d.height=Math.max(d.height,e*b);return d},insertionPointClass:SC.View.extend({emptyElement:'&lt;div class=&quot;list-insertion-point&quot;&gt;&lt;span class=&quot;anchor&quot;&gt;&lt;/span&gt;&lt;/div&gt;'}),showInsertionPointBefore:function(b){if(!b){return}if(!this._insertionPointView){this._insertionPointView=this.insertionPointClass.create()}var a=this._insertionPointView;f={height:0,x:8,y:b.get(&quot;frame&quot;).y,width:b.owner.get(&quot;frame&quot;).width};a.set(&quot;frame&quot;,f);if(a.parentNode!=b.parentNode){b.parentNode.appendChild(a)}},hideInsertionPoint:function(){var a=this._insertionPointView;if(a){a.removeFromParent()}},insertionIndexForLocation:function(d){var c=this.get(&quot;innerFrame&quot;);var b=this.get(&quot;scrollFrame&quot;);var a=Math.floor(((d.y-c.y-b.y)/this.get(&quot;rowHeight&quot;))+0.4);return a}});Event.simulateMouse=function(d,b){var c=Object.extend({pointerX:0,pointerY:0,buttons:0,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false},arguments[2]||{});var a=document.createEvent(&quot;MouseEvents&quot;);a.initMouseEvent(b,true,true,document.defaultView,c.buttons,c.pointerX,c.pointerY,c.pointerX,c.pointerY,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,0,$(d));if(this.mark){Element.remove(this.mark)}this.mark=document.createElement(&quot;div&quot;);this.mark.appendChild(document.createTextNode(&quot; &quot;));document.body.appendChild(this.mark);this.mark.style.position=&quot;absolute&quot;;this.mark.style.top=c.pointerY+&quot;px&quot;;this.mark.style.left=c.pointerX+&quot;px&quot;;this.mark.style.width=&quot;5px&quot;;this.mark.style.height=&quot;5px;&quot;;this.mark.style.borderTop=&quot;1px solid red;&quot;;this.mark.style.borderLeft=&quot;1px solid red;&quot;;if(this.step){alert(&quot;[&quot;+new Date().getTime().toString()+&quot;] &quot;+b+&quot;/&quot;+Test.Unit.inspect(c))}$(d).dispatchEvent(a)};Event.simulateKey=function(d,b){var c=Object.extend({ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,keyCode:0,charCode:0},arguments[2]||{});var a=document.createEvent(&quot;KeyEvents&quot;);a.initKeyEvent(b,true,true,window,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,c.keyCode,c.charCode);$(d).dispatchEvent(a)};Event.simulateKeys=function(b,c){for(var a=0;a&lt;c.length;a++){Event.simulateKey(b,&quot;keypress&quot;,{charCode:c.charCodeAt(a)})}};var Test={};Test.Unit={};Test.Unit.inspect=Object.inspect;Test.Unit.Logger=Class.create();Test.Unit.Logger.prototype={initialize:function(a){this.log=$(a);this.logId=this.log.id||&quot;x&quot;;if(this.log){this._createLogTable()}},start:function(a){if(!this.log){return}this.testName=a;this.lastLogLine=document.createElement(&quot;tr&quot;);this.statusCell=document.createElement(&quot;td&quot;);this.nameCell=document.createElement(&quot;td&quot;);this.nameCell.className=&quot;nameCell&quot;;this.nameCell.appendChild(document.createTextNode(a));this.messageCell=document.createElement(&quot;td&quot;);this.lastLogLine.appendChild(this.statusCell);this.lastLogLine.appendChild(this.nameCell);this.lastLogLine.appendChild(this.messageCell);this.loglines.appendChild(this.lastLogLine)},finish:function(a,b){if(!this.log){return}this.lastLogLine.className=a;this.statusCell.innerHTML=a;this.messageCell.innerHTML=this._toHTML(b);this.addLinksToResults()},message:function(a){if(!this.log){return}this.messageCell.innerHTML=this._toHTML(a)},summary:function(a){if(!this.log){return}this.logsummary.innerHTML=this._toHTML(a)},_createLogTable:function(){this.log.innerHTML='&lt;div id=&quot;'+this.logId+'-logsummary&quot; class=&quot;logsummary&quot;&gt;&lt;/div&gt;&lt;table id=&quot;'+this.logId+'-logtable&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Test&lt;/th&gt;&lt;th&gt;Message&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody id=&quot;'+this.logId+'-loglines&quot;&gt;&lt;/tbody&gt;&lt;/table&gt;';this.logsummary=$(this.logId+&quot;-logsummary&quot;);this.loglines=$(this.logId+&quot;-loglines&quot;)},_toHTML:function(a){return a.escapeHTML().replace(/\n/g,&quot;&lt;br/&gt;&quot;)},addLinksToResults:function(){$$(&quot;tr.failed .nameCell&quot;).each(function(a){a.title=&quot;Run only this test&quot;;Event.observe(a,&quot;click&quot;,function(){window.location.search=&quot;?tests=&quot;+a.innerHTML})});$$(&quot;tr.passed .nameCell&quot;).each(function(a){a.title=&quot;Run all tests&quot;;Event.observe(a,&quot;click&quot;,function(){window.location.search=&quot;&quot;})})}};document.incrementQueuedTests=function(b){if(b==undefined){b=1}var a=document.queuedTests||0;document.queuedTests=a+b};document.setTestStatus=function(a){var b=document.testStatus||&quot;SUCCESS&quot;;document.testStatus=(b==&quot;SUCCESS&quot;)?a:b};Test.Unit.Runner=Class.create();Test.Unit.Runner.prototype={initialize:function(b){this.options=Object.extend({testLog:&quot;testlog&quot;},arguments[1]||{});this.options.resultsURL=this.parseResultsURLQueryParameter();this.options.tests=this.parseTestsQueryParameter();if(this.options.testLog){var c=$(this.options.testLog)||null;var g=$(&quot;test-log&quot;);if(!g){var h=document.createElement(&quot;div&quot;);h.id=&quot;test-log&quot;;$(h).addClassName(&quot;testlog&quot;);var a=document.getElementsByTagName(&quot;body&quot;)[0];a.insertBefore(h,a.firstChild);g=h}if(g){var h=document.createElement(&quot;div&quot;);h.id=this.options.testLog;g.appendChild(h);c=h}this.options.testLog=c}if(this.options.tests){this.tests=[];for(var e=0;e&lt;this.options.tests.length;e++){if(/^test/.test(this.options.tests[e])){this.tests.push(new Test.Unit.Testcase(this.options.tests[e],b[this.options.tests[e]],b.setup,b.teardown))}}}else{if(this.options.test){this.tests=[new Test.Unit.Testcase(this.options.test,b[this.options.test],b.setup,b.teardown)]}else{this.tests=[];for(var d in b){if(/^test/.test(d)){this.tests.push(new Test.Unit.Testcase(this.options.context?&quot; -&gt; &quot;+this.options.titles[d]:d,b[d],b.setup,b.teardown))}}}}this.currentTest=0;this.logger=new Test.Unit.Logger(this.options.testLog);document.incrementQueuedTests(1);setTimeout(this.runTests.bind(this),1000)},parseResultsURLQueryParameter:function(){return window.location.search.parseQuery()[&quot;resultsURL&quot;]},parseTestsQueryParameter:function(){if(window.location.search.parseQuery()[&quot;tests&quot;]){return window.location.search.parseQuery()[&quot;tests&quot;].split(&quot;,&quot;)}},getResult:function(){var b=false;for(var a=0;a&lt;this.tests.length;a++){if(this.tests[a].errors&gt;0){return&quot;ERROR&quot;}if(this.tests[a].failures&gt;0){b=true}}if(b){return&quot;FAILURE&quot;}else{return&quot;SUCCESS&quot;}},postResults:function(){if(this.options.resultsURL){new Ajax.Request(this.options.resultsURL,{method:&quot;get&quot;,parameters:&quot;result=&quot;+this.getResult(),asynchronous:false})}},runTests:function(){var a=this.tests[this.currentTest];if(!a){this.postResults();this.logger.summary(this.summary());document.incrementQueuedTests(-1);document.setTestStatus(this.getResult());return}if(!a.isWaiting){this.logger.start(a.name)}a.run();if(a.isWaiting){this.logger.message(&quot;Waiting for &quot;+a.timeToWait+&quot;ms&quot;);setTimeout(this.runTests.bind(this),a.timeToWait||1000)}else{this.logger.finish(a.status(),a.summary());this.currentTest++;this.runTests()}},summary:function(){var d=0;var b=0;var e=0;var c=[];for(var a=0;a&lt;this.tests.length;a++){d+=this.tests[a].assertions;b+=this.tests[a].failures;e+=this.tests[a].errors}return((this.options.context?this.options.context+&quot;: &quot;:&quot;&quot;)+this.tests.length+&quot; tests, &quot;+d+&quot; assertions, &quot;+b+&quot; failures, &quot;+e+&quot; errors&quot;)}};Test.Unit.Assertions=Class.create();Test.Unit.Assertions.prototype={initialize:function(){this.assertions=0;this.failures=0;this.errors=0;this.messages=[]},summary:function(){return(this.assertions+&quot; assertions, &quot;+this.failures+&quot; failures, &quot;+this.errors+&quot; errors\n&quot;+this.messages.join(&quot;\n&quot;))},pass:function(){this.assertions++},fail:function(a){this.failures++;this.messages.push(&quot;Failure: &quot;+a)},info:function(a){this.messages.push(&quot;Info: &quot;+a)},error:function(a){this.errors++;this.messages.push(a.name+&quot;: &quot;+a.message+&quot;(&quot;+Test.Unit.inspect(a)+&quot;)&quot;)},status:function(){if(this.failures&gt;0){return&quot;failed&quot;}if(this.errors&gt;0){return&quot;error&quot;}return&quot;passed&quot;},assert:function(c){var a=arguments[1]||'assert: got &quot;'+Test.Unit.inspect(c)+'&quot;';try{c?this.pass():this.fail(a)}catch(b){this.error(b)}},assertEqual:function(b,d){var a=arguments[2]||&quot;assertEqual&quot;;try{(b==d)?this.pass():this.fail(a+': expected &quot;'+Test.Unit.inspect(b)+'&quot;, actual &quot;'+Test.Unit.inspect(d)+'&quot;')}catch(c){this.error(c)}},assertInspect:function(b,d){var a=arguments[2]||&quot;assertInspect&quot;;try{(b==d.inspect())?this.pass():this.fail(a+': expected &quot;'+Test.Unit.inspect(b)+'&quot;, actual &quot;'+Test.Unit.inspect(d)+'&quot;')}catch(c){this.error(c)}},assertEnumEqual:function(b,d){var a=arguments[2]||&quot;assertEnumEqual&quot;;try{$A(b).length==$A(d).length&amp;&amp;b.zip(d).all(function(e){return e[0]==e[1]})?this.pass():this.fail(a+&quot;: expected &quot;+Test.Unit.inspect(b)+&quot;, actual &quot;+Test.Unit.inspect(d))}catch(c){this.error(c)}},assertNotEqual:function(b,d){var a=arguments[2]||&quot;assertNotEqual&quot;;try{(b!=d)?this.pass():this.fail(a+': got &quot;'+Test.Unit.inspect(d)+'&quot;')}catch(c){this.error(c)}},assertIdentical:function(b,d){var a=arguments[2]||&quot;assertIdentical&quot;;try{(b===d)?this.pass():this.fail(a+': expected &quot;'+Test.Unit.inspect(b)+'&quot;, actual &quot;'+Test.Unit.inspect(d)+'&quot;')}catch(c){this.error(c)}},assertNotIdentical:function(b,d){var a=arguments[2]||&quot;assertNotIdentical&quot;;try{!(b===d)?this.pass():this.fail(a+': expected &quot;'+Test.Unit.inspect(b)+'&quot;, actual &quot;'+Test.Unit.inspect(d)+'&quot;')}catch(c){this.error(c)}},assertNull:function(c){var a=arguments[1]||&quot;assertNull&quot;;try{(c==null)?this.pass():this.fail(a+': got &quot;'+Test.Unit.inspect(c)+'&quot;')}catch(b){this.error(b)}},assertMatch:function(c,g){var b=arguments[2]||&quot;assertMatch&quot;;var a=new RegExp(c);try{(a.exec(g))?this.pass():this.fail(b+' : regex: &quot;'+Test.Unit.inspect(c)+&quot; did not match: &quot;+Test.Unit.inspect(g)+'&quot;')}catch(d){this.error(d)}},assertHidden:function(a){var b=arguments[1]||&quot;assertHidden&quot;;this.assertEqual(&quot;none&quot;,a.style.display,b)},assertNotNull:function(a){var b=arguments[1]||&quot;assertNotNull&quot;;this.assert(a!=null,b)},assertType:function(b,d){var a=arguments[2]||&quot;assertType&quot;;try{(d.constructor==b)?this.pass():this.fail(a+': expected &quot;'+Test.Unit.inspect(b)+'&quot;, actual &quot;'+(d.constructor)+'&quot;')}catch(c){this.error(c)}},assertNotOfType:function(b,d){var a=arguments[2]||&quot;assertNotOfType&quot;;try{(d.constructor!=b)?this.pass():this.fail(a+': expected &quot;'+Test.Unit.inspect(b)+'&quot;, actual &quot;'+(d.constructor)+'&quot;')}catch(c){this.error(c)}},assertInstanceOf:function(b,d){var a=arguments[2]||&quot;assertInstanceOf&quot;;try{(d instanceof b)?this.pass():this.fail(a+&quot;: object was not an instance of the expected type&quot;)}catch(c){this.error(c)}},assertNotInstanceOf:function(b,d){var a=arguments[2]||&quot;assertNotInstanceOf&quot;;try{!(d instanceof b)?this.pass():this.fail(a+&quot;: object was an instance of the not expected type&quot;)}catch(c){this.error(c)}},assertRespondsTo:function(d,c){var a=arguments[2]||&quot;assertRespondsTo&quot;;try{(c[d]&amp;&amp;typeof c[d]==&quot;function&quot;)?this.pass():this.fail(a+&quot;: object doesn't respond to [&quot;+d+&quot;]&quot;)}catch(b){this.error(b)}},assertReturnsTrue:function(g,d){var b=arguments[2]||&quot;assertReturnsTrue&quot;;try{var a=d[g];if(!a){a=d[&quot;is&quot;+g.charAt(0).toUpperCase()+g.slice(1)]}a()?this.pass():this.fail(b+&quot;: method returned false&quot;)}catch(c){this.error(c)}},assertReturnsFalse:function(g,d){var b=arguments[2]||&quot;assertReturnsFalse&quot;;try{var a=d[g];if(!a){a=d[&quot;is&quot;+g.charAt(0).toUpperCase()+g.slice(1)]}!a()?this.pass():this.fail(b+&quot;: method returned true&quot;)}catch(c){this.error(c)}},assertRaise:function(a,d){var b=arguments[2]||&quot;assertRaise&quot;;try{d();this.fail(b+&quot;: exception expected but none was raised&quot;)}catch(c){((a==null)||(c.name==a))?this.pass():this.error(c)}},assertElementsMatch:function(){var a=$A(arguments),b=$A(a.shift());if(b.length!=a.length){this.fail(&quot;assertElementsMatch: size mismatch: &quot;+b.length+&quot; elements, &quot;+a.length+&quot; expressions&quot;);return false}b.zip(a).all(function(g,c){var d=$(g.first()),e=g.last();if(d.match(e)){return true}this.fail(&quot;assertElementsMatch: (in index &quot;+c+&quot;) expected &quot;+e.inspect()+&quot; but got &quot;+d.inspect())}.bind(this))&amp;&amp;this.pass()},assertElementMatches:function(a,b){this.assertElementsMatch([a],b)},benchmark:function(c,d){var b=new Date();(d||1).times(c);var a=((new Date())-b);this.info((arguments[2]||&quot;Operation&quot;)+&quot; finished &quot;+d+&quot; iterations in &quot;+(a/1000)+&quot;s&quot;);return a},_isVisible:function(a){a=$(a);if(!a.parentNode){return true}this.assertNotNull(a);if(a.style&amp;&amp;Element.getStyle(a,&quot;display&quot;)==&quot;none&quot;){return false}return this._isVisible(a.parentNode)},assertNotVisible:function(a){this.assert(!this._isVisible(a),Test.Unit.inspect(a)+&quot; was not hidden and didn't have a hidden parent either. &quot;+(&quot;&quot;||arguments[1]))},assertVisible:function(a){this.assert(this._isVisible(a),Test.Unit.inspect(a)+&quot; was not visible. &quot;+(&quot;&quot;||arguments[1]))},benchmark:function(c,d){var b=new Date();(d||1).times(c);var a=((new Date())-b);this.info((arguments[2]||&quot;Operation&quot;)+&quot; finished &quot;+d+&quot; iterations in &quot;+(a/1000)+&quot;s&quot;);return a}};Test.Unit.Testcase=Class.create();Object.extend(Object.extend(Test.Unit.Testcase.prototype,Test.Unit.Assertions.prototype),{initialize:function(name,test,setup,teardown){Test.Unit.Assertions.prototype.initialize.bind(this)();this.name=name;if(typeof test==&quot;string&quot;){test=test.gsub(/(\.should[^\(]+\()/,&quot;#{0}this,&quot;);test=test.gsub(/(\.should[^\(]+)\(this,\)/,&quot;#{1}(this)&quot;);this.test=function(){eval(&quot;with(this){\n&quot;+test+&quot;\n}&quot;)}}else{this.test=test||function(){}}this.setup=setup||function(){};this.teardown=teardown||function(){};this.isWaiting=false;this.timeToWait=1000},wait:function(b,a){this.isWaiting=true;this.test=a;this.timeToWait=b},run:function(){if(!this.isWaiting){this.setup.bind(this)()}this.isWaiting=false;this.test.bind(this)();if(!this.isWaiting){this.teardown.bind(this)()}}});Test.setupBDDExtensionMethods=function(){var b={shouldEqual:&quot;assertEqual&quot;,shouldNotEqual:&quot;assertNotEqual&quot;,shouldEqualEnum:&quot;assertEnumEqual&quot;,shouldBeA:&quot;assertType&quot;,shouldNotBeA:&quot;assertNotOfType&quot;,shouldBeAn:&quot;assertType&quot;,shouldNotBeAn:&quot;assertNotOfType&quot;,shouldBeNull:&quot;assertNull&quot;,shouldNotBeNull:&quot;assertNotNull&quot;,shouldBe:&quot;assertReturnsTrue&quot;,shouldNotBe:&quot;assertReturnsFalse&quot;,shouldRespondTo:&quot;assertRespondsTo&quot;};var a=function(c,e,d){this[c].apply(this,(e||[]).concat([d]))};Test.BDDMethods={};$H(b).each(function(c){Test.BDDMethods[c.key]=function(){var d=$A(arguments);var e=d.shift();a.apply(e,[c.value,d,this])}});[Array.prototype,String.prototype,Number.prototype,Boolean.prototype].each(function(c){Object.extend(c,Test.BDDMethods)})};Test.context=function(d,c,g){Test.setupBDDExtensionMethods();var e={};var h={};for(specName in c){switch(specName){case&quot;setup&quot;:case&quot;teardown&quot;:e[specName]=c[specName];break;default:var b=&quot;test&quot;+specName.gsub(/\s+/,&quot;-&quot;).camelize();var a=c[specName].toString().split(&quot;\n&quot;).slice(1);if(/^\s*\{/.test(a[0])){a=a.slice(1)}a.pop();a=a.map(function(j){return j.strip()});e[b]=a.join(&quot;\n&quot;);h[b]=specName}}if(g===undefined){g=d.dasherize()}new Test.Unit.Runner(e,{titles:h,testLog:(g||&quot;testlog&quot;),context:d})};Test.Observer=function(){return function(){if(!arguments.callee.notified){arguments.callee.notified=0}return ++arguments.callee.notified}};require(&quot;views/view&quot;);require(&quot;views/label&quot;);require(&quot;mixins/control&quot;);SC.TOGGLE_BEHAVIOR=&quot;toggle&quot;;SC.PUSH_BEHAVIOR=&quot;push&quot;;SC.TOGGLE_ON_BEHAVIOR=&quot;on&quot;;SC.TOGGLE_OFF_BEHAVIOR=&quot;off&quot;;SC.ButtonView=SC.View.extend(SC.Control,{emptyElement:'&lt;a href=&quot;javascript:;&quot; class=&quot;sc-button-view regular&quot;&gt;&lt;span class=&quot;button-inner&quot;&gt;&lt;span class=&quot;label&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;',value:false,toggleOnValue:true,toggleOffValue:false,theme:&quot;regular&quot;,buttonBehavior:SC.PUSH_BEHAVIOR,isEnabled:YES,isSelected:NO,isDefault:NO,isDefaultBindingDefault:SC.Binding.OneWayBool,isCancel:NO,isCancelBindingDefault:SC.Binding.OneWayBool,localize:NO,titleSelector:&quot;.label&quot;,title:function(b,d){if(d!==undefined){if(this._title!=d){var e=this._title=d;var a=this.get(&quot;titleSelector&quot;);var c=(a)?this.$sel(a):this.rootElement;if(this.get(&quot;localize&quot;)){e=e.loc()}c.innerHTML=e}}if(!this._title){var c=this.$sel(this.get(&quot;titleSelector&quot;));this._title=(c)?c.innerHTML:&quot;&quot;}return this._title}.property(),href:function(a,c){var b=this.rootElement;if(c!==undefined){if(b){b.setAttribute(&quot;href&quot;,c)}}return(b)?b.getAttribute(&quot;href&quot;):null}.property(),action:null,target:null,keyEquivalent:null,_defaultKeyEquivalent:null,performKeyEquivalent:function(b,a){if(!this.get(&quot;isEnabled&quot;)){return false}var c=this.get(&quot;keyEquivalent&quot;);if(c&amp;&amp;(c==b)){return this.triggerAction(a)}return false},triggerAction:function(a){if(!this.get(&quot;isEnabled&quot;)){return false}this.setClassName(&quot;active&quot;,true);this.didTriggerAction();this._action(a);this.invokeLater(&quot;setClassName&quot;,200,&quot;active&quot;,false);return true},didTriggerAction:function(){},init:function(){arguments.callee.base.call(this);if(this.get(&quot;keyEquivalent&quot;)){this._defaultKeyEquivalent=this.get(&quot;keyEquivalent&quot;)}this._isDefaultOrCancelObserver();var a;var b=this.get(&quot;titleSelector&quot;);if(this.get(&quot;localize&quot;)&amp;&amp;b&amp;&amp;(a=this.$sel(b))){this._title=(a.innerHTML||&quot;&quot;).strip();a.innerHTML=this._title.loc()}},_selectedStateFromValue:function(c){var a=this.get(&quot;toggleOnValue&quot;);var b;if($type(c)==T_ARRAY){if(c.length==1){b=(c[0]==a)}else{b=(c.indexOf(a)&gt;=0)?SC.MIXED_STATE:false}}else{b=(c==a)}return b},propertyObserver:function(j,h,a,d){if(h!=this){return}switch(a){case&quot;value&quot;:d=this.get(&quot;value&quot;);if(d==this._value){return}this._value=d;var c=this._selectedStateFromValue(d);this.setIfChanged(&quot;isSelected&quot;,c);break;case&quot;isSelected&quot;:var g=this.get(&quot;isSelected&quot;);var e=this._selectedStateFromValue(this.get(&quot;value&quot;));if(e!=g){var b=(g)?&quot;toggleOnValue&quot;:&quot;toggleOffValue&quot;;this.set(&quot;value&quot;,this.get(b))}break;default:break}},_isDefaultOrCancelObserver:function(){var a=!!this.get(&quot;isDefault&quot;);var b=!a&amp;&amp;this.get(&quot;isCancel&quot;);if(this.didChangeFor(&quot;defaultCancelChanged&quot;,&quot;isDefault&quot;,&quot;isCancel&quot;)){this.setClassName(&quot;def&quot;,a);if(a){this.setIfChanged(&quot;keyEquivalent&quot;,&quot;return&quot;)}else{if(b){this.setIfChanged(&quot;keyEquivalent&quot;,&quot;escape&quot;)}else{this.set(&quot;keyEquivalent&quot;,this._defaultKeyEquivalent)}}}}.observes(&quot;isDefault&quot;,&quot;isCancel&quot;),isMouseDown:false,mouseDown:function(a){this.setClassName(&quot;active&quot;,this.get(&quot;isEnabled&quot;));this._isMouseDown=true;return true},mouseOut:function(a){this.setClassName(&quot;active&quot;,false);return true},mouseOver:function(a){this.setClassName(&quot;active&quot;,this._isMouseDown);return true},mouseUp:function(b){this.setClassName(&quot;active&quot;,false);this._isMouseDown=false;var c=Event.element(b);var a=false;while(c&amp;&amp;(c!=this.rootElement)){c=c.parentNode}if(c==this.rootElement){a=true}if(a&amp;&amp;this.get(&quot;isEnabled&quot;)){this._action(b)}return true},_action:function(a){switch(this.get(&quot;buttonBehavior&quot;)){case SC.TOGGLE_BEHAVIOR:var c=this.get(&quot;isSelected&quot;);if(c==true){this.set(&quot;value&quot;,this.get(&quot;toggleOffValue&quot;))}else{this.set(&quot;value&quot;,this.get(&quot;toggleOnValue&quot;))}break;case SC.TOGGLE_ON_BEHAVIOR:this.set(&quot;value&quot;,this.get(&quot;toggleOnValue&quot;));break;case SC.TOGGLE_OFF_BEHAVIOR:this.set(&quot;value&quot;,this.get(&quot;toggleOffValue&quot;));break;default:var b=this.get(&quot;action&quot;);var d=this.get(&quot;target&quot;)||null;if(b){if(this._hasLegacyActionHandler()){this._triggerLegacyActionHandler(a)}else{SC.app.sendAction(b,d,this)}}}},_hasLegacyActionHandler:function(){var a=this.get(&quot;action&quot;);if(a&amp;&amp;($type(a)==T_FUNCTION)){return true}if(a&amp;&amp;($type(a)==T_STRING)&amp;&amp;(a.indexOf(&quot;.&quot;)!=-1)){return true}return false},_triggerLegacyActionHandler:function(evt){if(!this._hasLegacyActionHandler()){return false}var action=this.get(&quot;action&quot;);if($type(action)==T_FUNCTION){this.action(evt)}if($type(action)==T_STRING){eval(&quot;this.action = function(e) { return &quot;+action+&quot;(this, e); };&quot;);this.action(evt)}}});require(&quot;views/button/button&quot;);SC.DisclosureView=SC.ButtonView.extend({emptyElement:'&lt;a href=&quot;javascript:;&quot; class=&quot;sc-disclosure-view sc-button-view button disclosure&quot;&gt;&lt;img  src=&quot;http://web.me.com/paynie/THE*RED*LOFT/%@&quot; class=&quot;button&quot; /&gt;&lt;span class=&quot;label&quot;&gt;&lt;/span&gt;&lt;/a&gt;'.fmt(&quot;/my/sproutcore/en/wpw/blank.gif&quot;),buttonBehavior:SC.TOGGLE_BEHAVIOR,toggleOnValue:YES,toggleOffValue:NO,valueBindingDefault:SC.Binding.Bool,init:function(){arguments.callee.base.apply(this,arguments);if(this.get(&quot;value&quot;)==this.get(&quot;toggleOnValue&quot;)){this.set(&quot;isSelected&quot;,true)}}});require(&quot;panes/overlay&quot;);SC.DIALOG_PANE=&quot;dialog&quot;;SC.DialogPaneView=SC.OverlayPaneView.extend({emptyElement:'&lt;div class=&quot;pane dialog-pane&quot;&gt;&lt;div class=&quot;shadow pane-wrapper&quot;&gt;&lt;div class=&quot;pane-root&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-left-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-left-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;left-edge&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;',layer:200});require(&quot;core&quot;);require(&quot;foundation/object&quot;);SC.Timer=SC.Object.extend({target:null,action:null,interval:0,startTime:null,repeats:NO,until:null,isPaused:NO,isScheduled:NO,isValid:function(){return !this._invalid}.property(&quot;isPaused&quot;),fireTime:null,invalidate:function(){this.propertyWillChange(&quot;isValid&quot;);this._invalid=YES;SC.runLoop.cancelTimer(this);this.propertyDidChange(&quot;isValid&quot;);this.action=this.target=null;return this},fire:function(){var a=this._computeNextFireTime();if(!this.get(&quot;isPaused&quot;)){this.performAction()}(a&gt;0)?this.schedule():this.invalidate()},performAction:function(){if($type(this.action)==T_FUNCTION){this.action.call((this.target||this),this)}else{if(this.action.indexOf(&quot;.&quot;)&gt;=0){var d=this.action.split(&quot;.&quot;);var b=d.pop();var c=SC.Object.objectForPropertyPath(d,window);var a=(c.get)?c.get(b):c[b];if(a&amp;&amp;$type(a)==T_FUNCTION){a.call(c,this)}else{throw&quot;%@: Timer could not find a function at %@&quot;.fmt(this,this.action)}}else{SC.app.sendAction(this.action,this.target,this)}}},schedule:function(){this.beginPropertyChanges();if(!this.startTime){this.set(&quot;startTime&quot;,SC.runLoop.get(&quot;startTime&quot;))}var a=(this.fireTime)?this.get(&quot;fireTime&quot;):this._computeNextFireTime();if(!this._invalid){this.set(&quot;isScheduled&quot;,YES);SC.runLoop.scheduleTimer(this,a)}this.endPropertyChanges();return this},init:function(){arguments.callee.base.call(this);if(this.startTime instanceof Date){this.startTime=this.startTime.getTime()}if(this.until instanceof Date){this.until=this.until.getTime()}},_isPausedObserver:function(){SC.runLoop.timerPausedStateDidChange(this)}.observes(&quot;isPaused&quot;),_computeNextFireTime:function(){var g=0;if(!this._invalid&amp;&amp;this.get(&quot;isValid&quot;)){var c=Date.now();var h=this.get(&quot;startTime&quot;)||c;var e=this.get(&quot;until&quot;);if((!e)||(e===0)||(c&lt;e)){var b=this.get(&quot;interval&quot;);var a=this.get(&quot;repeats&quot;);var d=Math.ceil(((c-h)/b)+0.01);if(d&lt;1){d=1}g=((d&lt;=1)||a)?h+(d*b):0}}this.setIfChanged(&quot;fireTime&quot;,g);return g}});SC.Timer.schedule=function(a){return this.create(a).schedule()};require(&quot;views/collection/collection&quot;);require(&quot;views/label&quot;);SC.GridView=SC.CollectionView.extend({emptyElement:'&lt;div class=&quot;grid-view&quot;&gt;&lt;/div&gt;',rowHeight:48,columnWidth:64,exampleView:SC.LabelView,insertionOrientation:SC.HORIZONTAL_ORIENTATION,itemsPerRow:function(){var a=this._computeItemsPerRow();return a}.property(),_computeItemsPerRow:function(){var b=this.get(&quot;innerFrame&quot;);var a=this.get(&quot;columnWidth&quot;)||0;return(a&lt;=0)?1:Math.floor(b.width/a)},contentRangeInFrame:function(g){var e=this.get(&quot;rowHeight&quot;)||48;var b=this._computeItemsPerRow();var d=Math.floor(SC.minY(g)/e)*b;var a=Math.ceil(SC.maxY(g)/e)*b;var c={start:d,length:a-d};return c},layoutItemView:function(g,d,j){SC.Benchmark.start(&quot;SC.GridView.layoutItemViewsFor&quot;);var a=this.get(&quot;rowHeight&quot;)||0;var l=g.get(&quot;parentView&quot;);var k=this.get(&quot;innerFrame&quot;).width;var h=this._computeItemsPerRow();var b=Math.floor(k/h);var m=Math.floor(d/h);var c=d-(h*m);var e={x:c*b,y:m*a,height:a,width:b};if(j||!SC.rectsEqual(g.get(&quot;frame&quot;),e)){g.set(&quot;frame&quot;,e)}SC.Benchmark.end(&quot;SC.GridView.layoutItemViewsFor&quot;)},layoutItemViewsFor:function(l,h){SC.Benchmark.start(&quot;SC.GridView.layoutItemViewsFor&quot;);var a=this.get(&quot;rowHeight&quot;);var b=this.get(&quot;columnWidth&quot;);if((a==null)||(b==null)){return false}l=l||this;var d=l.get(&quot;innerFrame&quot;);d.x=d.y=0;var g=Math.floor(d.width/(b||1));if(this.get(&quot;itemsPerRow&quot;)!=g){this.set(&quot;itemsPerRow&quot;,g)}b=Math.floor((d.width-20)/g);var j=h||l.firstChild;var e=this.get(&quot;content&quot;)||[];var k=(j)?e.indexOf(j.get(&quot;content&quot;)):0;d={x:0,y:0,height:a,width:b};while(j){var m=Math.floor(k/g);var c=k-(m*g);d.x=c*b;d.y=m*a;if(!SC.rectsEqual(j.get(&quot;frame&quot;),d)){j.set(&quot;frame&quot;,d)}j=j.nextSibling;k++}SC.Benchmark.end(&quot;SC.GridView.layoutItemViewsFor&quot;);return true},computeFrame:function(){var e=this.get(&quot;content&quot;);var d=(e)?e.get(&quot;length&quot;):0;var c=this.get(&quot;rowHeight&quot;)||0;var j=this.get(&quot;columnWidth&quot;)||0;var b=this.get(&quot;parentNode&quot;);var h=(b)?b.get(&quot;innerFrame&quot;):{width:0,height:0};var a=(j&lt;=0)?1:(h.width/j);var g=Math.ceil(d/a);h.x=h.y=0;h.height=Math.max(h.height,g*c);return h},insertionPointClass:SC.View.extend({emptyElement:'&lt;div class=&quot;grid-insertion-point&quot;&gt;&lt;span class=&quot;anchor&quot;&gt;&lt;/span&gt;&lt;/div&gt;'}),showInsertionPoint:function(c,d){if(!c){return}if(d===SC.DROP_ON){if(c!==this._dropOnInsertionPoint){this.hideInsertionPoint();c.addClassName(&quot;drop-target&quot;);this._dropOnInsertionPoint=c}}else{if(this._dropOnInsertionPoint){this._dropOnInsertionPoint.removeClassName(&quot;drop-target&quot;);this._dropOnInsertionPoint=null}if(!this._insertionPointView){this._insertionPointView=this.insertionPointClass.create()}var b=this._insertionPointView;var a=c.get(&quot;frame&quot;);f={height:a.height-6,x:a.x,y:a.y+6,width:0};if(!SC.rectsEqual(b.get(&quot;frame&quot;),f)){b.set(&quot;frame&quot;,f)}if(b.parentNode!=c.parentNode){c.parentNode.appendChild(b)}}},hideInsertionPoint:function(){var a=this._insertionPointView;if(a){a.removeFromParent()}if(this._dropOnInsertionPoint){this._dropOnInsertionPoint.removeClassName(&quot;drop-target&quot;);this._dropOnInsertionPoint=null}},insertionIndexForLocation:function(d,k){var e=this.get(&quot;frame&quot;);var g=this.get(&quot;scrollFrame&quot;);var l=this._computeItemsPerRow();var a=Math.floor(e.width/l);var o=Math.floor((d.y-e.y-g.y)/this.get(&quot;rowHeight&quot;));var j=SC.DROP_BEFORE;var c=(d.x-e.x-g.x);var b=Math.floor(c/a);var m=(c/a)-b;if(k===SC.DROP_ON){if(m&gt;0.8){b++}if((m&gt;=0.2)&amp;&amp;(m&lt;=0.8)){j=SC.DROP_ON}}else{if(m&gt;0.45){b++}}var h=(o*l)+b;return[h,j]}});require(&quot;views/field/text_field&quot;);SC.TextareaFieldView=SC.TextFieldView.extend({emptyElement:&quot;&lt;textarea&gt;&lt;/textarea&gt;&quot;,insertNewline:function(a){a._stopWhenHandled=false;return true}});SC.SelectionSupport={updateSelectionAfterContentChange:function(){var e=Array.from(this.get(&quot;arrangedObjects&quot;));var c=Array.from(this.get(&quot;selection&quot;));var d=[];var b=c.get(&quot;length&quot;);if(this.get(&quot;allowsSelection&quot;)){for(var a=0;a&lt;b;a++){var g=c.objectAt(a);if(e.indexOf(g)&gt;=0){d.push(g)}}}var h=d.get(&quot;length&quot;);if((h&gt;1)&amp;&amp;!this.get(&quot;allowsMultipleSelection&quot;)){d=[d.objectAt(0)]}if((h==0)&amp;&amp;!this.get(&quot;allowsEmptySelection&quot;)){if(e.get(&quot;length&quot;)&gt;0){d=[e.objectAt(0)]}}this.set(&quot;selection&quot;,d)},arrangedObjects:function(){return this}.property(),selection:function(c,e){if(e!==undefined){e=Array.from(e);var b=this.get(&quot;allowsSelection&quot;);var g=this.get(&quot;allowsEmptySelection&quot;);var a=this.get(&quot;allowsMultipleSelection&quot;);if(!b){return this._selection}switch(e.get(&quot;length&quot;)){case 0:if(!g){var d=this.get(&quot;arrangedObjects&quot;);if(d.get(&quot;length&quot;)&gt;0){e=[d.objectAt(0)]}}this._selection=e;break;case 1:this._selection=e;break;default:this._selection=a?e:this._selection;break}}return this._selection}.property(),allowsSelection:true,allowsMultipleSelection:true,allowsEmptySelection:true};require(&quot;foundation/object&quot;);SC.Controller=SC.Object.extend({hasChanges:false,context:null,commitChangesImmediately:true,init:function(){arguments.callee.base.apply(this,arguments);this._contextObserver()},_contextObserver:function(){if(this.context){this.commitChangesImmediately=this.context.commitChangesImmediately}}.observes(&quot;context&quot;),commitChanges:function(){this._commitTimeout=null;var a=this._canCommitChanges();if(!$ok(a)){return a}return this._performCommitChanges()},discardChanges:function(){var a=this._canDiscardChanges();if(!$ok(a)){return a}return this._performDiscardChanges()},controllerForValue:function(b){var a=null;switch($type(b)){case T_OBJECT:if(b.kindOf(SC.Collection)){a=SC.CollectionController}else{a=SC.ObjectController}break;case T_ARRAY:a=SC.ArrayController;break;default:a=null}return(a)?a.create({content:b,context:this}):b},editorDidChange:function(a){if(!a){a=this}if(a!=this){if(!this._dirtyEditors){this._dirtyEditors=SC.Set.create()}this._dirtyEditors.add(a)}else{this._hasLocalChanges=true}if(!this.get(&quot;hasChanges&quot;)){this.set(&quot;hasChanges&quot;,true);if(this.context){this.context.editorDidChange(this)}else{if(this.get(&quot;commitChangesImmediately&quot;)){if(!this._commitTimeout){this._commitTimeout=this.commitChanges.bind(this).defer()}}}}},editorDidClearChanges:function(b){if(!b){b=this}if(b!=this){if(this._clearingChanges){return}if(this._dirtyEditors){this._dirtyEditors.remove(b)}}else{this._hasLocalChanges=false}var a=!!(this._hasLocalChanges||(this._dirtyEditors&amp;&amp;this._dirtyEditors.length&gt;0));if(this.get(&quot;hasChanges&quot;)!=a){this.set(&quot;hasChanges&quot;,a);if(this.context){this.context.editorDidClearChanges(b)}}},canCommitChanges:function(){return true},performCommitChanges:function(){return $error(&quot;performCommitChanges is not implemented&quot;)},canDiscardChanges:function(){return true},performDiscardChanges:function(){return $error(&quot;performDiscardChanges is not implemented&quot;)},_canCommitChanges:function(){if(!this.get(&quot;hasChanges&quot;)){return false}var a=true;if(this._dirtyEditors){a=this._dirtyEditors.invokeWhile(true,&quot;_canCommitChanges&quot;);if(!$ok(a)){return a}}return this.canCommitChanges()},_performCommitChanges:function(){if(!this.get(&quot;hasChanges&quot;)){return true}var a=true;if(this._dirtyEditors){this._clearingChanges=true;a=this._dirtyEditors.invokeWhile(true,&quot;_performCommitChanges&quot;);this._clearingChanges=false;if($ok(a)){this._dirtyEditors=null}else{return a}}a=this.performCommitChanges();if($ok(a)){this.editorDidClearChanges()}return a},_canDiscardChanges:function(){if(!this.get(&quot;hasChanges&quot;)){return false}var a=true;if(this._dirtyEditors){a=this._dirtyEditors.invokeWhile(true,&quot;_canDiscardChanges&quot;);if(!$ok(a)){return a}}return this.canDiscardChanges()},_performDiscardChanges:function(){if(!this.get(&quot;hasChanges&quot;)){return true}var a=true;if(this._dirtyEditors){this._clearingChanges=true;a=this._dirtyEditors.invokeWhile(true,&quot;_performDiscardChanges&quot;);this._clearingChanges=false;if($ok(a)){this._dirtyEditors=null}else{return a}}a=this.performDiscardChanges();if($ok(a)){this.editorDidClearChanges()}return a}});require(&quot;controllers/controller&quot;);SC.ObjectController=SC.Controller.extend({content:null,hasNoContent:true,hasSingleContent:false,hasMultipleContent:false,allowsMultipleContent:true,destroy:function(){var a=this.get(&quot;content&quot;);if(a&amp;&amp;$type(a.destroy)===T_FUNCTION){a.destroy()}this.set(&quot;content&quot;,null)},performCommitChanges:function(){var h=this.get(&quot;content&quot;);var j=true;var d=false;if(this._isArray(h)){var g=this._lengthFor(h);if(g==0){h=null}else{if(g==1){h=this._objectAt(0,h)}else{if(this.get(&quot;allowsMultipleContent&quot;)){d=true}else{h=null}}}}if(!this._changes){this._changes={}}if(!h){return $error(&quot;No Content&quot;)}else{if(d){var e=this._lengthFor(h);while(--e&gt;=0){var c=this._objectAt(e,h);if(!c){continue}if(c.beginPropertyChanges){c.beginPropertyChanges()}for(var l in this._changes){if(!this._changes.hasOwnProperty(l)){continue}var k=this._changes[l];if(this._isArray(k)){k=this._objectAt(e,k)}if(c.set){c.set(l,k)}else{c[l]=k}}if(c.endPropertyChanges){c.endPropertyChanges()}if(c.commitChanges){j=c.commitChanges()}}}else{if(h.beginPropertyChanges){h.beginPropertyChanges()}for(var l in this._changes){if(!this._changes.hasOwnProperty(l)){continue}var a=h.get?h.get(l):h[l];var b=this._changes[l];if(a==null&amp;&amp;b==&quot;&quot;){b=null}if(b!=a){(h.set)?h.set(&quot;isDirty&quot;,true):(h.isDirty=true)}if(h.set){h.set(l,b)}else{h[l]=b}}if(h.endPropertyChanges){h.endPropertyChanges()}if(h.commitChanges){j=h.commitChanges()}}}if($ok(j)){this._changes={};this.editorDidClearChanges()}return j},performDiscardChanges:function(){this._changes={};this._valueControllers={};this.editorDidClearChanges();this.allPropertiesDidChange();return true},unknownProperty:function(a,b){if(a==&quot;content&quot;){if(!(b===undefined)){this[a]=b}return this[a]}else{if(!this._changes){this._changes={}}if(!this._valueControllers){this._valueControllers={}}if(b!==undefined){this._changes[a]=b;if(this._valueControllers[a]){this._valueControllers[a]=null}this.propertyWillChange(a+&quot;Controller&quot;);this.propertyDidChange(a+&quot;Controller&quot;);this.editorDidChange()}else{if(a.slice(a.length-10,a.length)==&quot;Controller&quot;){a=a.slice(0,-10);if(!this._valueControllers[a]){this._valueControllers[a]=this.controllerForValue(this._getValueForPropertyKey(a))}b=this._valueControllers[a]}else{b=this._getValueForPropertyKey(a)}}return b}},_getValueForPropertyKey:function(c){var e=this._changes[c];if(e!==undefined){return e}var g=this.get(&quot;content&quot;);if(!g){return null}if(this._isArray(g)){var e=[];var b=this._lengthFor(g);if(b&gt;1){if(this.get(&quot;allowsMultipleContent&quot;)){for(var a=0;a&lt;b;a++){var d=this._objectAt(a,g);e.push((d)?((d.get)?d.get(c):d[c]):null)}}else{e=null}}else{if(b==1){g=this._objectAt(0,g);e=(g.get)?g.get(c):g[c]}else{e=null}}}else{e=(g.get)?g.get(c):g[c]}return e},_lastPropertyRevision:0,propertyObserver:function(h,g,k,j,a){if(a&lt;=this._lastPropertyRevision){return}this._lastPropertyRevision=a;if(!this._boundObserver){this._boundObserver=this._contentPropertyObserver.bind(this)}if(g!=this){return}if((k==&quot;content&quot;)&amp;&amp;(j!=this._content)){var e=this._boundObserver;if(this.get(&quot;hasChanges&quot;)){var l=this.discardChanges();if(!$ok(l)){throw (l)}}else{this._valueControllers={}}if(this._content){var m=Array.from(this._content);var d=m.length;while(--d&gt;=0){var b=m[d];if(b&amp;&amp;b.removeObserver){b.removeObserver(&quot;*&quot;,e)}}}this._content=j;if(this._content){var m=Array.from(this._content);var d=m.length;while(--d&gt;=0){var b=m[d];if(b&amp;&amp;b.addObserver){b.addObserver(&quot;*&quot;,e)}}}var c=0;if(this._content){c=(this._isArray(this._content))?this._lengthFor(this._content):1}this.beginPropertyChanges();this.set(&quot;hasNoContent&quot;,c==0);this.set(&quot;hasSingleContent&quot;,c==1);this.set(&quot;hasMultipleContent&quot;,c&gt;1);this.allPropertiesDidChange();this.endPropertyChanges()}},_contentPropertyObserver:function(c,a,b){this._changeFromContent=true;if(a==&quot;*&quot;){this.allPropertiesDidChange()}else{this.propertyWillChange(a);this.propertyDidChange(a,b)}this._changeFromContent=false},_lengthFor:function(a){return((a.get)?a.get(&quot;length&quot;):a.length)||0},_objectAt:function(a,b){return(b.objectAt)?b.objectAt(a):((b.get)?b.get(a):b[a])},_isArray:function(a){return($type(a)==T_ARRAY)||(a&amp;&amp;a.objectAt)}});require(&quot;mixins/selection_support&quot;);require(&quot;controllers/object&quot;);SC.CollectionController=SC.ObjectController.extend(SC.SelectionSupport,{arrangedObjects:[],canEditCollection:false,pageSize:0,pageCount:function(){var a=this.get(&quot;pageSize&quot;);if(a&lt;=0){return 1}var c=this.get(&quot;content&quot;);var b=(c&amp;&amp;c.get)?c.get(&quot;count&quot;):0;if(b===null){b=0}return Math.ceil(b/a)}.property(),currentPage:function(b,c){if(c!==undefined){if(this._currentPage!=c){var a=Math.max(this.get(&quot;pageCount&quot;)-1,0);if(c&gt;a){c=a}if(c&lt;0){c=0}this._currentPage=c}}return this._currentPage||0}.property(),newObject:function(b){var c=this.get(&quot;content&quot;);if(!c||!this.get(&quot;canEditCollection&quot;)){return}try{if(c.newRecord){var g=c.newRecord(b);var a=function(){this.set(&quot;selection&quot;,(g)?[g]:[]);this._editingNewRecord=g}.invokeLater(this,1);return g}}catch(d){}},addObjects:function(b){var a=this.get(&quot;content&quot;);if(!a||!this.get(&quot;canEditCollection&quot;)){return}try{b=$A(arguments).flatten();if(a.addRecords){a.addRecords(b);this.set(&quot;selection&quot;,(b)?b:[])}}catch(c){}},addSelection:function(){return this.addObjects(this.get(&quot;selection&quot;))},removeObjects:function(c){var a=this.get(&quot;content&quot;);if(!a||!this.get(&quot;canEditCollection&quot;)){return}try{c=$A(arguments).flatten();if(a.removeRecords){var g=a.removeRecords(c);var b=(this.get(&quot;selection&quot;)||[]).without(c);this.set(&quot;selection&quot;,(b)?b:[])}}catch(d){}},removeSelection:function(){return this.removeObjects(this.get(&quot;selection&quot;))},newObjectDidLoseFocus:function(a){a.destroy()},_newRecordDidLoseFocus:function(a){if(a.get(&quot;newRecord&quot;)){this.newObjectDidLoseFocus(a)}},_pageObserver:function(){var g=this.get(&quot;content&quot;);if(g instanceof Array){g=g[0]}if(!g){return}var h=g.get(&quot;offset&quot;)||0;var c=g.get(&quot;limit&quot;)||0;var e=g.get(&quot;count&quot;)||0;var d=this.get(&quot;currentPage&quot;);var a=this.get(&quot;pageSize&quot;);var j,b;if(a==0){j=0;b=0}else{j=d*a;b=a}if((j!=h)||(b!=c)){g.beginPropertyChanges();g.set(&quot;offset&quot;,j);g.set(&quot;limit&quot;,b);g.endPropertyChanges()}}.observes(&quot;currentPage&quot;,&quot;pageCount&quot;,&quot;pageSize&quot;),_recordsObserver:function(d,b,c){var a=this.get(&quot;arrangedObjects&quot;);c=Array.asArray(d.get(b));this.set(&quot;arrangedObjects&quot;,c.slice());this.updateSelectionAfterContentChange()}.observes(&quot;records&quot;)});require(&quot;views/view&quot;);require(&quot;controllers/collection&quot;);SC.PaginationView=SC.View.extend({pageSize:0,pageCount:0,currentPage:0,currentPageString:&quot;_%@-%@ of %@&quot;,pageOptionString:&quot;_Page %@: %@-%@&quot;,hasPreviousPage:function(){return this.get(&quot;currentPage&quot;)&gt;0}.property(),hasNextPage:function(){return this.get(&quot;currentPage&quot;)&lt;this.get(&quot;pageCount&quot;)}.property(),emptyElement:'&lt;div class=&quot;pagination&quot;&gt;    &lt;button class=&quot;prev&quot;&gt;«&lt;/button&gt;    &lt;button class=&quot;page&quot;&gt;&lt;/button&gt;    &lt;button class=&quot;next&quot;&gt;»&lt;/button&gt;  &lt;/div&gt;',outlets:[&quot;prevButton&quot;,&quot;nextButton&quot;,&quot;pageButton&quot;],prevButton:SC.ButtonView.extend({action:function(){this.owner.decrementProperty(&quot;currentPage&quot;)},isEnabledBinding:&quot;*owner.hasPreviousPage&quot;})});require(&quot;views/view&quot;);SC.MenuItemView=SC.ButtonView.extend({emptyElement:['&lt;li class=&quot;button menu-item&quot;&gt;','&lt;a href=&quot;javascript:;&quot;&gt;','&lt;span class=&quot;sel&quot;&gt;&amp;#x2713;&lt;/span&gt;','&lt;span class=&quot;mixed&quot;&gt;-&lt;/span&gt;','&lt;span class=&quot;inner&quot;&gt;','&lt;span class=&quot;label&quot;&gt;&lt;/span&gt;',&quot;&lt;/span&gt;&quot;,'&lt;span class=&quot;shortcut&quot;&gt;&lt;/span&gt;',&quot;&lt;/a&gt;&quot;,&quot;&lt;/li&gt;&quot;].join(&quot;&quot;),computedRequiredWidth:function(){var b=0;var c=this.$sel(&quot;.inner&quot;);if(c){b=c.offsetLeft;b+=parseInt(Element.getStyle(c,&quot;padding-left&quot;),0);b+=parseInt(Element.getStyle(c,&quot;padding-right&quot;),0)}var a=Element.$sel(c,&quot;img&quot;);if(a){b+=Element.getDimensions(a).width}c=Element.$sel(c,&quot;.label&quot;);if(c){b+=Element.getDimensions(c).width}c=this.$sel(&quot;.shortcut&quot;);if(c){b+=Element.getDimensions(c).width}return b},mouseMoved:function(a){if(!this.get(&quot;isDefault&quot;)){this.get(&quot;parentNode&quot;).set(&quot;currentSelectedMenuItem&quot;,this)}},mouseOut:function(a){this.set(&quot;isDefault&quot;,false);this.setClassName(&quot;active&quot;,false)},mouseUp:function(a){arguments.callee.base.apply(this,arguments);this._closeParentMenu()},didTriggerAction:function(){this._closeParentMenu()},_closeParentMenu:function(){var a=this.get(&quot;parentNode&quot;);if(a){a.set(&quot;isVisible&quot;,false)}}});require(&quot;core&quot;);require(&quot;foundation/responder&quot;);require(&quot;panes/pane&quot;);SC.CAPTURE_BACKSPACE_KEY=NO;SC.window=SC.PaneView.extend({firstViewForEvent:function(a){var b=Event.element(a);while(b&amp;&amp;(b!=document)&amp;&amp;(!b._configured)){b=b.parentNode}if(b){b=SC.View.findViewForElement(b)}if(b==this){b=null}return b},innerFrame:function(){return this.frame()}.property(&quot;frame&quot;),clippingFrame:function(){return this.frame()}.property(&quot;frame&quot;),scrollFrame:function(){return this.frame()}.property(&quot;frame&quot;),frame:function(){var a=this.get(&quot;size&quot;);return{x:0,y:0,width:a.width,height:a.height}}.property(&quot;size&quot;),size:function(){if(!this._size){if(window.innerHeight){this._size={width:window.innerWidth,height:window.innerHeight}}else{if(document.documentElement&amp;&amp;document.documentElement.clientHeight){this._size={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}}else{if(document.body){this._size={width:document.body.clientWidth,height:document.body.clientHeight}}}}}return this._size}.property(),autoresizesChildViews:true,_onresize:function(a){SC.runLoop.beginRunLoop();var c=Object.clone(this.get(&quot;size&quot;));this._size=null;var b=this.get(&quot;size&quot;);if((b.width!=c.width)||(b.height!=c.height)){this.resizeChildrenWithOldSize(c)}SC.runLoop.endRunLoop()},_lastModifiers:null,_handleModifierChanges:function(b){var a=this._lastModifiers=this._lastModifiers||{alt:false,ctrl:false,shift:false};var c=false;if(b.altKey!=a.alt){a.alt=b.altKey;c=true}if(b.ctrlKey!=a.ctrl){a.ctrl=b.ctrlKey;c=true}if(b.shiftKey!=a.shift){a.shift=b.shiftKey;c=true}if(c){b._type=&quot;flagsChanged&quot;;b._modifiers=a;SC.app.sendEvent(b)}},_onkeydown:function(a){if(SC.Platform.Firefox&gt;0&amp;&amp;(a.which===8)){return true}this._handleModifierChanges(a);if(this._isModifierKey(a)){return false}if(!this._isFunctionOrNonPrintableKey(a)){return true}var b=this._sendEvent(&quot;keyDown&quot;,a);return b},_onkeypress:function(a){if(SC.Platform.Firefox&gt;0&amp;&amp;(a.which===8)){var b=this._sendEvent(&quot;keyDown&quot;,a)}else{if(this._isFunctionOrNonPrintableKey(a)){return true}if(a.charCode!=undefined&amp;&amp;a.charCode==0){return true}var b=this._sendEvent(&quot;keyDown&quot;,a)}return b},_onkeyup:function(a){this._handleModifierChanges(a);if(this._isModifierKey(a)){return}return this._sendEvent(&quot;keyUp&quot;,a)},_sendEvent:function(b,a){SC.runLoop.beginRunLoop();a._type=b;a._stopWhenHandled=(a._stopWhenHandled!==undefined)?a._stopWhenHandled:true;var d=SC.app.sendEvent(a);var c=true;if(d&amp;&amp;a._stopWhenHandled){Event.stop(a);c=false}SC.runLoop.endRunLoop();return c},_isFunctionOrNonPrintableKey:function(a){return !!(a.altKey||a.ctrlKey||SC.FUNCTION_KEYS[a.keyCode])},_isModifierKey:function(a){return !!SC.MODIFIER_KEYS[a.keyCode]},_mouseDownView:null,_clickCount:0,_lastMouseUpAt:null,dragDidStart:function(a){this._mouseDownView=a},_onmousedown:function(a){SC.runLoop.beginRunLoop();this._onfocus();this._clickCount=this._clickCount+1;if(!this._lastMouseUpAt||((Date.now()-this._lastMouseUpAt)&gt;200)){this._clickCount=1}a.clickCount=this._clickCount;a._type=&quot;mouseDown&quot;;a._stopWhenHandled=(a._stopWhenHandled!==undefined)?a._stopWhenHandled:true;this._mouseDownView=SC.app.sendEvent(a);var b=true;if(this._mouseDownView&amp;&amp;a._stopWhenHandled){Event.stop(a);b=false;if(this._mouseDownView.mouseDragged&amp;&amp;$type(this._mouseDownView.mouseDragged)==T_FUNCTION){this._mouseCanDrag=true}}SC.runLoop.endRunLoop();return b},_onmouseup:function(a){SC.runLoop.beginRunLoop();var b=null;this._lastMouseUpAt=Date.now();a.clickCount=this._clickCount;if(this._mouseDownView){a._type=&quot;mouseUp&quot;;b=SC.app.sendEvent(a,this._mouseDownView)}if(!b&amp;&amp;(this._clickCount==2)){a._type=&quot;doubleClick&quot;;b=SC.app.sendEvent(a,this._mouseDownView)}if(!b){a._type=&quot;click&quot;;b=SC.app.sendEvent(a,this._mouseDownView)}this._mouseCanDrag=false;this._mouseDownView=null;SC.runLoop.endRunLoop()},_ondblclick:function(a){if(SC.isIE()){this._clickCount=2;this._onmouseup(a)}},_lastHovered:null,_onmousemove:function(c){SC.runLoop.beginRunLoop();this._onfocus();var b=this._lastHovered||[];var e=[];var a=this.firstViewForEvent(c);while(a&amp;&amp;(a!=this)){var g=a.mouseOver||a.didMouseOver||a.mouseEntered;var d=a.mouseMoved||a.mouseDidMove;if(b.include(a)){if(d){d.call(a,c)}e.push(a)}else{if(g){g.call(a,c)}e.push(a)}a=a.get(&quot;nextResponder&quot;)}for(var j=0;j&lt;b.length;j++){a=b[j];var h=a.mouseOut||a.didMouseOut||a.mouseExited;if(h&amp;&amp;!e.include(a)){h.call(a,c)}}this._lastHovered=e;if(this._mouseDownView&amp;&amp;this._mouseDownView.mouseDragged){this._mouseDownView.mouseDragged(c)}SC.runLoop.endRunLoop()},_onunload:function(){this._listenerCache.each(function(a){Event.stopObserving.apply(Event,a)})},_onfocus:function(){if(!this._hasFocus){this._hasFocus=YES;this.addClassName(&quot;focus&quot;);this.removeClassName(&quot;blur&quot;)}},_onblur:function(){if(this._hasFocus){this._hasFocus=NO;this.removeClassName(&quot;focus&quot;);this.addClassName(&quot;blur&quot;)}},_mouseCanDrag:true,_onselectstart:function(){if(this._mouseCanDrag){return false}else{return true}},_ondrag:function(){return false},_hasFocus:NO,_EVTS:[&quot;mousedown&quot;,&quot;mouseup&quot;,&quot;click&quot;,&quot;dblclick&quot;,&quot;keydown&quot;,&quot;keyup&quot;,&quot;keypress&quot;,&quot;mouseover&quot;,&quot;mouseout&quot;,&quot;mousemove&quot;,&quot;resize&quot;,&quot;unload&quot;,&quot;focus&quot;,&quot;blur&quot;,&quot;drag&quot;,&quot;selectstart&quot;],_listenerCache:[],setup:function(){var a=this;a._EVTS.each(function(g){var b=a[&quot;_on&quot;+g];var d=(g!=&quot;resize&quot;)?document:window;if(b){var c=b.bindAsEventListener(a);if(g===&quot;keypress&quot;&amp;&amp;SC.CAPTURE_BACKSPACE_KEY&amp;&amp;SC.Platform.Firefox&gt;0){document.onkeypress=c}else{if(g===&quot;selectstart&quot;&amp;&amp;SC.Platform.IE&gt;0){document.body.onselectstart=c}else{if(g===&quot;drag&quot;&amp;&amp;SC.Platform.IE&gt;0){document.body.ondrag=c}else{Event.observe(d,g,c)}}}a._listenerCache.push([d,g,c])}});this.get(&quot;size&quot;);this.set(&quot;isVisibleInWindow&quot;,true);this._onfocus()}}).viewFor($tag(&quot;body&quot;));require(&quot;core&quot;);require(&quot;views/view&quot;);SC.DRAG_LINK=4;SC.DRAG_COPY=1;SC.DRAG_MOVE=2;SC.DRAG_NONE=0;SC.DRAG_ANY=7;SC.DRAG_AUTOSCROLL_ZONE_THICKNESS=20;SC.Drag=SC.Object.extend({source:null,ghostView:null,dragView:null,ghost:YES,slideBack:YES,mouseDownEvent:null,ghostOffset:{x:0,y:0},location:null,dataTypes:function(){if(this.dataSource){return this.dataSource.get(&quot;dragDataTypes&quot;)}if(this.data){var a=[];for(var b in this._data){if(this.data.hasOwnProperty(b)){a.push(b)}}return a}var c=this.get(&quot;source&quot;);if(c&amp;&amp;c.dragDataTypes){return c.get(&quot;dragDataTypes&quot;)}return[]}.property(),hasDataType:function(a){var b=this.get(&quot;dataTypes&quot;)||[];return(b.indexOf(a)&gt;=0)},dataForType:function(a){if(this.dataSource){return this.dataSource.dragDataForType(a,this)}else{if(this.data){return this.data[a]}else{var b=this.get(&quot;source&quot;);if(b&amp;&amp;$type(b.dragDataForType)==T_FUNCTION){return b.dragDataForType(a,this)}else{return null}}}},dataSource:null,data:null,_dragInProgress:YES,startDrag:function(){this._createGhostView();var a=this.dragView.convertFrameToView(this.dragView.get(&quot;frame&quot;),null);var b=Event.pointerLocation(this.event);window.dragEvent=this.event;this.ghostOffset={x:(b.x-a.x),y:(b.y-a.y)};this._positionGhostView(this.event);SC.window.dragDidStart(this);if(this.source&amp;&amp;this.source.dragDidBegin){this.source.dragDidBegin(this,b)}},_lastLoc:{},mouseDragged:function(a){var e=Event.pointerLocation(a);var b=this._autoscroll(a);if(!b&amp;&amp;(e.x==this._lastLoc.x)&amp;&amp;(e.y==this._lastLoc.y)){return}this._lastLoc=e;this.set(&quot;location&quot;,e);this._positionGhostView(a);var c=this._lastTarget;var d=this._findDropTarget(a);var g=SC.DRAG_NONE;while(d&amp;&amp;(d!=c)&amp;&amp;(g==SC.DRAG_NONE)){if(d&amp;&amp;this.source&amp;&amp;this.source.dragSourceOperationMaskFor){g=this.source.dragSourceOperationMaskFor(d,this)}else{g=SC.DRAG_ANY}if((g!=SC.DRAG_NONE)&amp;&amp;d&amp;&amp;d.dragEntered){g=g&amp;d.dragEntered(this,a)}else{g=SC.DRAG_NONE}if(g==SC.DRAG_NONE){d=this._findNextDropTarget(d)}}if(d!=c){if(c&amp;&amp;c.dragExited){c.dragExited(this,a)}if(d&amp;&amp;this.source&amp;&amp;this.source.dragSourceOperationMaskFor){g=this.source.dragSourceOperationMaskFor(d,this)}else{g=SC.DRAG_ANY}this.sourceDropOperations=g;if(d&amp;&amp;d.dragEntered){this.dropOperations=g&amp;d.dragEntered(this,a)}else{this.dropOperations=SC.DRAG_NONE}if(this.dropOperations==SC.DRAG_NONE){d=null}}else{if(d&amp;&amp;d.dragUpdated){d.dragUpdated(this,a)}}if(this.source&amp;&amp;this.source.dragDidMove){this.source.dragDidMove(this,e)}this._lastTarget=d},mouseUp:function(a){var e=Event.pointerLocation(a);var d=this._lastTarget;var g=this.dropOperations;if(d&amp;&amp;d.prepareForDragOperation(g,this)){g=d.performDragOperation(g,this)}else{g=SC.DRAG_NONE}var b=this;var c=function(){if(d){d.concludeDragOperation(g,this)}b._destroyGhostView()};if(d&amp;&amp;d.dragEnded){d.dragEnded(this,a)}this._lastTarget=null;if((g==SC.DRAG_NONE)&amp;&amp;this.get(&quot;slideBack&quot;)){var e=this.dragView.convertFrameToView(this.dragView.get(&quot;origin&quot;),null);this._ghostView.transitionTo(1,&quot;left: %@px; top: %@px&quot;.fmt(e.x,e.y),{duration:200,onComplete:c})}else{c()}if(this.source&amp;&amp;this.source.dragDidEnd){this.source.dragDidEnd(this,e,g)}this._dragInProgress=NO},_ghostViewClass:SC.View.extend({emptyElement:'&lt;div class=&quot;sc-ghost-view&quot;&gt;&lt;/div&gt;'}),_positionGhostView:function(a){var b=Event.pointerLocation(a);b.x-=this.ghostOffset.x;b.y-=this.ghostOffset.y;b=this._ghostView.convertFrameFromView(b,null);this._ghostView.set(&quot;origin&quot;,b)},_createGhostView:function(){var a=this.dragView.rootElement.cloneNode(true);this._ghostView=this._ghostViewClass.viewFor(a);this._ghostView.owner=this;this._ghostView.addClassName(&quot;sc-ghost-view&quot;);SC.window.appendChild(this._ghostView)},_destroyGhostView:function(){if(this._ghostView){this._ghostView.removeFromParent();this._ghostView=null}},_ghostView:null,_getOrderedDropTargets:function(){if(this._cachedDropTargets){return this._cachedDropTargets}var b=[];var d=SC.Drag._dropTargets;for(var c in d){if(!d.hasOwnProperty(c)){continue}b.push(d[c])}var e={};var a=function(g){if(!g){return 0}var j=SC.guidFor(g);var h=e[j];if(!h){h=1;while((g=g.parentNode)&amp;&amp;(g!==SC.window)){if(d[SC.guidFor(g)]!==undefined){h++}}e[j]=h}return h};b.sort(function(h,g){if(h===g){return 0}h=a(h);g=a(g);return(h&gt;g)?-1:1});this._cachedDropTargets=b;return b},_findDropTarget:function(b){var e=this._getOrderedDropTargets();var h=Event.pointerLocation(b);var c=null;for(var a=0;a&lt;e.length;a++){var d=e[a];if(!d.get(&quot;isVisibleInWindow&quot;)){continue}var g=d.convertFrameToView(d.get(&quot;clippingFrame&quot;),null);if(SC.pointInRect(h,g)){return d}}return null},_findNextDropTarget:function(a){while((a=a.parentNode)&amp;&amp;(a!=SC.window)){if(SC.Drag._dropTargets[a._guid]){return a}}return null},_autoscroll:function(m){if(!this._dragInProgress){return}var g=(m)?Event.pointerLocation(m):this._lastMouseLocation;if(!g){return false}this._lastMouseLocation=g;var j=this._findScrollableView(g);var b,p;var c,k,a;var o=null;while(j&amp;&amp;!o){b=j.get(&quot;hasVerticalScroller&quot;)?1:0;p=j.get(&quot;hasHorizontalScroller&quot;)?1:0;if((b!=0)||(p!=0)){var e=j.convertFrameToView(j.get(&quot;frame&quot;),null);var h=j.get(&quot;innerFrame&quot;);var d=j.get(&quot;scrollFrame&quot;)}if(b!=0){k=SC.maxY(e);c=k-SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;a=SC.maxY(d);if((a&gt;=h.height)&amp;&amp;(g.y&gt;=c)&amp;&amp;(g.y&lt;=k)){b=1}else{c=SC.minY(e);k=c+SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;a=SC.minY(d);if((a&lt;=h.height)&amp;&amp;(g.y&gt;=c)&amp;&amp;(g.y&lt;=k)){b=-1}else{b=0}}}if(p!=0){k=SC.maxX(e);c=k-SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;a=SC.maxX(d);if((a&gt;=h.width)&amp;&amp;(g.x&gt;=c)&amp;&amp;(g.x&lt;=k)){p=1}else{c=SC.minY(e);k=c+SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;a=SC.minY(d);if((a&lt;=h.width)&amp;&amp;(g.x&gt;=c)&amp;&amp;(g.x&lt;=k)){p=-1}else{p=0}}}if((b!=0)||(p!=0)){o=j}else{j=this._findNextScrollableView(j)}}if(o&amp;&amp;(this._lastScrollableView==o)){if((Date.now()-this._hotzoneStartTime)&gt;100){this._horizontalScrollAmount*=1.05;this._verticalScrollAmount*=1.05}}else{this._lastScrollableView=o;this._horizontalScrollAmount=15;this._verticalScrollAmount=15;this._hotzoneStartTime=(o)?Date.now():null;p=b=0}if(o&amp;&amp;((p!=0)||(b!=0))){var l={x:p*this._horizontalScrollAmount,y:b*this._verticalScrollAmount};o.scrollBy(l)}if(o){this.invokeLater(&quot;_autoscroll&quot;,100,null);return true}else{return false}},_scrollableViews:function(){if(this._cachedScrollableView){return this._cachedScrollableView}var a=[];var c=SC.Drag._scrollableViews;for(var b in c){if(!c.hasOwnProperty(b)){continue}a.push(c[b])}a=a.sort(function(g,d){var e=g;while((e=e.parentNode)&amp;&amp;(e!=SC.window)){if(d==e){return -1}}return 1});this._cachedScrollableView=a;return a},_findScrollableView:function(g){var d=this._scrollableViews();var b=null;for(var a=0;a&lt;d.length;a++){var c=d[a];if(!c.get(&quot;isVisibleInWindow&quot;)){continue}var e=c.convertFrameToView(c.get(&quot;frame&quot;),null);if(SC.pointInRect(g,e)){return c}}return null},_findNextScrollableView:function(a){while((a=a.parentNode)&amp;&amp;(a!=SC.window)){if(SC.Drag._scrollableViews[a._guid]){return a}}return null}});SC.Drag.mixin({start:function(b){var a=this.create(b);a.startDrag();return a},_dropTargets:{},_scrollableViews:{},addScrollableView:function(a){this._scrollableViews[a._guid]=a},removeScrollableView:function(a){delete this._scrollableViews[a._guid]},addDropTarget:function(a){this._dropTargets[a._guid]=a},removeDropTarget:function(a){delete this._dropTargets[a._guid]},inspectOperation:function(b){var a=[];if(b===SC.DRAG_NONE){a=[&quot;DRAG_NONE&quot;]}else{if(b===SC.DRAG_ANY){a=[&quot;DRAG_ANY&quot;]}else{if(b&amp;SC.DRAG_LINK){a.push(&quot;DRAG_LINK&quot;)}if(b&amp;SC.DRAG_COPY){a.push(&quot;DRAG_COPY&quot;)}if(b&amp;SC.DRAG_MOVE){a.push(&quot;DRAG_MOVE&quot;)}}}return a.join(&quot;|&quot;)}});require(&quot;drag/drag&quot;);SC.DragDataSource={dragDataTypes:[],dragDataForType:function(a,b){return null}};SC.Scrollable={isScrollable:true,verticalLineScroll:20,horizontalLineScroll:20,verticalPageScroll:function(){return this.get(&quot;innerFrame&quot;).height}.property(&quot;innerFrame&quot;),horizontalPageScroll:function(){return this.get(&quot;innerFrame&quot;).width}.property(&quot;innerFrame&quot;),hasVerticalScroller:function(){return this.get(&quot;scrollFrame&quot;).height&gt;this.get(&quot;innerFrame&quot;).height}.property(&quot;scrollFrame&quot;),hasHorizontalScroller:function(){return this.get(&quot;scrollFrame&quot;).width&gt;this.get(&quot;innerFrame&quot;).width}.property(&quot;scrollFrame&quot;),scrollBy:function(a){var b=this.get(&quot;scrollFrame&quot;);var c=this.get(&quot;innerFrame&quot;);if(!this.get(&quot;hasVerticalScroller&quot;)){a.y=0}if(b.height&lt;=c.height){a.y=0}if(!this.get(&quot;hasHorizontalScroller&quot;)){a.x=0}if(b.width&lt;=c.width){a.x=0}var d={x:b.x-(a.x||0),y:b.y-(a.y||0)};d=this.set(&quot;scrollFrame&quot;,d);return{x:d.x-b.x,y:d.y-b.y}},scrollTo:function(a,b){this.set(&quot;scrollFrame&quot;,{x:0-a,y:0-b})},scrollToVisible:function(b){var e=this.get(&quot;innerFrame&quot;);var d=this.get(&quot;scrollFrame&quot;);var a=this.convertFrameFromView(b.get(&quot;frame&quot;),b);a.x-=(e.x+d.x);a.y-=(e.y+d.y);var c={x:0-d.x,y:0-d.y,width:e.width,height:e.height};c.y-=Math.max(0,SC.minY(c)-SC.minY(a));c.x-=Math.max(0,SC.minX(c)-SC.minX(a));c.y+=Math.max(0,SC.maxY(a)-SC.maxY(c));c.x+=Math.max(0,SC.maxX(a)-SC.maxX(c));this.scrollTo(c.x,c.y)},scrollDownLine:function(a){if(a===undefined){a=1}return this.scrollBy({y:this.get(&quot;verticalLineScroll&quot;)*a}).y},scrollUpLine:function(a){if(a===undefined){a=1}return 0-this.scrollBy({y:0-this.get(&quot;verticalLineScroll&quot;)*a}).y},scrollRightLine:function(a){if(a===undefined){a=1}return this.scrollTo({y:this.get(&quot;horizontalLineScroll&quot;)*a}).x},scrollLeftLine:function(a){if(a===undefined){a=1}return 0-this.scrollTo({y:0-this.get(&quot;horizontalLineScroll&quot;)*a}).x},scrollDownPage:function(a){if(a===undefined){a=1}return this.scrollBy({y:this.get(&quot;verticalPageScroll&quot;)*a}).y},scrollUpPage:function(a){if(a===undefined){a=1}return 0-this.scrollBy({y:0-this.get(&quot;verticalPageScroll&quot;)*a}).y},scrollRightPage:function(a){if(a===undefined){a=1}return this.scrollTo({y:this.get(&quot;horizontalPageScroll&quot;)*a}).x},scrollLeftPage:function(a){if(a===undefined){a=1}return 0-this.scrollTo({y:0-this.get(&quot;horizontalPageScroll&quot;)*a}).x}};require(&quot;mixins/scrollable&quot;);require(&quot;views/container&quot;);SC.ScrollView=SC.ContainerView.extend(SC.Scrollable,{emptyElement:'&lt;div class=&quot;sc-scroll-view&quot;&gt;&lt;/div&gt;',canScrollVertical:YES,canScrollHorizontal:NO,_canScrollVerticalObserver:function(){this.setClassName(&quot;sc-scroll-vertical&quot;,this.get(&quot;canScrollVertical&quot;))}.observes(&quot;canScrollVertical&quot;),_canScrollHorizontalObserver:function(){this.setClassName(&quot;sc-scroll-horizontal&quot;,this.get(&quot;canScrollHorizontal&quot;))}.observes(&quot;canScrollHorizontal&quot;),init:function(){arguments.callee.base.apply(this,arguments);this._canScrollVerticalObserver();this._canScrollHorizontalObserver()},resizeChildrenWithOldSize:function(c){var a=this.get(&quot;firstChild&quot;);if(a){var d=a.get(&quot;frame&quot;);var e=Object.clone(d);var b=this.get(&quot;innerFrame&quot;);d.x=d.y=0;if(!this.get(&quot;canScrollHorizontal&quot;)){d.width=b.width}if(!this.get(&quot;canScrollVertical&quot;)){d.height=b.height}if(!SC.rectsEqual(d,e)){a.set(&quot;frame&quot;,d)}}}});require(&quot;views/view&quot;);SC.ProgressView=SC.View.extend({minimum:0,maximum:1,value:0.5,valueBindingDefault:SC.Binding.SingleNotEmpty,isIndeterminate:function(a,b){if(b!==undefined){this._isIndeterminate=b}return this._isIndeterminate&amp;&amp;(this.value!=SC.Binding.EMPTY_PLACEHOLDER)}.property(),isEnabled:function(a,b){if(b!==undefined){this._isEnabled=b}return this._isEnabled&amp;&amp;(this.value!=SC.Binding.MULTIPLE_PLACEHOLDER)}.property(),_isIndeterminate:false,_isEnabled:true,emptyElement:'&lt;div class=&quot;progress outer&quot;&gt;&lt;div class=&quot;outer-head&quot;&gt;&lt;/div&gt;&lt;div class=&quot;inner&quot;&gt;&lt;div class=&quot;inner-head&quot;&gt;&lt;/div&gt;&lt;div class=&quot;inner-tail&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;outer-tail&quot;&gt;&lt;/div&gt;&lt;/div&gt;',outlets:[&quot;innerView&quot;],innerView:SC.View.outletFor(&quot;.inner?&quot;),propertyObserver:function(h,g,b,e){if([&quot;value&quot;,&quot;minimum&quot;,&quot;maximum&quot;,&quot;isIndeterminate&quot;,&quot;isEnabled&quot;].include(b)){var a=this.get(&quot;isIndeterminate&quot;);var c=this.get(&quot;isEnabled&quot;);this.setClassName(&quot;indeterminate&quot;,a);this.setClassName(&quot;disabled&quot;,!c);var e;if(!c){e=0}else{if(a){e=1}else{var d=this.get(&quot;minimum&quot;)||0;var j=this.get(&quot;maximum&quot;)||1;e=this.get(&quot;value&quot;)||0;e=(e-d)/(j-d);if(e&gt;1){e=1}}}if(isNaN(e)){e=0}e=e*100;if(this.innerView){this.innerView.setStyle({width:(e+&quot;%&quot;)})}}}});function Animator(a){this.setOptions(a);var b=this;this.timerDelegate=function(){b.onTimerEvent()};this.subjects=[];this.target=0;this.state=0;this.lastTime=null}Animator.prototype={setOptions:function(a){this.options=Animator.applyDefaults({interval:20,duration:400,onComplete:function(){},onStep:function(){},transition:Animator.tx.easeInOut},a)},seekTo:function(a){this.seekFromTo(this.state,a)},seekFromTo:function(b,a){this.target=Math.max(0,Math.min(1,a));this.state=Math.max(0,Math.min(1,b));this.lastTime=new Date().getTime();if(!this.intervalId){this.intervalId=window.setInterval(this.timerDelegate,this.options.interval)}},jumpTo:function(a){this.target=this.state=Math.max(0,Math.min(1,a));this.propagate()},toggle:function(){this.seekTo(1-this.target)},addSubject:function(a){this.subjects[this.subjects.length]=a;return this},clearSubjects:function(){this.subjects=[]},propagate:function(){var b=this.options.transition(this.state);for(var a=0;a&lt;this.subjects.length;a++){if(this.subjects[a].setState){this.subjects[a].setState(b)}else{this.subjects[a](b)}}},onTimerEvent:function(){var c=new Date().getTime();var a=c-this.lastTime;this.lastTime=c;var b=(a/this.options.duration)*(this.state&lt;this.target?1:-1);if(Math.abs(b)&gt;=Math.abs(this.state-this.target)){this.state=this.target}else{this.state+=b}try{this.propagate()}finally{this.options.onStep.call(this);if(this.target==this.state){window.clearInterval(this.intervalId);this.intervalId=null;this.options.onComplete.call(this)}}},play:function(){this.seekFromTo(0,1)},reverse:function(){this.seekFromTo(1,0)},inspect:function(){var b=&quot;#&lt;Animator:\n&quot;;for(var a=0;a&lt;this.subjects.length;a++){b+=this.subjects[a].inspect()}b+=&quot;&gt;&quot;;return b}};Animator.applyDefaults=function(c,b){b=b||{};var d,a={};for(d in c){a[d]=b[d]!==undefined?b[d]:c[d]}return a};Animator.makeArray=function(c){if(c==null){return[]}if(!c.length){return[c]}var a=[];for(var b=0;b&lt;c.length;b++){a[b]=c[b]}return a};Animator.camelize=function(c){var e=c.split(&quot;-&quot;);if(e.length==1){return e[0]}var b=c.indexOf(&quot;-&quot;)==0?e[0].charAt(0).toUpperCase()+e[0].substring(1):e[0];for(var d=1,a=e.length;d&lt;a;d++){var g=e[d];b+=g.charAt(0).toUpperCase()+g.substring(1)}return b};Animator.apply=function(c,b,a){if(b instanceof Array){return new Animator(a).addSubject(new CSSStyleSubject(c,b[0],b[1]))}return new Animator(a).addSubject(new CSSStyleSubject(c,b))};Animator.makeEaseIn=function(b){return function(a){return Math.pow(a,b*2)}};Animator.makeEaseOut=function(b){return function(a){return 1-Math.pow(1-a,b*2)}};Animator.makeElastic=function(a){return function(b){b=Animator.tx.easeInOut(b);return((1-Math.cos(b*Math.PI*a))*(1-b))+b}};Animator.makeADSR=function(d,b,c,a){if(a==null){a=0.5}return function(e){if(e&lt;d){return e/d}if(e&lt;b){return 1-((e-d)/(b-d)*(1-a))}if(e&lt;c){return a}return a*(1-((e-c)/(1-c)))}};Animator.makeBounce=function(a){var b=Animator.makeElastic(a);return function(c){c=b(c);return c&lt;=1?c:2-c}};Animator.tx={easeInOut:function(a){return((-Math.cos(a*Math.PI)/2)+0.5)},linear:function(a){return a},easeIn:Animator.makeEaseIn(1.5),easeOut:Animator.makeEaseOut(1.5),strongEaseIn:Animator.makeEaseIn(2.5),strongEaseOut:Animator.makeEaseOut(2.5),elastic:Animator.makeElastic(1),veryElastic:Animator.makeElastic(3),bouncy:Animator.makeBounce(1),veryBouncy:Animator.makeBounce(3)};function NumericalStyleSubject(b,c,e,d,a){this.els=Animator.makeArray(b);if(c==&quot;opacity&quot;&amp;&amp;window.ActiveXObject){this.property=&quot;filter&quot;}else{this.property=Animator.camelize(c)}this.from=parseFloat(e);this.to=parseFloat(d);this.units=a!=null?a:&quot;px&quot;}NumericalStyleSubject.prototype={setState:function(g){var d=this.getStyle(g);var a=(this.property==&quot;opacity&quot;&amp;&amp;g==0)?&quot;hidden&quot;:&quot;&quot;;var b=0;for(var c=0;c&lt;this.els.length;c++){try{this.els[c].style[this.property]=d}catch(h){if(this.property!=&quot;fontWeight&quot;){throw h}}if(b++&gt;20){return}}},getStyle:function(a){a=this.from+((this.to-this.from)*a);if(this.property==&quot;filter&quot;){return&quot;alpha(opacity=&quot;+Math.round(a*100)+&quot;)&quot;}if(this.property==&quot;opacity&quot;){return a}return Math.round(a)+this.units},inspect:function(){return&quot;\t&quot;+this.property+&quot;(&quot;+this.from+this.units+&quot; to &quot;+this.to+this.units+&quot;)\n&quot;}};function ColorStyleSubject(a,b,d,c){this.els=Animator.makeArray(a);this.property=Animator.camelize(b);this.to=this.expandColor(c);this.from=this.expandColor(d);this.origFrom=d;this.origTo=c}ColorStyleSubject.prototype={expandColor:function(b){var c,e,d,a;c=ColorStyleSubject.parseColor(b);if(c){e=parseInt(c.slice(1,3),16);d=parseInt(c.slice(3,5),16);a=parseInt(c.slice(5,7),16);return[e,d,a]}if(window.DEBUG){alert(&quot;Invalid colour: '&quot;+b+&quot;'&quot;)}},getValueForState:function(a,b){return Math.round(this.from[a]+((this.to[a]-this.from[a])*b))},setState:function(c){var a=&quot;#&quot;+ColorStyleSubject.toColorPart(this.getValueForState(0,c))+ColorStyleSubject.toColorPart(this.getValueForState(1,c))+ColorStyleSubject.toColorPart(this.getValueForState(2,c));for(var b=0;b&lt;this.els.length;b++){this.els[b].style[this.property]=a}},inspect:function(){return&quot;\t&quot;+this.property+&quot;(&quot;+this.origFrom+&quot; to &quot;+this.origTo+&quot;)\n&quot;}};ColorStyleSubject.parseColor=function(d){var a=&quot;#&quot;,c;if(c=ColorStyleSubject.parseColor.rgbRe.exec(d)){var b;for(var e=1;e&lt;=3;e++){b=Math.max(0,Math.min(255,parseInt(c[e],0)));a+=ColorStyleSubject.toColorPart(b)}return a}if(c=ColorStyleSubject.parseColor.hexRe.exec(d)){if(c[1].length==3){for(var e=0;e&lt;3;e++){a+=c[1].charAt(e)+c[1].charAt(e)}return a}return&quot;#&quot;+c[1]}return false};ColorStyleSubject.toColorPart=function(a){if(a&gt;255){a=255}var b=a.toString(16);if(a&lt;16){return&quot;0&quot;+b}return b};ColorStyleSubject.parseColor.rgbRe=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i;ColorStyleSubject.parseColor.hexRe=/^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function DiscreteStyleSubject(b,c,e,d,a){this.els=Animator.makeArray(b);this.property=Animator.camelize(c);this.from=e;this.to=d;this.threshold=a||0.5}DiscreteStyleSubject.prototype={setState:function(c){var a=0;for(var b=0;b&lt;this.els.length;b++){this.els[b].style[this.property]=c&lt;=this.threshold?this.from:this.to}},inspect:function(){return&quot;\t&quot;+this.property+&quot;(&quot;+this.from+&quot; to &quot;+this.to+&quot; @ &quot;+this.threshold+&quot;)\n&quot;}};function CSSStyleSubject(d,p,l){d=Animator.makeArray(d);this.subjects=[];if(d.length==0){return}var a,q,b;if(l){b=this.parseStyle(p,d[0]);q=this.parseStyle(l,d[0])}else{q=this.parseStyle(p,d[0]);b={};for(a in q){b[a]=CSSStyleSubject.getStyle(d[0],a)}}var a;for(a in b){if(b[a]==q[a]){delete b[a];delete q[a]}}var a,j,e,k,o,m;for(a in b){var h=String(b[a]);var c=String(q[a]);if(q[a]==null){if(window.DEBUG){alert(&quot;No to style provided for '&quot;+a+'&quot;')}continue}if(o=ColorStyleSubject.parseColor(h)){m=ColorStyleSubject.parseColor(c);k=ColorStyleSubject}else{if(h.match(CSSStyleSubject.numericalRe)&amp;&amp;c.match(CSSStyleSubject.numericalRe)){o=parseFloat(h);m=parseFloat(c);k=NumericalStyleSubject;e=CSSStyleSubject.numericalRe.exec(h);var g=CSSStyleSubject.numericalRe.exec(c);if(e[1]!=null){j=e[1]}else{if(g[1]!=null){j=g[1]}else{j=g}}}else{if(h.match(CSSStyleSubject.discreteRe)&amp;&amp;c.match(CSSStyleSubject.discreteRe)){o=h;m=c;k=DiscreteStyleSubject;j=0}else{if(window.DEBUG){alert(&quot;Unrecognised format for value of &quot;+a+&quot;: '&quot;+b[a]+&quot;'&quot;)}continue}}}this.subjects[this.subjects.length]=new k(d,a,o,m,j)}}CSSStyleSubject.prototype={parseStyle:function(b,c){var h={};if(b.indexOf(&quot;:&quot;)!=-1){var k=b.split(&quot;;&quot;);for(var e=0;e&lt;k.length;e++){var d=CSSStyleSubject.ruleRe.exec(k[e]);if(d){h[d[1]]=d[2]}}}else{var a,j,g;g=c.className;c.className=b;for(var e=0;e&lt;CSSStyleSubject.cssProperties.length;e++){a=CSSStyleSubject.cssProperties[e];j=CSSStyleSubject.getStyle(c,a);if(j!=null){h[a]=j}}c.className=g}return h},setState:function(b){for(var a=0;a&lt;this.subjects.length;a++){this.subjects[a].setState(b)}},inspect:function(){var b=&quot;&quot;;for(var a=0;a&lt;this.subjects.length;a++){b+=this.subjects[a].inspect()}return b}};CSSStyleSubject.getStyle=function(b,c){var a;if(document.defaultView&amp;&amp;document.defaultView.getComputedStyle){a=document.defaultView.getComputedStyle(b,&quot;&quot;).getPropertyValue(c);if(a){return a}}c=Animator.camelize(c);if(b.currentStyle){a=b.currentStyle[c]}return a||b.style[c]};CSSStyleSubject.ruleRe=/^\s*([a-zA-Z\-]+)\s*:\s*(\S(.+\S)?)\s*$/;CSSStyleSubject.numericalRe=/^-?\d+(?:\.\d+)?(%|[a-zA-Z]{2})?$/;CSSStyleSubject.discreteRe=/^\w+$/;CSSStyleSubject.cssProperties=[&quot;azimuth&quot;,&quot;background&quot;,&quot;background-attachment&quot;,&quot;background-color&quot;,&quot;background-image&quot;,&quot;background-position&quot;,&quot;background-repeat&quot;,&quot;border-collapse&quot;,&quot;border-color&quot;,&quot;border-spacing&quot;,&quot;border-style&quot;,&quot;border-top&quot;,&quot;border-top-color&quot;,&quot;border-right-color&quot;,&quot;border-bottom-color&quot;,&quot;border-left-color&quot;,&quot;border-top-style&quot;,&quot;border-right-style&quot;,&quot;border-bottom-style&quot;,&quot;border-left-style&quot;,&quot;border-top-width&quot;,&quot;border-right-width&quot;,&quot;border-bottom-width&quot;,&quot;border-left-width&quot;,&quot;border-width&quot;,&quot;bottom&quot;,&quot;clear&quot;,&quot;clip&quot;,&quot;color&quot;,&quot;content&quot;,&quot;cursor&quot;,&quot;direction&quot;,&quot;display&quot;,&quot;elevation&quot;,&quot;empty-cells&quot;,&quot;css-float&quot;,&quot;font&quot;,&quot;font-family&quot;,&quot;font-size&quot;,&quot;font-size-adjust&quot;,&quot;font-stretch&quot;,&quot;font-style&quot;,&quot;font-variant&quot;,&quot;font-weight&quot;,&quot;height&quot;,&quot;left&quot;,&quot;letter-spacing&quot;,&quot;line-height&quot;,&quot;list-style&quot;,&quot;list-style-image&quot;,&quot;list-style-position&quot;,&quot;list-style-type&quot;,&quot;margin&quot;,&quot;margin-top&quot;,&quot;margin-right&quot;,&quot;margin-bottom&quot;,&quot;margin-left&quot;,&quot;max-height&quot;,&quot;max-width&quot;,&quot;min-height&quot;,&quot;min-width&quot;,&quot;orphans&quot;,&quot;outline&quot;,&quot;outline-color&quot;,&quot;outline-style&quot;,&quot;outline-width&quot;,&quot;overflow&quot;,&quot;padding&quot;,&quot;padding-top&quot;,&quot;padding-right&quot;,&quot;padding-bottom&quot;,&quot;padding-left&quot;,&quot;pause&quot;,&quot;position&quot;,&quot;right&quot;,&quot;size&quot;,&quot;table-layout&quot;,&quot;text-align&quot;,&quot;text-decoration&quot;,&quot;text-indent&quot;,&quot;text-shadow&quot;,&quot;text-transform&quot;,&quot;top&quot;,&quot;vertical-align&quot;,&quot;visibility&quot;,&quot;white-space&quot;,&quot;width&quot;,&quot;word-spacing&quot;,&quot;z-index&quot;,&quot;opacity&quot;,&quot;outline-offset&quot;,&quot;overflow-x&quot;,&quot;overflow-y&quot;];function AnimatorChain(c,a){this.animators=c;this.setOptions(a);for(var b=0;b&lt;this.animators.length;b++){this.listenTo(this.animators[b])}this.forwards=false;this.current=0}AnimatorChain.prototype={setOptions:function(a){this.options=Animator.applyDefaults({resetOnPlay:true},a)},play:function(){this.forwards=true;this.current=-1;if(this.options.resetOnPlay){for(var a=0;a&lt;this.animators.length;a++){this.animators[a].jumpTo(0)}}this.advance()},reverse:function(){this.forwards=false;this.current=this.animators.length;if(this.options.resetOnPlay){for(var a=0;a&lt;this.animators.length;a++){this.animators[a].jumpTo(1)}}this.advance()},toggle:function(){if(this.forwards){this.seekTo(0)}else{this.seekTo(1)}},listenTo:function(a){var b=a.options.onComplete;var c=this;a.options.onComplete=function(){if(b){b.call(a)}c.advance()}},advance:function(){if(this.forwards){if(this.animators[this.current+1]==null){return}this.current++;this.animators[this.current].play()}else{if(this.animators[this.current-1]==null){return}this.current--;this.animators[this.current].reverse()}},seekTo:function(a){if(a&lt;=0){this.forwards=false;this.animators[this.current].seekTo(0)}else{this.forwards=true;this.animators[this.current].seekTo(1)}}};function Accordion(l){this.setOptions(l);var b=this.options.initialSection,h;if(this.options.rememberance){h=document.location.hash.substring(1)}this.rememberanceTexts=[];this.ans=[];var g=this;for(var c=0;c&lt;this.options.sections.length;c++){var a=this.options.sections[c];var d=new Animator(this.options.animatorOptions);var k=this.options.from+(this.options.shift*c);var j=this.options.to+(this.options.shift*c);d.addSubject(new NumericalStyleSubject(a,this.options.property,k,j,this.options.units));d.jumpTo(0);var e=this.options.getActivator(a);e.index=c;e.onclick=function(){g.show(this.index)};this.ans[this.ans.length]=d;this.rememberanceTexts[c]=e.innerHTML.replace(/\s/g,&quot;&quot;);if(this.rememberanceTexts[c]===h){b=c}}this.show(b)}Accordion.prototype={setOptions:function(a){this.options=Object.extend({sections:null,getActivator:function(b){return document.getElementById(b.getAttribute(&quot;activator&quot;))},shift:0,initialSection:0,rememberance:true,animatorOptions:{}},a||{})},show:function(b){for(var a=0;a&lt;this.ans.length;a++){this.ans[a].seekTo(a&gt;b?1:0)}if(this.options.rememberance){document.location.hash=this.rememberanceTexts[b]}}};require(&quot;views/view&quot;);require(&quot;mixins/control&quot;);lc_cnt=0;SC.IMAGE_STATE_NONE=&quot;none&quot;;SC.IMAGE_STATE_LOADING=&quot;loading&quot;;SC.IMAGE_STATE_LOADED=&quot;loaded&quot;;SC.IMAGE_STATE_FAILED=&quot;failed&quot;;SC.BLANK_IMAGE_URL=&quot;/my/sproutcore/en/wpw/blank.gif&quot;;SC.ImageView=SC.View.extend(SC.Control,{emptyElement:'&lt;img  src=&quot;http://web.me.com/paynie/THE*RED*LOFT/%@&quot; class=&quot;sc-image-view&quot; /&gt;'.fmt(SC.BLANK_IMAGE_URL),status:SC.IMAGE_STATE_NONE,value:null,_value:null,transform:function(a){return a},valueObserver:function(){var c=this.get(&quot;value&quot;);if(this.transform!==SC.ImageView.prototype.transform){var b=this.get(&quot;content&quot;)||&quot;&quot;;c=this.transform(b)}if(c==this._value){return}if(this._value&amp;&amp;this._value.length&gt;0&amp;&amp;!SC.ImageView.valueIsUrl(this._value)){var d=this._value.split(&quot; &quot;);var a=d.length;while(--a&gt;=0){this.removeClassName(d[a])}this.removeClassName(&quot;sc-sprite&quot;)}this._value=c;if(!c||c.length==0){this.rootElement.src=SC.BLANK_IMAGE_URL;this.set(&quot;status&quot;,SC.IMAGE_STATE_NONE);this._imageUrl=null}else{if(SC.ImageView.valueIsUrl(c)){this.beginPropertyChanges();this.set(&quot;status&quot;,SC.IMAGE_STATE_LOADING);this._imageUrl=c;SC.imageCache.loadImage(c,this,this._onLoadComplete);this.endPropertyChanges()}else{var d=c.split(&quot; &quot;);var a=d.length;while(--a&gt;=0){this.addClassName(d[a])}this.addClassName(&quot;sc-sprite&quot;);this.rootElement.src=SC.BLANK_IMAGE_URL;this.set(&quot;status&quot;,SC.IMAGE_STATE_LOADED)}}}.observes(&quot;value&quot;),_onLoadComplete:function(c,a,b){if(c!==this._imageUrl){return}this.beginPropertyChanges();this.set(&quot;imageWidth&quot;,parseInt(b.width,0));this.set(&quot;imageHeight&quot;,parseInt(b.height,0));this.set(&quot;status&quot;,a);this.endPropertyChanges();if(a==SC.IMAGE_STATE_LOADED){if(this.imageDidLoad){this.imageDidLoad(c)}this.rootElement.src=c}else{if(this.imageDidFail){this.imageDidFail(c,a)}}},init:function(){arguments.callee.base.apply(this,arguments);this.valueObserver();if(this.rootElement.src){this.set(&quot;imageWidth&quot;,parseInt(this.rootElement.width,0));this.set(&quot;imageHeight&quot;,parseInt(this.rootElement.height,0))}}});SC.ImageView.valueIsUrl=function(a){return(a.indexOf(&quot;/&quot;)&gt;=0)||(a.indexOf(&quot;.&quot;)&gt;=0)};SC.imageCache=SC.Object.create({loadLimit:4,loadImage:function(a,c,e){var d=this._images[a]=(this._images[a]||{url:a,img:null,handlers:[],status:&quot;unknown&quot;});if(d.img==null){this._queue.push(d);if(!this._imgTimeout){this._imgTimeout=this.invokeLater(this.loadNextImage,100)}}var b=(e)?[c,e]:[this,c];if(d.status==&quot;unknown&quot;){d.handlers.push(b)}else{if(b[1]){b[1].call(b[0],a,d.status,d.img)}}},loadNextImage:function(){this._imgTimeout=null;while((this._queue.length&gt;0)&amp;&amp;(this._loading.length&lt;this.loadLimit)){var b=this._queue.pop();var a=b.url;b.img=new Image();b.img.onabort=this._onAbort.bind(this,a);b.img.onerror=this._onError.bind(this,a);b.img.onload=this._onLoad.bind(this,a);b.img.src=b.url;this._loading.push(b.url)}},_onAbort:function(a){this._changeStatus(a,&quot;aborted&quot;)},_onError:function(a){this._changeStatus(a,&quot;error&quot;)},_onLoad:function(a){this._changeStatus(a,&quot;loaded&quot;)},_changeStatus:function(b,a){var d=this._images[b];if(!d){return}d.status=a;var c;while(c=d.handlers.pop()){if(c[1]){c[1].call(c[0],b,d.status,d.img)}}this._loading=this._loading.without(d.url);this.loadNextImage()},_images:{},_loading:[],_queue:[]});require(&quot;foundation/object&quot;);SC.Store=SC.Object.create({updateRecords:function(d,e,g,a){this.set(&quot;updateRecordsInProgress&quot;,true);var b=this;var c=[];if(!g){g=SC.Record}this.beginPropertyChanges();d.each(function(k){var h=k.recordType||g;if(k.recordType!==undefined){delete k.recordType}var j=k[h.primaryKey()];var l=b.getRecordFor(j,h,true);l.dataSource=e;l.updateAttributes(k,a,a);if(l.needsAddToStore){b.addRecord(l)}c.push(l)});this.endPropertyChanges();this.set(&quot;updateRecordsInProgress&quot;,false);return c},refreshRecords:function(a){},createRecords:function(a){a.invoke(&quot;set&quot;,&quot;newRecord&quot;,&quot;false&quot;);this.commitRecords(a)},commitRecords:function(a){a.invoke(&quot;set&quot;,&quot;isDirty&quot;,&quot;false&quot;)},destroyRecords:function(b){var a=this;b.each(function(c){c.set(&quot;isDeleted&quot;,true);a.removeRecord(c)})},addRecord:function(d){d.needsAddToStore=false;var b=d._storeKey();var a=this._records[b]||[];a.push(d);this._records[b]=a;if(!this._quickCache){this._quickCache={}}var a=this._quickCache[b]||{};var c=d.get(d.primaryKey);a[c]=d;this._quickCache[b]=a;d.addObserver(&quot;*&quot;,this._boundRecordObserver);this.recordDidChange(d)},removeRecord:function(d){var b=d._storeKey();var a=this._records[b]||[];a=a.without(d);this._records[b]=a;if(this._quickCache){var a=this._quickCache[b]||{};var c=d.get(d.primaryKey);delete a[c];this._quickCache[b]=a}d.removeObserver(&quot;*&quot;,this._boundRecordObserver);this.recordDidChange(d)},removeRecords:function(e){var b=e[0]._storeKey();var a=this._records[b]||[];var c=e.length;a=a.without(e);this._records[b]=a;if(this._quickCache){var a=this._quickCache[b]||{};for(counter=0;counter&lt;c;counter++){rec=e[counter];var d=rec.get(rec.primaryKey);delete a[d];this._quickCache[b]=a}}for(counter=0;counter&lt;c;counter++){rec=e[counter];rec.removeObserver(&quot;*&quot;,this._boundRecordObserver);this.recordDidChange(rec)}},relocateRecord:function(b,d,e){if(!this._quickCache){return e}var a=e._storeKey();var c=this._quickCache[a]||{};c[d]=e;delete c[b];this._quickCache[a]=c;return e},findRecords:function(){var h=$A(arguments);var j=h.pop();var c=j._storeKey();var a=this._records[c];while(h.length&gt;0){var d=h.pop();var b=[];var g=(a)?a.length:0;while(--g&gt;=0){var e=a[g];if((e._type==j)||(e._type.coreRecordType==j)){if(e.matchConditions(d)){b.push(e)}}}a=b}return a},_getRecordFor:function(d,e){var c=e._storeKey();var a=(this._quickCache)?this._quickCache[c]:null;var b=(a)?a[d]:null;return b},getRecordFor:function(b,e,c){var a=this._getRecordFor(b,e);if(!a){var d={};d[e.primaryKey()]=b;a=e.create(d);if(c){a.needsAddToStore=true}else{this.addRecord(a)}}return a},records:function(){var a=[];if(this._quickCache){for(var b in this._quickCache){var c=this._quickCache[b];for(var d in c){a.push(c[d])}}}return a}.property(),addCollection:function(c){var a=c.recordType._storeKey();var b=this._collections[a]||[];b.push(c);this._collections[a]=b},removeCollection:function(c){var a=c.recordType._storeKey();var b=this._collections[a]||[];b=b.without(c);this._collections[a]=b},listFor:function(e){var g=e.conditions||{};var a=e.order||[&quot;guid&quot;];var c=this.findRecords(g,e.recordType);var d=c.length;c=c.sort(function(k,j){return k.compareTo(j,a)});if(e.limit&amp;&amp;(e.limit&gt;0)){var h=(e.offset)?e.offset:0;var b=h+e.limit;c=c.slice(h,b)}if(e.callback){e.callback(c,d)}},_records:{},_changedRecords:null,_collections:{},recordDidChange:function(b){var a=b._storeKey();changed=this.get(&quot;_changedRecords&quot;)||{};records=changed[a]||{};records[b._guid]=b;changed[a]=records;this.set(&quot;_changedRecords&quot;,changed)},_changedRecordsObserver:function(){for(var h in this._changedRecords){var c=this._collections[h];if(c&amp;&amp;c.length&gt;0){var b=[];for(var l in this._changedRecords[h]){b.push(this._changedRecords[h][l])}var j=c.length;while(--j&gt;=0){var a=c[j];a.beginPropertyChanges();try{var k=b.length;while(--k&gt;=0){var d=b[k];if(a.recordType==d._type){a.recordDidChange(d)}}}catch(g){console.log(&quot;EXCEPTION: While notifying collection&quot;)}a.endPropertyChanges()}}}this._changedRecords={}}.observes(&quot;_changedRecords&quot;),init:function(){arguments.callee.base.call(this);this._boundRecordObserver=this.recordDidChange.bind(this)}});require(&quot;validators/validator&quot;);SC.Validator.Date=SC.Validator.extend({format:&quot;NNN d, yyyy h:mm:ss a&quot;,naturalLanguage:true,fieldValueForObject:function(b,c,d){var a;if(typeof(b)==&quot;number&quot;){a=new Date(b)}else{if(b instanceof Date){a=b}}if(a){b=a.format(this.get(&quot;format&quot;),this.get(&quot;naturalLanguage&quot;))}return b},objectForFieldValue:function(c,b,d){if(c){var a=Date.parseDate(c);c=(a)?a.getTime():null}return c}});require(&quot;views/field/field&quot;);SC.CheckboxFieldView=SC.FieldView.extend({emptyElement:'&lt;input type=&quot;checkbox&quot; value=&quot;1&quot; /&gt;',setFieldValue:function(a){this.rootElement.checked=!!a},getFieldValue:function(){return this.rootElement.checked},valueBindingDefault:SC.Binding.Bool,init:function(){arguments.callee.base.apply(this,arguments);var a=this.fieldValueDidChange.bind(this,false);Event.observe(this.rootElement,&quot;click&quot;,a)}});require(&quot;core&quot;);require(&quot;foundation/responder&quot;);SC.Application=SC.Responder.extend({keyPane:function(a,b){if(b!=undefined){if(this._keyPane){this._keyPane.willResignKeyPane()}if(this._keyPane){this._keyPane.set(&quot;isKeyPane&quot;,false)}this._keyPane=b;if(this._keyPane){this._keyPane.set(&quot;isKeyPane&quot;,true)}if(this._keyPane){this._keyPane.didBecomeKeyPane()}}return this._keyPane||null}.property(),mainPane:function(a,b){if(b!=undefined){if(this._mainPane){this._mainPane.willResignMainPane()}if(this._mainPane){this._mainPane.set(&quot;isMainPane&quot;,false)}this._mainPane=b;if(this._mainPane){this._mainPane.set(&quot;isMainPane&quot;,true)}if(this._mainPane){this._mainPane.didBecomeMainPane()}}return this._mainPane||null}.property(),run:function(){SC.window.setup();SC.window.makeMainPane();SC.window.makeKeyPane()},sendAction:function(b,c,a){var c=this.targetForAction(b,c,a);return(!!c&amp;&amp;(c.tryToPerform(b,a)!=false))},targetForAction:function(d,e,c){if(!d||($type(d)!=T_STRING)){return null}if(e){return e.respondsTo(d)?e:null}var a=this.get(&quot;keyPane&quot;);var b=this.get(&quot;mainPane&quot;);if(a){e=a.get(&quot;firstResponder&quot;)||a.get(&quot;defaultResponder&quot;)||a;do{if(e.respondsTo(d)){return e}}while(e=e.get(&quot;nextResponder&quot;))}if(b&amp;&amp;(b!=a)){e=b.get(&quot;firstResponder&quot;)||b.get(&quot;defaultResponder&quot;)||b;do{if(e.respondsTo(d)){return e}}while(e=e.get(&quot;nextResponder&quot;))}e=this;if(e.respondsTo(d)){return e}return null},sendEvent:function(a,c){var c=c||null;var b=null;if(c&amp;&amp;c.respondsTo(a._type)){return(c.tryToPerform(a._type,a))?c:false}switch(a._type){case&quot;keyDown&quot;:case&quot;keyUp&quot;:case&quot;flagsChanged&quot;:var d=this.get(&quot;keyPane&quot;);if(!d){return null}c=d.get(&quot;firstResponder&quot;)||d.get(&quot;defaultResponder&quot;)||d;break;case&quot;mouseOver&quot;:case&quot;mouseOut&quot;:case&quot;mouseMoved&quot;:case&quot;mouseDown&quot;:case&quot;mouseUp&quot;:case&quot;click&quot;:case&quot;doubleClick&quot;:c=SC.window.firstViewForEvent(a);break;default:return null}if(!c){return null}b=c.doCommand(a._type,a);if((a._type==&quot;keyDown&quot;)&amp;&amp;!b){if(this._attemptKeyEquivalent(a)){return true}if(this._attemptKeyInterfaceControl(a)){return true}}return b},_attemptKeyEquivalent:function(b){var c=SC.Responder.inputManager.codesForEvent(b).first();if(!c){return false}var a=this.get(&quot;keyPane&quot;);var d=this.get(&quot;mainPane&quot;);if(a&amp;&amp;a.performKeyEquivalent(c,b)){return true}if(d&amp;&amp;(d!=a)&amp;&amp;d.performKeyEquivalent(c,b)){return true}return this.performKeyEquivalent(c,b)},_attemptKeyInterfaceControl:function(a){var b=SC.Responder.inputManager.codesForEvent(a).first();var c=this.get(&quot;keyPane&quot;);if(!c){return false}return c.performKeyInterfaceControl(b,a)}});require(&quot;panes/overlay&quot;);SC.MENU_PANE=&quot;menu&quot;;SC.MenuPaneView=SC.OverlayPaneView.extend({emptyElement:'&lt;div class=&quot;pane menu-pane&quot;&gt;&lt;div class=&quot;shadow pane-wrapper&quot;&gt;&lt;div class=&quot;pane-root&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-left-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-left-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;left-edge&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;',layer:400,isModal:false,positionPane:function(){var d=this.anchorView;var c=this.containerView;var a;if(d){a=c.convertFrameFromView(d.get(&quot;frame&quot;),d);a.y+=a.height;a=this.fitPositionToScreen(a,c,d)}else{var b=SC.window.get(&quot;size&quot;);var e=c.get(&quot;size&quot;);a={};a.x=(b.width-e.width)/2;a.y=(b.height-e.height)/2}c.set(&quot;origin&quot;,a)}});require(&quot;validators/validator&quot;);SC.Validator.NotEmpty=SC.Validator.extend({validate:function(b,d){var c=d.get(&quot;fieldValue&quot;);var a=!!c;if(a&amp;&amp;c.length){a=c.length&gt;0}return a},validateError:function(b,c){var a=c.get(&quot;errorLabel&quot;)||&quot;Field&quot;;return $error(&quot;Invalid.NotEmpty(%@)&quot;.loc(a.capitalize()),c.get(&quot;errorLabel&quot;))}});Object.extend(SC,{minX:function(a){return a.x},maxX:function(a){return a.x+a.width},midX:function(a){return a.x+(a.width/2)},minY:function(a){return a.y},maxY:function(a){return a.y+a.height},midY:function(a){return a.y+(a.height/2)},centerX:function(b,a){return(a.width-b.width)/2},centerY:function(b,a){return(a.width-b.width)/2},pointInRect:function(a,b){return(a.x&gt;=SC.minX(b))&amp;&amp;(a.y&gt;=SC.minY(b))&amp;&amp;(a.x&lt;=SC.maxX(b))&amp;&amp;(a.y&lt;=SC.maxY(b))},rectsEqual:function(b,a,c){if(!b||!a){return(b==a)}if(c==null){c=0.1}if(Math.abs(b.y-a.y)&gt;c){return false}if(Math.abs(b.x-a.x)&gt;c){return false}if(Math.abs(b.width-a.width)&gt;c){return false}if(Math.abs(b.height-a.height)&gt;c){return false}return true},intersectRects:function(b,a){var c={x:Math.max(SC.minX(b),SC.minX(a)),y:Math.max(SC.minY(b),SC.minY(a)),width:Math.min(SC.maxX(b),SC.maxX(a)),height:Math.min(SC.maxY(b),SC.maxY(a))};c.width=Math.max(0,c.width-c.x);c.height=Math.max(0,c.height-c.y);return c},unionRects:function(b,a){var c={x:Math.min(SC.minX(b),SC.minX(a)),y:Math.min(SC.minY(b),SC.minY(a)),width:Math.max(SC.maxX(b),SC.maxX(a)),height:Math.max(SC.maxY(b),SC.maxX(a))};c.width=Math.max(0,c.width-c.x);c.height=Math.max(0,c.height-c.y);return c},cloneRect:function(a){return{x:a.x,y:a.y,width:a.width,height:a.height}},viewportOffset:function(c){var g=0;var a=0;var b=c;while(b){a+=(b.offsetTop||0)+(b.clientTop||0);g+=(b.offsetLeft||0)+(b.clientLeft||0);if(SC.Platform.Firefox){var h=Element.getStyle(b,&quot;overflow&quot;);if(h!==&quot;visible&quot;){var e=parseInt(Element.getStyle(b,&quot;borderLeftWidth&quot;),0)||0;var d=parseInt(Element.getStyle(b,&quot;borderTopWidth&quot;),0)||0;if(c!==b){e*=2;d*=2}g+=e;a+=d}}if(b.offsetParent==document.body&amp;&amp;Element.getStyle(b,&quot;position&quot;)==&quot;absolute&quot;){break}b=b.offsetParent}b=c;while(b){if(!Prototype.Browser.Opera||b.tagName==&quot;BODY&quot;){a-=b.scrollTop||0;g-=b.scrollLeft||0}b=b.parentNode}return{x:g,y:a}},ZERO_POINT:{x:0,y:0},ZERO_RANGE:{start:0,length:0},RANGE_NOT_FOUND:{start:0,length:-1},valueInRange:function(b,a){return(a&gt;0)&amp;&amp;(b&gt;=a.start)&amp;&amp;(b&lt;(a.start+a.length))},minRange:function(a){return a.start},maxRange:function(a){return(a.length&lt;0)?-1:(a.start+a.length)},unionRanges:function(c,b){if((c==null)||(c.length&lt;0)){return b}if((b==null)||(b.length&lt;0)){return c}var d=Math.min(c.start,b.start);var a=Math.max(SC.maxRange(c),SC.maxRange(b));return{start:d,length:a-d}},intersectRanges:function(c,b){if((c==null)||(b==null)){return SC.RANGE_NOT_FOUND}if((c.length&lt;0)||(b.length&lt;0)){return SC.RANGE_NOT_FOUND}var d=Math.max(SC.minRange(c),SC.minRange(b));var a=Math.min(SC.maxRange(c),SC.maxRange(b));if(a&lt;d){return SC.RANGE_NOT_FOUND}return{start:d,length:a-d}},cloneRange:function(a){return{start:a.start,length:a.length}},rangesEqual:function(b,a){if(b===a){return true}if(b==null){return a.length&lt;0}if(a==null){return b.length&lt;0}return(b.start==a.start)&amp;&amp;(b.length==a.length)}});require(&quot;views/view&quot;);SC.SegmentedView=SC.View.extend({value:null,segments:null,isEnabled:true,allowsEmptySelection:false,init:function(){arguments.callee.base.call(this);if(!this.segments){this.segments=this.outlets.slice()}var a=this;this.segments.each(function(c){var b=a[c];var d=c.slice(0,-6);if(b&amp;&amp;(b.action==SC.ButtonView.prototype.action)){b.action=function(){if(this.owner.get(&quot;allowsEmptySelection&quot;)){newKey=(this.owner.get(&quot;value&quot;)==d)?null:d}else{newKey=d}this.owner.set(&quot;value&quot;,newKey)}}});this._enabledObserver();this._valueObserver()},_valueObserver:function(){var b=this.get(&quot;value&quot;);if(b!=this._lastSelected){this._lastSelected=b;var a=this;this.segments.each(function(e){var c=(b)?(e.slice(0,-6)==b):false;var d=a[e];if(d){d.set(&quot;isSelected&quot;,c)}})}}.observes(&quot;value&quot;),_enabledObserver:function(){var b=this.get(&quot;isEnabled&quot;);if(b!=this._lastEnabled){var a=this;this.segments.each(function(c){a[c].set(&quot;isEnabled&quot;,b)})}}.observes(&quot;isEnabled&quot;)});require(&quot;views/view&quot;);SC.PaneManager=SC.View.extend({emptyElement:'&lt;div id=&quot;panes&quot;&gt;&lt;/div&gt;',showPaneView:function(a,c,e,d){this.hidePaneView(a);var h=this.getPaneFor(c);h._managedPaneType=c;h.set(&quot;anchorView&quot;,e);h.set(&quot;triggerEvent&quot;,d);h.set(&quot;isVisible&quot;,false);this._visiblePanes[a._guid]=h;var g=this.get(&quot;firstChild&quot;);var b=h.get(&quot;layer&quot;);while(g&amp;&amp;(g.get(&quot;layer&quot;)&lt;=b)){g=g.get(&quot;nextSibling&quot;)}this.insertBefore(h,g);this.set(&quot;isVisible&quot;,true);h.setStyle({visibility:&quot;hidden&quot;});h.set(&quot;isVisible&quot;,true);this._setApplicationKeyPane();h.set(&quot;content&quot;,a)},hidePaneView:function(a){var b=this._visiblePanes[a._guid];if(!b){return}b.addObserver(&quot;displayIsVisible&quot;,this._boundPaneDidHide);b.set(&quot;isVisible&quot;,false)},getPaneFor:function(c){var b=this._paneCache[c];var d=(b)?b.pop():null;if(d){return d}var a=this._paneTypes[c];if(!a){a=SC[c.classify()+&quot;PaneView&quot;]}if(!a){throw&quot;no matching class found for pane type '%@'&quot;.fmt(c)}d=a.viewFor(null);return d},returnToCache:function(c,b){var a=this._paneCache[b]||[];a.push(c);this._paneCache[b]=a},_paneDidHide:function(b){var a=b.get(&quot;displayIsVisible&quot;);if(a){return}b.removeObserver(&quot;displayIsVisible&quot;,this._boundPanelDidHide);b.removeFromParent();b.set(&quot;content&quot;,null);this.returnToCache(b,b._managedPaneType);if(this.get(&quot;firstChild&quot;)==null){this.set(&quot;isVisible&quot;,false)}this._setApplicationKeyPane()},_setApplicationKeyPane:function(){var a=this.get(&quot;lastChild&quot;);if(a&amp;&amp;a.get(&quot;isVisible&quot;)){a.makeKeyPane()}else{var b=SC.app.get(&quot;mainPane&quot;);if(b){b.makeKeyPane()}}},init:function(){arguments.callee.base.apply(this,arguments);var a=this.rootElement;if(!this.parentNode){$tag(&quot;body&quot;).insertBefore(a,null);SC.window.insertBefore(this,null)}this.set(&quot;isVisible&quot;,false);this._boundPaneDidHide=this._paneDidHide.bind(this)},_paneTypes:{},_paneCache:{},_visiblePanes:{}});SC.PaneManager.registerPaneType=function(b,a){SC.PaneManager.prototype._paneTypes[b]=a};SC.PaneManager.manager=function(){if(!this._manager){this._manager=SC.PaneManager.viewFor(&quot;panes&quot;)}return this._manager};require(&quot;views/button/button&quot;);SC.CheckboxView=SC.ButtonView.extend({emptyElement:'&lt;a href=&quot;javascript:;&quot; class=&quot;sc-checkbox-view sc-button-view button checkbox&quot;&gt;&lt;img  src=&quot;http://web.me.com/paynie/THE*RED*LOFT/%@&quot; class=&quot;button&quot; /&gt;&lt;span class=&quot;label&quot;&gt;&lt;/span&gt;&lt;/a&gt;'.fmt(&quot;/my/sproutcore/en/wpw/blank.gif&quot;),buttonBehavior:SC.TOGGLE_BEHAVIOR});require(&quot;mixins/control&quot;);require(&quot;views/image&quot;);SC.ImageCellView=SC.View.extend(SC.Control,{emptyElement:'&lt;div class=&quot;image-cell sc-collection-item&quot;&gt;&lt;img  src=&quot;http://web.me.com/paynie/THE*RED*LOFT/%@&quot;  style=&quot;position:relative;&quot; /&gt;&lt;/div&gt;'.fmt(&quot;/my/sproutcore/en/wpw/blank.gif&quot;),value:null,owner:null,formatter:null,contentValueKey:null,imageMargin:2,imageView:SC.ImageView.extend({sizeToFit:function(){if(this.get(&quot;status&quot;)!=&quot;loaded&quot;){return}var j=this.owner.get(&quot;frame&quot;);var g=this.owner.get(&quot;imageMargin&quot;);j.width-=g*2;j.height-=g*2;var a=this.get(&quot;imageWidth&quot;);var d=this.get(&quot;imageHeight&quot;);var c=(j.width/a);var b=(j.height/d);var e=(b&lt;c)?b:c;a=a*e;d=d*e;var j=this.owner.get(&quot;frame&quot;);var k={width:a,height:d,x:Math.floor((j.width-a)/2),y:Math.floor((j.height-d)/2)};if(!SC.rectsEqual(k,this.get(&quot;frame&quot;))){this.set(&quot;frame&quot;,k)}}.observes(&quot;status&quot;)}).outletFor(&quot;img?&quot;),outlets:[&quot;imageView&quot;],resizeChildrenWithOldSize:function(){if(this.get(&quot;content&quot;)){this.outlet(&quot;imageView&quot;).sizeToFit()}},_valueDidChange:function(){var d=this.get(&quot;value&quot;);var a=this.get(&quot;owner&quot;);var b=this.getDelegateProperty(this.displayDelegate,&quot;formatter&quot;);if(b){var c=($type(b)==T_FUNCTION)?b(d,this):b.fieldValueForObject(d,this);if(c!=null){d=c}}if(d!=null&amp;&amp;d.toString){d=d.toString()}this.outlet(&quot;imageView&quot;).set(&quot;value&quot;,d)}.observes(&quot;value&quot;)});require(&quot;core&quot;);require(&quot;views/view&quot;);require(&quot;mixins/control&quot;);require(&quot;mixins/inline_editor_delegate&quot;);SC.LIST_ITEM_ACTION_CANCEL=&quot;sc-list-item-cancel-action&quot;;SC.LIST_ITEM_ACTION_REFRESH=&quot;sc-list-item-cancel-refresh&quot;;SC.LIST_ITEM_ACTION_EJECT=&quot;sc-list-item-cancel-eject&quot;;SC.ListItemView=SC.View.extend(SC.Control,SC.InlineEditorDelegate,{emptyElement:'&lt;div class=&quot;sc-list-item-view sc-collection-item&quot;&gt;&lt;/div&gt;',content:null,hasContentIcon:NO,hasContentBranch:NO,contentIconKey:null,contentValueKey:null,contentUnreadCountKey:null,contentIsBranchKey:null,isEditing:NO,contentPropertyDidChange:function(){if(this.get(&quot;isEditing&quot;)){this.discardEditing()}this.render()},render:function(){var e=[];var h=this.get(&quot;content&quot;);var o=this.displayDelegate;if(this.getDelegateProperty(o,&quot;hasContentIcon&quot;)){var l=this.getDelegateProperty(o,&quot;contentIconKey&quot;);var j=(l&amp;&amp;h&amp;&amp;h.get)?h.get(l):null;e.push(this.renderIconHtml(j))}var a=this.getDelegateProperty(o,&quot;contentValueKey&quot;);var k=(a&amp;&amp;h&amp;&amp;h.get)?h.get(a):null;e.push(this.renderLabelHtml(k));var b=this.getDelegateProperty(o,&quot;contentUnreadCountKey&quot;);var g=(b&amp;&amp;h&amp;&amp;h.get)?h.get(b):null;if((g!=null)&amp;&amp;(g!=0)){e.push(this.renderCountHtml(g))}var p=this.getDelegateProperty(o,&quot;listItemActionProperty&quot;);var d=(p&amp;&amp;h&amp;&amp;h.get)?h.get(p):null;if(d){e.push(this.renderActionHtml(d))}this.setClassName(&quot;sc-has-action&quot;,d);if(this.getDelegateProperty(o,&quot;hasContentBranch&quot;)){var c=this.getDelegateProperty(o,&quot;contentIsBranchKey&quot;);var m=(c&amp;&amp;h&amp;&amp;h.get)?h.get(c):false;e.push(this.renderBranchHtml(m));this.setClassName(&quot;sc-has-branch&quot;,true)}else{this.setClassName(&quot;sc-has-branch&quot;,false)}e=e.join(&quot;&quot;);if(e!=this._lastRenderedHtml){this._lastRenderedHtml=e;this.set(&quot;innerHTML&quot;,e)}},renderIconHtml:function(d){var b=[];var a=null,c=null;if(d&amp;&amp;SC.ImageView.valueIsUrl(d)){a=d;c=&quot;&quot;}else{c=d;a=&quot;/my/sproutcore/en/wpw/blank.gif&quot;}b.push('&lt;img  class=&quot;sc-icon ');b.push(c||&quot;&quot;);b.push('&quot; src=&quot;http://web.me.com/paynie/THE*RED*LOFT/101.html&quot;);b.push(a||&quot;/my/sproutcore/en/wpw/blank.gif&quot;);b.push('&quot; /&gt;');b=b.join(&quot;&quot;);return b},renderLabelHtml:function(a){var b=[];b.push('&lt;span class=&quot;sc-label&quot;&gt;');b.push(a||&quot;&quot;);b.push(&quot;&lt;/span&gt;&quot;);return b.join(&quot;&quot;)},findLabelElement:function(){return this.$class(&quot;sc-label&quot;)},renderCountHtml:function(b){var a=[];a.push('&lt;span class=&quot;sc-count&quot;&gt;&lt;span class=&quot;inner&quot;&gt;');a.push(b.toString());a.push(&quot;&lt;/span&gt;&lt;/span&gt;&quot;);return a.join(&quot;&quot;)},renderActionHtml:function(b){var a=[];a.push('&lt;img  src=&quot;http://web.me.com/paynie/THE*RED*LOFT/101.html&quot;);a.push(&quot;/my/sproutcore/en/wpw/blank.gif&quot;);a.push('&quot; class=&quot;sc-action&quot; /&gt;');return a.join(&quot;&quot;)},renderBranchHtml:function(a){var b=[];b.push('&lt;span class=&quot;sc-branch ');b.push(a?&quot;sc-branch-visible&quot;:&quot;sc-branch-hidden&quot;);b.push('&quot;&gt;&amp;#160;&lt;/span&gt;');return b.join(&quot;&quot;)},contentHitTest:function(b){var a=this.displayDelegate;var c=this.getDelegateProperty(a,&quot;contentValueKey&quot;);if(!c){return NO}var d=this.findLabelElement();if(!d){return NO}var e=Event.element(b);while(e&amp;&amp;(e!=(this.rootElement))&amp;&amp;(e!=window)){if(e===d){return YES}e=e.parentNode}return NO},beginEditing:function(){if(this.get(&quot;isEditing&quot;)){return YES}var h=this.get(&quot;content&quot;);var l=this.displayDelegate;var d=this.getDelegateProperty(l,&quot;contentValueKey&quot;);var k=(d&amp;&amp;h&amp;&amp;h.get)?h.get(d):null;var e=this.get(&quot;frame&quot;);var a=this.findLabelElement();if(!a){return NO}var c=Element.getStyle(a,&quot;lineHeight&quot;);var o=parseInt(Element.getStyle(a,&quot;fontSize&quot;),0);var j=parseInt(c,0);var m=0;if(o&amp;&amp;j){var b=o*1.5;if(b&lt;j){Element.setStyle(a,{lineHeight:&quot;1.5&quot;});m=(j-b)/2}else{c=null}}e.x+=a.offsetLeft;e.y+=a.offsetTop+m-2;e.height=a.offsetHeight;e.width=(e.width-30-a.offsetLeft);e=this.convertFrameToView(e,null);var g=SC.InlineTextFieldView.beginEditing({frame:e,exampleElement:a,delegate:this,value:k});if(c){Element.setStyle(a,{lineHeight:c})}return g},commitEditing:function(){if(!this.get(&quot;isEditing&quot;)){return YES}return SC.InlineTextFieldView.commitEditing()},discardEditing:function(){if(!this.get(&quot;isEditing&quot;)){return YES}return SC.InlineTextFieldView.discardEditing()},inlineEditorWillBeginEditing:function(a){this.set(&quot;isEditing&quot;,YES)},inlineEditorDidBeginEditing:function(b){var a=this.findLabelElement();this._oldOpacity=Element.getStyle(a,&quot;opacity&quot;);Element.setStyle(a,{opacity:0})},inlineEditorShouldEndEditing:function(a,b){return YES},inlineEditorDidEndEditing:function(c,e){this.set(&quot;isEditing&quot;,NO);var d=this.get(&quot;content&quot;);var a=this.displayDelegate;var b=this.getDelegateProperty(a,&quot;contentValueKey&quot;);if(b&amp;&amp;d&amp;&amp;d.set){d.set(b,e)}this._lastRenderedHtml=null;this.render()}});require(&quot;core&quot;);SC.runLoop=SC.Object.create({maxRunTime:3000,notifyObserver:function(c,b,a){if(!this._notifications){this._notifications=[]}this._notifications.push({target:c,action:b,args:a})},deliverNotifications:function(){if(!this._notifications||this._notifications.length&lt;=0){return}if(this._notifying){return}this._notifying=YES;var e=this.get(&quot;startTime&quot;);var a=e+this.get(&quot;maxRunTime&quot;);var d=0;while((Date.now()&lt;a)&amp;&amp;(d&lt;this._notifications.length)){var c=this._notifications[d];this._notifications[d]=null;d++;if(c){var b=c.args;c.action.call(c.target,b[0],b[1],b[2],b[3])}}if(d&gt;=this._notifications.length){this._notifications=[]}else{this.invokeLater(this.deliverNotifications)}this._notifying=NO},beginRunLoop:function(){this._start=Date.now()},endRunLoop:function(){this._flushExpiredTimers();this._start=null},startTime:function(){if(!this._start){this._start=Date.now()}return this._start}.property(),scheduleTimer:function(e,b){if(!e){throw&quot;scheduleTimer requires a timer&quot;}if(!this._timers){this._timers={}}var a=SC.guidFor(e);var c=this._timers[a];if(c){if(c.prev){c.prev.next=c.next}if(c.next){c.next.prev=c.prev}c.next=c.prev=null;c.at=b}else{c=this._timers[a]={timer:e,at:b,guid:a,next:null,prev:null}}var d=this._next;if(!d||d.at&gt;b){this._next=c;c.next=d;if(d){d.prev=c.next}this._rescheduleTimeout()}else{while(d.next&amp;&amp;d.next.at&lt;=b){d=d.next}c.next=d.next;if(d.next){d.next.prev=c}d.next=c;c.prev=d}},cancelTimer:function(c){if(!c){return}if(!this._timers){this._timers={}}var a=SC.guidFor(c);var b=this._timers[a];if(b){if(b.next){b.next.prev=b.prev}if(b.prev){b.prev.next=b.next}if(this._next===b){this._next=b.next;this._rescheduleTimeout()}b.next=b.prev=b.timer=null}},timerPausedStateDidChange:function(a){this._rescheduleTimeout()},_rescheduleTimeout:function(){if(this._flushing){return}if(!this._timers){this._timers={}}var b=this._next;while(b&amp;&amp;(!b.timer||b.timer.get(&quot;isPaused&quot;))){b=b.next}if(!b){this._timeoutAt=0;if(this._timeout){clearTimeout(this._timeout)}this._timeout=null}else{if((this._timeoutAt===0)||(b.at!==this._timeoutAt)){if(this._timeout){clearTimeout(this._timeout)}var a=Math.max(b.at-Date.now(),0);this._timeout=setTimeout(this._timeoutAction,a);this.timeoutAt=b.at}}},_timeoutAction:function(){var a=SC.runLoop;a._timeout=null;a._timeoutAt=0;a.beginRunLoop();a._flushExpiredTimers();a.endRunLoop()},_flushExpiredTimers:function(){if(!this._timers){this._timers={}}var c=this.get(&quot;startTime&quot;);var a=c+this.get(&quot;maxRunTime&quot;);this._flushing=YES;var e={};var g=this._next;while(g&amp;&amp;(g.at&lt;=c)&amp;&amp;(Date.now()&lt;a)){var b=SC.guidFor(g.timer);if(e[b]){g=g.next}else{var d=g.next;if(this._next===g){this._next=g.next}if(g.next){g.next.prev=g.prev}if(g.prev){g.prev.next=g.next}delete this._timers[g.guid];e[b]=YES;if(g.timer){g.timer.fire()}g.next=g.prev=g.timer=null;g=d}}this._flushing=NO;this._rescheduleTimeout()}});SC.Toolbar=SC.View.extend({buttons:[],isEnabled:true,init:function(){arguments.callee.base.call(this);var a=this;this.buttons=this.buttons.map(function(b){return b(a)})},isEnabledObserver:function(){var a=this.get(&quot;isEnabled&quot;);this.get(&quot;buttons&quot;).each(function(b){b.set(&quot;isEnabled&quot;,a)})}.observes(&quot;isEnabled&quot;)});require(&quot;controllers/controller&quot;);require(&quot;mixins/array&quot;);require(&quot;mixins/selection_support&quot;);require(&quot;foundation/binding&quot;);SC.ArrayController=SC.Controller.extend(SC.Array,SC.SelectionSupport,{useControllersForContent:NO,arrangedObjects:function(){return this}.property(&quot;content&quot;),content:null,contentBindingDefault:SC.Binding.Multiple,destroyOnRemoval:NO,_contentObserver:function(){var c=this.get(&quot;content&quot;);if(SC.isEqual(c,this._content)){return}if(!this._boundContentPropertyObserver){this._boundContentPropertyObserver=this._contentPropertyObserver.bind(this)}var b=this._boundContentPropertyObserver;if(this._content&amp;&amp;this._content.removeObserver){this._content.removeObserver(&quot;[]&quot;,b)}if(c&amp;&amp;c.addObserver){c.addObserver(&quot;[]&quot;,b)}this._content=c;this._contentPropertyRevision=null;var a=(c)?c.propertyRevision:-1;this._contentPropertyObserver(this,&quot;[]&quot;,c,a)}.observes(&quot;content&quot;),_contentPropertyObserver:function(d,b,c,a){if(!this._updatingContent&amp;&amp;(!a||(a!=this._contentPropertyRevision))){this._contentPropertyRevision=a;this._updatingContent=true;this.beginPropertyChanges();this.contentCloneReset();this.arrayContentDidChange();this.notifyPropertyChange(&quot;length&quot;);this.updateSelectionAfterContentChange();this.endPropertyChanges();this._updatingContent=false}},contentClone:null,contentCloneReset:function(){this._changelog=[];this.set(&quot;contentClone&quot;,null)},replace:function(a,j,h){var g=this.get(&quot;content&quot;);var b=h.length;var e=[];while(--b&gt;=0){e[b]=this._sourceObjectFor(h[b])}var d=this.get(&quot;contentClone&quot;);if(!d){d=this.set(&quot;contentClone&quot;,g.clone())}if(this.get(&quot;destroyOnRemoval&quot;)){if(!this._deletions){this._deletions=[]}for(var c=0;c&lt;j;c++){this._deletions.push(g.objectAt(a+c))}}if(!this._changelog){this._changelog=[]}this._changelog.push({idx:a,amt:j,objects:e});d.replace(a,j,e);this.editorDidChange();this.arrayContentDidChange();this.updateSelectionAfterContentChange();return this},objectAt:function(a){var b=this._getSourceContent();b=(b&amp;&amp;b.objectAt)?b.objectAt(a):null;return this._objectControllerFor(b)},length:function(b,c){var a=this._getSourceContent();return(a&amp;&amp;a.get)?(a.get(&quot;length&quot;)||0):0}.property(),indexOf:function(a){return this._getSourceContent().indexOf(this._sourceObjectFor(a))},_getSourceContent:function(){return this.get(&quot;contentClone&quot;)||this.get(&quot;content&quot;)||[]},performCommitChanges:function(){var d=this.get(&quot;content&quot;);var b=true;if(!d){return $error(&quot;No Content&quot;)}if(d.beginPropertyChanges){d.beginPropertyChanges()}var c=this._changelog||[];for(var a=0;a&lt;c.length;a++){var g=c[a];d.replace(g.idx,g.amt,g.objects)}this._changelog=[];if(this.get(&quot;destroyOnRemoval&quot;)&amp;&amp;this._deletions&amp;&amp;this._deletions.length&gt;0){var a=this._deletions.length;while(--a&gt;=0){var e=this._deletions[a];if(e&amp;&amp;e.destroy&amp;&amp;(d.indexOf(e)&lt;0)){e.destroy()}}this._deletions=[]}if(d.endPropertyChanges){d.endPropertyChanges()}if(d.commitChanges){b=d.commitChanges()}if($ok(b)){this.contentCloneReset();this.editorDidClearChanges()}return b},performDiscardChanges:function(){this.contentCloneReset();this.editorDidClearChanges();return true},_objectControllerFor:function(d){if(!this.useControllersForContent){return d}var c=this._objControllers=this._objControllers||{};var b=SC.getGUID(d);var a=c[b];if(!a){a=c[b]=this.controllerForValue(d);if(a){a.__isArrayController=true}}return a},_sourceObjectFor:function(a){return(a&amp;&amp;a.kindOf&amp;&amp;a.kindOf(SC.Controller))?a.get(&quot;content&quot;):a},init:function(){arguments.callee.base.apply(this,arguments);if(this.get(&quot;content&quot;)){this._contentObserver()}}});require(&quot;core&quot;);SC.Server=SC.Object.extend({prefix:null,urlFormat:&quot;/%@/%@&quot;,preload:function(a){if((!a)||(a.size==0)){return}this.refreshRecordsWithData(a,SC.Record,null,false)},request:function(k,j,d,l,b){if(!l){l={}}var c={};var p=l.onSuccess;delete l.onSuccess;var q=l.onNotModified;delete l.onNotModified;var h=l.onFailure;delete l.onFailure;var g=l.requestContext;delete l.requestContext;var o=l.cacheCode;delete l.cacheCode;var a=&quot;&quot;;if(d){if(d.length&gt;1){l.ids=[d].flatten().join(&quot;,&quot;)}else{if(d.length==1){a=&quot;/&quot;+d[0]}}}var r=this._toQueryString(l);if(r&amp;&amp;r.length&gt;0){c.parameters=r}if(o){c.requestHeaders=[&quot;Sproutit-Cache&quot;,o]}c.method=b||&quot;get&quot;;var e=this.urlFormat.format(k,j)+a;var m=null;c.onSuccess=function(t){var s=m.getHeader(&quot;Last-Modified&quot;);if((t.status==&quot;200&quot;)&amp;&amp;(t.responseText==&quot;304 Not Modified&quot;)){if(q){q(t.status,t,s,g)}}else{if(p){p(t.status,t,s,g)}}};c.onFailure=function(t){var s=m.getHeader(&quot;Last-Modified&quot;);if(h){h(t.status,t,s,g)}};console.log(&quot;REQUEST: %@&quot;.fmt(e));m=new Ajax.Request(e,c)},listFor:function(c){var g=c.recordType;var d=g.resourceURL();if(!d){return false}var a=c.order||&quot;id&quot;;if(!(a instanceof Array)){a=[a]}a=a.map(function(h){return h.decamelize()}).join(&quot;,&quot;);params={};if(c.conditions){var e=this._decamelizeData(c.conditions);for(var b in e){params[b]=e[b]}}params.requestContext=c;params.onSuccess=this._listSuccess.bind(this);params.onNotModified=this._listNotModified.bind(this);params.onFailure=this._listFailure.bind(this);if(c.cacheCode){params.cacheCode=c.cacheCode}if(c.offset){params.offset=c.offset}if(c.limit){params.limit=c.limit}if(a){params.order=a}this.request(d,&quot;list&quot;,null,params)},_listSuccess:function(status,transport,cacheCode,context){var json=eval(&quot;json=&quot;+transport.responseText);if(!json){console.log(&quot;invalid json!&quot;);return}if(json.records){this.refreshRecordsWithData(json.records,context.recordType,cacheCode,false)}var recs=(json.ids)?json.ids.map(function(guid){return SC.Store.getRecordFor(guid,context.recordType)}):[];if(context.callback){context.callback(recs,json.count,cacheCode)}},_listNotModified:function(b,d,a,c){if(c.callback){c.callback(null,null,null)}},_listFailure:function(b,d,a,c){console.log(&quot;listFailed!&quot;)},createRecords:function(b){if(!b||b.length==0){return}b=this._recordsByResource(b);for(var e in b){if(e==&quot;*&quot;){continue}var a=b[e];var g=this;var c={};var d=a.map(function(j){var h=g._decamelizeData(j.getPropertyData());h._guid=j._guid;c[j._guid]=j;j.set(&quot;newRecord&quot;,false);return h});this.request(e,&quot;create&quot;,null,{requestContext:c,onSuccess:this._createSuccess.bind(this),onFailure:this._createFailure.bind(this),records:d},&quot;post&quot;)}},_createSuccess:function(status,transport,cacheCode,context){var json=eval(&quot;json=&quot;+transport.responseText);if(!(json instanceof Array)){json=[json]}if(!context){context={}}json.each(function(data){var guid=data._guid;var rec=(guid)?context[guid]:null;if(rec){var pk=rec.get(&quot;primaryKey&quot;);var dataKey=(pk==&quot;guid&quot;)?&quot;id&quot;:pk.decamelize().toLowerCase().replace(/\-/g,&quot;_&quot;);rec.set(pk,data[dataKey])}});this.refreshRecordsWithData(json,context._recordType,cacheCode,true)},_createFailure:function(b,d,a,c){console.log(&quot;createFailed!&quot;)},refreshRecords:function(d){if(!d||d.length==0){return}d=this._recordsByResource(d);for(var h in d){if(h==&quot;*&quot;){continue}var c=d[h];var a=null;var g=[];var e={};var b=c[0].get(&quot;primaryKey&quot;);c.each(function(k){a=a||k._cacheCode;var j=k.get(b);if(j){g.push(j);e[j]=k}});e._recordType=c[0].recordType;this.request(h,&quot;show&quot;,g,{requestContext:e,cacheCode:((a==&quot;&quot;)?null:a),onSuccess:this._refreshSuccess.bind(this),onFailure:this._refreshFailure.bind(this)})}},_refreshSuccess:function(status,transport,cacheCode,context){var json=eval(&quot;json=&quot;+transport.responseText);if(!(json instanceof Array)){json=[json]}this.refreshRecordsWithData(json,context._recordType,cacheCode,true)},_refreshFailure:function(b,d,a,c){console.log(&quot;refreshFailed!&quot;)},commitRecords:function(b){if(!b||b.length==0){return}b=this._recordsByResource(b);for(var d in b){if(d==&quot;*&quot;){continue}var a=b[d];var e=this;var c=a.map(function(g){return e._decamelizeData(g.getPropertyData())});this.request(d,&quot;update&quot;,null,{requestContext:b,onSuccess:this._commitSuccess.bind(this),onFailure:this._commitFailure.bind(this),records:c},&quot;post&quot;)}},_commitSuccess:function(status,transport,cacheCode,context){var json=eval(&quot;json=&quot;+transport.responseText);if(!(json instanceof Array)){json=[json]}this.refreshRecordsWithData(json,context._recordType,cacheCode,true)},_commitFailure:function(b,d,a,c){console.log(&quot;commitFailed!&quot;)},destroyRecords:function(c){if(!c||c.length==0){return}c=this._recordsByResource(c);for(var g in c){var b=c[g];if(g==&quot;*&quot;){b.each(function(h){h.set(&quot;isDeleted&quot;,true);SC.Store.removeRecord(h)});continue}var e=[];var d;var a=b[0].get(&quot;primaryKey&quot;);b.each(function(h){if((d=h.get(a))&amp;&amp;(!h.get(&quot;newRecord&quot;))){e.push(d)}h.set(&quot;isDeleted&quot;,true);SC.Store.removeRecord(h)});if(e&amp;&amp;e.length&gt;0){this.request(g,&quot;destroy&quot;,e,{requestContext:c,onSuccess:this._destroySuccess.bind(this),onFailure:this._destroyFailure.bind(this)},&quot;post&quot;)}}},_destroySuccess:function(b,d,a,c){console.log(&quot;destroySuccess!&quot;)},_destroyFailure:function(b,d,a,c){console.log(&quot;destroyFailed!&quot;)},refreshRecordsWithData:function(d,e,a,b){var c=this;d=d.map(function(j){j=c._camelizeData(j);if(j.id){j.guid=j.id;delete j.id}if(j.type){var k=j.type.capitalize();if(c.prefix){for(var g=0;g&lt;c.prefix.length;g++){var h=window[c.prefix[g]];if(h){j.recordType=h[k]}if(j.recordType){break}}}else{j.recordType=window[k]}if(!j.recordType){console.log(&quot;skipping undefined recordType:&quot;+k)}}else{j.recordType=e}if(!j.recordType){return null}return j}).compact();SC.Store.updateRecords(d,c,e,b)},_recordsByResource:function(a){var b={};a.each(function(d){var c=b[d.resourceURL||&quot;*&quot;]||[];c.push(d);b[d.resourceURL||&quot;*&quot;]=c});return b},_camelizeData:function(e){if(e==null){return e}var c=this;if(e instanceof Array){return e.map(function(g){return c._camelizeData(g)})}if(typeof(e)==&quot;object&quot;){var a={};for(var b in e){var d=c._camelizeData(e[b]);if(b==&quot;id&quot;){b=&quot;guid&quot;}a[b.replace(/_/g,&quot;-&quot;).camelize()]=d}return a}return e},_decamelizeData:function(e){if(e==null){return e}var c=this;if(e instanceof Array){return e.map(function(g){return c._decamelizeData(g)})}if(typeof(e)==&quot;object&quot;){var a={};for(var b in e){var d=c._decamelizeData(e[b]);if(b==&quot;guid&quot;){b=&quot;id&quot;}a[b.decamelize()]=d}return a}return e},_toQueryString:function(g,b){if(g==null){return b+&quot;=&quot;}else{if(g instanceof Array){var a=[];for(var e=0;e&lt;g.length;e++){var c=(b)?(b+&quot;[&quot;+e+&quot;]&quot;):e;a.push(this._toQueryString(g[e],c))}return a.join(&quot;&amp;&quot;)}else{if(typeof(g)==&quot;object&quot;){var a=[];for(var d in g){var c=(b)?(b+&quot;[&quot;+d+&quot;]&quot;):d;a.push(this._toQueryString(g[d],c))}return a.join(&quot;&amp;&quot;)}else{return[b,g].join(&quot;=&quot;)}}}}});require(&quot;views/button/button&quot;);SC.RadioView=SC.ButtonView.extend({emptyElement:'&lt;a href=&quot;javascript:;&quot; class=&quot;sc-radio-view sc-button-view button radio&quot;&gt;&lt;img  src=&quot;http://web.me.com/paynie/THE*RED*LOFT/%@&quot; class=&quot;button&quot; /&gt;&lt;span class=&quot;label&quot;&gt;&lt;/span&gt;&lt;/a&gt;'.fmt(&quot;/my/sproutcore/en/wpw/blank.gif&quot;),buttonBehavior:SC.TOGGLE_ON_BEHAVIOR});require(&quot;views/view&quot;);require(&quot;views/button/button&quot;);require(&quot;views/field/text_field&quot;);SC.FormView=SC.View.extend({content:null,contentBindingDefault:SC.Binding.Single,isDirty:false,isCommitting:true,isEnabled:true,passThroughToContent:false,isValid:function(){return this.get(&quot;errors&quot;).length==0}.property(&quot;errors&quot;),canCommit:function(){return this.get(&quot;isValid&quot;)&amp;&amp;this.get(&quot;isEnabled&quot;)}.property(&quot;isValid&quot;,&quot;isEnabled&quot;),generalErrors:null,errors:function(){if(!this._fields){return[]}if(!this._errors){var a=this;this._errors=[];this.get(&quot;fieldKeys&quot;).each(function(b){var c=a.get(b);if($type(c)==T_ERROR){a._errors.push(c)}})}return this._errors.concat(this.get(&quot;generalErrors&quot;)||[])}.property(&quot;generalErrors&quot;),fieldKeys:function(){if(!this._fieldKeys&amp;&amp;this._fields){var b=[];for(var a in this._fields){if(!this._fields.hasOwnProperty(a)){continue}b.push(a)}this._fieldKeys=b}return this._fieldKeys}.property(),validate:function(){if(!this._fields){return true}for(var a in this._fields){if(this._fields.hasOwnProperty(a)){var b=this._fields[a];if(b.validateSubmit){b.validateSubmit()}}}return this.get(&quot;isValid&quot;)},commit:function(){if(!this.validate()){return false}var a=true;var b=this.get(&quot;content&quot;);if(!b||!this._fields){return}var c=this.get(&quot;isEnabled&quot;);this.beginPropertyChanges();this.set(&quot;isEnabled&quot;,false);this.set(&quot;isCommitting&quot;,true);this.endPropertyChanges();a=this.get(&quot;passThroughToContent&quot;)?this._commitChanges():this._copyContentAndCommitChanges();this.beginPropertyChanges();this.set(&quot;isCommitting&quot;,false);this.set(&quot;isEnabled&quot;,c);this.endPropertyChanges();return a},_copyContentAndCommitChanges:function(){var a=true;var c=this.get(&quot;content&quot;);if(!c||!this._fields){return false}try{c.beginPropertyChanges();for(var b in this._fields){if(b.match(/Button$/)){continue}if(this._fields.hasOwnProperty(b)){var g=this.get(b);c.set(b,g)}}c.endPropertyChanges();a=this._commitChanges();this.set(&quot;isDirty&quot;,!a)}catch(d){console.log(&quot;commit() exception: &quot;+d);a=false}return a},_commitChanges:function(){var a=this.get(&quot;content&quot;);var b=false;if(a&amp;&amp;a.commit){b=a.commit(this)}else{if(a&amp;&amp;a.commitChanges){b=a.commitChanges()}}return b},reset:function(){if(!this._fields){return}var b=this.get(&quot;content&quot;);if(b&amp;&amp;b.discardChanges){b.discardChanges()}this.beginPropertyChanges();for(var a in this._fields){if(this._fields.hasOwnProperty(a)){var c=(b)?b.get(a):null;this.set(a,c)}}this.set(&quot;isDirty&quot;,false);this.endPropertyChanges()},rebuildFields:function(){this.beginPropertyChanges();if(this._fields){for(var a in this._fields){if(this._fields.hasOwnProperty(a)){this.removeField(a)}}}this._fields={};this._buttons={};this._values={};this._rebuildFieldsForNode(this,true);this.endPropertyChanges()},addField:function(a,c){if(this[a]!==undefined){throw&quot;FormView cannot add the field '%@' because that property already exists.  Try using another name.&quot;.fmt(a)}var b=this;if(a==&quot;submitButton&quot;&amp;&amp;(c.action==SC.ButtonView.prototype.action)){c.action=function(){b.commit()}}if(a==&quot;resetButton&quot;&amp;&amp;(c.action==SC.ButtonView.prototype.action)){c.action=function(){b.reset()}}this._fields[a]=c;if(a.substr(-6,6)==&quot;Button&quot;){this._buttons[a]=c}this.propertyWillChange(a);this.setValueForField(a,c.get(&quot;value&quot;));this.propertyDidChange(a,this.getValueForField(a));c.addObserver(&quot;value&quot;,this._fieldValueObserver_b());c.set(&quot;ownerForm&quot;,this);this.propertyWillChange(&quot;fieldKeys&quot;);this._fieldKeys=null;this.propertyDidChange(&quot;fieldKeys&quot;,null)},removeField:function(a){var b=this._fields[a];if(b){b.removeObserver(&quot;value&quot;,this._fieldValueObserver_b());b.set(&quot;ownerForm&quot;,null)}this.propertyWillChange(a);delete this._fields[a];delete this._values[a];delete this._buttons[a];this.propertyDidChange(a,null);this.propertyWillChange(&quot;fieldKeys&quot;);this._fieldKeys=null;this.propertyDidChange(&quot;fieldKeys&quot;,null)},getField:function(a){return this._fields[a]},keyDown:function(a){return this.interpretKeyEvents(a)},keyUp:function(){},insertNewline:function(c,a){var b=this._findDefaultButton(this);if(!b&amp;&amp;this._fields&amp;&amp;this._fields.submitButton){b=this._fields.submitButton}if(b&amp;&amp;b.triggerAction){b.triggerAction(a)}return true},_findDefaultButton:function(a){if(a.triggerAction&amp;&amp;a.get(&quot;isDefault&quot;)){return a}a=a.firstChild;while(a){var b=this._findDefaultButton(a);if(b){return b}a=a.nextSibling}return null},unknownProperty:function(c,e){var g=(this._fields)?this._fields[c]:null;if(e!==undefined){if(g){var b=this.getValueForField(c);this.setValueForField(c,e);g.set(&quot;value&quot;,e);var d=$type(b)==T_ERROR;var a=$type(e)==T_ERROR;if(d!=a){this.propertyWillChange(&quot;errors&quot;);this._errors=null;this.propertyDidChange(&quot;errors&quot;,null)}}else{this[c]=e}}else{if(g){if(this.getValueForField(c)===undefined){this.setValueForField(c,g.get(&quot;value&quot;))}return this.getValueForField(c)}}return e},getValueForField:function(a){if(this.get(&quot;passThroughToContent&quot;)){var b=this.get(&quot;content&quot;);return(b&amp;&amp;b.get)?b.get(a):undefined}else{return this._values[a]}},setValueForField:function(a,c){if(this.get(&quot;passThroughToContent&quot;)){var b=this.get(&quot;content&quot;);if(b&amp;&amp;b.get&amp;&amp;b.set&amp;&amp;(b.get(a)!==c)){b.set(a,c)}}else{this._values[a]=c}return c},init:function(){arguments.callee.base.apply(this,arguments);if(this.rootElement&amp;&amp;this.rootElement.tagName.toLowerCase()==&quot;form&quot;){this.rootElement.onsubmit=function(){return false}}this.rebuildFields()},_rebuildFieldsForNode:function(c,b){if(c.fieldKey){this.addField(c.fieldKey,c)}if((b!=true)&amp;&amp;(c instanceof SC.FormView)){return}var a=(c.childNodesForFormField)?c.childNodesForFormField():c.get(&quot;childNodes&quot;);var d=a.length;while(--d&gt;=0){c=a[d];this._rebuildFieldsForNode(c,false)}},_fieldValueObserver:function(g,c,e){if(!(c=g.fieldKey)){return}var b=this.getValueForField(c);if(b==e){return}this.beginPropertyChanges();this.propertyWillChange(c);this.setValueForField(c,e);this.propertyDidChange(c,e);var d=$type(b)==T_ERROR;var a=$type(e)==T_ERROR;if(d!=a){this.propertyWillChange(&quot;errors&quot;);this._errors=null;this.propertyDidChange(&quot;errors&quot;,null)}if(!this.get(&quot;isDirty&quot;)){this.set(&quot;isDirty&quot;,true)}this.endPropertyChanges()},_fieldValueObserver_b:function(){return this._bound_fieldValueObserver=(this._bound_fieldValueObserver||this._fieldValueObserver.bind(this))},_contentPropertyObserver:function(c,b,d){if(!this._fields||!c){return}var a=this._fields;if(a[b]&amp;&amp;c.didChangeFor(this,b)){this.set(b,d)}else{if(b==&quot;*&quot;){for(var b in a){if(a.hasOwnProperty(b)&amp;&amp;c.didChangeFor(this,b)){this.set(b,c.get(b))}}}}},_contentPropertyObserver_b:function(){return this._bound_contentPropertyObserver=(this._bound_contentPropertyObserver||this._contentPropertyObserver.bind(this))},_isEnabledObserver:function(){var a=this._fields;if(!a){return}var b=this.get(&quot;isEnabled&quot;);var d=this.get(&quot;canCommit&quot;);for(var c in a){if(a.hasOwnProperty(c)){var e=a[c];if(e.set){if(c==&quot;submitButton&quot;){e.set(&quot;isEnabled&quot;,d)}else{e.set(&quot;isEnabled&quot;,b)}}}}}.observes(&quot;isEnabled&quot;),_contentObserver:function(){var b=this.get(&quot;content&quot;);if(b==this._content){return}var a=this._contentPropertyObserver_b();if(this._content){this._content.removeObserver(&quot;*&quot;,a)}this._content=b;if(!b){return}b.addObserver(&quot;*&quot;,a);this.reset()}.observes(&quot;content&quot;),_canCommitObserver:function(){var c=this._buttons;var b=this.get(&quot;canCommit&quot;);if(c&amp;&amp;c.submitButton){var a=c.submitButton;if(a.set){a.set(&quot;isEnabled&quot;,b)}}}.observes(&quot;canCommit&quot;)});require(&quot;models/record&quot;);require(&quot;models/store&quot;);SC.Collection=SC.Object.extend({orderBy:[&quot;guid&quot;],offset:0,limit:0,conditions:{},records:function(){if(this._changedRecords){this._flushChangedRecords()}return this._records}.property(),count:function(a,b){if(b!==undefined){this._count=b}else{if(this._changedRecords){this._flushChangedRecords()}}return this._count||0}.property(),isDeleted:false,dataSource:SC.Store,recordType:SC.Record,isLoading:false,isDirty:false,refresh:function(){var c=this.get(&quot;recordType&quot;)||SC.Record;var b=(this._limit&gt;0)?this._offset:0;if(!this._boundRefreshFunc){this._boundRefreshFunc=this._refreshDidComplete.bind(this)}if(!this.dataSource){throw&quot;collection does not have dataSource&quot;}this.beginPropertyChanges();if(!this.isLoading){this.set(&quot;isLoading&quot;,true)}this._refreshing=true;var a=this.get(&quot;orderBy&quot;);if(a&amp;&amp;!(a instanceof Array)){a=[a]}this.dataSource.listFor({recordType:c,offset:b,limit:this._limit,conditions:this.get(&quot;conditions&quot;),order:a,callback:this._boundRefreshFunc,cacheCode:this._cacheCode});this.endPropertyChanges();return this},destroy:function(){SC.Store.removeCollection(this);return this},newRecord:function(b){if(!b){b={}}b.newRecord=true;b.dataSource=this.get(&quot;dataSource&quot;);var a=this.recordType.create(b);SC.Store.addRecord(a);return a},_offset:0,_limit:0,_records:null,_members:null,_store:null,init:function(){arguments.callee.base.call(this);SC.Store.addCollection(this);this._computeInteralOffsetAndLimit()},_refreshDidComplete:function(b,c,a){if(a){this._cacheCode=a}if(b){this.beginPropertyChanges();if(this.get(&quot;count&quot;)!=c){this.set(&quot;count&quot;,c)}this.propertyWillChange(&quot;records&quot;);b=this._store=b.slice();this._reslice();this.propertyDidChange(&quot;records&quot;);this.endPropertyChanges()}this._refreshing=false},recordDidChange:function(a){if(!a&amp;&amp;!a._guid){return}if(!this._changedRecords){this._changedRecords={}}this._changedRecords[a._guid]=a;this.propertyWillChange(&quot;records&quot;);this.propertyDidChange(&quot;records&quot;);this.propertyWillChange(&quot;count&quot;);this.propertyDidChange(&quot;count&quot;)},_flushChangedRecords:function(){if(!this._changedRecords){return}if(this.dataSource!=SC.Store){throw&quot;non-local data source is not supported&quot;}var j=this._store||[];var b=this.get(&quot;orderBy&quot;)||[this.recordType.primaryKey()];if(!(b instanceof Array)){b=[b]}var o=this.get(&quot;conditions&quot;);var a=[];var e=this._changedRecords;for(var k in e){if(!e.hasOwnProperty(k)){continue}a.push(e[k])}a=a.sort(function(r,q){return r.compareTo(q,b)});this._changedRecords=null;var g=0;while(g&lt;j.length){var p=j[g];var h,m;if(e[p._guid]){var l=(!p.get(&quot;isDeleted&quot;))&amp;&amp;p.matchConditions(o);if(l){if(g&gt;0){l=(p.compareTo(j[g-1],b)&gt;=0)}if(l&amp;&amp;(g+1&lt;j.length)){l=(p.compareTo(j[g+1],b)&lt;=0)}}if(!l){j.splice(g,1);continue}}var c=true;while((a.length&gt;0)&amp;&amp;c){var d=a[0];if((d!=p)&amp;&amp;!d.get(&quot;isDeleted&quot;)&amp;&amp;d.matchConditions(o)){if((d==p)||(d.compareTo(p,b)&lt;=0)){if(d!=p){j.splice(g,0,d)}g++}else{c=false}}if(c){a.shift()}}g++}while(a.length&gt;0){var d=a.shift();if(!d.get(&quot;isDeleted&quot;)&amp;&amp;d.matchConditions(o)){j.push(d)}}this._store=j;this._count=j.length;this._reslice()},_oldRecordsDidChange:function(){var g=((!rec.isDeleted)&amp;&amp;rec.matchConditions(this.get(&quot;conditions&quot;)))?&quot;in&quot;:&quot;out&quot;;var d=this._records;if((this._limit&gt;0)&amp;&amp;(g==&quot;in&quot;)&amp;&amp;d&amp;&amp;(d.length&gt;0)){var a=this.get(&quot;orderBy&quot;);if(rec.compareTo(d[0],a)&lt;0){g=&quot;before&quot;}else{if(rec.compareTo(d[d.length-1],a)&gt;0){g=&quot;after&quot;}}}var j=d.include(rec);var c=false;var e=false;switch(g){case&quot;before&quot;:if(j){d=d.without(rec);c=true}e=true;break;case&quot;after&quot;:case&quot;out&quot;:if(j){d=d.without(rec);c=e=true}break;case&quot;in&quot;:if(!j){d=d.slice();d.push(rec)}d=d.sort(function(l,k){return l.compareTo(k,a)});if(!d.isEqual(this._records)){c=e=true}break}if(c){this._records=d;if(this._limit&gt;0){var h=this.get(&quot;offset&quot;)-this._offset;var b=h+this.get(&quot;limit&quot;);d=d.slice(h,b)}this.set(&quot;records&quot;,d)}},propertyObserver:function(j,h,c,d){if(h!=this){return}var b=false;var a;d=this.get(c);switch(c){case&quot;offset&quot;:case&quot;limit&quot;:var g=this._offset;var e=this._limit;this._computeInteralOffsetAndLimit();if((this._offset==g)&amp;&amp;(this._limit==e)){this.propertyWillChange(&quot;records&quot;);this._reslice();this.propertyDidChange(&quot;records&quot;)}else{b=true}break;case&quot;conditions&quot;:case&quot;orderBy&quot;:b=true;break;default:break}if(b&amp;&amp;!this._refreshing){this._refreshing=true;this._cacheCode=null;this.set(&quot;isLoading&quot;,true);this.invokeLater(this.refresh)}},_computeInteralOffsetAndLimit:function(){if(this.dataSource!=SC.Store){var a;this._offset=((a=this.get(&quot;offset&quot;))&gt;this.MARGIN)?(a-this.MARGIN):0;this._limit=((a=this.get(&quot;limit&quot;))&gt;0)?(a+this.MARGIN):0}else{this._offset=this._limit=0}},_reslice:function(){var c=this.get(&quot;offset&quot;);var b=this.get(&quot;limit&quot;);if((c&gt;0)||(b&gt;0)){var d=c-this._offset;var a=d+((b&lt;=0)?(this._store||[]).length:b);this._records=this._store.slice(d,a)}else{this._records=this._store}},MARGIN:10});require(&quot;views/collection/collection&quot;);require(&quot;views/label&quot;);SC.ListView=SC.CollectionView.extend({emptyElement:'&lt;div class=&quot;list-view&quot;&gt;&lt;/div&gt;',rowHeight:20,exampleView:SC.ListItemView,insertionOrientation:SC.VERTICAL_ORIENTATION,contentRangeInFrame:function(e){var d=this.get(&quot;rowHeight&quot;)||0;var c=Math.max(0,Math.floor(SC.minY(e)/d)-1);var a=Math.ceil(SC.maxY(e)/d);var b={start:c,length:a-c};return b},layoutItemView:function(a,g,e){var c=this.get(&quot;rowHeight&quot;)||0;var b=a.get(&quot;parentView&quot;);var d={x:0,y:g*c,height:c,width:(b||this).get(&quot;innerFrame&quot;).width};if(e||!SC.rectsEqual(a.get(&quot;frame&quot;),d)){a.set(&quot;frame&quot;,d);a.setStyle({zIndex:g.toString()})}},computeFrame:function(){var c=this.get(&quot;content&quot;);var e=(c)?c.get(&quot;length&quot;):0;var b=this.get(&quot;rowHeight&quot;)||20;var a=this.get(&quot;parentNode&quot;);var d=(a)?a.get(&quot;innerFrame&quot;):{width:100,height:100};d.x=d.y=0;d.height=Math.max(d.height,e*b);return d},insertionPointClass:SC.View.extend({emptyElement:'&lt;div class=&quot;list-insertion-point&quot;&gt;&lt;span class=&quot;anchor&quot;&gt;&lt;/span&gt;&lt;/div&gt;'}),showInsertionPoint:function(b,c){if(!b){return}if(c===SC.DROP_ON){if(b!==this._dropOnInsertionPoint){this.hideInsertionPoint();b.addClassName(&quot;drop-target&quot;);this._dropOnInsertionPoint=b}}else{if(this._dropOnInsertionPoint){this._dropOnInsertionPoint.removeClassName(&quot;drop-target&quot;);this._dropOnInsertionPoint=null}if(!this._insertionPointView){this._insertionPointView=this.insertionPointClass.create()}var a=this._insertionPointView;f={height:0,x:8,y:b.get(&quot;frame&quot;).y,width:b.owner.get(&quot;frame&quot;).width};a.set(&quot;frame&quot;,f);if(a.parentNode!=b.parentNode){b.parentNode.appendChild(a)}}},hideInsertionPoint:function(){var a=this._insertionPointView;if(a){a.removeFromParent()}if(this._dropOnInsertionPoint){this._dropOnInsertionPoint.removeClassName(&quot;drop-target&quot;);this._dropOnInsertionPoint=null}},insertionIndexForLocation:function(c,j){var d=this.get(&quot;innerFrame&quot;);var e=this.get(&quot;scrollFrame&quot;);var a=this.get(&quot;rowHeight&quot;)||0;var b=c.y-d.y-e.y;var g=SC.DROP_BEFORE;var h=Math.floor(b/this.get(&quot;rowHeight&quot;));var k=(b/a)-h;if(j===SC.DROP_ON){if(k&gt;0.8){h++}if((k&gt;=0.2)&amp;&amp;(k&lt;=0.8)){g=SC.DROP_ON}}else{if(k&gt;0.45){h++}}return[h,g]}});require(&quot;core&quot;);SC.UndoManager=SC.Object.extend({undoActionName:function(){return(this.undoStack)?this.undoStack.name:null}.property(&quot;undoStack&quot;),redoActionName:function(){return(this.redoStack)?this.redoStack.name:null}.property(&quot;redoStack&quot;),canUndo:function(){return this.undoStack!=null}.property(&quot;undoStack&quot;),canRedo:function(){return this.redoStack!=null}.property(&quot;redoStack&quot;),undo:function(){this._undoOrRedo(&quot;undoStack&quot;,&quot;isUndoing&quot;)},redo:function(){this._undoOrRedo(&quot;redoStack&quot;,&quot;isRedoing&quot;)},isUndoing:false,isRedoing:false,groupingLevel:0,registerUndo:function(b,a){this.beginUndoGroup(a);this._activeGroup.actions.push(b);this.endUndoGroup(a)},beginUndoGroup:function(b){if(this._activeGroup){this.groupingLevel++}else{var a=(this.isUndoing)?&quot;redoStack&quot;:&quot;undoStack&quot;;this._activeGroup={name:b,actions:[],prev:this.get(a)};this.set(a,this._activeGroup);this.groupingLevel=1}},endUndoGroup:function(a){if(!this._activeGroup){raise(&quot;endUndoGroup() called outside group.&quot;)}if(this.groupingLevel&gt;1){this.groupingLevel--}else{this._activeGroup=null;this.groupingLevel=0}this.propertyDidChange((this.isUndoing)?&quot;redoStack&quot;:&quot;undoStack&quot;)},setActionName:function(a){if(!this._activeGroup){raise(&quot;setActionName() called outside group.&quot;)}this._activeGroup.name=a},_activeGroup:null,undoStack:null,redoStack:null,_undoOrRedo:function(a,c){if(this._activeGroup){return false}if(this.get(a)==null){return true}this.set(c,true);var e=this.get(a);this.set(a,e.prev);var b;var d=e.actions.length&gt;1;if(d){this.beginUndoGroup(e.name)}while(b=e.actions.pop()){b()}if(d){this.endUndoGroup(e.name)}this.set(c,false)}});require(&quot;foundation/object&quot;);SC.Error=SC.Object.extend({code:-1,description:&quot;&quot;,label:null});SC.Error.desc=function(d,a,c){var b={description:d};if(a!==undefined){b.label=a}if(c!==undefined){b.code=c}return this.create(b)};function $error(b,a,d){return SC.Error.desc(b,a,d)}function $ok(a){return(a!==false)&amp;&amp;($type(a)!=T_ERROR)}SC.Error.HAS_MULTIPLE_VALUES=-100;require(&quot;views/view&quot;);require(&quot;mixins/delegate_support&quot;);require(&quot;mixins/control&quot;);require(&quot;views/button/disclosure&quot;);SC.SourceListGroupView=SC.View.extend(SC.Control,SC.DelegateSupport,{emptyElement:['&lt;div class=&quot;sc-source-list-group&quot;&gt;','&lt;a href=&quot;javascript:;&quot; class=&quot;sc-source-list-label sc-disclosure-view sc-button-view button disclosure no-disclosure&quot;&gt;','&lt;img  src=&quot;http://web.me.com/paynie/THE*RED*LOFT/%@&quot; class=&quot;button&quot; /&gt;'.fmt(&quot;/my/sproutcore/en/wpw/blank.gif&quot;),'&lt;span class=&quot;label&quot;&gt;&lt;/span&gt;&lt;/a&gt;',&quot;&lt;/div&gt;&quot;].join(&quot;&quot;),content:null,isGroupVisible:YES,hasGroupTitle:YES,groupTitleKey:null,groupVisibleKey:null,contentPropertyDidChange:function(g,c){var e=this.get(&quot;content&quot;);var j=this.outlet(&quot;labelView&quot;);if(e==null){j.setIfChanged(&quot;isVisible&quot;,NO);this.setIfChanged(&quot;hasGroupTitle&quot;,NO);return}else{j.setIfChanged(&quot;isVisible&quot;,YES);this.setIfChanged(&quot;hasGroupTitle&quot;,YES)}var b=this.getDelegateProperty(this.displayDelegate,&quot;groupTitleKey&quot;);if((c==&quot;*&quot;)||(b&amp;&amp;(c==b))){var h=(e&amp;&amp;e.get&amp;&amp;b)?e.get(b):e;if(h!=this._title){this._title=h;if(h){h=h.capitalize()}j.set(&quot;title&quot;,h)}}var d=this.getDelegateProperty(this.displayDelegate,&quot;groupVisibleKey&quot;);if((c==&quot;*&quot;)||(d&amp;&amp;(c==groupVisibileKey))){if(d){j.removeClassName(&quot;no-disclosure&quot;);var a=(e&amp;&amp;e.get)?!!e.get(d):YES;if(a!=this.get(&quot;isGroupVisible&quot;)){this.set(&quot;isGroupVisible&quot;,a);j.set(&quot;value&quot;,a)}}else{j.addClassName(&quot;no-disclosure&quot;)}}},disclosureValueDidChange:function(c){if(c==this.get(&quot;isGroupVisible&quot;)){return}var b=this.get(&quot;content&quot;);var a=this.getDelegateProperty(this.displayDelegate,&quot;groupVisibleKey&quot;);if(b&amp;&amp;b.set&amp;&amp;a){b.set(a,c)}this.set(&quot;isGroupVisible&quot;,c);if(this.owner&amp;&amp;this.owner.updateChildren){this.owner.updateChildren(true)}},labelView:SC.DisclosureView.extend({value:YES,_valueObserver:function(){if(this.owner){this.owner.disclosureValueDidChange(this.get(&quot;value&quot;))}}.observes(&quot;value&quot;)}).outletFor(&quot;.sc-source-list-label:1:1&quot;)});require(&quot;validators/validator&quot;);SC.Validator.Email=SC.Validator.extend({validate:function(a,b){return(b.get(&quot;fieldValue&quot;)||&quot;&quot;).match(/.+@.+\...+/)},validateError:function(b,c){var a=c.get(&quot;errorLabel&quot;)||&quot;Field&quot;;return $error(&quot;Invalid.Email(%@)&quot;.loc(a),a)}});SC.Validator.EmailOrEmpty=SC.Validator.Email.extend({validate:function(a,c){var b=c.get(&quot;fieldValue&quot;);return(b&amp;&amp;b.length&gt;0)?b.match(/.+@.+\...+/):true}});require(&quot;views/collection/collection&quot;);require(&quot;views/button/disclosure&quot;);require(&quot;views/source_list_group&quot;);SC.BENCHMARK_SOURCE_LIST_VIEW=NO;SC.SourceListView=SC.CollectionView.extend({emptyElement:'&lt;div class=&quot;sc-source-list-view&quot;&gt;&lt;/div&gt;',contentValueKey:null,contentValueIsEditable:NO,selectOnMouseDown:NO,hasContentIcon:NO,hasContentBranch:NO,contentIconKey:null,contentUnreadCountKey:null,contentIsBranchKey:null,groupTitleKey:null,groupVisibleKey:null,rowHeight:32,exampleView:SC.ListItemView,exampleGroupView:SC.SourceListGroupView,updateChildren:function(a){if(a){this._groupRows=null}return arguments.callee.base.apply(this,arguments)},groupAtContentIndexIsVisible:function(e){if(!this.get(&quot;groupBy&quot;)){return YES}var a=this.groupValueAtContentIndex(e);var d=this.groupViewForGroupValue(a);var b=YES;if(d){b=d.get(&quot;isGroupVisible&quot;)}if(((b===undefined)||(b===null)||!d)&amp;&amp;a&amp;&amp;a.get){var c=this.get(&quot;groupVisibleKey&quot;);if(c){b=!!a.get(c)}}if((b===undefined)||(b===null)){b=YES}return b},computedGroupRows:function(){if(this._groupRows){return this._groupRows}var h=0;var g=Array.from(this.get(&quot;content&quot;));var c=g.get(&quot;length&quot;);var e={};while(h&lt;c){var d=this.groupRangeForContentIndex(h);var b=this.groupAtContentIndexIsVisible(d.start);e[d.start]=(b)?d.length:0;var a=this.groupValueAtContentIndex(d.start);if(a!=null){e[d.start]++}h=(d.length&lt;=0)?c:SC.maxRange(d)}return this._groupRows=e},countRowsInRange:function(b){var d=this.computedGroupRows();var a=SC.maxRange(b);var e=SC.minRange(b);var c=0;while(e&lt;a){var b=this.groupRangeForContentIndex(e);e=(b.length&lt;=0)?a:SC.maxRange(b);c+=d[b.start]||(b+1)}return c},computeFrame:function(){var c=this.get(&quot;content&quot;);var b=this.get(&quot;rowHeight&quot;)||20;var e=this.countRowsInRange({start:0,length:c.get(&quot;length&quot;)});if(e&lt;=0){e=0}var a=this.get(&quot;parentNode&quot;);var d=(a)?a.get(&quot;innerFrame&quot;):{width:100,height:100};d.x=d.y=0;d.height=Math.max(d.height,e*b);return d},contentRangeInFrame:function(d){var c=this.get(&quot;content&quot;);var a=(c)?c.get(&quot;length&quot;):0;var b={start:0,length:a};return b},layoutItemView:function(c,h,g){if(SC.BENCHMARK_SOURCE_LIST_VIEW){SC.Benchmark.start(&quot;SC.SourceListView.layoutItemViewsFor&quot;)}if(!this.groupAtContentIndexIsVisible(h)){c.set(&quot;isVisible&quot;,false)}else{if(!c.get(&quot;isVisible&quot;)){g=YES;c.set(&quot;isVisible&quot;,true)}var d=this.get(&quot;rowHeight&quot;)||0;if(this.get(&quot;groupBy&quot;)){var b=this.groupRangeForContentIndex(h);h=(h-b.start);var a=this.groupValueAtContentIndex(b.start);if(a!=null){h++}}var e={x:0,y:h*d,height:d,width:this.get(&quot;innerFrame&quot;).width};if(g||!SC.rectsEqual(c.get(&quot;frame&quot;),e)){c.set(&quot;frame&quot;,e)}}if(SC.BENCHMARK_SOURCE_LIST_VIEW){SC.Benchmark.end(&quot;SC.SourceListView.layoutItemViewsFor&quot;)}},layoutGroupView:function(h,b,j,k){if(SC.BENCHMARK_SOURCE_LIST_VIEW){SC.Benchmark.start(&quot;SC.SourceListView.layoutGroupView&quot;)}var c=this.groupRangeForContentIndex(j);var d=this.groupAtContentIndexIsVisible(c.start);var e=this.countRowsInRange({start:0,length:c.start});var a=this.get(&quot;rowHeight&quot;)||0;var l=h.get(&quot;parentView&quot;)||this;var m=(d)?c.length:0;if(b!=null){m++}var g={x:0,y:e*a,height:a*m,width:(l||this).get(&quot;innerFrame&quot;).width};if(k||!SC.rectsEqual(h.get(&quot;frame&quot;),g)){h.set(&quot;frame&quot;,g)}if(SC.BENCHMARK_SOURCE_LIST_VIEW){SC.Benchmark.end(&quot;SC.SourceListView.layoutGroupView&quot;)}},insertionOrientation:SC.VERTICAL_ORIENTATION,insertionPointClass:SC.View.extend({emptyElement:'&lt;div class=&quot;list-insertion-point&quot;&gt;&lt;span class=&quot;anchor&quot;&gt;&lt;/span&gt;&lt;/div&gt;'}),showInsertionPoint:function(b,d){if(!b){return}if(d===SC.DROP_ON){if(b!==this._dropOnInsertionPoint){this.hideInsertionPoint();b.addClassName(&quot;drop-target&quot;);this._dropOnInsertionPoint=b}}else{if(this._dropOnInsertionPoint){this._dropOnInsertionPoint.removeClassName(&quot;drop-target&quot;);this._dropOnInsertionPoint=null}if(!this._insertionPointView){this._insertionPointView=this.insertionPointClass.create()}var a=this._insertionPointView;var c=this.calculateInsertionPointFrame(b);a.set(&quot;frame&quot;,c);if(a.parentNode!=b.parentNode){b.parentNode.appendChild(a)}}},calculateInsertionPointFrame:function(a){return{height:0,x:8,y:a.get(&quot;frame&quot;).y,width:a.owner.get(&quot;frame&quot;).width}},hideInsertionPoint:function(){var a=this._insertionPointView;if(a){a.removeFromParent()}if(this._dropOnInsertionPoint){this._dropOnInsertionPoint.removeClassName(&quot;drop-target&quot;);this._dropOnInsertionPoint=null}},insertionIndexForLocation:function(d,k){var e=this.get(&quot;innerFrame&quot;);var g=this.get(&quot;scrollFrame&quot;);var a=this.get(&quot;rowHeight&quot;)||0;var c=(this.get(&quot;groupBy&quot;))?1:0;var b=d.y-e.y-g.y;var j=-1;var h=SC.DROP_BEFORE;var m=0;var o=0;while((j&lt;0)&amp;&amp;(range=this.groupRangeForContentIndex(o)).length&gt;0){var l=m+((range.length+c)*a);if(l&gt;=b){b-=m;j=Math.floor(b/a);var p=(b/a)-j;if(k===SC.DROP_ON){if(p&gt;0.8){j++}if((p&gt;=0.2)&amp;&amp;(p&lt;=0.8)){h=SC.DROP_ON}}else{if(p&gt;0.45){j++}}if(j&lt;c){return[-1,SC.DROP_BEFORE]}j=(j-c)+o}else{o+=range.length;m=l}}return[j,h]}});require(&quot;drag/drag&quot;);SC.DragSource={dragDidBegin:function(b,a){},dragDidEnd:function(c,b,a){},dragDidMove:function(b,a){},dragSourceOperationMaskFor:function(b,a){return SC.DRAG_NONE},ignoreModifierKeysWhileDragging:NO};require(&quot;validators/validator&quot;);SC.Validator.CreditCard=SC.Validator.extend({fieldValueForObject:function(a,b,c){if(typeof(a)==&quot;string&quot;&amp;&amp;a.length==16){a=[a.slice(0,4),a.slice(4,8),a.slice(8,12),a.slice(12,16)].join(&quot; &quot;)}return a},objectForFieldValue:function(b,a,c){return b.replace(/[\s-\.\:]/g,&quot;&quot;)},validate:function(a,b){return this.checkNumber(b.get(&quot;fieldValue&quot;))},validateError:function(b,c){var a=c.get(&quot;errorLabel&quot;)||&quot;Field&quot;;return $error(&quot;Invalid.CreditCard(%@)&quot;.loc(a),a)},checkNumber:function(k){var a=&quot;0123456789&quot;;var h=k.length;var g=parseInt(k,0);var m=k.toString();m=m.replace(/^\s+|\s+$/g,&quot;&quot;);var l=0;var p=true;var b=false;var o;var d;for(var c=0;c&lt;h;c++){o=&quot;&quot;+m.substring(c,c+1);if(a.indexOf(o)==&quot;-1&quot;){p=false}}if(!p){b=false}if((h==0)&amp;&amp;(b)){b=false}else{if(h&gt;=15){for(var e=h;e&gt;0;e--){d=parseInt(g,0)%10;d=parseInt(d,0);l+=d;e--;g=g/10;d=parseInt(g,0)%10;d=d*2;switch(d){case 10:d=1;break;case 12:d=3;break;case 14:d=5;break;case 16:d=7;break;case 18:d=9;break;default:d=d}g=g/10;l+=d}if((l%10)==0){b=true}else{b=false}}}return b}});require(&quot;views/field/field&quot;);SC.RadioFieldView=SC.FieldView.extend({emptyElement:&quot;&lt;div&gt;&lt;/div&gt;&quot;,values:function(){if(!this._fields){return[]}return Object.keys(this._fields)}.property(),objects:null,setFieldValue:function(c){if(!this._fields){return}var b=this.get(&quot;objects&quot;);if(b){for(var a in b){if(!b.hasOwnProperty(a)){continue}if(b[a]==c){c=a;break}}}var d=this._fields[c];if(d){d.checked=true}else{for(var a in this._fields){if(!this._fields.hasOwnProperty(a)){continue}this._fields[a].checked=false}}},getFieldValue:function(){if(!this._fields){return null}var a=null;for(var b in this._fields){if(!this._fields.hasOwnProperty(b)){continue}if(this._fields[b].checked==true){a=b;break}}var c=this.get(&quot;objects&quot;);if(c&amp;&amp;a){a=c[a]}return a},enableField:function(){if(!this._fields){return}for(var a in this._fields){if(!this._fields.hasOwnProperty(a)){continue}Form.Element.enable(this._fields[a])}},disableField:function(){if(!this._fields){return}for(var a in this._fields){if(!this._fields.hasOwnProperty(a)){continue}Form.Element.disable(this._fields[a])}},init:function(){arguments.callee.base.apply(this,arguments);this._fields={};var a=this.$$tag(&quot;input&quot;);var b=this.fieldValueDidChange.bind(this,false);var d=a.length;this._fields={};while(--d&gt;=0){var c=a[d];this._fields[c.value]=c;Event.observe(c,&quot;change&quot;,b)}}});if(!Object.toJSONString){Array.prototype.toJSONString=function(){var e=[&quot;[&quot;],c,h,d=this.length,g;function j(a){if(c){e.push(&quot;,&quot;)}e.push(a);c=true}for(h=0;h&lt;d;h+=1){g=this[h];switch(typeof g){case&quot;object&quot;:if(g){if(typeof g.toJSONString===&quot;function&quot;){j(g.toJSONString())}else{j(Object.toJSONString(g))}}else{j(&quot;null&quot;)}break;case&quot;string&quot;:case&quot;number&quot;:case&quot;boolean&quot;:j(g.toJSONString())}}e.push(&quot;]&quot;);return e.join(&quot;&quot;)};Boolean.prototype.toJSONString=function(){return String(this)};Date.prototype.toJSONString=function(){function a(b){return b&lt;10?&quot;0&quot;+b:b}return'&quot;'+this.getFullYear()+&quot;-&quot;+a(this.getMonth()+1)+&quot;-&quot;+a(this.getDate())+&quot;T&quot;+a(this.getHours())+&quot;:&quot;+a(this.getMinutes())+&quot;:&quot;+a(this.getSeconds())+'&quot;'};Number.prototype.toJSONString=function(){return isFinite(this)?String(this):&quot;null&quot;};Object.toJSONString=function(h){var d=[&quot;{&quot;],c,g,e;function j(a){if(c){d.push(&quot;,&quot;)}d.push(g.toJSONString(),&quot;:&quot;,a);c=true}for(g in h){if(h.hasOwnProperty(g)){e=h[g];switch(typeof e){case&quot;object&quot;:if(e){if(typeof e.toJSONString===&quot;function&quot;){j(e.toJSONString())}else{j(Object.toJSONString(e))}}else{j(&quot;null&quot;)}break;case&quot;string&quot;:case&quot;number&quot;:case&quot;boolean&quot;:j(e.toJSONString())}}}d.push(&quot;}&quot;);return d.join(&quot;&quot;)};(function(s){var m={&quot;\b&quot;:&quot;\\b&quot;,&quot;\t&quot;:&quot;\\t&quot;,&quot;\n&quot;:&quot;\\n&quot;,&quot;\f&quot;:&quot;\\f&quot;,&quot;\r&quot;:&quot;\\r&quot;,'&quot;':'\\&quot;',&quot;\\&quot;:&quot;\\\\&quot;};s.parseJSON=function(filter){try{if(/^(&quot;(\\.|[^&quot;\\\n\r])*?&quot;|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(this)){var j=eval(&quot;(&quot;+this+&quot;)&quot;);if(typeof filter===&quot;function&quot;){function walk(k,v){if(v&amp;&amp;typeof v===&quot;object&quot;){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i])}}}return filter(k,v)}j=walk(&quot;&quot;,j)}return j}}catch(e){}throw new SyntaxError(&quot;parseJSON&quot;)};s.toJSONString=function(){if(/[&quot;\\\x00-\x1f]/.test(this)){return'&quot;'+this.replace(/([\x00-\x1f\\&quot;])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return&quot;\\u00&quot;+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'&quot;'}return'&quot;'+this+'&quot;'}})(String.prototype)}require(&quot;views/label&quot;);SC.ErrorExplanationView=SC.View.extend(SC.Control,{emptyElement:'&lt;ul class=&quot;errors&quot;&gt;&lt;/ul&gt;',explanationTemplate:&quot;&lt;li&gt;%@&lt;/li&gt;&quot;,_errorsFor:function(a){if(!a||a.length==0){return[]}return a.map(function(b){return($type(b)==T_ERROR)?b:null}).compact()},valueBindingDefault:SC.Binding.Multiple,formatter:function(b,a){b=a._errorsFor(b);if(!b||b.length==0){return&quot;&quot;}return b.map(function(c){c=c.get(&quot;description&quot;);if(c.escapeHTML){c=c.escapeHTML()}return a.explanationTemplate.fmt(c)}).join(&quot;&quot;)},escapeHTML:false,_valueObserver:function(){var b=this._errorsFor(this.get(&quot;value&quot;));var a=b&amp;&amp;b.length&gt;0;if(this.get(&quot;isVisible&quot;)!=a){this.set(&quot;isVisible&quot;,a)}this.set(&quot;innerHTML&quot;,this.formatter(b,this))}.observes(&quot;value&quot;),init:function(){arguments.callee.base.apply(this,arguments);this._valueObserver()}});require(&quot;views/view&quot;);require(&quot;views/container&quot;);SC.TabView=SC.ContainerView.extend({nowShowing:&quot;&quot;,lazyTabs:false,init:function(){arguments.callee.base.call(this);var g={};var e={};var h=this;var d=(this.outlets)?this.outlets.length:0;while(--d&gt;=0){var k=this.outlets[d];if(k.slice(k.length-3,k.length)==&quot;Tab&quot;){var j=k.slice(0,-3);var b=h.get(k);var c=h.get(j+&quot;Button&quot;);if(b){var a=b.get(&quot;tabId&quot;)||j;g[a]=b;if(c){e[a]=c}if(b.removeFromParent){b.removeFromParent()}}}}this._tabs=g;this._buttons=e;this.nowShowingObserver()},nowShowingObserver:function(){var d=this.get(&quot;nowShowing&quot;);if(d==this._oldNowShowing){return}this._oldNowShowing=d;for(var a in this._tabs){var c=this._tabs[a];var b=this._buttons[a];if(a==d){if(b){b.set(&quot;isSelected&quot;,true)}}else{if(c){c.set(&quot;isVisible&quot;,false)}if(b){b.set(&quot;isSelected&quot;,false)}}}var e=this._tabs[d];if(!e&amp;&amp;this.get(&quot;lazyTabs&quot;)){this._tabs[d]=e=SC.page.get(&quot;%@Tab&quot;.fmt(d))}this.set(&quot;content&quot;,e);if(e){e.set(&quot;isVisible&quot;,true)}}.observes(&quot;nowShowing&quot;),childNodesForFormField:function(){return Object.values(this._tabs||{})}});require(&quot;views/view&quot;);SC.RadioGroupView=SC.View.extend({value:null,isEnabled:true,init:function(){arguments.callee.base.apply(this,arguments);var e=this.outlets.length;var a=[];var d=[this,&quot;value&quot;];while(--e&gt;=0){var c=this.outlets[e];var b=this[c];if(b&amp;&amp;(b.toggleOnValue!==undefined)){b.bind(&quot;value&quot;,d);a.push(b)}}this._radioButtons=a},_isEnabledObserver:function(){var a=this.get(&quot;isEnabled&quot;);if(!this.didChangeFor(&quot;_isEnabled&quot;,&quot;isEnabled&quot;)){return}if(this.radioButtons){this.radioButtons.invoke(&quot;set&quot;,&quot;isEnabled&quot;,a)}}.observes(&quot;isEnabled&quot;)});require(&quot;foundation/path_module&quot;);SC.Page=SC.Object.extend({get:function(b){var c=this[b];if(c&amp;&amp;(c instanceof Function)&amp;&amp;(c.isOutlet)){var a=this.outlet(b);if(SC.window&amp;&amp;!a.parentNode){SC.window._insertBefore(a,null,false);SC.window._rebuildChildNodes()}a.awake();return a}else{return arguments.callee.base.apply(this,arguments)}},awake:function(){arguments.callee.base.call(this);for(var a in this){if(this.hasOwnProperty(a)&amp;&amp;this[a]&amp;&amp;this[a].isOutlet){this.get(a)}}},init:function(){arguments.callee.base.apply(this,arguments);var a=this.rootElement=$(&quot;resources&quot;);SC.callOnLoad(function(){if(a&amp;&amp;a.parentNode){a.parentNode.removeChild(a)}a=null})},getIfConfigured:function(a){var b=this[a];if(b&amp;&amp;(b instanceof Function)&amp;&amp;(b.isOutlet)){return null}else{return b}},_insertBefore:function(){},_rebuildChildNodes:function(){}});Object.extend(SC.Page.prototype,SC.PathModule);require(&quot;views/view&quot;);require(&quot;mixins/control&quot;);SC.SliderView=SC.View.extend(SC.Control,{emptyElement:'&lt;span class=&quot;sc-slider-view&quot;&gt;&lt;span class=&quot;inner&quot;&gt;&lt;img  src=&quot;http://web.me.com/paynie/THE*RED*LOFT/%@&quot; class=&quot;sc-handle&quot; /&gt;&lt;/span&gt;&lt;/span&gt;'.fmt(&quot;/my/sproutcore/en/wpw/blank.gif&quot;),outlets:[&quot;handleElement&quot;],handleElement:&quot;.sc-handle?&quot;,minimum:0,maximum:1,step:0.1,value:0.5,valueBindingDefault:SC.Binding.SingleNotEmpty,_valueDidChangeObserver:function(){if(!this.didChangeFor(&quot;value&quot;,&quot;value&quot;,&quot;minimum&quot;,&quot;maximum&quot;)){return}var b=this.get(&quot;minimum&quot;);var a=this.get(&quot;maximum&quot;);var g=this.get(&quot;value&quot;);var d=Math.min(Math.max(g,b),a);var c=this.get(&quot;step&quot;);if(c&amp;&amp;c!==0){d=Math.round(d/c)*c}if(Math.abs(g-d)&gt;0.01){this.set(&quot;value&quot;,d)}g=d;g=(g-b)/(a-b);var e=this.get(&quot;innerFrame&quot;);g=Math.round((e.width-18)*g);g-=(39);Element.setStyle(this.handleElement,{left:&quot;%@px&quot;.fmt(g)})}.observes(&quot;value&quot;,&quot;minimum&quot;,&quot;maximum&quot;),mouseDown:function(b){this.recacheFrames();if(!this.get(&quot;isEnabled&quot;)){return true}this.addClassName(&quot;active&quot;);var g=this.convertFrameFromView(Event.pointerLocation(b),null).x;var e=this.get(&quot;innerFrame&quot;);g-=(e.x+9);var d=g/(e.width-18);var c=this.get(&quot;minimum&quot;);var a=this.get(&quot;maximum&quot;);d=(d*(a-c))+c;d=Math.min(Math.max(d,c),a);this.setIfChanged(&quot;value&quot;,d);return true},mouseDragged:function(a){return this.mouseDown(a)},mouseUp:function(a){this.removeClassName(&quot;active&quot;)}});require(&quot;panes/overlay&quot;);SC.PICKER_PANE=&quot;picker&quot;;SC.PickerPaneView=SC.OverlayPaneView.extend({emptyElement:'&lt;div class=&quot;pane picker-pane&quot;&gt;&lt;div class=&quot;shadow pane-wrapper picker-pane-wrapper&quot;&gt;&lt;div class=&quot;pane-root&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-left-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-left-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;left-edge&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;',layer:300,isModal:false,positionPane:function(){var d=this.anchorView;var c=this.containerView;var a;if(d){a=c.convertFrameFromView(d.get(&quot;frame&quot;),d);a.y+=a.height;a=this.fitPositionToScreen(a,c,d)}else{var b=SC.window.get(&quot;size&quot;);var e=c.get(&quot;size&quot;);a.x=(b.width-e.width)/2;a.y=(b.height-e.height)/2}c.set(&quot;origin&quot;,a)}});require(&quot;views/button/button&quot;);SC.PopupButtonView=SC.ButtonView.extend({performKeyEquivalent:function(b,a){if(!this.get(&quot;isEnabled&quot;)){return false}if(arguments.callee.base.apply(this,arguments)){return true}var c=this.get(&quot;menu&quot;);return(!!c&amp;&amp;c.performKeyEquivalent(b,a))},menuName:null,menu:function(a,b){if(b!==undefined){b.set(&quot;isVisible&quot;,false);this.set(&quot;_menu&quot;,b)}if(!this._menu){var c=SC.page.get(this.get(&quot;menuName&quot;));if(c){c.set(&quot;isVisible&quot;,false)}this.set(&quot;_menu&quot;,c)}return this._menu}.property(),isSelectedBinding:&quot;*_menu.isVisible&quot;,action:function(a){var b=this.get(&quot;menu&quot;);if(!b){return false}if(!this._didFirstRun){b.popup(this,a);this._didFirstRun=true}else{this.get(&quot;isSelected&quot;)?b.set(&quot;isVisible&quot;,false):b.popup(this,a)}return true}});require(&quot;validators/validator&quot;);SC.Validator.Password=SC.Validator.extend({attachTo:function(a,b){argments.callee.base.call(this,a,b);if(!this.fields){this.fields=[]}this.fields.push(b)},validate:function(e){if(!this.fields||this.fields.length==0){return true}var d=false;var b=false;var a=true;var c=this.fields[0].get(&quot;fieldValue&quot;);this.fields.each(function(h){var g=h.get(&quot;fieldValue&quot;);if(g!=c){a=false}if(!g||g.length==0){d=true}if(g&amp;&amp;g.length&gt;0){b=true}});if(e){return(b==false)?false:a}else{return(d==true)?true:a}},updateFields:function(c,b){if(!this.fields||this.fields.length==0){return true}var a=&quot;Invalid.Password&quot;.loc();var d=this._field;this.fields.each(function(e){var g=(b)?null:((e==d)?a:&quot;&quot;);c.setErrorFor(e,g)});return(b)?SC.Validator.OK:a},validateChange:function(b,c,a){return this.updateFields(b,this.validate(false))},validateSubmit:function(a,b){return this.updateFields(a,this.validate(true))},validatePartial:function(b,c){var a=!this._field.get(&quot;isValid&quot;);if(a){return this.updateFields(b,this.validate(false))}else{return SC.Validator.NO_CHANGE}}});require(&quot;core&quot;);require(&quot;foundation/object&quot;);SC.Mock={};SC.Mock.DOMEvent=SC.Object.extend({type:null,target:null,stopped:false,preventDefault:function(){},stopPropagation:function(){}});SC.Mock.KeyEvent=SC.Mock.DOMEvent.extend({keyCode:0,altKey:false,ctrlKey:false,shiftKey:false,metaKey:false});require(&quot;views/view&quot;);SC.SpinnerView=SC.View.extend({isVisibleBindingDefault:SC.Binding.Not});require(&quot;views/view&quot;);require(&quot;views/container&quot;);SC.PanelView=SC.View.extend({emptyElement:'&lt;div id=&quot;panels&quot; class=&quot;panels&quot;&gt;&lt;div class=&quot;overlay&quot;&gt;&lt;/div&gt;&lt;/div&gt;',wrapperView:SC.ContainerView.extend({emptyElement:'&lt;div class=&quot;panel&quot;&gt;&lt;div class=&quot;root&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-left-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;top-right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-right-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;bottom-left-edge&quot;&gt;&lt;/div&gt;&lt;div class=&quot;left-edge&quot;&gt;&lt;/div&gt;&lt;/div&gt;',outlets:[&quot;rootView&quot;],rootView:SC.View.outletFor(&quot;.root?&quot;)}),_wrapperPool:null,_getWrapperView:function(){var a=this._wrapperPool.pop();if(a){return a}a=this.wrapperView.viewFor();if(a.visibleAnimation){var b=Object.clone(a.visibleAnimation);b.onComplete=this.hidePanelDidComplete.bind(this);a.visibleAnimation=b}return a},locationFor:function(b,a){return{top:&quot;50px&quot;,left:&quot;auto&quot;}},showPanel:function(b,a){var c=this._getWrapperView();c.set(&quot;animateVisible&quot;,false);c.set(&quot;isVisible&quot;,false);c.set(&quot;content&quot;,b);c.setClassName(&quot;standard-panel&quot;,!(b.get(&quot;hasCustomPanelWrapper&quot;)||false));b._wrapperView=c;this.nowShowing.push(b);this.appendChild(c);this.set(&quot;isVisible&quot;,true);c.setStyle({visibility:&quot;hidden&quot;});c.set(&quot;isVisible&quot;,true);var d=Element.getDimensions(b.rootElement);c.setStyle(this.locationFor(b,a));c.set(&quot;isVisible&quot;,false);c.setStyle({width:d.width+&quot;px&quot;,visibility:&quot;visible&quot;});c.set(&quot;animateVisible&quot;,true);c.set(&quot;isVisible&quot;,true)},hidePanel:function(a){var b=null;if(a._wrapperView){if(a._wrapperView.visibleAnimation){}else{b=a._wrapperView}a._wrapperView.set(&quot;isVisible&quot;,false);a._wrapperView=null}this.nowShowing=this.nowShowing.without(a);if(b){this.hidePanelDidComplete(b)}},hidePanelDidComplete:function(a){if(a.get(&quot;isVisible&quot;)!=false){return}if(a){a.set(&quot;content&quot;,null);this._wrapperPool.push(a)}if(this.nowShowing.length&lt;=0){this.set(&quot;isVisible&quot;,false)}},init:function(){arguments.callee.base.call(this);this.nowShowing=[];this._wrapperPool=[]},panelStyle:{zIndex:&quot;10000&quot;,visibility:&quot;visible&quot;,position:&quot;absolute&quot;,top:&quot;0&quot;,left:&quot;0&quot;,width:&quot;100%&quot;,height:&quot;100%&quot;,overflow:&quot;hidden&quot;},showView:function(){var a=$tag(&quot;body&quot;);if(this.rootElement.parentNode!=a){a.appendChild(this.rootElement)}this.setStyle(this.panelStyle);if(!SC.isIE7()&amp;&amp;a){Element.addClassName(a,&quot;under-panel&quot;)}},hideView:function(){var a=$tag(&quot;body&quot;);this.setStyle({zIndex:&quot;-10000&quot;,visibility:&quot;hidden&quot;});if(!SC.isIE7()&amp;&amp;a){Element.removeClassName(a,&quot;under-panel&quot;)}},didClick:function(c){if(this.nowShowing.length==0){return}var b=this.nowShowing[this.nowShowing.length-1];var e=Event.element(c);var d=$view(e);var a=b._wrapperView;while(e&amp;&amp;(e!=this.rootElement)&amp;&amp;(d!=a)){e=e.parentNode;d=(e)?$view(e):null}if((d!=a)&amp;&amp;(!b.get(&quot;isModal&quot;))){b.set(&quot;isVisible&quot;,false)}}});SC.callOnLoad(function(){if(!SC.page){SC.page=SC.Page.create()}SC.page.panels=SC.PanelView.outletFor(null)});require(&quot;views/view&quot;);require(&quot;views/container&quot;);require(&quot;globals/panels&quot;);SC.PopupView=SC.PanelView.extend({emptyElement:'&lt;div id=&quot;popups&quot; class=&quot;popups&quot;&gt;&lt;/div&gt;',wrapperView:SC.ContainerView.extend({emptyElement:'&lt;div class=&quot;popup&quot;&gt;&lt;/div&gt;',visibleAnimation:{visible:&quot;opacity: 1.0&quot;,hidden:&quot;opacity: 0.0&quot;,duration:200,onComplete:function(a){if(!a.get(&quot;isVisible&quot;)){SC.popups.hidePanelDidComplete(a)}}}}),locationFor:function(c,e){var h=Event.pointerLocation(e);var a=(e)?(h.x-20):100;var j=(e)?lox.y:100;var g=c.get(&quot;size&quot;);var d=Element.getDimensions(this);var b=(a+g.width+50)-d.width;if(b&gt;0){a-=b}var b=(j+g.height+20)-d.height;if(b&gt;0){j-=b}return{left:a+&quot;px&quot;,top:j+&quot;px&quot;}},viewHide:function(){SC.page.get(&quot;popups&quot;).hidePanel(this)}});SC.callOnLoad(function(){if(!SC.page){SC.page=SC.Page.create()}SC.page.popups=SC.PopupView.outletFor(null)});require(&quot;views/field/field&quot;);SC.SelectFieldView=SC.FieldView.extend({emptyElement:&quot;&lt;select&gt;&lt;/select&gt;&quot;,objects:null,nameKey:null,sortKey:null,valueKey:null,emptyName:null,localize:false,validateMenuItem:function(b,a){return true},sortObjects:function(b){var a=this.get(&quot;sortKey&quot;)||this.get(&quot;nameKey&quot;);b=b.sort(function(d,c){if(a){d=(d.get)?d.get(a):d[a];c=(c.get)?c.get(a):c[a]}return(d&lt;c)?-1:((d&gt;c)?1:0)});return b},rebuildMenu:function(){this._rebuildMenu()},mouseDown:function(a){a._stopWhenHandled=false;return false},getFieldValue:function(){var e=this.rootElement.value;var b=this.get(&quot;valueKey&quot;);var d=this.get(&quot;objects&quot;);if(e==&quot;***&quot;){e=null}else{if(e&amp;&amp;d){d=Array.from(d);var g=d.length;var c=null;while(!c&amp;&amp;(--g&gt;=0)){var a=d[g];if(b){a=(a.get)?a.get(b):a[b]}ov=(a)?((a._guid)?a._guid:a.toString()):null;if(e==ov){c=a}}}}return e},setFieldValue:function(a){if(a){a=(a._guid)?a._guid:a.toString()}else{a=&quot;***&quot;}if(this.rootElement.value!=a){this.rootElement.value=a}},_rebuildMenu:function(){var c=this.get(&quot;nameKey&quot;);var d=this.get(&quot;valueKey&quot;);var g=this.get(&quot;objects&quot;);var e=this.get(&quot;value&quot;);var h=this.get(&quot;localize&quot;);if(!d&amp;&amp;e){e=e._guid}if((e==null)||(e==&quot;&quot;)){e=&quot;***&quot;}if(g){g=Array.from(g);g=this.sortObjects(g);var a=[];var b=this.get(&quot;emptyName&quot;);if(b){if(h){b=b.loc()}b=b.escapeHTML();a.push('&lt;option value=&quot;***&quot;&gt;%@&lt;/option&gt;'.fmt(b));a.push('&lt;option disabled=&quot;disabled&quot;&gt;&lt;/option&gt;')}g.each(function(l){if(l){var k=(c)?((l.get)?l.get(c):l[c]):l.toString();if(h){k=k.loc()}k=k.escapeHTML();var m=(d)?((l.get)?l.get(d):l[d]):l;if(m){m=(m._guid)?m._guid:m.toString()}m=m.escapeHTML();var j=(this.validateMenuItem&amp;&amp;this.validateMenuItem(m,k))?&quot;&quot;:'disabled=&quot;disabled&quot; ';if(j){a.push('&lt;optgroup class=&quot;disabled&quot; %@label=&quot;%@&quot;&gt; &lt;/optgroup&gt;'.fmt(j,k))}else{a.push('&lt;option value=&quot;%@&quot;&gt;%@&lt;/option&gt;'.fmt(m,k))}}else{a.push('&lt;optgroup class=&quot;disabled&quot; disabled=&quot;disabled&quot; label=&quot; &quot;&gt; &lt;/optgroup&gt;')}}.bind(this));this.update(a.join(&quot;&quot;));this.rootElement.value=e}else{this.set(&quot;value&quot;,null)}},_objectsObserver:function(){if(!this._boundObserver){this._boundObserver=this._objectsItemObserver.bind(this)}if(this.didChangeFor(&quot;_objO&quot;,&quot;objects&quot;,&quot;nameKey&quot;,&quot;valueKey&quot;)){var d;var c=Array.from(this.get(&quot;objects&quot;));var b=this._boundObserver;if(this._objects){d=this._objects.length;while(--d&gt;=0){var a=this._objects[d];if(a&amp;&amp;a.removeObserver){if(this._nameKey&amp;&amp;this._valueKey){a.removeObserver(this._nameKey,b);a.removeObserver(this._valueKey,b)}else{a.removeObserver(&quot;*&quot;,b)}}}}this._objects=c;this._nameKey=this.get(&quot;nameKey&quot;);this._valueKey=this.get(&quot;valueKey&quot;);if(this._objects){d=this._objects.length;while(--d&gt;=0){var a=this._objects[d];if(a&amp;&amp;a.addObserver){if(this._nameKey&amp;&amp;this._valueKey){a.addObserver(this._nameKey,b);a.addObserver(this._valueKey,b)}else{a.addObserver(&quot;*&quot;,b)}}}}this._rebuildMenu()}}.observes(&quot;objects&quot;,&quot;nameKey&quot;,&quot;valueKey&quot;),_objectsItemObserver:function(b,a,c){if(b.didChangeFor(this._guid,a)){this._rebuildMenu()}},_fieldDidFocus:function(){var a=this.get(&quot;isFocused&quot;);if(!a){this.set(&quot;isFocused&quot;,true)}},_fieldDidBlur:function(){var a=this.get(&quot;isFocused&quot;);if(a){this.set(&quot;isFocused&quot;,false)}},_isFocusedObserver:function(){var a=this.get(&quot;isFocused&quot;);this.setClassName(&quot;focus&quot;,a)}.observes(&quot;isFocused&quot;),init:function(){arguments.callee.base.call(this);this._rebuildMenu();var a=this.fieldValueDidChange.bind(this,false);Element.observe(this.rootElement,&quot;change&quot;,a);var b=this._fieldDidFocus.bindAsEventListener(this);Element.observe(this.rootElement,&quot;focus&quot;,b);var c=this._fieldDidBlur.bindAsEventListener(this);Element.observe(this.rootElement,&quot;blur&quot;,c)}});require(&quot;mixins/array&quot;);SC.Set=SC.Object.extend(SC.Array,{length:0,revision:0,contains:function(a){if(a===null){return false}return this[this._guidFor(a)]===a},add:function(b){if(b==null){return NO}var a=this._guidFor(b);if(this[a]==null){this[this._guidFor(b)]=b;this.incrementProperty(&quot;length&quot;);this.incrementProperty(&quot;revision&quot;);return YES}else{return NO}},remove:function(b){if(b==null){return NO}var a=this._guidFor(b);if(this[a]===b){delete this[this._guidFor(b)];this.decrementProperty(&quot;length&quot;);this.incrementProperty(&quot;revision&quot;);return YES}else{return NO}},_guidFor:function(a){return&quot;@&quot;+SC.guidFor(a)},_each:function(b){for(var a in this){if(!this.hasOwnProperty(a)){continue}if(a.match(/^@/)){b(this[a])}}}});SC.Set.prototype.push=SC.Set.prototype.unshift=SC.Set.prototype.add;SC.Set.prototype.pop=SC.Set.prototype.shift=SC.Set.prototype.remove;SC.Set._create=SC.Set.create;SC.Set.create=function(a){if(!a){a=[]}var c={},d=a.length;while(--d&gt;=0){var b=a[d];if(b==null){continue}c[SC.Set.prototype._guidFor(b)]=b}c.length=a.length;return SC.Set._create(c)};require(&quot;views/button/button&quot;);SC.FilterButtonView=SC.ButtonView.extend({filterValue:null,filterOn:null,filterOff:null,action:function(){var a=this.get(&quot;filterValue&quot;);a=(a==this.get(&quot;filterOn&quot;))?this.get(&quot;filterOff&quot;):this.get(&quot;filterOn&quot;);this.set(&quot;filterValue&quot;,a)},filterValueObserver:function(){var a=this.get(&quot;filterValue&quot;)==this.get(&quot;filterOn&quot;);if(a!=this.get(&quot;isSelected&quot;)){this.set(&quot;isSelected&quot;,a)}}.observes(&quot;filterValue&quot;)});require(&quot;drag/drag&quot;);SC.DropTarget={isDropTarget:true,dragEntered:function(b,a){return SC.DRAG_NONE},dragUpdated:function(b,a){},dragExited:function(b,a){},dragEnded:function(b,a){},prepareForDragOperation:function(a,b){return true},performDragOperation:function(a,b){return SC.DRAG_NONE},concludeDragOperation:function(a,b){}};
--&gt;
&lt;/script&gt;
&lt;/script&gt;
  
&lt;!-- http://www.me.com/my/shared/en/16dn/javascript.js --&gt;
&lt;script  type=&quot;text/javascript&quot; &gt;
&lt;!--
/*
 * IMPORTANT NOTE: This file is licensed only for use in providing the MobileMe service,
 * or any part thereof, and is subject to the MobileMe Terms and Conditions. You may not
 * port this file to another platform without Apple's written consent.
 */

Object.extend(String.English,{&quot;Invalid.CreditCard(%@)&quot;:&quot;This credit card number is not valid.&quot;,&quot;Invalid.Email(%@)&quot;:&quot;This email address is not valid.&quot;,&quot;Invalid.NotEmpty(%@)&quot;:&quot;This field is required.&quot;,&quot;Invalid.Password&quot;:&quot;These passwords do not match. Please try again.&quot;,&quot;Invalid.General(%@)&quot;:&quot;The text entered is not valid. Please try again.&quot;,&quot;Invalid.Date(%@)&quot;:&quot;This date is not valid.&quot;,&quot;Invalid.Number(%@)&quot;:&quot;Only enter numbers in this field.&quot;,year:&quot;%@&quot;,January:&quot;January&quot;,February:&quot;February&quot;,March:&quot;March&quot;,April:&quot;April&quot;,May:&quot;May&quot;,June:&quot;June&quot;,July:&quot;July&quot;,August:&quot;August&quot;,September:&quot;September&quot;,October:&quot;October&quot;,November:&quot;November&quot;,December:&quot;December&quot;,Jan:&quot;Jan&quot;,Feb:&quot;Feb&quot;,Mar:&quot;Mar&quot;,Apr:&quot;Apr&quot;,Jun:&quot;Jun&quot;,Jul:&quot;Jul&quot;,Aug:&quot;Aug&quot;,Sep:&quot;Sep&quot;,Oct:&quot;Oct&quot;,Nov:&quot;Nov&quot;,Dec:&quot;Dec&quot;,Sunday:&quot;Sunday&quot;,Monday:&quot;Monday&quot;,Tuesday:&quot;Tuesday&quot;,Wednesday:&quot;Wednesday&quot;,Thursday:&quot;Thursday&quot;,Friday:&quot;Friday&quot;,Saturday:&quot;Saturday&quot;,Sun:&quot;Sun&quot;,Mon:&quot;Mon&quot;,Tue:&quot;Tue&quot;,Wed:&quot;Wed&quot;,Thu:&quot;Thu&quot;,Fri:&quot;Fri&quot;,Sat:&quot;Sat&quot;,&quot;Dock.Title&quot;:&quot;MobileMe %@1 - %@2 
%@3 (%@4)&quot;,&quot;Dock.Icon.Photos&quot;:&quot;Photos&quot;,&quot;Dock.Icon.Mail&quot;:&quot;Mail&quot;,&quot;Dock.Icon.Contacts&quot;:&quot;Contacts&quot;,&quot;Dock.Icon.Calendar&quot;:&quot;Calendar&quot;,&quot;Dock.Icon.Gallery&quot;:&quot;Gallery&quot;,&quot;Dock.Icon.iDisk&quot;:&quot;iDisk&quot;,&quot;Dock.Icon.Account&quot;:&quot;Account Settings&quot;,&quot;Dock.Icon.FindMyiPhone&quot;:&quot;Find My iPhone&quot;,&quot;Dock.Icon.Logout&quot;:&quot;Log out %@1 %@2 (%@3)&quot;,&quot;Dock.Icon.LogoutDefault&quot;:&quot;Log out&quot;,&quot;Dock.Icon.Help&quot;:&quot;Get help for %@&quot;,&quot;Dock.ErrorIcon.Mail&quot;:&quot;Your MobileMe Inbox is temporarily unavailable.&quot;,&quot;Dock.ErrorIcon.Contacts&quot;:&quot;Your MobileMe Contacts is temporarily unavailable.&quot;,&quot;Dock.ErrorIcon.Calendar&quot;:&quot;Your MobileMe Calendar is temporarily unavailable.&quot;,&quot;Dock.ErrorIcon.Gallery&quot;:&quot;Your MobileMe Gallery is temporarily unavailable.&quot;,&quot;Dock.ErrorIcon.iDisk&quot;:&quot;Your MobileMe iDisk is temporarily unavailable.&quot;,&quot;Dock.ErrorIcon.FindMyiPhone&quot;:&quot;Your MobileMe Find My iPhone is temporarily unavailable.&quot;,&quot;Dock.ErrorIcon.Account&quot;:&quot;Your MobileMe Account information is temporarily unavailable.&quot;,&quot;Dock.Search&quot;:&quot;Search&quot;,&quot;Button.MobileMeStatus&quot;:&quot;Check MobileMe Status&amp;#8230;&quot;,&quot;Button.Reload&quot;:&quot;Reload&quot;,&quot;Dialog.Error.Text.Title&quot;:&quot;Unable to connect to MobileMe&quot;,&quot;Dialog.Error.Text.msg1&quot;:&quot;We are unable to connect to MobileMe. This might be a problem with your internet connection or MobileMe's servers are temporarily unavailable.&quot;,&quot;Dialog.Error.Text.msg2&quot;:&quot;If you have lost your network connection, you will not be able to connect to MobileMe. If you can still connect to the internet, check MobileMe's status to see if there are known service problems.&quot;,&quot;Dialog.Unavailable.Title&quot;:&quot;%@ is temporarily unavailable.&quot;,&quot;Dialog.Unavailable.Message&quot;:&quot;We're working hard to restore normal service. We apologize for the inconvenience.&quot;,&quot;Dialog.AccountStatus.Title&quot;:&quot;%@ is not available.&quot;,&quot;Dialog.AccountStatus.Message&quot;:&quot;You can't use %@ because your account has expired or you have an email-only account. To renew or upgrade your account, go to Account Settings.&lt;br/&gt;&lt;br/&gt;If you have recently renewed or reactivated your account, access will be restored shortly. Try logging out and logging in again.&quot;,&quot;Dialog.MinusOne.Text&quot;:&quot;If this problem persists, please contact MobileMe Support.&quot;,&quot;Dialog.MinusOne.StatusLink&quot;:&quot;MobileMe Support&quot;,&quot;Dialog.MinusOne.msg2&quot;:&quot;Try reloading the page.  If this problem persists, contact %@.&quot;,&quot;Dialog.Maintenance.Title&quot;:&quot;MobileMe %@ is currently unavailable.&quot;,&quot;Dialog.Maintenance.msg1&quot;:&quot;We apologize for this service interruption and are working hard to resolve the problem.&quot;,&quot;Dialog.Maintenance.msg2&quot;:&quot;For more information, please refer to System Status on the %@.&quot;,&quot;Dialog.Maintenance.StatusLink&quot;:&quot;MobileMe Support Page&quot;,&quot;Dialog.Maintenance.AccountSpecificError.msg1&quot;:&quot;%@ failed to load because of a server error. Try reloading the page.&quot;,&quot;Dialog.Maintenance.AccountSpecificError.msg2&quot;:&quot;If this problem persists, contact %@.&quot;,&quot;Dialog.Maintenance.SupportLink&quot;:&quot;MobileMe Support&quot;,&quot;Dialog.AppIsStillLoading.Title&quot;:&quot;MobileMe %@ is loading.&quot;,&quot;Dialog.AppIsStillLoading.msg1&quot;:&quot;%@1 may take some time to load because of high traffic or a slow internet connection. If your %@2 does not load, try refreshing the page or check the System Status on the %@3.&quot;,&quot;Button.OK&quot;:&quot;OK&quot;,&quot;Dialog.Error.Text.LogInAgain&quot;:&quot;We are unable to to connect to MobileMe at this time. You may be able to resolve this issue by logging in again.&quot;,&quot;Dialog.Error.Text.CheckStatus&quot;:&quot;If the problem persists, check MobileMe status to view known service problems.&quot;,&quot;Button.LogInAgain&quot;:&quot;Log In Again…&quot;,&quot;Dialog.Progress.Retry.Title&quot;:&quot;Loading %@…&quot;,&quot;Dialog.Progress.Retry.Message&quot;:&quot;Please wait while we load your information.&quot;,&quot;MobileMe.Support.URL.External&quot;:&quot;http://www.apple.com/support/mobileme/&quot;,&quot;Loading.Mail&quot;:&quot;Loading Mail…&quot;,&quot;Loading.Account&quot;:&quot;Loading Account…&quot;,&quot;Loading.FindMyiPhone&quot;:&quot;Loading Find My iPhone…&quot;,&quot;Loading.Contacts&quot;:&quot;Loading Contacts…&quot;,&quot;Dialog.Mail.Maintenance.msg1&quot;:&quot;We are currently performing scheduled maintenance on your account.&quot;,&quot;Dialog.Mail.Maintenance.msg2&quot;:&quot;Try reloading %@1 in a few minutes. If this problem persists, contact %@2.&quot;});Mac=SC;Mac.PanelView.prototype.wrapperView=SC.View.extend({content:null,emptyElement:'&lt;div class=&quot;panel&quot;&gt;&lt;div class=&quot;inner&quot;&gt;&lt;/div&gt;&lt;div class=&quot;panel-left&quot;&gt;&lt;/div&gt;&lt;div class=&quot;panel-right&quot;&gt;&lt;/div&gt;&lt;div class=&quot;panel-bottom&quot;&gt;&lt;/div&gt;&lt;div class=&quot;panel-bottom-left&quot;&gt;&lt;/div&gt;&lt;div class=&quot;panel-bottom-right&quot;&gt;&lt;/div&gt;&lt;/div&gt;',outlets:[&quot;containerView&quot;],containerView:SC.ContainerView.extend({contentBinding:&quot;*owner.content&quot;}).outletFor(&quot;.inner?&quot;),visibleAnimation:{visible:&quot;top: 0px&quot;,hidden:&quot;top: -500px&quot;,duration:250,onComplete:function(a){if(!a.get(&quot;isVisible&quot;)){Mac.panels.hidePanelDidComplete(a)}}}});Mac.INITIAL_FADE_IN_DURATION=150;Mac.showUploader=function(g){var c=Mac.dockController.get(&quot;lang&quot;)===&quot;en&quot;?480:588;var a=315;var f=Math.round((window.screenY||window.screenTop)+(window.outerHeight||document.body.clientHeight)/2-a/2)+g.yOffset;var e=Math.round((window.screenX||window.screenLeft)+(window.outerWidth||document.body.clientWidth)/2-c/2)+g.xOffset;var b=&quot;top=%@,left=%@,height=%@,width=%@,resizable=yes,scrollbars=no,menubar=no,status=0,toolbar=0,location=0&quot;.fmt(f,e,a,c);var d=window.open(g.url,g.windowName,b);d.focus()};Mac.prettyUrl=function(a){return a.replace(/\?.+/,&quot;&quot;)};require(&quot;core&quot;);Mac.retryController=SC.Object.create({retryCount:0,retryMax:5,currentTime:0,FINAL_RETRY_DELAY:60000,MAXIMUM_RETRY_DELAY:1000,testErrorState:function(a){if(a===&quot;LOADING&quot;){this.retryMax=1}else{if(a===&quot;SERVER_ERROR&quot;){this.retryMax=0}}this.handleRetry(&quot;&quot;,{})},handleRetry:function(c,b){var h=this.get(&quot;retryCount&quot;);var f=this.get(&quot;retryMax&quot;);var d=this.get(&quot;MAXIMUM_RETRY_DELAY&quot;);var e=this.get(&quot;FINAL_RETRY_DELAY&quot;);var a=SC.page.get(&quot;retryProgressPanel&quot;);if(h&lt;=f-2){this.invokeLater(&quot;retryRequest&quot;,Math.floor(d*Math.random()),c,b)}else{if(h==(f-1)){if(window.Mail){Mail.thinClientController.removeLoadingSkeleton()}else{if(window.Account){Account.thinClientController.removeLoadingSkeleton()}}a.set(&quot;isVisible&quot;,true);this._animateProgress=SC.Timer.schedule({target:this,action:&quot;updateCurrentTime&quot;,interval:500,repeats:YES,until:Date.now()+e});this.invokeLater(&quot;retryRequest&quot;,e,c,b)}else{if(h==f){var g={msgTitle:&quot;Dialog.Error.Text.Title&quot;.loc(),msgLine1:&quot;Dialog.Error.Text.msg1&quot;.loc(),msgLine2:&quot;Dialog.Error.Text.msg2&quot;.loc(),showLeftButton:true,showRightButton:false,action1:function(){window.location.href=&quot;MobileMe.Support.URL.External&quot;.loc()}};Mac.errorController.showErrorPanel(g)}}}},handleRetrySuccess:function(){this.hidePanel()},hidePanel:function(){var a=SC.page.get(&quot;retryProgressPanel&quot;);if(this._animateProgress){this._animateProgress.invalidate();this._animateProgress=null}if(a){a.set(&quot;isVisible&quot;,false)}},_animateProgress:null,updateCurrentTime:function(){var a=this.get(&quot;currentTime&quot;);this.set(&quot;currentTime&quot;,a+500)},retryRequest:function(b,a){this.incrementProperty(&quot;retryCount&quot;);if(this.get(&quot;retryCount&quot;)==this.get(&quot;retryMax&quot;)){this.hidePanel()}new Ajax.Request(b,a)},messageTitle:function(){var a=Mac.dockController.get(&quot;selectedApplicationName&quot;);var b=Mac.dockController.locKeyForApp(a);b=b.loc();return&quot;Dialog.Progress.Retry.Title&quot;.loc(b)}.property()});require(&quot;core&quot;);Mac.DockBadgeView=SC.View.extend({emptyElement:'&lt;div class=&quot;dock-badge&quot;&gt;&lt;/div&gt;',anchorView:null,unreadCount:0,warningCount:0,infoCount:0,_updateDisplayState:function(){if(!this.didChangeFor(&quot;counts&quot;,&quot;anchorView&quot;,&quot;unreadCount&quot;,&quot;warningCount&quot;,&quot;infoCount&quot;)){return}var b=this.get(&quot;unreadCount&quot;);v