>>32-t}}),CW.SpritePreloadEnforcement={hasSpritePreloadEnforcement:YES,extraRequiredSrcs:null,extraRequiredImages:null,didFinishWaitingForImages:function(){},initMixin:function(){this.didCreateLayer&&(this._user_didCreateLayer=this.didCreateLayer),this.didCreateLayer=function(){if(this._user_didCreateLayer)var e=this._user_didCreateLayer.apply(this,arguments);return this._preload_didCreateLayer(),e}},_preload_didCreateLayer:function(){if(this.constructor.prototype.__hasPreloadedSprites__){var e=this.constructor.prototype.__preloadedExtraRequiredImages__;e&&(this.extraRequiredImages=e),SC.debug("Creating another instance of "+this.constructor+": all sprite backgrounds are confirmed to have been downloaded. Performing no preload action."),this.hasPaneAnimationSupport&&(SC.debug("Because this is the first append, and this pane has PaneAnimationSupport, we now trigger animateShow() to perform the animation."),this._hasShownFromDidCreateLayer=!0
,this.animateShow());return}this.hideForPreload(),this.preloadBackgroundSprites(this.getPreloadElementList(),this.showForPreload,this)},getPreloadElementList:function(){return SC.$A(this.$("*"))},hideForPreload:function(){this.set("isVisible",NO)},showForPreload:function(){this.set("isVisible",YES),this.hasPaneAnimationSupport&&(this._hasShownFromDidCreateLayer=!0,this.animateShow())},preloadBackgroundSprites:function(e,t,n){this.__elements__=e,this.__callback__=t,this.__target__=n,this.invokeLast("_preloadBackgroundSprites",e,t,n)},_preloadBackgroundSprites:function(e,t,n){e=this.__elements__,t=this.__callback__,n=this.__target__,this.__target__=this.__callback__=this.__elements__=undefined;var r=CW._backgroundImageLoadedness||(CW._backgroundImageLoadedness={}),i,s=0,o=!1,u=this,a=undefined,f=this.get("extraRequiredSrcs"),l=this.extraRequiredImages=f?{}:null,c=function(){s--,SC.debug("Finished loading "+this._src_+". images remaining before callback: "+s),r[this._src_]=!0,l&&this._extraKey_&&(l[this._extraKey_]=this),s===0&&(SC.debug("All images are downloaded. Now running callback."),h())},h=function(e){a&&clearTimeout(a);if(o){SC.debug("Performing the callback for all images having finished loading, but it has already been performed. Aborting.");return}e||(u.constructor.prototype.__hasPreloadedSprites__=!0,l&&(u.constructor.prototype.__preloadedExtraRequiredImages__=l)),u.didFinishWaitingForImages(),o=!0,SC.run(function(){t.apply(n||u)})};e=SC.$A(e);for(var p=0,d,v,m,g;d=e[p];p++){m=jQuery(d).css("background-image");if(!m)continue;if(m.indexOf("http")===-1)continue;if(m.indexOf
("url(")===-1)continue;m=m.substring(4,m.length-1);if((v=m.charAt(0))==='"'||v==="'")m=m.substring(1);if((v=m.charAt(m.length-1))==='"'||v==="'")m=m.substring(0,m.length-1);if(r[m])continue;if(i&&i[m])continue;(i||(i={}))[m]=!0,s++,g=new Image,g.onload=c,SC.debug("Preloading "+m),g.src=g._src_=m}if(f)for(p in f){if(!f.hasOwnProperty(p))continue;m=f[p],s++,g=new Image,g.onload=c,SC.debug("Preloading explicitly-specified image "+m),g.src=g._src_=m,g._extraKey_=p}if(s===0)SC.debug("Preloading background images, but every image was already loaded. Running callback immediately."),h();else{var y=SC.buildMode==="debug"?3e3:1500;a=setTimeout(function(){SC.debug("Attempted to preload background images, but the loading is taking longer than "+y/1e3+" seconds. Now running callback regardless of image loadedness."),h(!0)},y)}}},CW.TouchApproximation={isTouchApproximationEnabled:YES,distanceThreshold:50,touchStart:function(e){var t=this.convertFrameFromView({x:e.pageX,y:e.pageY}),n=t.x,r=t.y,i,s,o=this.get("touchApproximationViews")||this.get("childViews"),u=this.get("distanceThreshold"),a=null,f=Infinity,l,c,h,p,d;p=o.get("length");for(h=0;hc.x+c.width&&(i=n-(c.x+c.width)),rc.y+c.height&&(s=r-(c.y+c.height)),i!==-1&&s!==-1?i=(i+s)/2:s!==-1&&(i=s),i!==-1&&i>18&63,l=p>>12&63,c=p>>6&63,h=p&63,s[r++]=t.charAt(f)+t.charAt(l)+t.charAt(c)+t.charAt(h);while(n>4,s=(a&15)<<4|f>>2,o=(f&3)<<6|l,t+=String.fromCharCode(i),f!==64&&(t+=String.fromCharCode(s)),l!==64&&(t+=String.fromCharCode(o));t=this.decodeUTF8(t)}else CW.fatalError("Cannot decode blank input");return t},encodeUTF8:function(e){e=e.replace(/\r\n/g,"\n");var t="",n,r,i;for(n=0,r=e.length;n>6|192),t+=String.fromCharCode(i&63|128)):i<65536?(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(i&63|128)):(t+=String.fromCharCode(i>>18|240),t+=String.fromCharCode(i>>12&63|128),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(i&63|128));return t},decodeUTF8:function(e){var t="",n=0,r,i,s,o;r=i=
s=o=0;var u=String.fromCodePoint||this._fromCodePoint,a=String.fromCharCode;while(n191&&r<224?(i=e.charCodeAt(n++),t+=a((r&31)<<6|i&63)):r>=224&&r<240?(i=e.charCodeAt(n++),s=e.charCodeAt(n++),t+=a((r&15)<<12|(i&63)<<6|s&63)):r>=240&&(i=e.charCodeAt(n++),s=e.charCodeAt(n++),o=e.charCodeAt(n++),t+=u((r&7)<<18|(i&63)<<12|(s&63)<<6|o&63));return t},_fromCodePoint:function(e){if(e<65536)return String.fromCharCode(e);var t=((e-=65536)>>10)+55296,n=e%1024+56320;return String.fromCharCode(t,n)},_b64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}),CW.DATE_ONLY=0,CW.DATE_TIME=1,CW.DATE_TIME_TO_MIDNIGHT=3,CW.DATE_TIME_SEC=4,CW.DAY_MIN_DUR=1440,CW.DAY_MILLIS_DUR=864e5,CW.Date={value:null,dateType:CW.DATE_ONLY,timeFormat:null,fullDateFormat:null,dateFormat:null,_dateObj:null,_timezoneOffset:0,incrementSeconds:function(e){return this.seconds(this.seconds()+e),this},incrementMinutes:function(e){return this.minutes(this.minutes()+e),this},incrementHours:function(e){return this.hours(this.hours()+e),this},incrementDate:function(e){return this.date(this.date()+e),this},incrementMonth:function(e){return this.month(this.month()+e),this},incrementYear:function(e){return this.year(this.year()+e),this},now:function(){this._dateObj=new Date;var e=this._dateObj.getTime(),t=this._dateObj.getTimezoneOffset()*6e4;return this._dateObj.setTime(e-t),this._dateObj._isUsingUTC=!0,this._dateComponentDidChange(),this},dateComponent:function(){var e=this.value;return e?e[0]:null},date:function(e){return e!==undefined?(this._dateObj
.setUTCDate(e),this._dateComponentDidChange()):this.value[3]},dateObject:function(){return this._dateObj},day:function(){return this._dateObj.getUTCDay()},fullYear:function(e){return e!==undefined?(this._dateObj.setUTCFullYear(e),this._dateComponentDidChange()):this.value[1]},hours:function(e){return e!==undefined?(this._dateObj.setUTCHours(e),this._dateComponentDidChange()):this.value[4]},minutes:function(e){return e!==undefined?(this._dateObj.setUTCMinutes(e),this._dateComponentDidChange()):this.value[5]},seconds:function(e){return this.dateType===CW.DATE_TIME_SEC?e!==undefined?(this._dateObj.setUTCSeconds(e),this._dateComponentDidChange()):this.value[6]:0},month:function(e){return e!==undefined?(this._dateObj.setUTCMonth(e),this._dateComponentDidChange()):this._dateObj.getUTCMonth()},time:function(e){return e!==undefined?(this._dateObj.setTime(e),this._dateComponentDidChange()):this._dateObj.getTime()},timezoneOffset:function(e){return e!==undefined?(this.set("_timezoneOffset",e),this._dateComponentDidChange()):this.get("_timezoneOffset")},year:function(e){return this.fullYear(e)},changeDateType:function(e){return e===this.dateType?this:(e===CW.DATE_ONLY||e===CW.DATE_TIME||e===CW.DATE_TIME_TO_MIDNIGHT||e===CW.DATE_TIME_SEC?(this.dateType=e,this._dateComponentDidChange()):CW.fatalError("You must provide a valid date type."),this)},weekNumber:function(e){e=e?e:this._dateObj;var t=new Date(e.getUTCFullYear(),0,1),n=1,r=t.getUTCDay()-n,i=Math.floor((e.getTime()-t.getTime())/CW.DAY_MILLIS_DUR)+1,s,o,u,a,f;return r=r>=0?r:r+7,r<4?(s=Math.floor((i+r-1)/7)+1,s>52&&(o=new Date(e.getUTCFullYear
()+1,0,1),u=o.getUTCDay()-n,u=u>=0?u:u+7,s=u<4?1:53)):(a=Math.floor((i+r-1)/7),s=a===0?53:a),f=e.getUTCFullYear(),s===53&&e.getUTCMonth()===0?f--:s===1&&e.getUTCMonth()===11&&f++,[f,s]},weekNumberToDate:function(e,t){e=parseInt(e,0),t=parseInt(t,0);var n=new Date(t,0,10,12,0,0),r=new Date(t,0,4,12,0,0),i=new Date(r.getTime()-n.getUTCDay()*CW.DAY_MILLIS_DUR),s=new Date(i.getTime()+(e-1)*6048e5),o=new Date(s.getTime()+5184e5),u=[s,o];return u},dateRangeOfWeek:function(){var e=this._dateObj,t=e.getUTCDay(),n;t===0?n=6:n=t+1;var r=new Date(e.valueOf());r.setDate(e.getUTCDate()-n);var i=new Date(e.valueOf());return i.setDate(e.getUTCDate()+(7-e.getUTCDay())),[r,i]},daysInMonth:function(){var e=this.year(),t=this.month(),n=[31,28,31,30,31,30,31,31,30,31,30,31];return t===1&&(e%4===0&&e%100!==0||e%400===0)?29:n[t]},toTimeString:function(e){return e?this.format(e):this.timeFormat?this.format(this.timeFormat):this._dateObj.toString().substr(16,5)},toString:function(e){if(e)return this.format(e);if(this.fullDateFormat)return this.format(this.fullDateFormat);var t=this._dateObj;return t?t.toString():"null"},toDateString:function(e){return e?this.format(e):this.dateFormat?this.format(this.dateFormat):this._dateObj.toString().substr(0,15)},parse:function(e){var t=this._dateObj;return SC.typeOf(e)===SC.T_ARRAY?(isNaN(e[3])||t.setUTCDate(e[3]),isNaN(e[1])||t.setUTCFullYear(e[1]),isNaN(e[2])||t.setUTCMonth(e[2]-1),!isNaN(e[3])&&e[3]!==t.getUTCDate()&&t.setUTCDate(e[3]),this.dateType===CW.DATE_ONLY?(t.setUTCHours(12),t.setUTCMinutes(0)):(isNaN(e[4])||t.setUTCHours(e[4]),isNaN(e[5])||t.setUTCMinutes
(e[5]),this.dateType===CW.DATE_TIME_SEC&&(isNaN(e[6])||t.setUTCSeconds(e[6])))):e&&e.getTime&&(e._isUsingUTC?(t.setUTCFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setUTCHours(e.getUTCHours()),t.setUTCMinutes(e.getUTCMinutes()),this.dateType===CW.DATE_TIME_SEC&&t.setUTCSeconds(e.getUTCSeconds())):(t.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setUTCHours(e.getHours()),t.setUTCMinutes(e.getMinutes()),this.dateType===CW.DATE_TIME_SEC&&t.setUTCSeconds(e.getSeconds()))),this.dateType!==CW.DATE_TIME_SEC&&t.setUTCSeconds(0),t.setUTCMilliseconds(0),t._isUsingUTC=!0,this._dateObj=t,this._dateComponentDidChange(),this},format:function(e,t){e+="",t&&(e=e.loc());var n=this._dateObj,r=this.value||{},i=e.length,s="",o=0,u="",a="",f=r[1]+"",l=r[2],c=r[3],h=n.getUTCDay(),p=r[4],d=r[5],v=n.getUTCSeconds(),m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_;f.length<3&&(f>=0&&f<=28?f=""+(f+2e3):f>=28&&f<=99&&(f=""+(f+1900))),r.y=""+f,r.yyyy=f,r.yy=f.substring(2,4),r.M=l,r.MM=LZ(l),r.MMM=MONTH_NAMES[l-1],r.NNN=MONTH_NAMES[l+11],r.d=c,r.dd=LZ(c),r.E=DAY_NAMES[h+7],r.EE=DAY_NAMES[h],r.H=p,r.HH=LZ(p),p===0?r.h=12:p>12?r.h=p-12:r.h=p,r.hh=LZ(r.h),p>11?r.K=p-12:r.K=p,r.k=p+1,r.KK=LZ(r.K),r.kk=LZ(r.k),p>11?r.a="SC.Date.Period.PM".loc():r.a="SC.Date.Period.AM".loc(),r.m=d,r.mm=LZ(d),r.s=v,r.ss=LZ(v);while(o0?(n=CW.Date._pool.pop(),n.value=null,n.dateType=CW.DATE_ONLY):n=SC.beget(CW.Date),n._dateObj=new Date,n._dateObj._isUsingUTC=!0,e&&SC.typeOf(e)===SC.T_NUMBER&&(t=e,e=null),t!==undefined&&(n.dateType=t),n.parse(e),n},createFromDateObject:function(e,t){var n;return CW
.Date._pool.length>0?(n=CW.Date._pool.pop(),n.value=null,n.dateType=CW.DATE_ONLY):n=SC.beget(CW.Date),n._dateObj=e,n.dateType=t||CW.DATE_ONLY,n},createFromDateComponent:function(e){e||CW.fatalError("createFromDateComponent(): No date component was specified");var t=Math.floor(e/1e4),n=Math.floor(e/100)-t*100,r=e-t*1e4-n*100,i=[e,t,n,r],s=CW.Date.create(i,CW.DATE_ONLY);return s},areDatesInRange:function(e,t,n,r){return!e||!t?NO:t[0]===n[0]&&t[6]===1440?NO:e[0]>=n[0]&&e[0]<=r[0]||t[0]>=n[0]&&t[0]<=r[0]||e[0]<=n[0]&&t[0]>=r[0]},compareDates:function(e,t,n){if(!e||!t)return e||t;var r,i,s,o;return r=e._dateObj?e.components():e,i=t._dateObj?t.components():t,r[0]o?n?e:t:null):n?e:t},greaterThan:function(e,t){SC.typeOf(e)===SC.T_ARRAY&&(e=CW.Date.create(e)),SC.typeOf(t)===SC.T_ARRAY&&(t=CW.Date.create(t));var n=this.compareDates(e,t,YES);return n===e?YES:NO}}),CW.DateParser={parseDate:function(e,t,n,r){var i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w=["Sunday".loc().toLowerCase(),"Monday".loc().toLowerCase(),"Tuesday".loc().toLowerCase(),"Wednesday".loc().toLowerCase(),"Thursday".loc().toLowerCase(),"Friday".loc().toLowerCase()],E=e.toLowerCase(),S,x,T,N,C,k=SC.Locale.currentLocale.language,L;if(!isNaN(e)&&parseInt(e,10)>31)i=CW.Date.create(t),b=e.length,b===2?(n?(s=parseInt(e.charAt(1),10)-1,o=parseInt(e.charAt(0),10)):(s=parseInt(e.charAt(0),10)-1,o=parseInt(e.charAt(1),10)),u=(new Date).getFullYear()):b===3?(v=e,a=parseInt(e.charAt(0),10),c=parseInt(e.substr(0,2),10),h=parseInt(e.substr(1,2),10),l=parseInt(e.charAt(2),10),
n?(s=h<=12?h-1:l-1,o=h<=12?a:c):(s=c<=12?c-1:a-1,o=c<=12?l:h),u=(new Date).getFullYear()):b===4?(m=e,a=parseInt(e.charAt(0),10),c=parseInt(e.substr(0,2),10),p=parseInt(e.substr(2,2),10),f=parseInt(e.charAt(1),10),n?(s=h<=12?h-1:l-1,o=h<=12?a:c):(s=c<=12&&p<=31?c-1:a-1,o=c<=12&&p<=31?p:f,u=c<=12&&p<=31?(new Date).getFullYear():2e3+p)):b===5?(g=parseInt(e,10).toString(),a=parseInt(e.charAt(0),10),c=parseInt(e.substr(0,2),10),h=parseInt(e.substr(1,2),10),y=parseInt(e.substr(3,2),10),l=parseInt(e.substr(2,1),10),n?(s=h<=12?h-1:l-1,o=h<=12?a:c):(s=c<=12?c-1:a-1,o=c<=12?l:h),u=2e3+y):b>=6&&b<=8&&(c=parseInt(e.substr(0,2),10),p=parseInt(e.substr(2,2),10),l=parseInt(e.charAt(2),10),y=parseInt(e.substr(3,2),10),d=parseInt(e.substr(4),10),b===6&&p===20||b===7&&y===20?b===6&&p===20?n?(s=f-1,o=a):(s=a-1,o=f):b===7&&y===20&&(n?(s=h<=12?h-1:l-1,o=h<=12?a:c):(s=c<=12?c-1:a-1,o=c<=12?l:h)):(s=c<=12?c-1:p<=12&&c>=1&&c<=31?p-1:-1,o=p>=1&&p<=31&&s===c-1?p:c>=1&&c<=31&&s===p-1?c:-1,u=b>6?d:2e3+d)),s<0||s>=12||o<1||o>31||u<0?i=null:(i._dateObj.set({month:s,day:o,year:u}),i._dateComponentDidChange());else if(!isNaN(e)&&(L=parseInt(e,10))<31){i=CW.Date.create();var A=Date.parse(e);SC.none(A)?i=null:(i._dateObj=A,i._dateComponentDidChange())}return i}},CW.Response=SC.XHRResponse.extend({bodyShouldBeLogged:function(){var e=this.get("status");return!SC.none(e)&&e!==200}.property("status"),fakeReply:null,overallTimeoutTimer:null,addedToOutgoingQueueTimestamp:null,getFullAddress:function(){return this.get("request").getFullAddress()},notify:function(){var e=arguments.callee.base.apply(this,arguments),t=
CW.RequestManagement,n;return t&&(n=t.sharedInstance()),n&&n.removeOutstandingResponse(this),e},fire:function(e){var t=this.get("request"),n=t?t.get("source"):null;n&&n.willSend&&n.willSend(t,this),t.freeze(),this.get("isCancelled")||this.invokeTransport(e);var r=t.get("timeout");if(r){var i=SC.Timer.schedule({target:this,action:"timeoutReached",interval:r,repeats:NO});this.set("timeoutTimer",i)}!this.get("isCancelled")&&n&&n.didSend&&n.didSend(t,this)},timeoutReached:function(){var e=this.get("timeoutTimer");return e&&e.invalidate(),e=this.get("overallTimeoutTimer"),e&&e.invalidate(),arguments.callee.base.apply(this,arguments)},receive:function(e,t){var n=this.get("overallTimeoutTimer");return n&&n.invalidate(),arguments.callee.base.apply(this,arguments)},invokeTransport:function(){var e=this.get("fakeReply"),t;if(!e){var n=this.createRequest(),r,i,s;return this.set("rawRequest",n),s=!!this.getPath("request.isAsynchronous"),s&&(!SC.browser.msie&&!SC.browser.opera?SC.Event.add(n,"readystatechange",this,this.finishRequest,n):(r=this,i=function(){if(!r)return null;var e=r.finishRequest();return e&&(r=null),e},n.onreadystatechange=i)),n.open(this.get("type"),this.getFullAddress(),s),this.setRequestHeaders(),this.getPath("request.useCrossDomain")&&this.getPath("request.withCredentials")&&(n.withCredentials=!0),n.send(this.getPath("request.encodedBody")),s||this.finishRequest(),n}this.set("rawRequest",e),t=e.get("delay"),this.invokeLater(this._triggerFakeReply,t)},setRequestHeaders:function(){var e=this.get("rawRequest"),t=this.getPath("request.headers");for(var n in t)e.setRequestHeader
(n,t[n])},cancelTransport:function(){var e=this.get("fakeReply");if(e)return;return arguments.callee.base.apply(this,arguments)},_triggerFakeReply:function(){var e=this.get("fakeReply");e&&(e.set("readyState",4),this.finishRequest(undefined))}}),CW.IFramePostMessageResponse=CW.Response.extend({isCrossDomain:YES,requestId:-1,rawResponse:null,_activeRequests:{},destinationDomain:"",headers:function(){var e=this.get("rawResponse");if(!e)return{};var t=e.headers,n={};return t?(t.split("\n").forEach(function(e){var t=e.indexOf(":"),r,i;t>=0&&(r=e.slice(0,t),i=e.slice(t+1).trim(),n[r]=i)},this),n):n}.property("status").cacheable(),header:function(e){var t=this.get("headers");return t[e]||null},encodedBody:function(){var e=this.get("rawResponse");return e?e.responseText:""}.property("status").cacheable(),invokeTransport:function(e){var t=this.get("request"),n={requestId:e,url:t.getFullAddress(),type:t.get("type"),headers:t.get("headers"),body:t.get("body"),isAsynchronous:t.get("isAsynchronous")},r=SC.Request.manager.get("crossDomainIFrames")[t.get("destinationDomain")];try{r.contentWindow.postMessage(SC.json.encode(n),this.get("destinationDomain"))}catch(i){SC.debug('CW.IFramePostMessageResponse: iFrame not properly loaded from "%@". Maybe ajax_sender.html is missing?',r.src)}},finishRequest:function(e){var t=this.get("rawResponse"),n=t?t.readyState:null,r,i,s;return n===4&&!this.get("timedOut")?(this.receive(function(e){if(!e)return;i=-1;try{i=t.status||0}catch(n){}if(i<200||i>=300){try{s=t.statusText||""}catch(o){s=""}r=SC.$error(s||"HTTP Request failed","Request",i),r.set("errorValue"
,this),this.set("isError",YES),this.set("errorObject",r)}this.set("status",i)},this),!SC.browser.msie&&!SC.browser.opera?SC.Event.remove(t,"readystatechange",this,this.finishRequest):t.onreadystatechange=null,YES):NO},cancelTransport:function(){this.set("rawRequest",null)}}),CW.ImagePreloader=SC.Object.extend({images:null,callBack:null,init:function(){this.loadImages()},loadImages:function(){this._numLoaded=0,this._numProcessed=0,this._allImages=[],this._numImages=this.get("images").length;for(var e=0;e=0;r--)if(n[r].performKeyEquivalent(e,t))return YES;return NO},installKeyResponder:function(){var e=SC.RootResponder.prototype.attemptKeyEquivalent;SC.RootResponder.reopen({attemptKeyEquivalent:function(t){var n=e.apply(this,arguments);if(n)return n;var r=t.commandCodes()[0];return r?CW.performKeyEquivalent(r,t):NO}}),SC.View.reopen(CW.ViewKeyHandlingHelpers),SC.Pane.reopen(CW.KeyResponder),SC.ButtonView.reopen(CW.ButtonKeyHandlingHelpers)}}),CW.keyResponders.push(CW.globalKeyResponder),CW.LOG_NOTIFICATIONS=NO,CW.notificationCenter=SC.Object.create({_subscriptions:{},postNotification:function(e){var t=this._subscriptions;if(!t[e]){CW.LOG_NOTIFICATIONS&&SC.info("Notification Center: Could not find any subscribers for %@, returning."
.fmt(e));return}var n=t[e],r=n.length,i=SC.A(arguments).slice(1);i||(i=[]),CW.LOG_NOTIFICATIONS&&SC.info("Notification Center: Posting notification %@".fmt(e));for(var s=0;s0?(t._receivedAtWhileSuspended=SC.getCurrentTimeForPerformance(),r=n._suspendedResponses,r?r.push(t):r=n._suspendedResponses=[t],t.get("isCancelled")||(t._receivedWhenSuspended=YES,t.set("isCancelled",YES))):CW._logResponseIfAppropriate(t)},destinationDomain:function(){var e=this.getFullAddress(),t=null,n,r;if(e){if(URI(e).protocol()===""||URI(e).host()==="")return SC.error("Malformed URL: "+e),null;t=URI(e).protocol()+"://"+URI(e).host()}return t}.property("addressPrefix","address"),cycleDidChange:function(){var e=CW.RequestManagement,t=e?e.sharedInstance():null,n,r;t&&(n=this.get("cycle"),this._isPending?n!==this._cycleWhenPended&&t.cycleDidChangeForPendingRequest():(r=this._cycleWhenSent,r&&n!==r&&t.cycleDidChangeForOutstandingResponse()))}.observes("cycle"),toString:function(){var e=arguments.callee.base.apply(this,arguments),t=this.get("address");return t&&(e+=" ("+t+")"),e},_crossDomainMethod:null,_queryParameters:null,_isPending:NO,_cycleWhenPended:null,_cycleWhenSent:null,_determineResponseClassAndMethod:function(){var e=SC.kindOf,t,
n;if(this.get("useCrossDomain")){t=this.get("responseClass"),t||(XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?t=CW.Response:this._isAppropriateForXDomainRequest()?t=CW.XDRResponse:window.postMessage?t=CW.IFramePostMessageResponse:SC.browser.msie&&SC.browser.version<=7&&(t=CW.IFrameDocumentDomainResponse));if(!this._crossDomainMethod){if(e(t,CW.IFramePostMessageResponse))n="postMessage";else if(e(t,CW.IFrameDocumentDomainResponse))n="documentDomain";else if(e(t,CW.Response)||e(t,CW.XDRResponse))n="cors";n&&(this._crossDomainMethod=n)}}else t=CW.Response;!this.get("responseClass")&&t&&this.set("responseClass",t)},_isAppropriateForXDomainRequest:function(){var e=this.get("headers"),t=YES,n;if(e)for(n in e)if(n.toLowerCase()!=="content-type"||e[n]!=="text/plain")t=NO;return t&&SC.browser.msie&&SC.browser.version<=9&&!this.get("withCredentials")?YES:NO},_getFakeReply:function(){var e=CW.get("fakeReplyQueue"),t=e?e.length:0,n=null,r,i,s,o,u,a;if(t>0){r=this.get("isBackgroundRequest"),i=null;for(s=0;s0&&t.length=n[0]&&e<=n[1])return YES}return NO},stringIsCJK:function(e){e=e.trim();if(SC.empty(e))return NO;var t=0,n=e.length-1;while(t<=n)if(!this.characterCodeIsCJK(e.charCodeAt(t++))||!this.characterCodeIsCJK(e.charCodeAt(n--)))return NO;return YES}}),SC.time=
function(e){var t=SC.beget(fn);return t.value=e,t},function(){var e=new Date;SC.mixin(SC.time,{month:function(t,n){return e.setTime(t),n===undefined?e.getMonth():(e.setMonth(n),e.getTime())},utc:function(t){return e.setTime(t),t+e.getTimezoneOffset()*60*1e3},local:function(t){return e.setTime(t),t-e.getTimezoneOffset()*60*1e3},parse:function(e){},format:function(e){}})}(),SC.time.fmt=SC.time.format,SC.time.fn={done:function(){return this.value}},"month day year".split(" ").forEach(function(e){SC.time.fn[e]=function(t){return t===undefined?SC.time[e](this.value):(this.value=SC.time[e](this.value,t),this)}});var MONTH_NAMES=["January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DAY_NAMES=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat"];SC.Locale.define("en",{longMonthNames:"January February March April May".split(" "),shortMonthNames:[],shortDateFormat:"dd/mm/yy",longDateFormat:""}),SC.mixin(Date,{isDate:function(e,t){var n=Date.getDateFromFormat(e,t);return n===0?!1:!0},compareDates:function(e,t,n,r){var i=Date.getDateFromFormat(e,t),s=Date.getDateFromFormat(n,r);return i===0||s===0?-1:i>s?1:0},getDateFromFormat:function(e,t){e+="",t+="";var n=0,r=0,i="",s="",o="",u,a,f=new Date,l=f.getFullYear(),c=f.getMonth()+1,h=1,p=f.getHours(),d=f.getMinutes(),v=f.getSeconds(),m="",g=SC.Locale.currentLocale;while(r70?l=1900+(l-0):l=2e3+(l-0))}else if(s==="MMM"||s==="NNN"){c=0;for(var y=0;y11){c=y+1,c>12&&(c-=12),n+=b.length;break}}if(c<1||c>12)return 0}else if(s==="EE"||s==="E")for(y=0;y12)return 0;n+=c.length}else if(s==="dd"||s==="d"){h=Date._getInt(e,n,s.length,2);if(h===null||h<1||h>31)return 0;n+=h.length}else if(s==="hh"||s==="h"){p=Date._getInt(e,n,s.length,2);if(p===null||p<1||p>12)return 0;n+=p.length}else if(s==="HH"||s==="H"){p=Date._getInt(e,n,s.length,2);if(p===null||p<0||p>23)return 0;n+=p.length}else if(s==="KK"||s==="K"){p=Date._getInt(e,n,s.length,2);if(p===null||p<0||p>11)return 0;n+=p.length}else if(s==="kk"||s==="k"){p=Date._getInt(e,n,s.length,2);if(p===null||p<1||p>24)return 0;n+=p.length,p--}else if(s==="mm"||s==="m"){d=Date._getInt(e,n,s.length,2);if(d===null||d<0||d>59)return 0;n+=d.length}else if(s==="ss"||s==="s"){v=Date._getInt(e,n,s.length,2);if(v===null||v<0||v>59)return 0;n+=v.length}else if(s==="a"){if(e.substring(n,n+2).toLowerCase()==="am")m="AM";else{if(e.substring(n,n+2).toLowerCase()!=="pm")return 0;m="PM"}n+=2}else{if(e.substring(n,n+s.length)!=s)return 0;n+=
s.length}}if(n!==e.length)return 0;if(c===2)if(l%4===0&&l%100!==0||l%400===0){if(h>29)return 0}else if(h>28)return 0;if(c===4||c===6||c===9||c===11)if(h>30)return 0;p<12&&m=="PM"?p=p-0+12:p>11&&m=="AM"&&(p-=12);var E=new Date(l,c-1,h,p,d,v);return E.getTime()},parseDate:function(e){var t=arguments.length==2?arguments[1]:!1,n=["E NNN dd HH:mm:ss UTC yyyy","y-M-d","y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d","d MMM y","d.MMM.y","y MMM d","y.MMM.d"],r=["M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d"],i=["d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M"],s=t?n.concat(i,r):n.concat(r,i),o=null;o=0;var u=(new Date).getTime();switch(e.toLowerCase()){case SC.String.loc("yesterday"):o=u-864e5;break;case SC.String.loc("today"):case SC.String.loc("now"):o=u;break;case SC.String.loc("tomorrow"):o=u+864e5}if(o>0)return new Date(o);for(var a=0;a=n;i--){var s=e.substring(t,t+i);if(s.length12?L.h=l-12:L.h=l,L.hh=LZ(L.h),l>11?L.K=l-12:L.K=l,L.k=l+1,L.KK=LZ(L.K),L.kk=LZ(L.k),l>11?L.a="PM":L.a="AM",L.m=c,L.mm=LZ(c),L.s=h,L.ss=LZ(h);while(r=0;n--){var r=e[n],i=this._fileIsAcceptableToUpload(r);if(i!==CW.UPLOADER_READY)t.push(this._errorForFile(r,i));else if(this.shouldUploadFile(r))try{this._createAndSendUploadRequest(r)}catch(s){console.warn(s.toString())}}return t},_xhrHeaders:function(){var e={"If-Modified-Since":"Mon, 26 Jul 1997 05:00:00 GMT","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};return this.get("encloseFileWithinForm")||(e["Content-Type"]="text/plain"),e}.property("encloseFileWithinForm").cacheable(),_fileTooBigDescription:"Uploader.fileTooBigDescription".loc(),_wrongFileTypeDescription:"Uploader.wrongFiletypeDescription".loc(),_createAndSendUploadRequest:function(e){var t=this.get("uploadURL");if(!t)throw"%@: Can't upload file if uploadURL is not set.".fmt(this);var n=this.get("encloseFileWithinForm"),
r;n?(r=new FormData,r.append(this.get("formFieldName"),e)):r=e;var i=new XMLHttpRequest;if(!i)throw this._errorForFile(e,CW.UPLOADER_MISSING_XHR);this.willUploadFile(e,i),i.open("POST",t,!0),this.setRequestHeaders(e,i),this.get("withCredentials")&&(i.withCredentials=YES),i.send(r)},_fileIsAcceptableToUpload:function(e){var t=CW.UPLOADER_READY,n=this.get("maximumFileSize"),r=this.get("allowedFileTypes"),i=e.type.split("/")[1];return e.fileSize>n&&(t=CW.UPLOADER_FILE_TOO_BIG),r.indexOf(i)===-1&&(t=CW.UPLOADER_INCOMPATIBLE_FILE_TYPE),t},_errorForFile:function(e,t){var n="",r="";switch(t){case CW.UPLOADER_INCOMPATIBLE_FILE_TYPE:n=this._wrongFileTypeDescription;break;case CW.UPLOADER_FILE_TOO_BIG:n=this._fileTooBigDescription}return SC.$error(n,r,e,t)}}),CW.XDRResponse=CW.Response.extend({createRequest:function(){var e=new XDomainRequest,t=this;return e.timeout=null,e.onerror=function(){if(!t)return null;var e=t.finishRequest();return e&&(t=null),e},e.onload=function(){if(!t)return null;var e=t.finishRequest(200);return e&&(t=null),e},e},setRequestHeaders:function(){},finishRequest:function(e){var t=this.get("rawRequest");return t.readyState=4,t.status=e,arguments.callee.base.apply(this,arguments)}}),window.CW||(window.CW={}),function(){var e=CW.Animator=CW.Anim={fps:60,fpsModifier:65/60,tasks:[],speedMultiplier:1,frameCount:0,isActive:!1,isInFrame:!1,extraStatus:{},ENABLE_OLD_IE:!0,_runningCWAguid:0,_hasSC:!!(window.SC&&SC.RunLoop&&SC.Object),_frameTimeNoiseLevelingWindowSize:30,_frameNoiseLevelerLog:[],_movingAverageFrameTime:function(){for(var t=0,n=e._frameNoiseLevelerLog,r=0
,i=n.length;t=300&&o>=(r=Math.max(e._movingAverageFrameTime(),60))*5?(o=0,i.unshift(r/2)):i.unshift(o),i.length<=s||(i.length=s),e.frameTime=o;var f=!e._hasSC||SC.RunLoop.isRunLoopInProgress();if(!e.shouldSkipFrame||!e.shouldSkipFrame()){f||(SC.RunLoop.begin(),e._SCLoopBegan()),e.trigger("preframe");for(var l=0,c;c=e.tasks[l];l++)c.running&&c.elapse(o*e.speedMultiplier);e._canAddLastSecondTasks=!1;for(l=0;c=e.tasks[l];l++)c.running?c&&(c.fps||e.fps)>a&&(a=c.fps||e.fps):(c._inCWATasks=!1,e.tasks.splice(l--,1));e.trigger("frame"),f||(SC.RunLoop.end(),e._SCLoopEnded()),e.isActive=!!e.tasks.length,e.frameCount++}else e._canAddLastSecondTasks=!1;e.frameRate=Math.round(1e5/u)/100,e.computeTime=(new Date).valueOf()-e.now;var h=Math.round(1e3/(a*e.fpsModifier));e.timeoutWaitTime=Math.max(0,h-e.computeTime),e.clearNextTimeout(),!n&&e.isActive?e.useRAF?e._timeout=window.requestAnimationFrame(e.nextFrame,document.body):e._timeout=setTimeout(e.nextFrame,e.lock16?16:e.timeoutWaitTime):e.stop(),e.firstActiveFrame&&(e.firstActiveFrame=!1),e.isInFrame=!1,e._alreadyExpeditedNextFrame=!1
},start:function(){if(e.isActive){e._canAddLastSecondTasks||e.expediteNextFrame();return}e.firstActiveFrame=!0,e.isActive=!0,e._lastFrameTime=-1,e.frameTime=1e3/e.fps,e.frameRate=1e3/e.frameTime,e.computeTime=0,e.trigger("start"),e.nextFrame()},stop:function(){e.isActive=!1,e.frameTime=Infinity,e.frameRate=0,e.computeTime=NaN,e.timeoutWaitTime=NaN,e.clearNextTimeout(),e.trigger("stop")},clearNextTimeout:function(){if(!e._timeout)return;e.useRAF?window.cancelRequestAnimationFrame(e._timeout):clearTimeout(e._timeout),e._timeout=0},expediteNextFrame:function(){if(e._alreadyExpeditedNextFrame||!e.isActive)return;e._alreadyExpeditedNextFrame=!0,e.clearNextTimeout(),e._timeout=setTimeout(e.nextFrame,0)},handleTask:function(t){if(!t||t.isDestroyed)return;if(!t._inCWATasks){if(t.name)for(var n=0,r=e.tasks,i;i=r[n];n++)i.name===t.name&&i.stop();e.tasks.push(t)}t._inCWATasks=!0,e.start()},tellStop:function(){arguments._isArgs_=!0,this.performMethodOn("stop",arguments)},tellFinish:function(){arguments._isArgs_=!0,this.performMethodOn("finish",arguments)},performMethodOn:function(e,t){var n=1,r=arguments;t&&t._isArgs_&&(n=0,r=t);for(var i=n,s,o=r.length;i").split(" ").join(" ")},toCamel:function(e,t){for(var n=0,r=e.length;n.9999||isNaN(t)?this.removeOpacity(e):(e.cwa$opacity=t,e.style.opacity=t,t)):-1},removeOpacity:function(e){return e?(e.cwa$opacity=1,e.style.opacity="",1):-1},encodeColor:function(e,t,n){if(typeof e=="object"&&typeof e.r=="number"&&typeof e.g=="number"&&typeof e.b=="number")t=e.g,n=e.b,e=e.r;else if(typeof e=="object")t=e[1],n=e[2],e=e[0];else if(typeof e=="string"){if(e.charAt(0)=="#"&&e.length===7)return e;e=CW.Anim.decodeColor(e),t=e[1],n=e[2],e=e[0]}return e=Math.round(Math.max(0,Math.min(255,e))).toString(16),e.length==1&&(e="0"+e),t=Math.round(Math.max(0,Math.min(255,t))).toString(16),t.length==1&&(t="0"+t),n=Math.round(Math.max(0,Math.min(255,n))).toString(16),n.length==1&&(n="0"+n),("#"+e+t+n).toUpperCase()},decodeColor:function(t){e.colors&&e.colors[t]&&(t=e.colors[t]);var n,r,i,s;if((n=typeof t)=="number"||n=="object")return undefined;t=t.replace(/\s+/g,"");if(t.charAt(0)=="#")t.length==4&&(t="#"+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)+t.charAt(3)+t.charAt(3)),r=parseInt(t.substring(1,3),16),i=parseInt(t.substring(3,5),16),s=parseInt(t.substring(5,7),16);else{var o;if(t.indexOf("rgba(")!=-1)o=5;else{if(t.indexOf("rgb(")==-1)return undefined;o=4}t=t.substring(o,t.length-1).split(","),r=parseInt(t[0],10),i=parseInt(t[1],10),s=parseInt(t[2],10)}return[r,i,s]},colors:{red:"#ff0000","orange red":"#ff4500",orange:"#ff7f00",yellow:"#ffff00",green:"#00ff00","forest green":"#228b22",cyan:"#00ffff","light sea green":"#20b2aa",blue:"#0000ff","cornflower blue":"#6495ed","medium blue":"#3232cd",purple:"#a020f0","hot pink"
:"#ff69b4",magenta:"#ff00ff",white:"#ffffff","light gray":"#d3d3d3",gray:"#bebebe","dark gray":"#a9a9a9","dim gray":"#696969",black:"#000000"},initRandom:function(e,t,n){return{isInitRandom:!0,lo:e,hi:t,round:n}},_improveSCCompatibility:function(){if(!e._hasSC)return;e._runLoopedTrigger=function(){var t=SC.RunLoop.isRunLoopInProgress();t||SC.RunLoop.begin(),e._inSCLoop=!0;var n=e._coreTrigger.apply(this,arguments);return e._inSCLoop=!1,t||SC.RunLoop.end(),n},e._coreTrigger=e.trigger,e.trigger=e._runLoopedTrigger},_SCLoopBegan:function(){e._inSCLoop=!0,e.trigger=e.Object.prototype.trigger=e._coreTrigger},_SCLoopEnded:function(){e._inSCLoop=!1,e.trigger=e.Object.prototype.trigger=e._runLoopedTrigger}}}(),CW.Anim.init(),CW.Anim._improveSCCompatibility(),CW.Anim.Task=CW.Anim.Object.extend({className:"CW.Anim.Task",running:!1,speedMultiplier:1,frameCount:0,elapsedTime:0,ticked:!1,tickCount:0,start:function(){return this.running?this:(this.running=!0,this.elapsedTime=this.frameCount=this.tickCount=0,this.trigger("start"),CW.Anim.handleTask(this),this)},stop:function(){return this.running?(this.running=!1,this.trigger("stop"),this):this},elapse:function(e,t){if(this.isDestroyed)return this.running=!1,this;if(!t&&this.shouldSkipFrame&&this.shouldSkipFrame())return this;this._forcedZeroes&&(e=0,this._forcedZeroes--),e*=this.speedMultiplier,this.trigger("preframe"),this.elapsedTime+=e;if(!this.ticked)this.trigger("pretick"),this.run instanceof Function&&this.run(e),this.tickCount++,this.trigger("tick");else for(var n=this.ticked===!0?1e3/CW.Anim.fps:this.ticked,r=1+Math.floor(this.elapsedTime/
n),i=r-this.tickCount,s=0;s=(7-4*n)/11){t=r*r-Math.pow((11-6*n-11*e)/4,2);break}return 1-t},SINE_IN_OUT:function(e){return.5-.5*Math.cos(Math.PI*e)},multiSineInOut:function(e,t){var n=e%1;e=Math.floor(e);for(var r=0;rd)return((c*d+l)*d+f)*d;while(pm?p=v:d=v,v=(d-p)*.5+p}return((c*v+l)*v+f)*v},linearInterpolation:function(e,t){var n=e._length_||(e._length=e.length),r=t*n/n*(n-1),i=Math.floor(r),s=e[i],o=r-i;if(o===0)return s;var u=e[Math.ceil(r)];return s*(1-o)+u*o}},CW.Anim.Animation=CW.Animation=CW.Anim.Task.extend({className:"CW.Animation",isAnimation:!0,init:function(){arguments.callee.base.call(this),this.hasOwnProperty("animateOldIE")||(this.animateOldIE=CW.Anim.ENABLE_OLD_IE),SC.browser.isIE8OrLower&&!this.animateOldIE&&(this.disabled=!0);var e,t,n,r,i,s=this._type.prototype.freevars;typeof this.freevars=="string"&&(this.freevars=this.freevars.split(/\s+/)),this.freevars&&!this.freevars.length&&(this.freevars=[this.freevars]);if(this.freevars&&s&&this.freevars===s){i=[];for(t=0;t<(r||(r=this.freevars.length));t++)i.push(this.freevars[t]);this.freevars=i}this.freevars&&this.speed===undefined&&this.duration===undefined&&!this.signal&&(this.duration=0);for(t=-1,r=!!this.freevars&&this.freevars.length;t0&&(this.repeat--,this.reverseOnRepeat?this.reverse():this.reset(),this.start()),n},_finishNaturally:function(){this.finish(!0)},update:function(
){},toString:function(){var e=arguments.callee.base.apply(this,arguments);return e=e.substring(0,e.length-1)+(this.name?" "+this.name:"")+(this.running?" running":"")+(this.fps?" fps="+this.fps:"")+(this.freevars||this.inertia?"":" "+this.from+"-to-"+this.to+" "+this.duration+"ms "+Math.round(this.progress*100)+"%")+"]",e},destroy:function(){var e=arguments.callee.base.apply(this,arguments);return this.update=this.run=this.finish=function(){},e},recycle:function(){this.tickCount=this.frameCount=this.elapsedTime=this._forcedZeroes=0}}),CW.Animation.defaultFreevar={tween:CW.Anim.tweens.WEBKIT_EASE,discreteness:0},CW.Animation._tweenFreevar=function(){var e=function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t])};return e.prototype={from:0,to:1,duration:1e3,importants:undefined,isAlmostFinished:function(e){return Math.abs(this.to-this.current)i||s===!1&&t._untweenedCurrent=t.to||!n&&t._untweenedCurrent<=t.to)t._untweenedCurrent=t.to}return t.from!==undefined&&t.to!==undefined?(t.progress=(t._untweenedCurrent-t.from)/(t.to-t.from),t.tween instanceof Function&&t.from!=t.to&&(t.from===0&&t.to===1?t.current=t.tweenedProgress=t.tween.call(this,t._untweenedCurrent):t.current=(t.tweenedProgress=t.tween.call(this,t.progress))*(t.to-t.from)+t.from)):t.current=t._untweenedCurrent,t.discreteness&&Math.abs(t.to/t.discreteness)%1<1e-8&&(t.current=Math.round(t.current/t.discreteness)*t.discreteness),t.isFinished}},e._freevarPrototype=e,e}(),CW.Animation._inertiaFreevar=function(){var e=function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t])};return e.prototype={from:0,to:1,speed:1,inertia:3,headStart:.01,isAlmostFinished:function(e){return Math.abs(this.to-this.current)=i||!u&&r<=i)r=i;t===0?n._undampedCurrent=r:o[t-1]=r}return n.current=r,n.discreteness&&Math.abs(n.to/n.discreteness)%1<1e-8&&(n.current=Math.round(n.current/n.discreteness)*n.discreteness),n.isFinished=n.to===n.current,n.progress=NaN,n.isFinished}},e._freevarPrototype=e,e}(),CW.Animation._signalFreevar=function(){var e=function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t])};return e.prototype={speed:1,from:0,signal:function(e){return.5+.5*Math.sin(e*Math.PI*2)},persistent:!0,isAlmostFinished:function(e){return!this.persistent},reverse:function(){return this.speed=-this.speed,this},reset:function(){return this._unsignaledCurrent=this.from,this},redirectTo:function(){return this},force:function(){return this},advance:function(e){this._unsignaledCurrent+=e},zeroOutDuration:function(){return this},freevarRun:function(e){return this._unsignaledCurrent+=e/1e3*this.speed,this.current=this.signal(this
._unsignaledCurrent),this.discreteness&&(this.current=Math.round(this.current/this.discreteness)*this.discreteness),this.isFinished=!this.persistent,this.progress=NaN,this.isFinished}},e._freevarPrototype=e,e}(),CW.Anim.Fader=CW.Fader=CW.Animation.extend({className:"CW.Fader",update:function(){CW.Anim.setOpacity(this.element,this.current)},init:function(){this.from===undefined&&(this._untweenedCurrent=this.from=CW.Anim.getOpacity(this.element)),arguments.callee.base.apply(this,arguments)},_removeOnFinish:function(){if(!this.REMOVE_ON_FINISH)return;this.element.parentNode&&this.element.parentNode.removeChild(this.element)}.listens("finish"),saveSelf:function(){var e=this.element._cwaFader;e&&e.stop(),this.element._cwaFader=this}.listens("start"),killSelf:function(){this.element._cwaFader=undefined}.listens("stop")}),CW.Anim.DisplayNoneAtZero={isMixin:!0,setDisplayNone:function(){this.to===0&&(this.element.style.display="none")}.listens("finish"),removeDisplayNone:function(){this.element.style.display=""}.listens("start")},CW.Anim.ColorFader=CW.ColorFader=CW.Animation.extend({className:"CW.ColorFader",style:"color",init:function(){this.colorKey="_cwa"+this.style+"color",this.saveKey="_cwa"+this.style+"Fader";var e;if(this.sR===undefined||this.sG===undefined||this.sB===undefined)(e=CW.Anim.getStyle(this.element,this.style))?e=CW.Anim.decodeColor(e):e=this.element[this.colorKey]||(this.element[this.colorKey]=[0,0,0]),this.sR=e[0],this.sG=e[1],this.sB=e[2];arguments.callee.base.apply(this,arguments)},update:function(){if(!this.element||!this.style)return;var e=this.current,t=1-e,
n,r,i,s=this.element[this.colorKey]||(this.element[this.colorKey]=[]);s[0]=n=this.tR*e+this.sR*t,s[1]=r=this.tG*e+this.sG*t,s[2]=i=this.tB*e+this.sB*t,this.element.style[this.style]=(this.cssBeforeColor||"")+CW.Anim.encodeColor(n,r,i)+(this.cssAfterColor||"")},saveSelf:function(){var e=this.element[this.saveKey];e&&e.stop(),this.element[this.saveKey]=this}.listens("start"),killSelf:function(){this.element[this.saveKey]=undefined}.listens("stop")}),CW.Anim.Mover=CW.Mover=CW.Animation.extend({className:"CW.Mover",getOmittedPositions:function(){var e,t,n,r;if(this.fromX===undefined||this.anchorX===undefined)n="left",e=parseInt(CW.Anim.getStyle(this.element,n),10),isNaN(e)&&(n="right",e=parseInt(CW.Anim.getStyle(this.element,n),10)),isNaN(e)&&(n="left"),this.anchorX!==undefined||(this.anchorX=n),this.fromX!==undefined||(this.fromX=e);if(this.fromY===undefined||this.anchorY===undefined)r="top",t=parseInt(CW.Anim.getStyle(this.element,r),10),isNaN(t)&&(r="bottom",t=parseInt(CW.Anim.getStyle(this.element,r),10)),isNaN(t)&&(n="top"),this.anchorY!==undefined||(this.anchorY=r),this.fromY!==undefined||(this.fromY=t);if(isNaN(this.fromX)||isNaN(this.fromY))this.anchorX="left",this.anchorY="top",this.fromX=this.element.offsetLeft,this.fromY=this.element.offsetTop,this.element.style.position="absolute";this.toX===undefined&&(this.toX=this.fromX),this.toY===undefined&&(this.toY=this.fromY)}.listens("start"),update:function(){var e=this.element.style,t=this.current,n=1-t;e[this.anchorX]=Math.round(t*this.toX+n*this.fromX)+"px",e[this.anchorY]=Math.round(t*this.toY+n*this.fromY)+"px"}}),CW.Animatability=
{ENABLE_OLD_IE:YES,hasAnimatability:!0,mustKeepLayoutSync:YES,isAnimating:NO,isAnimatingInWindow:NO,isAnimatingWithParent:NO,recomputeIsAnimatingBooleans:function(){var e=this.get("isAnimatingInWindow"),t=!1,n=this,r=this._animCount>0,i;while(n=n.get("parentView"))if(n.hasAnimatability&&n.get("isAnimating")){t=!0;break}i=t||r,this.isAnimating!==r&&this.set("isAnimating",r),this.isAnimatingInWindow!==i&&this.set("isAnimatingInWindow",i),this.isAnimatingWithParent!==t&&this.set("isAnimatingWithParent",t),i!==e&&this._recomputeChildrenIsAnimatingBooleans()},_recomputeChildrenIsAnimatingBooleans:function(){for(var e=0,t=this.get("childViews"),n;n=t[e];e++)n.hasAnimatability?n.recomputeIsAnimatingBooleans():CW.Animatability._recomputeChildrenIsAnimatingBooleans.apply(n)},incrementAnimationCount:function(){this._animCount=(this._animCount||0)+1,this.recomputeIsAnimatingBooleans()},decrementAnimationCount:function(){this._animCount=Math.max(this._animCount-1,0),this.recomputeIsAnimatingBooleans()},animateProperty:function(e,t,n){return this.animateProperties.apply(this,arguments)},animateProperties:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L=SC.A(arguments),A=this._currentlyAnimatingProperties,O=this.get("mustKeepLayoutSync");if(o=typeof e=="string")(s={})[e]=t,e=s,t=L[2];if(!e){SC.warn("When using .animateProperties(, either a property name (string)or a hash, keyed by property name, full of destinations (or full freevar optionshashes) must be supplied as the first argument. Aborting the call.");return}e=SC.clone(e);if(t)for((n=o?2:1)&&(i=L.length)&&!(t=
undefined);nE&&(E=h.duration),O||this.adjust(h.propertyName,h.to),h.to===h.from?(O&&this.adjust(h.propertyName,h.to),delete e[n]):T++}if(T===0)m||(k=CW.Animation.create({view:this,duration:E||u||0},t).start());else if(m&&(w=this._bestMatchAnimationForProperties(e)||this._animationFromPool())){for(n in e)w.addProperty(e[n]);for(n in t)w[n]=t[n];k=w.start()}else{v={freevars:[],properties:[]};for(n in e)v.freevars.push(n),v.properties.push(n);v.view=this,w=CW.MultiPropertyAnimation.create(v,e,t);for(n in e)A[n]=w;k=w.start()}if(S){for(n in S){if(!S.hasOwnProperty(n))continue;x=S[n];if(x.__checked__)continue;x.__checked__=!0,x.stopIfNoProperties()}for(n in S){if(!S.hasOwnProperty(n))continue;S[n].__checked__=!1}}return k},_bestMatchAnimationForProperties:function(e){var t,n,r,i,s,o,u=this._currentlyAnimatingProperties;for(t in u){if(!(i=u[t])||i.___matchCheck)continue;i.___matchCheck=!0,r=i.properties.length,s=0;for(n=0;n