/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 5th 2010 7:41:40 PM PST                             */
/*      Machine:  10.16.140.107                                                */
/*       Source:  Local Cache                                                  */
/*     Location:  rsrc:4:9gao3ypk                                              */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/4anxote5hmm84s84.pkg.js                                   */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/4anxote5hmm84s84.pkg.js"]); }

function object(b){var a=new Function();a.prototype=b;return new a();}function is_scalar(a){switch(typeof(a)){case 'string':case 'number':case 'null':case 'boolean':return true;}return false;}function keys(c){if(hasArrayNature(c))throw new TypeError('keys() was passed an array.');var b=[];for(var a in c)b.push(a);return b;}function values(b){if(hasArrayNature(b))throw new TypeError('values() was passed an array; use to_array().');var c=[];for(var a in b)c.push(b[a]);return c;}function count(c){if(hasArrayNature(c))throw new TypeError('count() was passed an array.');var a=0;for(var b in c)a++;return a;}function are_equal(a,b){return JSON.encode(a)==JSON.encode(b);}function merge(){var b={};for(var a=0;a<arguments.length;a++)copy_properties(b,arguments[a]);return b;}function obj_filter_keys(d,c){var e={};for(var a=0;a<c.length;a++){var b=c[a];if(b in d)e[b]=d[b];}return e;}function obj_intersect_keys(){var f={};var a=arguments[0];oloop:for(var c in a){if(!a.hasOwnProperty(c))continue;iloop:for(var b=1;b<arguments.length;b++){var e=arguments[b];for(var d in e)if(d===c){if(arguments.length-1===b)f[c]=a[c];continue iloop;}continue oloop;};};return f;}function head(b){for(var a in b)return b[a];return null;}Object.from=function(c,e){if(!hasArrayNature(c))throw new TypeError('Must pass an array of keys.');var d={};var b=hasArrayNature(e);if(typeof e=='undefined')e=true;for(var a=c.length;a--;)d[c[a]]=b?e[a]:e;return d;};function coalesce(){for(var a=0;a<arguments.length;++a)if(arguments[a]!=null)return arguments[a];return null;}
function to_array(c){var d=[];for(var a=0,b=c.length;a<b;++a)d.push(c[a]);return d;}var $A=to_array;Array.prototype.alloc=function(a){return a?new Array(a):[];};Array.prototype.map=function(a,e){if(this==window)throw new TypeError();if(typeof(a)!=="function")throw new TypeError();var b;var c=this.length;var d=this.alloc(c);for(b=0;b<c;++b)if(b in this)d[b]=a.call(e,this[b],b,this);return d;};Array.prototype.forEach=function(a,b){this.map(a,b);return this;};Array.prototype.each=function(a,b){return this.forEach.apply(this,arguments);};Array.prototype.filter=function(a,e){a=a||identity;if(this==window)throw new TypeError();if(typeof(a)!=="function")throw new TypeError();var b,f,c=this.length,d=this.alloc();for(b=0;b<c;++b)if(b in this){f=this[b];if(a.call(e,f,b,this))d.push(f);}return d;};Array.prototype.every=function(a,b){return (this.filter(a,b).length==this.length);};Array.prototype.some=function(a,b){return (this.filter(a,b).length>0);};Array.prototype.pull=function(b){if(this==window)throw new TypeError();if(typeof(b)=='string'){var c=b;b=function(){return this[c];};}if(typeof(b)!=='function')throw new TypeError();var a=Array.prototype.slice.call(arguments,1);var e=this.length;var f=this.alloc(e);for(var d=0;d<e;++d)if(d in this)f[d]=b.apply(this[d],a);return f;};Array.prototype.pullEach=function(a){this.pull.apply(this,arguments);return this;};Array.prototype.filterEach=function(a){var d=this.pull.apply(this,arguments);var c=this.length;var e=this.alloc();for(var b=0;b<c;++b)if(b in this)e.push(this[b]);return e;};Array.prototype.reduce=null;Array.prototype.reduceRight=null;Array.prototype.sort=(function(a){return function(b){return (this==window)?null:(b?a.call(this,function(c,d){return b(c,d);}):a.call(this));};})(Array.prototype.sort);Array.prototype.reverse=(function(a){return function(){return (this==window)?null:a.call(this);};})(Array.prototype.reverse);Array.prototype.concat=(function(a){return function(){return (this==window)?null:a.apply(this,arguments);};})(Array.prototype.concat);Array.prototype.slice=(function(a){return function(){return (this==window)?null:a.apply(this,arguments);};})(Array.prototype.slice);Array.prototype.clone=Array.prototype.slice;if(Array.prototype.indexOf){Array.prototype.indexOf=(function(a){return function(c,b){return (this==window)?null:a.apply(this,arguments);};})(Array.prototype.indexOf);}else Array.prototype.indexOf=function(d,b){if(this==window)throw new TypeError();var c=this.length;var a=Number(b)||0;a=(a<0)?Math.ceil(a):Math.floor(a);if(a<0)a+=c;for(;a<c;a++)if(a in this&&this[a]===d)return a;return -1;};Array.prototype.contains=function(a){return this.indexOf(a)!=-1;};Array.prototype.remove=function(b){var a=this.indexOf(b);if(a!=-1)this.splice(a,1);};function mapToInt(a){return a.map(function(c,b){return parseInt(c,10);});}function unique(a){var c={};var d=[];for(var b=0;b<a.length;b++){var e=a[b];if(!c[e])d.push(e);c[e]=1;}return d;}function array_set_add(a,b){if(!a.contains(b))a.push(b);return a;}function array_intersect(a,b){var d=[];for(var c=0;c<a.length;c++)if(b.contains(a[c]))d.push(a[c]);return d;}Array.from=function(a){if(a instanceof Array)return a;return (a==null)?[]:hasArrayNature(a)?Array.prototype.slice.call(a):[a];};
function env_get(a){return typeof(window['Env'])!='undefined'&&Env[a];}function muffinize(d){var c='a';var b='d';var a=[c,b].join('');return d.replace(/muffin/g,a);}var Util=window.Util||{isDevelopmentEnvironment:function(){return env_get('dev');},warn:bagofholding,error:bagofholding,info:bagofholding,group:bagofholding,groupEnd:bagofholding,dir:bagofholding,log:bagofholding,stack:bagofholding,trace:bagofholding};
function escapeURI(a){if(encodeURIComponent)return encodeURIComponent(a);if(escape)return escape(a);}function htmlspecialchars(a){if(typeof(a)=='undefined'||a===null||!a.toString)return '';if(a===false){return '0';}else if(a===true)return '1';return a.toString().replace(/&/g,'&amp;').replace(/"/g,'&quot;').replace(/'/g,'&#039;').replace(/</g,'&lt;').replace(/>/g,'&gt;');}function htmlize(a){return htmlspecialchars(a).replace(/\n/g,'<br />');}function escape_js_quotes(a){if(typeof(a)=='undefined'||!a.toString)return '';return a.toString().replace(/\\/g,'\\\\').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/"/g,'\\x22').replace(/'/g,'\\\'').replace(/</g,'\\x3c').replace(/>/g,'\\x3e').replace(/&/g,'\\x26');}
window.aiert=(function(a){var b=function _aiert(c){if(window.last_alert){(window.alerts=window.alerts||[]).push((new Date()).getTime()-window.last_alert);window.alerts.splice(0,window.alerts.length-3);if(window.alerts.length==3&&window.alerts[0]+window.alerts[1]+window.alerts[2]<200){if(!confirm(c+'\n\nThis page may be caught in an infinite loop. Press "Cancel" to abort, or "Ok" to continue.'))window.aiert=bagofholding;window.last_alert=(new Date()).getTime();return;}}a(c);window.last_alert=(new Date()).getTime();};return b;})(window.alert);window.alert=function _alert(a){if(a!==undefined){(new Image()).src='/ajax/typeahead_callback.php?l='+escapeURI(document.location)+'&m='+escapeURI(a)+(typeof Env!='undefined'?'&t='+Math.round(((new Date()).getTime()-Env.start)/100):'')+'&d='+escapeURI((typeof fbpd!='undefined')?JSON.encode(fbpd):'')+'&ai='+escapeURI(window.aiert)+'&al='+escapeURI(window.alert);return window.aiert(a);}};
window.onloadRegister=function(a){window.loaded?_runHook(a):_addHook('onloadhooks',a);};function onafterloadRegister(a){window.afterloaded?setTimeout(function(){_runHook(a);},0):_addHook('onafterloadhooks',a);}function _onloadHook(){!window.loaded&&window.CavalryLogger&&CavalryLogger.getInstance().setTimeStamp('t_prehooks');_runHooks('onloadhooks');!window.loaded&&window.CavalryLogger&&CavalryLogger.getInstance().setTimeStamp('t_hooks');window.loaded=true;if(window.logOnloadData)aggregate_js_onload('onloadRegister');}function _onafterloadHook(){_runHooks('onafterloadhooks');window.afterloaded=true;if(window.logOnloadData)aggregate_js_onload('onafterloadRegister');}function _runHook(a){try{a();}catch(ex){}}function _runHooks(c){var e=c=='onbeforeleavehooks'||c=='onbeforeunloadhooks';var g=null;if(window.logOnloadData){var f=new Date().getTime();window.totalHookTime=window.totalHookTime||{};}do{var b=window[c];if(!e)window[c]=null;if(!b)break;for(var d=0;d<b.length;d++)try{if(e){g=g||b[d]();}else b[d]();}catch(ex){}if(e)break;}while(window[c]);if(window.logOnloadData){var a=new Date().getTime();window.totalHookTime[c]=a-f;}if(e&&g)return g;}function keep_window_set_as_loaded(){if(window.loaded==false){window.loaded=true;_runHooks('onloadhooks');}if(window.afterloaded==false){window.afterloaded=true;_runHooks('onafterloadhooks');}}function log_js_onload(b,d,c){window.logOnloadData=window.logOnloadData||{};window.logOnloadData[b]=window.logOnloadData[b]||{};var a=window.logOnloadData[b];if(a[c]){a[c].count++;a[c].total_time+=d;}else{a[c]={};a[c]={count:1,total_time:d};}}function aggregate_js_onload(d){var c=window.logOnloadData[d];var a=[];var f=0;for(var e in c){f+=c[e].total_time;a.push(sprintf("%' 4.4d",c[e].total_time)+'ms : '+sprintf("%' 2.2d",c[e].count)+' calls : '+e.replace('Task_','(Task) '));}if(!a.length)return;a.sort().reverse();var b;if(d=='onloadRegister'){b='onloadhooks';}else b='onafterloadhooks';a.each(function(g){});window.logOnloadData[d]={};}Arbiter.registerCallback(_onloadHook,[OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK,InitialJSLoader.INITIAL_JS_READY]);Arbiter.registerCallback(_onafterloadHook,[OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK,OnloadEvent.ONLOAD_CALLBACK,InitialJSLoader.INITIAL_JS_READY]);Arbiter.subscribe(OnloadEvent.ONBEFOREUNLOAD,function(b,a){a.warn=_runHooks('onbeforeleavehooks')||_runHooks('onbeforeunloadhooks');if(!a.warn){window.loaded=false;window.afterloaded=false;}},Arbiter.SUBSCRIBE_NEW);Arbiter.subscribe(OnloadEvent.ONUNLOAD,function(b,a){_runHooks('onleavehooks');_runHooks('onunloadhooks');},Arbiter.SUBSCRIBE_NEW);
function chain(d,e){var b,a=[];for(var c=0;c<arguments.length;c++)a.push(arguments[c]);b=function(event){event=event||window.event;for(var f=0;f<a.length;f++)if(a[f]&&a[f].apply(this,arguments)===false){return false;}else if(event&&event.cancelBubble)return true;return true;};b.toString=function(){return chain._toString(a);};return b;}if(!chain._toString)chain._toString=function(b){var d='chained fns',a=b.filter();for(var c=0;c<b.length;c++)d+='\n'+b[c].toString();return d;};
void(0);
function ads_refresh(l,h,g,f,i,m,k){if(window.ads_refreshing)return;if(m===undefined)m=0;var j=['sidebar_ads','home_sponsor_nile','ego'];var e=[];for(var d=0;d<j.length;d++)if(ge(j[d]))e.push(j[d]);if(e.length==0)return;var c={page:h,tab:l,locations:e,photo_refresh:(i?'yes':'no'),cache:m};var b=function(r,q){window.ads_refreshing=false;if(!r){var n=q.getPayload();for(var p in n){var o=ge(p);if(o&&n[p].length>0)if(ua.ie()<7){o.outerHTML=n[p];}else DOM.replace(o,HTML(n[p]));}}if(g)g(q);}.curry(k);var a=function(n){window.ads_refreshing=false;if(f)f(n);};new AsyncRequest().setURI('/ajax/location_refresh.php').setData(c).setOption('bundle',true).setHandler(b).setErrorHandler(a).send();window.ads_refreshing=true;}function social_ads_pagecache_log_imps(){var a=DOM.scry(document,'div.pagecache_social_ad');for(var c=0;c<a.length;c++){var b={meta:DataStore.get(a[c],'link_data')};new AsyncRequest().setURI('/ajax/social_ad_impression.php').setOption('bundle',true).setData(b).send();}}
var ChannelRebuildReasons={Unknown:0,AsyncError:1,TooLong:2,Refresh:3,RefreshDelay:4,UIRestart:5,NeedSeq:6,PrevFailed:7,IFrameLoadGiveUp:8,IFrameLoadRetry:9,IFrameLoadRetryWorked:10,PageTransitionRetry:11};
var ChatUserInfos={};
var kError_Account_IncorrectPassword=1340001,kError_Global_ValidationError=1346001,kError_Login_GenericError=1348009,kError_Chat_NotAvailable=1356002,kError_Chat_SendOtherNotAvailable=1356003,kError_Async_NotLoggedIn=1357001,kError_Async_LoginChanged=1357003,kError_Async_CSRFCheckFailed=1357004,kError_Chat_TooManyMessages=1356008,kError_Platform_CallbackValidationFailure=1349007,kError_Platform_ApplicationResponseInvalid=1349008,kError_FBPayments_Unknown=1383001,kError_FBPayments_InvalidParameters=1383002,kError_Gifts_NoGiftSelected=1391001,kError_Gifts_NoReceiverSpecified=1391003,kError_Gifts_NoMessageAttached=1391004,kError_Async_InternalCaptchaRequired=1357007,kError_Recruiting_MessageDeliveryFailed=1405001,kError_FBPayments_PaymentFailure=1383003,kError_Intern_UnknownError=1408001,kError_Privacy_FriendListNameAlreadyExists=1409001,kError_Mobile_InvalidWapLocale=1347008,kError_Gifts_MessageTooLong=1391007,kError_Inbox_DuplicateMessages=1415001,kError_Async_ConfirmationRequired=1357008,kError_Gifter_GiftNotMoved=1416001,kError_Gifter_GiftNotCreated=1416002,kError_Gifter_GiftNotUpdated=1416003,kError_Gifter_DesignerNotAdded=1416004,kError_Gifter_GiftsNotLoaded=1416005,kError_Megaphone_InvalidHideData=1419001,kError_Megaphone_StoryNotFound=1419002,kError_Megaphone_InternalError=1419003,kError_Megaphone_HandleHideFailed=1419004,kError_Screenname_LimiteExceeded=1423001,kError_Screenname_AllocationError=1423002,kError_OpenId_RegistrationGeneralError=1428001,kError_OpenId_SignatureError=1428002,kError_OpenId_MissingRequiredInformation=1428003,kError_OpenId_ProtocolError=1428004,kError_OpenId_ProtocolErrorWithMessage=1428005,kError_OpenId_EmailAlreadyTaken=1428006,kError_ProfileConnect_AlreadyConnected=1431001,kError_Inbox_ThreadsUnavailable=1415002,kError_OpenId_CancelResponse=1428010,kError_OpenId_SetupNeededResponse=1428011,kError_Payment_CreditCardError=1353008,kError_FBPayments_InvalidOperation=1383004,kError_FBPayments_PermissionDenied=1383005,kError_FBPayments_DatabaseError=1383006,kError_FBPayments_InvalidApp=1383007,kError_FBPayments_AppNoResponse=1383008,kError_FBPayments_AppErrorResponse=1383009,kError_FBPayments_UserCanceled=1383010,kError_FBPayments_Disabled=1383011,kError_Wall_RateLimitExceeded=1367004,kError_Async_Roadblocked=1357011,kError_Gigaboxx_InvalidFolder=1441008,kError_Gifts_GiftsWithCreditsGlobalLimitExceeded=1391027,kError_Login_LsdFailed=1348035,kError_Payment_CaptchaFailed=1353010,kError_Payment_SecurityRestriction=1353011,kError_OpenId_EmailAlreadyTakenLinkAccounts=1428016,kError_UIErrorForm_HasErrors=1460001,kError_CreditCardForm_InvalidCardType=1463001,kError_CreditCardForm_InvalidExpDate=1463002,kError_CreditCardForm_InvalidNumber=1463003,kError_CreditCardForm_InvalidZip=1463004,kError_CreditCardForm_InvalidState=1463005,kError_CreditCardForm_InvalidStreet=1463006,kError_CreditCardForm_InvalidCity=1463007,kError_CreditCardForm_NonNumericCard=1463008,kError_CreditCardForm_InvalidFirstName=1463009,kError_CreditCardForm_InvalidLastName=1463010,kError_CreditCardForm_InvalidCSC=1463011,kError_CreditCardForm_NonNumericCSC=1463012,kError_CreditCardForm_FailedAuth=1463013,kError_CreditCardForm_InvalidAddress=1463014,kError_CreditCardForm_FailedRegistration=1463015,kError_CreditCardForm_FailedRetrieval=1463016,kError_CreditCardForm_FailedRemove=1463017,kError_Mentions_UntaggingMentionFailed=1462003,kError_Async_PopUpCaptchaRequired=1357013,kError_Verification_ConfirmEmail=1442002,kError_FBPayments_DisputeFlow=1383014,kError_Login_WantsNotification=1348040,kError_Bughouse_UnknownBadge=1480001,kError_Privacy_ReBlockTimeoutFail=1409006,kError_Privacy_BlockFail=1409007,kError_Privacy_CannotSelfBlock=1409008;
function RenderManager(a){copy_properties(this,{_isDirty:false,_obj:a});}copy_properties(RenderManager.prototype,{dirty:function(){if(!this._isDirty){this._isDirty=true;bind(this,this.doPaint).defer();}},doPaint:function(){this._isDirty=false;this._obj.paint();}});
function CounterDisplay(a,f,g,d,c){copy_properties(this,{_name:a,_valueNode:$(f),_wrapperNode:$(g)||null,_statusClass:c,_rm:new RenderManager(this),_arbiterSubscription:null,_count:0});var b=this._valueNode.firstChild;if(b){var e=parseInt(b.nodeValue,10);if(!isNaN(e))this._count=e;}this._statusNode=d?$(d):null;this._subscribeAll();CounterDisplay.instances.push(this);onunloadRegister(this._destroy.bind(this),true);}copy_properties(CounterDisplay,{EVENT_TYPE_ADJUST:'CounterDisplay/adjust',EVENT_TYPE_UPDATE:'CounterDisplay/update',instances:[],adjustCount:function(a,b){Arbiter.inform(CounterDisplay.EVENT_TYPE_ADJUST+'/'+a,b);},setCount:function(a,b){Arbiter.inform(CounterDisplay.EVENT_TYPE_UPDATE+'/'+a,b);}});CounterDisplay.mixin({_destroy:function(){delete this._valueNode;delete this._wrapperNode;if(this._arbiterSubscription){Arbiter.unsubscribe(this._arbiterSubscription);delete this._arbiterSubscription;}CounterDisplay.instances.remove(this);},adjustCount:function(a){this._count=Math.max(0,this._count+a);this._rm.dirty();return this;},setCount:function(a){this._count=Math.max(0,a);this._rm.dirty();return this;},paint:function(){DOM.setContent(this._valueNode,this._count);if(this._wrapperNode)if(this._count<=0){hide(this._wrapperNode);if(this._statusClass&&this._statusNode)CSS.removeClass(this._statusNode,this._statusClass);}else{show(this._wrapperNode);if(this._statusClass&&this._statusNode)CSS.addClass(this._statusNode,this._statusClass);}},_subscribeAll:function(){var a=[CounterDisplay.EVENT_TYPE_ADJUST+'/'+this._name,CounterDisplay.EVENT_TYPE_UPDATE+'/'+this._name];this._arbiterSubscription=Arbiter.subscribe(a,this._onInform.bind(this),Arbiter.SUBSCRIBE_NEW);},_onInform:function(a,b){b=parseInt(b);if(isNaN(b))return;if(a.indexOf(CounterDisplay.EVENT_TYPE_ADJUST)!=-1){this.adjustCount(b);}else if(a.indexOf(CounterDisplay.EVENT_TYPE_UPDATE)!=-1){this.setCount(b);}else return;return;}});
function InstrumentedLogger(a){if(this===window)return new InstrumentedLogger(a);if(InstrumentedLogger._instances[a])return InstrumentedLogger._instances[a];copy_properties(this,{id:a,_phases:{}});return InstrumentedLogger._instances[a]=this;}copy_properties(InstrumentedLogger,{_instances:{}});copy_properties(InstrumentedLogger.prototype,{beginPhase:function(a){if(this._phases[a]&&this._phases[a].start)this.endPhase(a);if(typeof(this._phases[a])=='undefined')this._phases[a]={start:0,count:0,duration:0};this._phases[a].start=new Date().getTime();return this;},endPhase:function(a){var b=this._phases[a];if(b&&b.start){b.count++;b.duration+=new Date().getTime()-b.start;b.start=null;}return this;},dumpAndReset:function(){this.dump();return this.reset();},dump:function(){for(var b in this._phases){var c=this._phases[b];var a=(this.id?this.id+'::':'')+b;}return this;},get:function(a){if(this._phases[a])return this._phases[a].duration/this._phases[a].count;return 0;},reset:function(){this._phases={};return this;}});InstrumentedLogger.prototype.b=InstrumentedLogger.prototype.beginPhase;InstrumentedLogger.prototype.e=InstrumentedLogger.prototype.endPhase;InstrumentedLogger.prototype.d=InstrumentedLogger.prototype.dump;InstrumentedLogger.prototype.D=InstrumentedLogger.prototype.dumpAndReset;InstrumentedLogger.prototype.r=InstrumentedLogger.prototype.reset;var IL=InstrumentedLogger;
function URI(a){if(a===window)return;if(this===window)return new URI(a||window.location.href);this.parse(a||'');}copy_properties(URI,{getRequestURI:function(a,b){a=a===undefined||a;if(a&&window.PageTransitions&&PageTransitions.isInitialized()){return PageTransitions.getCurrentURI(!!b).getQualifiedURI();}else return new URI(window.location.href);},getMostRecentURI:function(){if(window.PageTransitions&&PageTransitions.isInitialized()){return PageTransitions.getMostRecentURI().getQualifiedURI();}else return new URI(window.location.href);},expression:/(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/,arrayQueryExpression:/^(\w+)((?:\[\w*\])+)=?(.*)/,explodeQuery:function(g){if(!g)return {};var h={};g=g.replace(/%5B/ig,'[').replace(/%5D/ig,']');g=g.split('&');for(var b=0,d=g.length;b<d;b++){var e=g[b].match(URI.arrayQueryExpression);if(!e){var j=g[b].split('=');h[URI.decodeComponent(j[0])]=j[1]===undefined?null:URI.decodeComponent(j[1]);}else{var c=e[2].split(/\]\[|\[|\]/).slice(0,-1);var f=e[1];var k=URI.decodeComponent(e[3]||'');c[0]=f;var i=h;for(var a=0;a<c.length-1;a++)if(c[a]){if(i[c[a]]===undefined)if(c[a+1]&&!c[a+1].match(/\d+$/)){i[c[a]]={};}else i[c[a]]=[];i=i[c[a]];}else{if(c[a+1]&&!c[a+1].match(/\d+$/)){i.push({});}else i.push([]);i=i[i.length-1];}if(i instanceof Array&&c[c.length-1]==''){i.push(k);}else i[c[c.length-1]]=k;}}return h;},implodeQuery:function(e,d,a){d=d||'';if(a===undefined)a=true;var f=[];if(e===null||e===undefined){f.push(a?URI.encodeComponent(d):d);}else if(e instanceof Array){for(var b=0;b<e.length;++b)try{if(e[b]!==undefined)f.push(URI.implodeQuery(e[b],d?(d+'['+b+']'):b));}catch(ignored){}}else if(typeof(e)=='object'){if(DOM.isNode(e)){f.push('{node}');}else for(var c in e)try{if(e[c]!==undefined)f.push(URI.implodeQuery(e[c],d?(d+'['+c+']'):c));}catch(ignored){}}else if(a){f.push(URI.encodeComponent(d)+'='+URI.encodeComponent(e));}else f.push(d+'='+e);return f.join('&');},encodeComponent:function(d){var c=String(d).split(/([\[\]])/);for(var a=0,b=c.length;a<b;a+=2)c[a]=window.encodeURIComponent(c[a]);return c.join('');},decodeComponent:function(a){return window.decodeURIComponent(a.replace(/\+/g,' '));}});copy_properties(URI.prototype,{parse:function(b){var a=b.toString().match(URI.expression);copy_properties(this,{protocol:a[3]||'',domain:a[4]||'',port:a[6]||'',path:a[7]||'',query_s:a[9]||'',fragment:a[11]||''});return this;},setProtocol:function(a){this.protocol=a;return this;},getProtocol:function(){return this.protocol;},setQueryData:function(a){this.query_s=URI.implodeQuery(a);return this;},addQueryData:function(a){return this.setQueryData(copy_properties(this.getQueryData(),a));},removeQueryData:function(b){if(!(b instanceof Array))b=[b];var d=this.getQueryData();for(var a=0,c=b.length;a<c;++a)delete d[b[a]];return this.setQueryData(d);},getQueryData:function(){return URI.explodeQuery(this.query_s);},setFragment:function(a){this.fragment=a;return this;},getFragment:function(){return this.fragment;},setDomain:function(a){this.domain=a;return this;},getDomain:function(){return this.domain;},setPort:function(a){this.port=a;return this;},getPort:function(){return this.port;},setPath:function(a){this.path=a;return this;},getPath:function(){return this.path.replace(/^\/+/,'/');},toString:function(){var a='';this.protocol&&(a+=this.protocol+'://');this.domain&&(a+=this.domain);this.port&&(a+=':'+this.port);if(this.domain&&!this.path)a+='/';this.path&&(a+=this.path);this.query_s&&(a+='?'+this.query_s);this.fragment&&(a+='#'+this.fragment);return a;},valueOf:function(){return this.toString();},isFacebookURI:function(){if(!URI._facebookURIRegex)URI._facebookURIRegex=new RegExp('(^|\.)facebook\.('+env_get('tlds').join('|')+')([^.]*)$','i');return !this.domain||URI._facebookURIRegex.test(this.domain);},isQuicklingEnabled:function(){return window.Quickling&&Quickling.isActive()&&Quickling.isPageActive(this);},getRegisteredDomain:function(){if(!this.domain)return '';if(!this.isFacebookURI())return null;var b=this.domain.split('.');var a=b.indexOf('facebook');return b.slice(a).join('.');},getTld:function(f){if(!this.domain)return '';var d=this.domain.split('.');var e=d[d.length-1];if(f)return e;var c=env_get('tlds');if(c.indexOf(e)==-1)for(var a=0;a<c.length;++a){var b=c[a];if(new RegExp(b+'$').test(this.domain)){e=b;break;}}return e;},getUnqualifiedURI:function(){return new URI(this).setProtocol(null).setDomain(null).setPort(null);},getQualifiedURI:function(){var b=new URI(this);if(!b.getDomain()){var a=URI();b.setProtocol(a.getProtocol()).setDomain(a.getDomain()).setPort(a.getPort());}return b;},isSameOrigin:function(a){var b=a||window.location.href;if(!(b instanceof URI))b=new URI(b.toString());if(this.getProtocol()&&this.getProtocol()!=b.getProtocol())return false;if(this.getDomain()&&this.getDomain()!=b.getDomain())return false;return true;},coerceToSameOrigin:function(d){var e=d||window.location.href;if(!(e instanceof URI))e=new URI(e.toString());if(this.isSameOrigin(e))return true;if(this.getProtocol()!=e.getProtocol())return false;var a=e.getDomain().split('.');var c=this.getDomain().split('.');var b;if(e.isFacebookURI())while((b=a.pop())&&b==c.pop())if(b=='facebook'){this.setDomain(e.getDomain());return true;}return false;},go:function(a){goURI(this,a);},setSubdomain:function(b){var c=new URI(this).getQualifiedURI();var a=c.getDomain().split('.');if(a.length<=2){a.unshift(b);}else a[0]=b;return c.setDomain(a.join('.'));},getSubdomain:function(){if(!this.getDomain())return '';var a=this.getDomain().split('.');if(a.length<=2){return '';}else return a[0];}});
Arbiter.inform("template\/registerTemplate", {"name":"\/templates\/UIActionButton.tmpl","template":"\n<a bindPoint=\"root\" class=\"UIButton UIActionButton\" href=\"#\">\n  <span class=\"UIButton_Text\" bindPoint=\"text\"><\/span>\n<\/a>\n"}, Arbiter.BEHAVIOR_PERSISTENT);
String.prototype.trim=function(){if(this==window)return null;return this.replace(/^\s*|\s*$/g,'');};function trim(a){try{return String(a.toString()).trim();}catch(ignored){return '';}}String.prototype.startsWith=function(a){if(this==window)return null;return this.substring(0,a.length)==a;};String.prototype.endsWith=function(a){if(this==window)return null;return this.length>=a.length&&this.substring(this.length-a.length)==a;};String.prototype.split=(function(a){return function(h,e){var b="";if(h===null||e===null){return [];}else if(typeof h=='string'){return a.call(this,h,e);}else if(h===undefined){return [this.toString()];}else if(h instanceof RegExp){if(!h._2||!h._1){b=h.toString().replace(/^[\S\s]+\//,"");if(!h._1)if(!h.global){h._1=new RegExp(h.source,"g"+b);}else h._1=1;}separator1=h._1===1?h:h._1;var i=(h._2?h._2:h._2=new RegExp("^"+separator1.source+"$",b));if(e===undefined||e<0){e=false;}else{e=Math.floor(e);if(!e)return [];}var f,g=[],d=0,c=0;while((e?c++<=e:true)&&(f=separator1.exec(this))){if((f[0].length===0)&&(separator1.lastIndex>f.index))separator1.lastIndex--;if(separator1.lastIndex>d){if(f.length>1)f[0].replace(i,function(){for(var j=1;j<arguments.length-2;j++)if(arguments[j]===undefined)f[j]=undefined;});g=g.concat(this.substring(d,f.index),(f.index===this.length?[]:f.slice(1)));d=separator1.lastIndex;}if(f[0].length===0)separator1.lastIndex++;}return (d===this.length)?(separator1.test("")?g:g.concat("")):(e?g:g.concat(this.substring(d)));}else return a.call(this,h,e);};})(String.prototype.split);
window.CSS.setClass=function(b,a){$(b,true).className=a||'';return b;};window.CSS.conditionClass=function(c,a,b){return (b?CSS.addClass:CSS.removeClass)(c,a);};window.CSS.chooseClass=function(b,a,d,c){CSS.conditionClass(b,d,a);CSS.conditionClass(b,c,!a);};window.CSS.setStyle=function(a,b,c){a.style[b]=c;return a;};window.CSS.getStyle=function(b,d){b=$(b);function c(e){return e.replace(/[A-Z]/g,function(f){return '-'+f.toLowerCase();});}if(window.getComputedStyle)return window.getComputedStyle(b,null).getPropertyValue(c(d));if(document.defaultView&&document.defaultView.getComputedStyle){var a=document.defaultView.getComputedStyle(b,null);if(a)return a.getPropertyValue(c(d));if(d=="display")return "none";}if(b.currentStyle)return b.currentStyle[d];return b.style[d];};window.CSS.setOpacity=function(a,b){a=$(a);var c=(b==1);try{a.style.opacity=(c?'':''+b);}catch(ignored){}try{a.style.filter=(c?'':'alpha(opacity='+(b*100)+')');}catch(ignored){}};window.CSS.getOpacity=function(a){a=$(a);var b=CSS.getStyle(a,'filter');var c=null;if(b&&(c=/(\d+(?:\.\d+)?)/.exec(b))){return parseFloat(c.pop())/100;}else if(b=CSS.getStyle(a,'opacity')){return parseFloat(b);}else return 1;};window.CSS.Cursor={kGrabbable:'grabbable',kGrabbing:'grabbing',kEditable:'editable',set:function(a,b){a=$(a);a=a||document.body;switch(b){case CSS.Cursor.kEditable:b='text';break;case CSS.Cursor.kGrabbable:if(ua.firefox()){b='-moz-grab';}else b='move';break;case CSS.Cursor.kGrabbing:if(ua.firefox()){b='-moz-grabbing';}else b='move';break;}a.style.cursor=b;}};NodeAugment.add(window.CSS);
DataStore=window.DataStore||{_storage:{},_elements:{},_tokenCounter:1,_NOT_IN_DOM_CONST:1,_getStorage:function(a){var b;if(typeof a=='string'){b='str_'+a;}else{b='elem_'+(a.__FB_TOKEN||(a.__FB_TOKEN=[DataStore._tokenCounter++]))[0];DataStore._elements[b]=a;}return DataStore._storage[b]||(DataStore._storage[b]={});},_shouldDeleteData:function(a){if(!a.nodeName)return false;try{if(null!=a.offsetParent)return false;}catch(ex){}if(document.documentElement.contains){return !document.documentElement.contains(a);}else return (document.documentElement.compareDocumentPosition(a)&DataStore._NOT_IN_DOM_CONST);},set:function(c,b,d){var a=DataStore._getStorage(c);a[b]=d;return c;},get:function(e,d,c){var b=DataStore._getStorage(e);var f=b[d];if((undefined===f)&&(typeof e.getAttribute=='function')){var a=e.getAttribute('data-'+d);f=(null===a)?undefined:a;}if((c!==undefined)&&(f===undefined))f=b[d]=c;return f;},remove:function(c,b){var a=DataStore._getStorage(c);delete a[b];return c;},cleanup:function(){var b,a;for(b in DataStore._elements){a=DataStore._elements[b];if(DataStore._shouldDeleteData(a)){delete DataStore._storage[b];delete DataStore._elements[b];}}}};
window.Event=window.Event||function(){};Event.DATASTORE_KEY='Event.listeners';if(!Event.prototype)Event.prototype={};function $E(a){a=a||window.event||{};if(!a._inherits_from_prototype)for(var b in Event.prototype)try{a[b]=Event.prototype[b];}catch(ignored){}return a;}(function(){copy_properties(Event.prototype,{_inherits_from_prototype:true,stop:function(){this.cancelBubble=true;this.stopPropagation&&this.stopPropagation();return this;},prevent:function(){this.returnValue=false;this.preventDefault&&this.preventDefault();return this;},kill:function(){this.stop().prevent();return false;},getTarget:function(){var g=this.target||this.srcElement;return g?$(g):null;},getRelatedTarget:function(){var g=this.relatedTarget||this.fromElement;return g?$(g):null;},getModifiers:function(){var g={control:!!this.ctrlKey,shift:!!this.shiftKey,alt:!!this.altKey,meta:!!this.metaKey};g.access=ua.osx()?g.control:g.alt;g.any=g.control||g.shift||g.alt||g.meta;return g;}});copy_properties(Event,{listen:function(h,p,j,m){if(typeof h=='string')h=$(h,true);if(typeof m=='undefined')m=Event.Priority.NORMAL;if(typeof p=='object'){var i={};for(var o in p)i[o]=Event.listen(h,o,p[o],m);return i;}if(p.match(/^on/i))throw new TypeError("Bad event name `"+event+"': use `click', not `onclick'.");p=p.toLowerCase();var k=DataStore.get(h,b,{});if(f[p]){var g=f[p];p=g.base;j=g.wrap(j);}a(h,p);var q=k[p];if(!(m in q))q[m]=[];var l=q[m].length,n=new EventHandlerRef(j,q[m],l);q[m].push(n);return n;},stop:function(g){return $E(g).stop();},prevent:function(g){return $E(g).prevent();},kill:function(g){return $E(g).kill();},getKeyCode:function(event){event=$E(event);if(!event)return false;switch(event.keyCode){case 63232:return 38;case 63233:return 40;case 63234:return 37;case 63235:return 39;case 63272:case 63273:case 63275:return null;case 63276:return 33;case 63277:return 34;}if(event.shiftKey)switch(event.keyCode){case 33:case 34:case 37:case 38:case 39:case 40:return null;}return event.keyCode;},getPriorities:function(){if(!e){var g=values(Event.Priority);g.sort(function(h,i){return h-i;});e=g;}return e;}});var e=null,b=Event.DATASTORE_KEY;var c=function(g){return function(h){if(!DOM.contains(this,h.getRelatedTarget()))return g.call(this,h);};};var f={mouseenter:{base:'mouseover',wrap:c},mouseleave:{base:'mouseout',wrap:c}};var a=function(g,k){var h='on'+k,i=DataStore.get(g,b);if(k in i){if(g[h]!==d)throw new Error("`"+h+"' listen handler gone!");return;}i[k]={};var j=g[h];g[h]=d;if(j)Event.listen(g,k,j,Event.Priority.TRADITIONAL);};var d=function(event){event=$E(event);var m=event.type;if(!DataStore.get(this,b))throw new Error("Bad listenHandler context.");var n=DataStore.get(this,b)[m];if(!n)throw new Error("No registered handlers for `"+m+"'.");var j=Event.getPriorities();for(var i=0;i<j.length;i++){var k=j[i];if(k in n){var g=n[k];for(var h=0;h<g.length;h++){if(!g[h])continue;var l=g[h].fire(this,event);if(l===false){return event.kill();}else if(event.returnValue===false){return false;}else if(event.cancelBubble)return event.stop();}}}};})();NodeAugment.add({listen:Event.listen});Event.Priority={URGENT:-20,TRADITIONAL:-10,NORMAL:0};function EventHandlerRef(b,a,c){this._handler=b;this._container=a;this._index=c;}EventHandlerRef.prototype={remove:function(){delete this._handler;delete this._container[this._index];},fire:function(a,event){return this._handler.call(a,event);}};function addEventBase(d,e,a,c){if(d.addEventListener){d.addEventListener(e,a,false);}else if(d.attachEvent){var b=e+a+c;d["e"+b]=a;d[b]=function(){d["e"+b](window.event);};d.attachEvent("on"+e,d[b]);}return a;}function removeEventBase(d,e,a,c){if(d.removeEventListener){d.removeEventListener(e,a,false);}else if(d.detachEvent){var b=e+a+c;if(d[b]){d.detachEvent("on"+e,d[b]);d[b]=null;d["e"+b]=null;}}}
function Vector2(b,c,a){copy_properties(this,{x:parseFloat(b),y:parseFloat(c),domain:a||'pure'});}copy_properties(Vector2.prototype,{toString:function(){return '('+this.x+', '+this.y+')';},add:function(c,d){if(arguments.length==1){if(c.domain!='pure')c=c.convertTo(this.domain);return this.add(c.x,c.y);}var a=parseFloat(c);var b=parseFloat(d);return new Vector2(this.x+a,this.y+b,this.domain);},mul:function(a,b){if(typeof(b)=="undefined")b=a;return new Vector2(this.x*a,this.y*b,this.domain);},sub:function(a,b){if(arguments.length==1){return this.add(a.mul(-1));}else return this.add(-a,-b);},distanceTo:function(a){return this.sub(a).magnitude();},magnitude:function(){return Math.sqrt((this.x*this.x)+(this.y*this.y));},convertTo:function(a){if(a!='pure'&&a!='viewport'&&a!='document')return new Vector2(0,0);if(a==this.domain)return new Vector2(this.x,this.y,this.domain);if(a=='pure')return new Vector2(this.x,this.y);if(this.domain=='pure')return new Vector2(0,0);var b=Vector2.getScrollPosition('document');var c=this.x,d=this.y;if(this.domain=='document'){c-=b.x;d-=b.y;}else{c+=b.x;d+=b.y;}return new Vector2(c,d,a);},setElementPosition:function(a){var b=this.convertTo('document');a.style.left=parseInt(b.x)+'px';a.style.top=parseInt(b.y)+'px';return this;},setElementDimensions:function(a){return this.setElementWidth(a).setElementHeight(a);},setElementWidth:function(a){a.style.width=parseInt(this.x,10)+'px';return this;},setElementHeight:function(a){a.style.height=parseInt(this.y,10)+'px';return this;},scrollElementBy:function(a){if(a==document.body)a=DOMScroll.getScrollRoot();if(a==document.body){window.scrollBy(this.x,this.y);}else{a.scrollLeft+=this.x;a.scrollTop+=this.y;}return this;}});copy_properties(Vector2,{compass:{east:'e',west:'w',north:'n',south:'s',center:'center',northeast:'ne',northwest:'nw',southeast:'se',southwest:'sw'},getEventPosition:function(b,a){a=a||'document';b=$E(b);var d=b.pageX||(b.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));var e=b.pageY||(b.clientY+(document.documentElement.scrollTop||document.body.scrollTop));var c=new Vector2(d,e,'document');if(DOMScroll.getScrollWrapper())c=c.add(Vector2.getScrollPosition());return c.convertTo(a);},getScrollPosition:function(a){a=a||'document';var b=DOMScroll.getScrollWrapper();if(b){var c=b.scrollLeft;var d=b.scrollTop;}else{var c=document.body.scrollLeft||document.documentElement.scrollLeft;var d=document.body.scrollTop||document.documentElement.scrollTop;}return (new Vector2(c,d,'document').convertTo(a));},getElementPosition:function(b,a){a=a||'document';if(!b)return;if(ua.safari()<500&&b.tagName=='TR')b=b.firstChild;var d=b.offsetLeft;var h=b.offsetTop;var e=b.offsetParent;var f=DOMScroll.getScrollWrapper()||document.body;var c=false;while(b.parentNode&&f!=b.parentNode&&document.body!=b.parentNode){b=b.parentNode;if(!isNaN(b.scrollTop))if(!(ua.opera()<9.5)||!operaIgnoreScroll[window.getComputedStyle(b,'').getPropertyValue('display')]){h-=b.scrollTop;d-=b.scrollLeft;}if(e==b){if(ua.safari()<500&&b.tagName=='TR'){h+=b.firstChild.offsetTop;d+=b.firstChild.offsetLeft;}else{h+=b.offsetTop;d+=b.offsetLeft;}e=b.offsetParent;}if(e&&CSS.getStyle(e,'position')=='fixed'){c=true;h+=e.offsetTop;d+=e.offsetLeft;break;}}if(c){var g=Vector2.getScrollPosition('document');d+=g.x;h+=g.y;}return (new Vector2(d,h,'document').convertTo(a));},getElementDimensions:function(b,d){if(ua.safariPreWebkit()&&b.nodeName=='TR'){var c=b.getElementsByTagName('td');var a=Vector2.getElementCompassPoint(c[c.length-1],Vector2.compass.southeast,d).sub(Vector2.getElementPosition(c[0],'document',d));return a;}var e=(d?b.clientWidth:b.offsetWidth)||0;var f=(d?b.clientHeight:b.offsetHeight)||0;return new Vector2(e,f);},getHiddenElementDimensions:function(a){var b=$(a);var c=b.style;var g=c.visibility;var f=c.position;var e=c.display;if(e=='none'){c.visibility='hidden';c.position='absolute';c.display='block';}var d=Vector2.getElementDimensions(b);c.display=e;c.position=f;c.visibility=g;return d;},getElementCompassPoint:function(c,f,e){f=f||Vector2.compass.southeast;var d=Vector2.getElementPosition(c);var b=Vector2.getElementDimensions(c,e);var a=Vector2.compass;switch(f){case a.east:return d.add(b.x,b.y*.5);case a.west:return d.add(0,b.y*.5);case a.north:return d.add(b.x*.5,0);case a.south:return d.add(b.x*.5,b.y);case a.center:return d.add(b.mul(.5));case a.northwest:return d;case a.northeast:return d.add(b.x,0);case a.southwest:return d.add(0,b.y);case a.southeast:return d.add(b);}return d;},getViewportDimensions:function(){var a=(window&&window.innerWidth)||(document&&document.documentElement&&document.documentElement.clientWidth)||(document&&document.body&&document.body.clientWidth)||0;var b=(window&&window.innerHeight)||(document&&document.documentElement&&document.documentElement.clientHeight)||(document&&document.body&&document.body.clientHeight)||0;return new Vector2(a,b,'viewport');},getDocumentDimensions:function(){var a=DOMScroll.getScrollWrapper();var b=(a&&a.scrollWidth)||(document&&document.documentElement&&document.documentElement.scrollWidth)||(document&&document.body&&document.body.scrollWidth)||0;var c=(a&&a.scrollHeight)||(document&&document.documentElement&&document.documentElement.scrollHeight)||(document&&document.body&&document.body.scrollHeight)||0;return new Vector2(b,c,'document');},scrollIntoView:function(a){var b=a.offsetParent;var d=Rect(a);var c=d.boundWithin(Rect(b)).getPositionVector();d.getPositionVector().sub(c).scrollElementBy(b);}});var operaIgnoreScroll={table:true,'inline-table':true,inline:true};function elementX(a){return Vector2.getElementPosition(a,'document').x;}function elementY(a){return Vector2.getElementPosition(a,'document').y;}NodeAugment.add({getPosition:Vector2.getElementPosition,getDimensions:Vector2.getElementDimensions,getHiddenDimensions:Vector2.getHiddenElementDimensions,getCompassPoint:Vector2.getElementCompassPoint});
var DOMScroll={_scrollWrapper:0,usingScrollWrapper:function(){return env_get('use_scroll_wrapper');},getScrollWrapper:function(){if(DOMScroll._scrollWrapper===0)DOMScroll._scrollWrapper=DOMScroll.usingScrollWrapper()?ge('scroll_wrapper'):null;return DOMScroll._scrollWrapper;},getScrollRoot:function(){return DOMScroll.getScrollWrapper()||document.body;},SCROLL_CHANGE:'scroll_change',_hasScrollListeners:false,_isScrolled:null,registerScrollChangeHandler:function(a){Arbiter.subscribe(DOMScroll.SCROLL_CHANGE,a);if(!DOMScroll._hasScrollListeners){DOMScroll._hasScrollListeners=true;Event.listen(window,'resize',DOMScroll.updateScrollState);}},updateScrollState:function(){if(DOMScroll.usingScrollWrapper()){var i=DOMScroll.getScrollWrapper();var g=Vector2.getElementDimensions(i);var b=Vector2.getElementDimensions(i,true);var d=(g.y>b.y);var e=(g.x>b.x);}else{var h=Vector2.getViewportDimensions();var c=Vector2.getDocumentDimensions();var d=(c.x>h.x);var e=(c.y>h.y);}d+=0;e+=0;var a=(DOMScroll._isScrolled===null)||(d!=DOMScroll._isScrolled.x)||(e!=DOMScroll._isScrolled.y);if(a){DOMScroll._isScrolled=new Vector2(d,e);var f={sender:DOMScroll,is_scrolled:DOMScroll.getScrollState()};Arbiter.inform(DOMScroll.SCROLL_CHANGE,f,Arbiter.BEHAVIOR_STATE);}},getScrollState:function(){if(DOMScroll._isScrolled===null)DOMScroll.updateScrollState();return DOMScroll._isScrolled;},_scrollbarSize:null,_initScrollbarSize:function(){var a=$N('p');a.style.width='100%';a.style.height='200px';var b=$N('div');b.style.position='absolute';b.style.top='0px';b.style.left='0px';b.style.visibility='hidden';b.style.width='200px';b.style.height='150px';b.style.overflow='hidden';b.appendChild(a);document.body.appendChild(b);var c=a.offsetWidth;b.style.overflow='scroll';var d=a.offsetWidth;if(c==d)d=b.clientWidth;document.body.removeChild(b);DOMScroll._scrollbarSize=c-d;if(DOMScroll._scrollbarSize<5)DOMScroll._scrollbarSize=15;},getScrollbarSize:function(){if(DOMScroll._scrollbarSize===null)DOMScroll._initScrollbarSize();return DOMScroll._scrollbarSize;},scrollTo:function(e,d,b,a){d=d||d===undefined;if(!(e instanceof Vector2)){var g=Vector2.getScrollPosition().x;var h=Vector2.getElementPosition($(e)).y;h=h-Math.min(0,Math.max(Vector2.getViewportDimensions().y/3,100));e=new Vector2(g,h,'document');}if(b){e.y-=Vector2.getViewportDimensions().y/2;}else if(a){e.y-=Vector2.getViewportDimensions().y;e.y+=a;}e=e.convertTo('document');var f=DOMScroll.getScrollWrapper();if(d&&window.animation){var c=f||document.body;animation(c).to('scrollTop',e.y).to('scrollLeft',e.x).ease(animation.ease.end).duration(750).go();}else if(f){f.scrollTop=e.y;f.scrollLeft=e.x;}else if(window.scrollTo)window.scrollTo(e.x,e.y);}};
function animation(a){if(a==undefined)return;if(this==window){return new animation(a);}else{this.obj=a;this._reset_state();this.queue=[];this.last_attr=null;}}animation.resolution=20;animation.offset=0;animation.prototype._reset_state=function(){this.state={attrs:{},duration:500};};animation.prototype.stop=function(){this._reset_state();this.queue=[];return this;};animation.prototype._build_container=function(){if(this.container_div){this._refresh_container();return;}if(this.obj.firstChild&&this.obj.firstChild.__animation_refs){this.container_div=this.obj.firstChild;this.container_div.__animation_refs++;this._refresh_container();return;}var b=document.createElement('div');b.style.padding='0px';b.style.margin='0px';b.style.border='0px';b.__animation_refs=1;var a=this.obj.childNodes;while(a.length)b.appendChild(a[0]);this.obj.appendChild(b);this.obj.style.overflow='hidden';this.container_div=b;this._refresh_container();};animation.prototype._refresh_container=function(){this.container_div.style.height='auto';this.container_div.style.width='auto';this.container_div.style.height=this.container_div.offsetHeight+'px';this.container_div.style.width=this.container_div.offsetWidth+'px';};animation.prototype._destroy_container=function(){if(!this.container_div)return;if(!--this.container_div.__animation_refs){var a=this.container_div.childNodes;while(a.length)this.obj.appendChild(a[0]);this.obj.removeChild(this.container_div);}this.container_div=null;};animation.ATTR_TO=1;animation.ATTR_BY=2;animation.ATTR_FROM=3;animation.prototype._attr=function(a,d,c){a=a.replace(/-[a-z]/gi,function(e){return e.substring(1).toUpperCase();});var b=false;switch(a){case 'background':this._attr('backgroundColor',d,c);return this;case 'margin':d=animation.parse_group(d);this._attr('marginBottom',d[0],c);this._attr('marginLeft',d[1],c);this._attr('marginRight',d[2],c);this._attr('marginTop',d[3],c);return this;case 'padding':d=animation.parse_group(d);this._attr('paddingBottom',d[0],c);this._attr('paddingLeft',d[1],c);this._attr('paddingRight',d[2],c);this._attr('paddingTop',d[3],c);return this;case 'backgroundColor':case 'borderColor':case 'color':d=animation.parse_color(d);break;case 'opacity':d=parseFloat(d,10);break;case 'height':case 'width':if(d=='auto'){b=true;}else d=parseInt(d,10);break;case 'borderWidth':case 'lineHeight':case 'fontSize':case 'marginBottom':case 'marginLeft':case 'marginRight':case 'marginTop':case 'paddingBottom':case 'paddingLeft':case 'paddingRight':case 'paddingTop':case 'bottom':case 'left':case 'right':case 'top':case 'scrollTop':case 'scrollLeft':d=parseInt(d,10);break;default:throw new Error(a+' is not a supported attribute!');}if(this.state.attrs[a]===undefined)this.state.attrs[a]={};if(b)this.state.attrs[a].auto=true;switch(c){case animation.ATTR_FROM:this.state.attrs[a].start=d;break;case animation.ATTR_BY:this.state.attrs[a].by=true;case animation.ATTR_TO:this.state.attrs[a].value=d;break;}};animation._get_box_width=function(c){var d=parseInt(CSS.getStyle(c,'paddingLeft'),10),e=parseInt(CSS.getStyle(c,'paddingRight'),10),a=parseInt(CSS.getStyle(c,'borderLeftWidth'),10),b=parseInt(CSS.getStyle(c,'borderRightWidth'),10);return c.offsetWidth-(d?d:0)-(e?e:0)-(a?a:0)-(b?b:0);};animation._get_box_height=function(c){var e=parseInt(CSS.getStyle(c,'paddingTop'),10),d=parseInt(CSS.getStyle(c,'paddingBottom'),10),a=parseInt(CSS.getStyle(c,'borderTopWidth'),10),b=parseInt(CSS.getStyle(c,'borderBottomWidth'),10);return c.offsetHeight-(e?e:0)-(d?d:0)-(a?a:0)-(b?b:0);};animation.prototype.to=function(a,b){if(b===undefined){this._attr(this.last_attr,a,animation.ATTR_TO);}else{this._attr(a,b,animation.ATTR_TO);this.last_attr=a;}return this;};animation.prototype.by=function(a,b){if(b===undefined){this._attr(this.last_attr,a,animation.ATTR_BY);}else{this._attr(a,b,animation.ATTR_BY);this.last_attr=a;}return this;};animation.prototype.from=function(a,b){if(b===undefined){this._attr(this.last_attr,a,animation.ATTR_FROM);}else{this._attr(a,b,animation.ATTR_FROM);this.last_attr=a;}return this;};animation.prototype.duration=function(a){this.state.duration=a?a:0;return this;};animation.prototype.checkpoint=function(b,a){if(b===undefined)b=1;this.state.checkpoint=b;this.queue.push(this.state);this._reset_state();this.state.checkpointcb=a;return this;};animation.prototype.blind=function(){this.state.blind=true;return this;};animation.prototype.hide=function(){this.state.hide=true;return this;};animation.prototype.show=function(){this.state.show=true;return this;};animation.prototype.ease=function(a){this.state.ease=a;return this;};animation.prototype.go=function(){var b=(new Date()).getTime();this.queue.push(this.state);for(var a=0;a<this.queue.length;a++){this.queue[a].start=b-animation.offset;if(this.queue[a].checkpoint)b+=this.queue[a].checkpoint*this.queue[a].duration;}animation.push(this);return this;};animation.prototype._frame=function(l){var d=true;var k=false;var n=false;for(var e=0;e<this.queue.length;e++){var b=this.queue[e];if(b.start>l){d=false;continue;}if(b.checkpointcb){this._callback(b.checkpointcb,l-b.start);b.checkpointcb=null;}if(b.started===undefined){if(b.show)this.obj.style.display='block';for(var a in b.attrs){if(b.attrs[a].start!==undefined)continue;switch(a){case 'backgroundColor':case 'borderColor':case 'color':var m=animation.parse_color(CSS.getStyle(this.obj,a=='borderColor'?'borderLeftColor':a));if(b.attrs[a].by){b.attrs[a].value[0]=Math.min(255,Math.max(0,b.attrs[a].value[0]+m[0]));b.attrs[a].value[1]=Math.min(255,Math.max(0,b.attrs[a].value[1]+m[1]));b.attrs[a].value[2]=Math.min(255,Math.max(0,b.attrs[a].value[2]+m[2]));}break;case 'opacity':var m=CSS.getOpacity(this.obj);if(b.attrs[a].by)b.attrs[a].value=Math.min(1,Math.max(0,b.attrs[a].value+m));break;case 'height':var m=animation._get_box_height(this.obj);if(b.attrs[a].by)b.attrs[a].value+=m;break;case 'width':var m=animation._get_box_width(this.obj);if(b.attrs[a].by)b.attrs[a].value+=m;break;case 'scrollLeft':case 'scrollTop':var m=(this.obj==document.body)?(document.documentElement[a]||document.body[a]):this.obj[a];if(b.attrs[a].by)b.attrs[a].value+=m;b['last'+a]=m;break;default:var m=parseInt(CSS.getStyle(this.obj,a),10)||0;if(b.attrs[a].by)b.attrs[a].value+=m;break;}b.attrs[a].start=m;}if((b.attrs.height&&b.attrs.height.auto)||(b.attrs.width&&b.attrs.width.auto)){if(ua.firefox()<3)n=true;this._destroy_container();for(var a in {height:1,width:1,fontSize:1,borderLeftWidth:1,borderRightWidth:1,borderTopWidth:1,borderBottomWidth:1,paddingLeft:1,paddingRight:1,paddingTop:1,paddingBottom:1})if(b.attrs[a])this.obj.style[a]=b.attrs[a].value+(typeof b.attrs[a].value=='number'?'px':'');if(b.attrs.height&&b.attrs.height.auto)b.attrs.height.value=animation._get_box_height(this.obj);if(b.attrs.width&&b.attrs.width.auto)b.attrs.width.value=animation._get_box_width(this.obj);}b.started=true;if(b.blind)this._build_container();}var h=(l-b.start)/b.duration;if(h>=1){h=1;if(b.hide)this.obj.style.display='none';}else d=false;var j=b.ease?b.ease(h):h;if(!k&&h!=1&&b.blind)k=true;if(n&&this.obj.parentNode){var i=this.obj.parentNode;var g=this.obj.nextSibling;i.removeChild(this.obj);}for(var a in b.attrs)switch(a){case 'backgroundColor':case 'borderColor':case 'color':this.obj.style[a]='rgb('+animation.calc_tween(j,b.attrs[a].start[0],b.attrs[a].value[0],true)+','+animation.calc_tween(j,b.attrs[a].start[1],b.attrs[a].value[1],true)+','+animation.calc_tween(j,b.attrs[a].start[2],b.attrs[a].value[2],true)+')';break;case 'opacity':CSS.setOpacity(this.obj,animation.calc_tween(j,b.attrs[a].start,b.attrs[a].value));break;case 'height':case 'width':this.obj.style[a]=j==1&&b.attrs[a].auto?'auto':animation.calc_tween(j,b.attrs[a].start,b.attrs[a].value,true)+'px';break;case 'scrollLeft':case 'scrollTop':var f=this.obj==document.body;var m=(f)?(document.documentElement[a]||document.body[a]):this.obj[a];if(b['last'+a]!=m){delete b.attrs[a];}else{var c=animation.calc_tween(j,b.attrs[a].start,b.attrs[a].value,true)-m;if(DOMScroll.usingScrollWrapper()||!f){this.obj[a]=c+m;}else if(a=='scrollLeft'){window.scrollBy(c,0);}else window.scrollBy(0,c);b['last'+a]=c+m;}break;default:this.obj.style[a]=animation.calc_tween(j,b.attrs[a].start,b.attrs[a].value,true)+'px';break;}if(h==1){this.queue.splice(e--,1);this._callback(b.ondone,l-b.start-b.duration);}}if(n)i[g?'insertBefore':'appendChild'](this.obj,g);if(!k&&this.container_div)this._destroy_container();return !d;};animation.prototype.ondone=function(a){this.state.ondone=a;return this;};animation.prototype._callback=function(a,b){if(a){animation.offset=b;a.call(this);animation.offset=0;}};animation.calc_tween=function(a,b,c,d){return (d?parseInt:parseFloat)((c-b)*a+b,10);};animation.parse_color=function(a){var b=/^#([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})$/i.exec(a);if(b){return [parseInt(b[1].length==1?b[1]+b[1]:b[1],16),parseInt(b[2].length==1?b[2]+b[2]:b[2],16),parseInt(b[3].length==1?b[3]+b[3]:b[3],16)];}else{var c=/^rgba? *\(([0-9]+), *([0-9]+), *([0-9]+)(?:, *([0-9]+))?\)$/.exec(a);if(c){if(c[4]==='0'){return [255,255,255];}else return [parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}else if(a=='transparent'){return [255,255,255];}else throw 'Named color attributes are not supported.';}};animation.parse_group=function(a){var a=trim(a).split(/ +/);if(a.length==4){return a;}else if(a.length==3){return [a[0],a[1],a[2],a[1]];}else if(a.length==2){return [a[0],a[1],a[0],a[1]];}else return [a[0],a[0],a[0],a[0]];};animation.push=function(a){if(!animation.active)animation.active=[];animation.active.push(a);if(!animation.timeout)animation.timeout=setInterval(animation.animate.bind(animation),animation.resolution,false);animation.animate(true);};animation.animate=function(b){var c=(new Date()).getTime();for(var a=b===true?animation.active.length-1:0;a<animation.active.length;a++)try{if(!animation.active[a]._frame(c))animation.active.splice(a--,1);}catch(e){animation.active.splice(a--,1);}if(animation.active.length==0){clearInterval(animation.timeout);animation.timeout=null;}};animation.ease={};animation.ease.begin=function(a){return Math.sin(Math.PI/2*(a-1))+1;};animation.ease.end=function(a){return Math.sin(.5*Math.PI*a);};animation.ease.both=function(a){return .5*Math.sin(Math.PI*(a-.5))+.5;};
function intl_set_xmode(a){(new AsyncRequest()).setURI('/ajax/intl/save_xmode.php').setData({xmode:a}).setHandler(function(){document.location.reload();}).send();}function intl_set_cmode(a){(new AsyncRequest()).setURI('/ajax/intl/save_xmode.php').setData({cmode:a}).setHandler(function(){document.location.reload();}).send();}function intl_set_vmode(a){(new AsyncRequest()).setURI('/ajax/intl/save_xmode.php').setData({vmode:a}).setHandler(function(){document.location.reload();}).send();}function intl_set_amode(a){(new AsyncRequest()).setURI('/ajax/intl/save_xmode.php').setData({amode:a,app:false}).setHandler(function(){document.location.reload();}).send();}function intl_set_pmode(a){CSS.toggleClass($('translations_nub'),'pnub');if(a==0){CSS.addClass($('progress_check'),'progress_hidden');CSS.removeClass($('progress_check'),'progress_shown');}else{CSS.addClass($('progress_check'),'progress_shown');CSS.removeClass($('progress_check'),'progress_hidden');}(new AsyncRequest()).setURI('/ajax/intl/save_xmode.php').setData({pmode:a}).setHandler(function(){}).send();}function intl_set_locale(b,c,a){if(!a)var a=b.options[b.selectedIndex].value;intl_save_locale(a,true,null,c);}function intl_save_locale(a,c,b,d){new AsyncRequest().setURI('/ajax/intl/save_locale.php').setData({locale:a,source:d}).setHandler(function(e){if(c){document.location.reload();}else goURI(b);}).send();}function intl_toggle_beta_locale_install(a){if(a.checked){show($('beta_locale_install'));}else hide($('beta_locale_install'));}function intl_set_cookie_locale(a,d,c){var b=getCookie('locale');new AsyncRequest().setURI('/ajax/intl/save_locale_cookie_logging.php').setData({new_locale:a,old_locale:b,source:c}).setReadOnly(true).send();setCookie('locale',a,7*24*3600000);if(URI.getRequestURI().getTld()!='com'){transferCookieToComTld('locale',function(e){if(e)clearCookie('locale');goURI(d);});}else goURI(d);}function intl_disable_rooster_save(b){var c=document.getElementById('install_translation_app');c.disabled=!b.checked;var a=document.getElementById('install_container');if(b.checked){a.style.display='block';}else a.style.display='none';}function intl_confirm_rooster_and_install_app(b,a){goURI('/add.php?api_key=efa7a7045708fcadede8d705e39b1642');}function intl_locale_is_rtl(){return ('rtl'==CSS.getStyle(document.body,'direction'));}function intl_is_left_click(a){if(a.which==null){if(a.button<2&&!a.ctrlKey)return true;}else if(a.which<2&&!a.ctrlKey)return true;return false;}function intl_left_click_cancelBubble(a){if(intl_is_left_click(a))a.cancelBubble=true;}
function List(b){if(arguments.length>1){for(var a=0;a<arguments.length;a++)this.push(arguments[a]);}else this.resize(b||0);}List.prototype.length=0;List.prototype.size=function(){return this.length;};List.prototype.resize=function(a){this.length=a;return this;};List.prototype.alloc=function(a){return new List(a);};List.prototype.toString=function(){return '['+this.join(', ')+']';};List.prototype.push=Array.prototype.push;List.prototype.pop=Array.prototype.pop;List.prototype.join=Array.prototype.join;List.prototype.map=Array.prototype.map;List.prototype.forEach=Array.prototype.forEach;List.prototype.each=Array.prototype.each;List.prototype.filter=Array.prototype.filter;List.prototype.every=Array.prototype.every;List.prototype.some=Array.prototype.some;List.prototype.pull=Array.prototype.pull;List.prototype.pullEach=Array.prototype.pullEach;List.prototype.pullFilter=Array.prototype.pullFilter;List.prototype.splice=Array.prototype.splice;
function HTML(a){if(this===window){if(a instanceof HTML)return a;return new HTML(a);}this._content=a;this._defer=false;this._extra_action='';this._nodes=null;this._inline_js=bagofholding;this._has_option_elements=false;return this;}copy_properties(HTML.prototype,{toString:function(){var a=this._content;if(this._extra_action)a+='<script type="text/javascript">'+this._extra_action+'</scr'+'ipt>';return a;},setAction:function(a){this._extra_action=a;return this;},getAction:function(){this._fillCache();var a=function(){this._inline_js();eval_global(this._extra_action);}.bind(this);if(this.getDeferred()){return a.defer.bind(a);}else return a;},setDeferred:function(a){this._defer=!!a;return this;},getDeferred:function(){return this._defer;},getContent:function(){return this._content;},getNodes:function(){this._fillCache();return this._nodes;},getRootNode:function(){return this.getNodes()[0];},hasOptionElements:function(){this._fillCache();return this._has_option_elements;},_fillCache:function(){if(null!==this._nodes)return;var d=this._content;if(!d){this._nodes=[];return;}d=d.replace(/(<(\w+)[^>]*?)\/>/g,function(l,m,n){return n.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?l:m+'></'+n+'>';});var h=d.trim().toLowerCase(),k=document.createElement('div'),b=false;var j=(!h.indexOf('<opt')&&[1,'<select multiple="multiple" class="__WRAPPER">','</select>'])||(!h.indexOf('<leg')&&[1,'<fieldset class="__WRAPPER">','</fieldset>'])||(h.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,'<table class="__WRAPPER">','</table>'])||(!h.indexOf('<tr')&&[2,'<table><tbody class="__WRAPPER">','</tbody></table>'])||((!h.indexOf('<td')||!h.indexOf('<th'))&&[3,'<table><tbody><tr class="__WRAPPER">','</tr></tbody></table>'])||(!h.indexOf('<col')&&[2,'<table><tbody></tbody><colgroup class="__WRAPPER">','</colgroup></table>'])||null;if(null===j){k.className='__WRAPPER';if(ua.ie()){j=[0,'<span style="display:none">&nbsp;</span>',''];b=true;}else j=[0,'',''];}k.innerHTML=j[1]+d+j[2];while(j[0]--)k=k.lastChild;if(b)k.removeChild(k.firstChild);k.className!='__WRAPPER';if(0!=k.getElementsByTagName('option').length)this._has_option_elements=true;if(ua.ie()){var i;if(!h.indexOf('<table')&&-1==h.indexOf('<tbody')){i=k.firstChild&&k.firstChild.childNodes;}else if(j[1]=='<table>'&&-1==h.indexOf('<tbody')){i=k.childNodes;}else i=[];for(var f=i.length-1;f>=0;--f)if(i[f].nodeName&&i[f].nodeName.toLowerCase()=='tbody'&&i[f].childNodes.length==0)i[f].parentNode.removeChild(i[f]);}var g=k.getElementsByTagName('script');var a=[];for(var e=0;e<g.length;e++)if(g[e].src){a.push(Bootloader.requestResource.bind(Bootloader,'js',g[e].src));}else a.push(eval_global.bind(null,g[e].innerHTML));for(var e=g.length-1;e>=0;e--)g[e].parentNode.removeChild(g[e]);var c=function(){for(var l=0;l<a.length;l++)a[l]();};this._nodes=to_array(k.childNodes);this._inline_js=c;}});
function show(){for(var b=0;b<arguments.length;b++){var a=ge(arguments[b]);if(a&&a.style)a.style.display='';}return false;}function hide(){for(var b=0;b<arguments.length;b++){var a=ge(arguments[b]);if(a&&a.style)a.style.display='none';}return false;}function shown(a){a=ge(a);return (a.style.display!='none'&&!(a.style.display==''&&a.offsetWidth==0));}function toggle(){for(var b=0;b<arguments.length;b++){var a=$(arguments[b]);a.style.display=CSS.getStyle(a,"display")=='block'?'none':'block';}return false;}function toggleDisplayNone(){for(var b=0;b<arguments.length;b++){var a=$(arguments[b]);if(shown(a)){hide(a);}else show(a);}return false;}function set_inner_html(c,b,a){DOM.setContent(c,HTML(b).setDeferred(!!a));}function expandCollapseInplace(b,a){topElem=ge(b);bottomElem=ge(a);if(!topElem||!bottomElem)return false;topElemHeight=topElem.clientHeight;if(shown(a)){bottomElemHeight=bottomElem.clientHeight;newHeight=topElemHeight+bottomElemHeight;topElem.style.height=newHeight+'px';CSS.addClass(bottomElem,'hidden_elem');}else{CSS.removeClass(bottomElem,'hidden_elem');bottomElemHeight=bottomElem.clientHeight;newHeight=topElemHeight-bottomElemHeight;topElem.style.height=newHeight+'px';}return true;}
var DOM={find:function(a,c){var b=DOM.scry(a,c);if(1!=b.length)return null;return b[0];},scry:function(j,x,u){var y=x.split(' ');var d=[j||document];var i=d[0]==document;for(var m=0;m<y.length;m++){if(d.length==0)break;if(y[m]=='')continue;var w=y[m];var t=[];var zf=false;if(w.charAt(0)=='^')if(m==0){zf=true;w=w.slice(1);}else return;w=w.replace(/\./g,' .');w=w.replace(/\#/g,' #');w=w.replace(/\[/g,' [');var zb=w.split(' ');var zc=zb[0]||'*';var n=zb[1]&&zb[1].charAt(0)=='#';if(n){var h=ge(zb[1].slice(1),true);if(h&&('*'==zc||h.tagName.toLowerCase()==zc))for(var q=0;q<d.length;q++)if(zf&&DOM.contains(h,d[q])){t=[h];break;}else if(document==d[q]||DOM.contains(d[q],h)){t=[h];break;}}else{var ze=[];var c=d.length;for(var o=0;o<c;o++){if(zf){var k=[];var g=d[o].parentNode;var a=zc=='*';while(DOM.isNode(g,DOM.NODE_TYPES.ELEMENT)){if(a||g.tagName.toLowerCase()==zc)k.push(g);g=g.parentNode;}}else var k=d[o].getElementsByTagName(zc);var l=k.length;for(var r=0;r<l;r++)ze.push(k[r]);}var p;var e;for(var z=1;z<zb.length;z++){var za=zb[z];if(za.charAt(0)=='.'){p=true;e=new RegExp('\\b'+za.substring(1)+'\\b');}else p=false;for(var o=0;o<ze.length;o++){var zd=ze[o];if(!zd)continue;if(p){if(!e.test(zd.className))delete ze[o];continue;}else{var f=za.slice(1,za.length-1);if(f.indexOf('=')==-1){if(zd.getAttribute(f)===null){delete ze[o];continue;}}else{var v=f.split('=');var b=v[0];var zg=v[1];zg=zg.slice(1,zg.length-1);if(zd.getAttribute(b)!=zg){delete ze[o];continue;}}}}}for(var o=0;o<ze.length;o++)if(ze[o]){t.push(ze[o]);if(zf)break;}}d=t;}var s=null;if(!u){for(var o=0;o<d.length;o++)$(d[o]);s=new NodeList();s.push.apply(s,$A(d));}else s=d;return s;},getText:(function(){var a=document.createElement('div'),b=a.innerText==null?'textContent':'innerText';return function(c){if(!c){return '';}else if(DOM.isNode(c,DOM.NODE_TYPES.TEXT)){return c.data;}else return c[b];};})(),_getSelectionPrivate:function(a){var b=a?false:'';if(document.selection&&document.selection.createRange&&document.selection.createRange.text){b=a?true:document.selection.createRange().text;}else if(document.getSelection){b=a?true:document.getSelection();}else if(window.getSelection)b=a?true:window.getSelection();return b;},getSelectionSupported:function(){return DOM._getSelectionPrivate(true);},getSelection:function(){return DOM._getSelectionPrivate(false);},create:function(c,a,b,e){c=document.createElement(c);if(a){a=copy_properties({},a);if(a.style){copy_properties(c.style,a.style);delete a.style;}for(var d in a)if(d.toLowerCase().indexOf('on')==0){typeof a[d]!='function';Event.listen(c,d.substr(2),a[d]);delete a[d];}copy_properties(c,a);}if(b!=undefined)DOM.setContent(c,b);return $(c,e);},setID:function(a,b){a.id=b;},prependContent:function(c,b){if(!DOM.isNode(c))throw new Error('DOM.prependContent: reference element is not a node');var a=function(d){if(c.firstChild){c.insertBefore(d,c.firstChild);}else c.appendChild(d);};return DOM._addContent(b,a,c);},insertAfter:function(c,b){if(!DOM.isNode(c)||!c.parentNode)throw new Error('DOM.insertAfter: reference element is not a node');var a=function(d){if(c.nextSibling){c.parentNode.insertBefore(d,c.nextSibling);}else c.parentNode.appendChild(d);};return DOM._addContent(b,a,c.parentNode);},insertBefore:function(b,c){if(!DOM.isNode(c)||!c.parentNode)throw new Error('DOM.insertBefore: reference element is not a node or '+'does not have a parent.');var a=function(d){c.parentNode.insertBefore(d,c);};return DOM._addContent(b,a,c.parentNode);},setContent:function(b,a){if(!DOM.isNode(b))throw new Error('DOM.setContent: reference element is not a node');DOM.empty(b);return DOM.appendContent(b,a);},appendContent:function(c,b){if(!DOM.isNode(c))throw new Error('DOM.appendContent: reference element is not a node');var a=function(d){c.appendChild(d);};return DOM._addContent(b,a,c);},replace:function(c,b){if(!DOM.isNode(c)||!c.parentNode)throw new Error('DOM.replace: reference element must be a node with a'+' parent');var a=function(d){c.parentNode.replaceChild(d,c);};return DOM._addContent(b,a,c.parentNode);},_gettingCaretPosition:false,getCaretPosition:function(a){a=$(a);if(!DOM.isNode(a,['input','textarea']))return {start:undefined,end:undefined};if(!document.selection)return {start:a.selectionStart,end:a.selectionEnd};if(DOM.isNode(a,'input')){var c=document.selection.createRange();return {start:-c.moveStart('character',-a.value.length),end:-c.moveEnd('character',-a.value.length)};}else{if(!DOM._gettingCaretPosition){DOM._gettingCaretPosition=true;a.focus();DOM._gettingCaretPosition=false;}var c=document.selection.createRange();var d=c.duplicate();d.moveToElementText(a);d.setEndPoint('StartToEnd',c);var b=a.value.length-d.text.length;d.setEndPoint('StartToStart',c);return {start:a.value.length-d.text.length,end:b};}},setCaretPosition:function(c,f,a){c=$(c);if(document.selection){if(c.tagName=='TEXTAREA'){var b=c.value.indexOf("\r",0);while(b!=-1&&b<a){a--;if(b<f)f--;b=c.value.indexOf("\r",b+1);}}var d=c.createTextRange();d.collapse(true);d.moveStart('character',f);if(a!=undefined)d.moveEnd('character',a-f);d.select();}else{c.selectionStart=f;var e=a==undefined?f:a;c.selectionEnd=Math.min(e,c.value.length);c.focus();}},remove:function(a,b){a=$(a,true);if(a.parentNode){a.parentNode.removeChild(a);if(!b&&ua.ie()<8)try{}catch(ignored){}}},empty:function(a){a=$(a,true);while(a.firstChild)DOM.remove(a.firstChild);},contains:function(b,a){b=ge(b,true);a=ge(a,true);if(!b||!a){return false;}else if(b===a){return true;}else if(DOM.isNode(b,'#text')){return false;}else if(DOM.isNode(a,'#text')){return DOM.contains(b,a.parentNode);}else if(b.contains){return b.contains(a);}else if(b.compareDocumentPosition){return !!(b.compareDocumentPosition(a)&16);}else return false;},getRootElement:function(){var a=null;if(window.Quickling&&Quickling.isActive())a=ge('content');return a||DOMScroll.getScrollRoot();},suppressSelection:function(a){if(typeof a.onselectstart!='undefined'){a.listen('selectstart',function(){return false;});}else if(typeof a.style.MozUserSelect!='undefined'){a.style.MozUserSelect='none';}else a.listen('mousedown',function(){return false;});return a;},isNode:function(c,d){if(typeof(Node)=='undefined')Node=null;try{if(!c||!((Node!=undefined&&c instanceof Node)||c.nodeName))return false;}catch(ignored){return false;}if(typeof(d)!=='undefined'){d=arrayize(d).map(function(f){return (f+'').toUpperCase();});var b,e;try{b=new String(c.nodeName).toUpperCase();e=c.nodeType;}catch(ignored){return false;}for(var a=0;a<d.length;a++)try{if(b==d[a]||e==d[a])return true;}catch(ignored){}return false;}return true;},NODE_TYPES:{ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION_NODE:12},_addContent:function(d,a,k){if(d instanceof HTML&&-1==d.toString().indexOf('<scr'+'ipt')&&''==k.innerHTML){if(!ua.ie()||!DOM.isNode(k,['table','tbody','thead','tfoot','tr','select','fieldset'])){k.innerHTML=d;return;}}else if(DOM.isNode(k,DOM.NODE_TYPES.TEXT)){k.data=d;return;}var h,e=new NodeList(),b=[];var f=document.createDocumentFragment();if(!(d instanceof Array))d=[d];for(var g=0;g<d.length;g++){h=d[g];if(h instanceof HTML){b.push(h.getAction());var j=h.getNodes(),c;for(var i=0;i<j.length;i++){c=(ua.safari()||(ua.ie()&&h.hasOptionElements()))?j[i]:j[i].cloneNode(true);e.push(c);f.appendChild(c);}}else if(is_scalar(h)){var l=document.createTextNode(h);e.push(l);f.appendChild(l);}else if(DOM.isNode(h)){e.push(h);f.appendChild(h);}else if(!(h instanceof Array))h!==null;}a(f);for(var g=0;g<b.length;g++)b[g]();return e;},getNearest:function(a,b){while(a&&!DOM.isNode(a,b))a=a.parentNode;return a;},findParentByClass:function(b,a){while(DOM.isNode(b)){if(CSS.hasClass(b,a))return b;b=b.parentNode;}return null;}};function NodeList(a){if(!NodeList._augmented){copy_properties(NodeList.prototype,NodeList._getAugment());NodeList._augmented=true;}List.call(this,a);}NodeList.prototype=new List();copy_properties(NodeList.prototype,{toString:function(){return '[NodeList]';}});copy_properties(NodeList,{_augmented:false,_getAugment:function(){var a=function(f,e){return function(){d();var g=$A(arguments);return this[f](function(j,h,i){return e.apply(null,[j].concat(g));});};};var c=function(e){return function(){d();e.apply(this,$A(arguments));return this;};};var b=function(f,e){return function(){d();var i=e.apply(this,$A(arguments));var h=new f();for(var g=0;g<i.length;g++)h.push.apply(h,$A(i[g]));return h;};};var d=function(){};return {scry:b(NodeList,a('map',DOM.scry)),addClass:c(a('map',CSS.addClass)),removeClass:c(a('map',CSS.removeClass)),hasClass:a('every',CSS.hasClass),toggleClass:c(a('map',CSS.toggleClass)),getStyle:a('map',CSS.getStyle),setStyle:c(a('map',CSS.setStyle))};}});function $N(c,a,b){if(typeof a!='object'||DOM.isNode(a)||a instanceof Array||a instanceof HTML){b=a;a=null;}return DOM.create(c,a,b);}var $$=function _$$(a){return DOM.scry.apply(null,[document].concat($A(arguments)));};NodeAugment.add({setContent:DOM.setContent,prependContent:DOM.prependContent,appendContent:DOM.appendContent,replace:DOM.replace,remove:DOM.remove,empty:DOM.empty,scry:DOM.scry,find:DOM.find,isNode:DOM.isNode,getText:DOM.getText});
function getRadioFormValue(b){for(var a=0;a<b.length;a++)if(b[a].checked)return b[a].value;return null;}function get_all_form_inputs(a){a=a||document;return [].concat($A(DOM.scry(a,'input')),$A(DOM.scry(a,'select')),$A(DOM.scry(a,'textarea')),$A(DOM.scry(a,'button')));}function get_form_select_value(a){return a.options[a.selectedIndex].value;}function set_form_select_value(b,c){for(var a=0;a<b.options.length;++a)if(b.options[a].value==c){b.selectedIndex=a;break;}}function get_form_attr(b,a){var f=b[a];if(typeof f=='object'&&f.tagName=='INPUT'){var e=f.parentNode,d=f.nextSibling,c=f;e.removeChild(c);f=b[a];d?e.insertBefore(c,d):e.appendChild(c);}return f;}function serialize_form_helper(a,d,e){var c=/([^\]]+)\[([^\]]*)\](.*)/.exec(d);if(c){a[c[1]]=a[c[1]]||{};if(c[2]==''){var b=0;while(a[c[1]][b]!=undefined)b++;}else b=c[2];if(c[3]==''){a[c[1]][b]=e;}else serialize_form_helper(a[c[1]],b.concat(c[3]),e);}else a[d]=e;}function serialize_form_fix(a){var e=[];for(var b in a){if(a instanceof Object)a[b]=serialize_form_fix(a[b]);e.push(b);}var d=0,c=true;e.sort().each(function(g){if(g!=d++)c=false;});if(c){var f={};e.each(function(g){f[g]=a[g];});return f;}else return a;}function form_get_elements(a){return $A(a.tagName=='FORM'?a.elements:get_all_form_inputs(a));}function serialize_form(b,c){var a={};form_get_elements(b).forEach(function(d){if(d.name&&!d.disabled&&d.type!='submit')if(!d.type||((d.type=='radio'||d.type=='checkbox')&&d.checked)||d.type=='text'||d.type=='password'||d.type=='hidden'||d.tagName=='TEXTAREA'||d.tagName=='SELECT')serialize_form_helper(a,d.name,d.value);});if(c&&'submit'==c.type&&DOM.contains(b,c)&&DOM.isNode(c,['input','button']))serialize_form_helper(a,c.name,c.value);return serialize_form_fix(a);}function form_set_disabled(b,a){form_get_elements(b).forEach(function(c){if(c.disabled!=undefined)if(a){DataStore.set(c,'origDisabledState',c.disabled);c.disabled=a;}else{if(DataStore.get(c,'origDisabledState')!==true)c.disabled=false;DataStore.remove(c,'origDisabledState');}});}function bootstrap_form(b,c){var d=b.method.toUpperCase();c=DOM.getNearest(c,['input','button']);var a=serialize_form(b,c);form_set_disabled(b,true);var e=b;if(CSS.hasClass(c,'stat_elem'))e=c;new AsyncRequest(b.action).setData(a).setReadOnly(d=='GET').setMethod(d).setHandler(AsyncRequest.responseOpsHandler.bind(null,b)).setStatusElement(e).setFinallyHandler(form_set_disabled.bind(null,b,false)).send();}function do_post(f){var d=/(^([^?])+)\??(.*)$/.exec(f.toString());var a=document.createElement('form');a.action=d[1];a.method='post';a.style.display='none';var e=/([\w]+)(?:=([^&]+)|&|$)/g;var c=null;if(ge('post_form_id'))d[3]+='&post_form_id='+$('post_form_id').value;if(ge('fb_dtsg'))d[3]+='&fb_dtsg='+$('fb_dtsg').value;while(c=e.exec(d[3])){var b=document.createElement('input');b.type='hidden';b.name=decodeURIComponent(c[1]);b.value=decodeURIComponent(c[2]);a.appendChild(b);}DOM.getRootElement().appendChild(a);a.submit();return false;}function dynamic_post(d,b,c){var a=document.createElement('form');a.action=d.toString();a.method='POST';a.style.display='none';if(c)a.target=c;if(ge('post_form_id'))b.post_form_id=$('post_form_id').value;b.fb_dtsg=Env.fb_dtsg;b.post_form_id_source='dynamic_post';b.next=htmlspecialchars(document.location.href);create_hidden_inputs(b,a);DOM.getRootElement().appendChild(a);a.submit();return false;}function create_hidden_inputs(g,a,d,f){d=d||{};var c;var h=URI.implodeQuery(g,'',false);var i=h.split('&');for(var b=0;b<i.length;b++)if(i[b]){var j=i[b].split('=');var e=j[0];var k=j[1];if(e===undefined||k===undefined)continue;k=URI.decodeComponent(k);if(d[e]&&f){d[e].value=k;}else{c=$N('input',{type:'hidden',name:e,value:k});d[e]=c;a.appendChild(c);}}return d;}
function KeyEventController(){copy_properties(this,{handlers:{}});document.onkeyup=this.onkeyevent.bind(this,'onkeyup');document.onkeydown=this.onkeyevent.bind(this,'onkeydown');document.onkeypress=this.onkeyevent.bind(this,'onkeypress');}copy_properties(KeyEventController,{instance:null,getInstance:function(){return KeyEventController.instance||(KeyEventController.instance=new KeyEventController());},defaultFilter:function(event,a){event=$E(event);return KeyEventController.filterEventTypes(event,a)&&KeyEventController.filterEventTargets(event,a)&&KeyEventController.filterEventModifiers(event,a);},filterEventTypes:function(event,a){if(a==='onkeydown')return true;return false;},filterEventTargets:function(event,b){var a=$E(event).getTarget();if(DOM.isNode(a,['input','select','textarea','object','embed']))if(a.type!='checkbox'&&a.type!='radio')return false;return true;},filterEventModifiers:function(event,a){if(event.ctrlKey||event.altKey||event.metaKey||event.repeat)return false;return true;},registerKey:function(f,a,d){if(d===undefined)d=KeyEventController.defaultFilter;var b=KeyEventController.getInstance();var c=b.mapKey(f);if(is_empty(b.handlers))onunloadRegister(b.resetHandlers.bind(b));for(var e=0;e<c.length;e++){f=c[e];if(!b.handlers[f])b.handlers[f]=[];b.handlers[f].push({callback:a,filter:d});}},keyCodeMap:{'[':[219],']':[221],'`':[192],LEFT:[KEYS.LEFT,63234],RIGHT:[KEYS.RIGHT,63235],RETURN:[KEYS.RETURN],TAB:[KEYS.TAB],DOWN:[KEYS.DOWN,63233],UP:[KEYS.UP,63232],ESCAPE:[KEYS.ESC]}});copy_properties(KeyEventController.prototype,{mapKey:function(a){if(typeof(a)=='number')return [48+a,96+a];if(KeyEventController.keyCodeMap[a.toUpperCase()])return KeyEventController.keyCodeMap[a.toUpperCase()];var b=a.toUpperCase().charCodeAt(0);return [b];},onkeyevent:function(h,c){c=$E(c);var d=null;var f=this.handlers[c.keyCode];var b,e,a;if(f)for(var g=0;g<f.length;g++){b=f[g].callback;e=f[g].filter;try{if(!e||e(c,h)){a=b(c,h);if(a===false)return Event.kill(c);}}catch(exception){}}return true;},resetHandlers:function(){this.handlers={};}});
function Rect(e,d,a,c,b){if(this===window){if(e instanceof Rect)return e;if(e instanceof Vector2)return new Rect(e.y,e.x,e.y,e.x,e.domain);return Rect.getElementBounds($(e));}copy_properties(this,{t:e,r:d,b:a,l:c,domain:b||'pure'});}copy_properties(Rect.prototype,{w:function(){return this.r-this.l;},h:function(){return this.b-this.t;},area:function(){return this.w()*this.h();},toString:function(){return '(('+this.l+', '+this.t+'), ('+this.r+', '+this.b+'))';},intersects:function(b){b=Rect(b).convertTo(this.domain);var a=this;if(a.l>b.r||b.l>a.r||a.t>b.b||b.t>a.b)return false;return true;},clipTo:function(a){a=a.convertTo(this.domain);if(!this.intersects(a))return null;return new Rect(Math.max(this.t,a.t),Math.min(this.r,a.r),Math.min(this.b,a.b),Math.max(this.l,a.l),this.domain);},contains:function(b){b=Rect(b).convertTo(this.domain);var a=this;if(b instanceof Vector2){return (a.l<=b.x&&a.r>=b.x&&a.t<=b.y&&a.b>=b.y);}else return (a.l<=b.l&&a.r>=a.r&&a.t<=b.t&&a.b>=b.b);},canContain:function(a){a=Rect(a).convertTo(this.domain);return (a.h()<=this.h())&&(a.w()<=this.w());},forceBelow:function(b,a){a=a||0;b=Rect(b).convertTo(this.domain);if(b.b>this.t)return this.add(0,(b.b-this.t)+a);return this;},add:function(c,d){if(arguments.length==1){if(c.domain!='pure')c=c.convertTo(this.domain);return this.add(c.x,c.y);}var a=parseFloat(c);var b=parseFloat(d);return new Rect(this.t+b,this.r+a,this.b+b,this.l+a,this.domain);},sub:function(a,b){if(arguments.length==1){return this.add(a.mul(-1));}else return this.add(-a,-b);},expand:function(a,b){return new Rect(this.t,this.r+a,this.b+b,this.l,this.domain);},scale:function(a,b){b=b||a;return new Rect(this.t,this.l+(this.w()*a),this.t+(this.h()*b),this.l,this.domain);},setDimensions:function(a,b){return new Rect(this.t,this.l+a,this.t+b,this.l,this.domain);},setPosition:function(a,b){return new Rect(a,this.w(),this.h(),b,this.domain);},boundWithin:function(a){var b=0,c=0;if(this.l<a.l){b=a.l-this.l;}else if(this.r>a.r)b=a.r-this.r;if(this.t<a.t){c=a.t-this.t;}else if(this.b>a.b)c=a.b-this.b;return this.add(b,c);},setElementBounds:function(a){this.getPositionVector().setElementPosition(a);this.getDimensionVector().setElementDimensions(a);return this;},getPositionVector:function(){return new Vector2(this.l,this.t,this.domain);},getDimensionVector:function(){return new Vector2(this.w(),this.h(),'pure');},convertTo:function(a){if(this.domain==a)return this;if(a=='pure')return new Rect(this.t,this.r,this.b,this.l,'pure');if(this.domain=='pure')return new Rect(0,0,0,0);var b=new Vector2(this.l,this.t,this.domain).convertTo(a);return new Rect(b.y,b.x+this.w(),b.y+this.h(),b.x,a);},constrict:function(a,b){if(typeof(b)=='undefined')b=a;a=a||0;return new Rect(this.t+b,this.r-a,this.b-b,this.l+a,this.domain);},expandX:function(){return new Rect(this.t,Number.POSITIVE_INFINITY,this.b,Number.NEGATIVE_INFINITY);},expandY:function(){return new Rect(number.NEGATIVE_INFINITY,this.r,Number.POSITIVE_INFINITY,this.l);},drawBox:function(a){var b=$N('div',{style:{position:'absolute',border:'2px solid '+(a||'red'),zIndex:'10000'}});this.setElementBounds(b);document.body.appendChild(b);}});copy_properties(Rect,{newFromVectors:function(b,a){return new Rect(b.y,b.x+a.x,b.y+a.y,b.x,b.domain);},getElementBounds:function(a){return Rect.newFromVectors(Vector2.getElementPosition(a),Vector2.getElementDimensions(a));},getViewportBounds:function(){return Rect.newFromVectors(Vector2.getScrollPosition(),Vector2.getViewportDimensions());},getDocumentBounds:function(){return Rect.newFromVectors(new Vector2(0,0,'document'),Vector2.getDocumentDimensions());}});
function Dialog(a){Dialog._setup();this._show_loading=true;this._loading_text=null;this._auto_focus=true;this._fade_enabled=true;this._onload_handlers=[];this._top=125;this._content=null;this._obj=null;this._popup=null;this._overlay=null;this._iframe=null;this._hidden_objects=[];if(a)this._setFromModel(a);}copy_properties(Dialog,{OK:{name:'ok',label:_tx("OK")},CANCEL:{name:'cancel',label:_tx("Annulla"),className:'inputaux'},CLOSE:{name:'close',label:_tx("Chiudi")},NEXT:{name:'next',label:_tx("Next")},SAVE:{name:'save',label:_tx("Salva")},SUBMIT:{name:'submit',label:_tx("Invia")},CONFIRM:{name:'confirm',label:_tx("Conferma")},DELETE:{name:'delete',label:_tx("Elimina")}});copy_properties(Dialog,{OK_AND_CANCEL:[Dialog.OK,Dialog.CANCEL],_STANDARD_BUTTONS:[Dialog.OK,Dialog.CANCEL,Dialog.CLOSE,Dialog.SAVE,Dialog.SUBMIT,Dialog.CONFIRM,Dialog.DELETE],SHOULD_HIDE_OBJECTS:!ua.windows(),MODALITY:{DARK:'dark',WHITE:'white'},SHOULD_USE_IFRAME:ua.ie()<7||(ua.osx()&&ua.firefox()),dialogStack:null,newButton:function(e,d,b,c){var a={name:e,label:d};if(b)a.className=b;if(c)a.handler=c;return a;},getCurrent:function(){var a=Dialog.dialogStack;if(!a||!a.length)return null;return a[a.length-1];},createConfirmationDialog:function(c,d,a,b){a=a||Dialog.CONFIRM;return new Dialog().setClassName('confirm_dialog').setTitle(d||_tx("\u00c8 richiesta una conferma")).setBody(c||_tx("Sei sicuro di voler fare questa azione?")).setButtons([a,Dialog.CANCEL]).setCancelHandler(b||bagofholding).setModal();},bootstrap:function(f,a,e,c,d){a=a||{};copy_properties(a,new URI(f).getQueryData());c=c||(e?'GET':'POST');var b=new Dialog(d).setAsync(new AsyncRequest().setURI(f).setData(a).setReadOnly(!!e).setMethod(c));b.show();return false;},showFormAjax:function(j,k,a,h){var c='dialog_ajax_form__'+(+new Date());var b=new Dialog().setTitle(j).setShowLoading(true).show();var f=function(l){if(l.getError()!=true){b.hide();ErrorDialog.showAsyncError(l);}else b.setBody(l.getPayload()).setButtons(Dialog.OK).clearHandler().show();};var g=function(n){var m='<form id="'+c+'" onsubmit="return false;">'+n.getPayload()+'</form>';var l=[Dialog.newButton(a.toLowerCase(),a),Dialog.CANCEL];b.setBody(m).setButtons(l).setHandler(i).show();};var i=function(){new AsyncRequest().setURI(k).setData(serialize_form(ge(c))).setHandler(e).setErrorHandler(d).send();};var e=function(l){b.setBody(l.getPayload()).setButtons([Dialog.OK]).show();if(h){window.location.reload();}else b.setAutohide(750);};var d=function(l){if(l.getError()==kError_Global_ValidationError){g(l);}else if(l.getError()!=true){ErrorDialog.showAsyncError(l);}else f(l);};new AsyncRequest().setURI(k).setReadOnly(true).setHandler(g).setErrorHandler(f).send();},_basicMutator:function(a){return function(b){this[a]=b;this._dirty();return this;};},_findButton:function(a,c){if(a)for(var b=0;b<a.length;++b)if(a[b].name==c)return a[b];return null;},_setup:function(){if(Dialog._is_set_up)return;Dialog._is_set_up=true;var a=function(event,b){return b=='onkeyup'&&KeyEventController.filterEventModifiers(event,b);};KeyEventController.registerKey('ESCAPE',Dialog._handleEscapeKey,a);},_hideAll:function(){if(Dialog.dialogStack!==null&&Dialog.dialogStack.length){var b=Dialog.dialogStack.clone();Dialog.dialogStack=null;for(var a=b.length-1;a>=0;a--)b[a].hide();}},_handleEscapeKey:function(event,f){var d=Dialog.getCurrent();if(!d)return true;var e=d._semi_modal;var b=d._buttons;if(!b&&!e)return true;if(e&&!b){d.hide();return true;}var c=Dialog._findButton(b,'cancel');if(c){var a=c;}else if(b.length==1){var a=b[0];}else return true;d._handleButton(a);return false;},call_or_eval:function(obj,func,args){if(!func)return undefined;args=args||{};if(typeof(func)=='string'){var params=keys(args).join(', ');func=eval('({f: function('+params+') { '+func+'}})').f;}return func.apply(obj,values(args));}});copy_properties(Dialog.prototype,{show:function(a){this._showing=true;if(a){if(this._overlay)this._overlay.style.display='';if(this._iframe)this._iframe.style.display='';this._obj.style.display='';}else this._dirty();return this;},showLoading:function(){this._renderDialog($N('div',{className:'dialog_loading'},this._loading_text||_tx("Caricamento...")));return this;},hide:function(a){if(!this._showing)return this;this._showing=false;if(this._autohide_timeout){clearTimeout(this._autohide_timeout);this._autohide_timeout=null;}if(this._fade_enabled&&(!Dialog.dialogStack||Dialog.dialogStack.length<=1)){this._fadeOut(a);}else this._hide(a);return this;},fade_out:function(a){this.setAutohide(a);return this;},getRoot:function(){return this._obj;},getButtonElement:function(a){if(typeof a=='string')a=Dialog._findButton(this._buttons,a);if(!a||!a.name)return null;var b=DOM.scry(this._popup,'input');var c=function(d){return d.name==a.name;};return b.filter(c)[0]||null;},getContentNode:function(){var a=DOM.scry(this._content,'div.dialog_content');a.length!=1;return a[0];},getFormData:function(){return serialize_form(this.getContentNode());},setShowing:function(){this.show();return this;},setHiding:function(){this.hide();return this;},setTitle:Dialog._basicMutator('_title'),setBody:Dialog._basicMutator('_body'),setExtraData:Dialog._basicMutator('_extra_data'),setShowLoading:Dialog._basicMutator('_show_loading'),setLoadingText:Dialog._basicMutator('_loading_text'),setFullBleed:Dialog._basicMutator('_full_bleed'),setImmediateRendering:Dialog._basicMutator('_immediate_rendering'),setUserData:Dialog._basicMutator('_user_data'),getUserData:function(){return this._user_data;},setAutohide:function(a){if(a){if(this._showing){this._autohide_timeout=setTimeout(this.hide.shield(this),a);}else this._autohide=a;}else{this._autohide=null;if(this._autohide_timeout){clearTimeout(this._autohide_timeout);this._autohide_timeout=null;}}return this;},setSummary:Dialog._basicMutator('_summary'),setButtons:function(a){var c;if(!(a instanceof Array)){c=Array.from(arguments);}else c=a;for(var d=0;d<c.length;++d)if(typeof c[d]=='string'){var b=Dialog._findButton(Dialog._STANDARD_BUTTONS,c[d]);!b;c[d]=b;}this._buttons=c;this._dirtyButtons();return this;},setButtonsMessage:Dialog._basicMutator('_buttons_message'),setStackable:function(b,a){this._is_stackable=b;this._shown_while_stacked=b&&a;return this;},setHandler:function(a){this._handler=a;return this;},setCancelHandler:function(a){this._cancelHandler=a;return this;},setCloseHandler:function(a){this._close_handler=Dialog.call_or_eval.bind(null,this,a);return this;},clearHandler:function(){return this.setHandler(null);},setPostURI:function(b,a){if(a===undefined)a=true;if(a){this.setHandler(this._submitForm.bind(this,'POST',b));}else this.setHandler(function(){dynamic_post(b,this.getFormData());this.hide();}.bind(this));return this;},setGetURI:function(a){this.setHandler(this._submitForm.bind(this,'GET',a));return this;},setModal:function(a,b){if(a===undefined)a=true;this._showing&&this._modal&&!a;if(a&&b)switch(b){case Dialog.MODALITY.DARK:this._modal_class='dark_dialog_overlay';break;case Dialog.MODALITY.WHITE:this._modal_class='light_dialog_overlay';break;}this._modal=a;return this;},setSemiModal:function(a){if(a===undefined)a=true;if(a)this.setModal(true,Dialog.MODALITY.DARK);this._semi_modal=a;return this;},setContentWidth:Dialog._basicMutator('_content_width'),setTitleLoading:function(b){if(b===undefined)b=true;var a=DOM.find(this._popup,'h2.dialog_title');if(a)CSS.conditionClass(a,'loading',b);return this;},setClassName:Dialog._basicMutator('_class_name'),setFading:Dialog._basicMutator('_fade_enabled'),setFooter:Dialog._basicMutator('_footer'),setAutoFocus:Dialog._basicMutator('_auto_focus'),setTop:Dialog._basicMutator('_top'),onloadRegister:function(a){arrayize(a).forEach(function(b){if(typeof b=='string')b=new Function(b);this._onload_handlers.push(b.bind(this));}.bind(this));return this;},setAsyncURL:function(a){return this.setAsync(new AsyncRequest(a));},setAsync:function(a){var c=function(f){if(this._async_request!=a)return;this._async_request=null;var e=f.getPayload();if(typeof e=='string'){this.setBody(e);}else this._setFromModel(e);this._update(true);}.bind(this);var b=a.getData();b.__d=1;a.setData(b);var d=bind(this,'hide');a.setHandler(chain(a.getHandler(),c)).setErrorHandler(chain(d,a.getErrorHandler())).setTransportErrorHandler(chain(d,a.getTransportErrorHandler())).send();this._async_request=a;this._dirty();return this;},_dirty:function(){if(!this._is_dirty){this._is_dirty=true;if(this._immediate_rendering){this._update();}else bind(this,'_update').defer();}},_dirtyButtons:function(){if(this._immediate_rendering){this._updateButtons();}else bind(this,'_updateButtons').defer();},_format:function(a){if(typeof a=='string')return HTML(a).setDeferred(true);return a;},_update:function(c){if(!this._is_dirty&&c!==true)return;this._is_dirty=false;if(!this._showing)return;if(this._autohide&&!this._async_request&&!this._autohide_timeout)this._autohide_timeout=setTimeout(bind(this,'hide'),this._autohide);if(!this._async_request||!this._show_loading){var b=[];if(this._summary)b.push($N('div',{className:'dialog_summary'},this._format(this._summary)));b.push($N('div',{className:'dialog_body'},this._format(this._body)));var a=this._getButtonContent();if(a.length)b.push($N('div',{className:'dialog_buttons clearfix'},a));if(this._footer)b.push($N('div',{className:'dialog_footer'},this._format(this._footer)));b=$N('div',{className:'dialog_content'},b);if(this._title){var e=$N('h2',{className:'dialog_title'},$N('span',this._format(this._title)));b=[e,b];}else b=[b];this._renderDialog(b);for(var d=0;d<this._onload_handlers.length;++d)try{this._onload_handlers[d]();}catch(ex){}this._onload_handlers=[];}else this.showLoading();if(this._content_width)this._popup.style.width=(this._content_width+42)+'px';},_updateButtons:function(){if(!this._showing)return;var b=this._getButtonContent();var c=null;if(b.length)c=$N('div',{className:'dialog_buttons clearfix'},b);var d=DOM.scry(this._content,'div.dialog_buttons')[0]||null;if(!d){if(!c)return;var a=DOM.scry(this._content,'div.dialog_body')[0]||null;if(a)DOM.insertAfter(a,c);}else if(c){DOM.replace(d,c);}else DOM.remove(d);},_getButtonContent:function(){var e=[];if((this._buttons&&this._buttons.length>0)||this._buttons_message){var e=[];if(this._buttons_message)e.push($N('div',{className:'dialog_buttons_msg'},this._format(this._buttons_message)));if(this._buttons)for(var g=0;g<this._buttons.length;g++){var b=this._buttons[g];var d=UIActionButton.colorBlue;var c=(b.className||'').split(' ');var a=c.indexOf('inputaux');if(a>=0){d=UIActionButton.colorGray;c.splice(a,1);}var f=new UIFormButton(b.label).setName(b.name||'').setColor(d).setOnclick(this._handleButton.bind(this,b.name)).getNodes()[0];CSS.addClass(f,c.join(' '));e.push(f);}}return e;},_shouldUseIframe:function(){return Dialog.SHOULD_USE_IFRAME||(this._modal&&ua.ie()==7);},_renderDialog:function(a){if(Dialog.dialogStack===null)onunloadRegister(Dialog._hideAll,true);if(!this._obj)this._buildDialog();if(this._class_name)CSS.addClass(this._obj,this._class_name);CSS.conditionClass(this._obj,'full_bleed',this._full_bleed);if(typeof a=='string')a=HTML(a).setDeferred(this._immediate_rendering!==true);DOM.setContent(this._content,a);this._showDialog();if(this._auto_focus)this._focusFirstTextboxOrButton.bind(this).defer();return this;},_buildDialog:function(){this._obj=$N('div',{className:'generic_dialog'});this._obj.style.display='none';DOM.getRootElement().appendChild(this._obj);if(this._shouldUseIframe())this._buildIframe();if(!this._popup)this._popup=$N('div',{className:'generic_dialog_popup'});this._popup.style.left=this._popup.style.top='';this._obj.appendChild(this._popup);this._buildDialogContent();},_showDialog:function(){if(this._modal)if(this._overlay){this._overlay.style.display='';}else this._buildOverlay();if(this._obj&&this._obj.style.display){this._obj.style.visibility='hidden';this._obj.style.display='';this._resetDialog();this._obj.style.visibility='';this._obj.dialog=this;}else this._resetDialog();clearInterval(this.active_hiding);this.active_hiding=setInterval(this._activeResize.bind(this),500);if(!Dialog.dialogStack)Dialog.dialogStack=[];var c=Dialog.dialogStack;if(c.length){var a=c[c.length-1];if(a!=this&&!a._is_stackable)a._hide();for(var b=c.length-1;b>=0;b--)if(c[b]==this){c.splice(b,1);}else if(!c[b]._shown_while_stacked)c[b]._hide(true);}c.push(this);return this;},_activeResize:function(){if(this.last_offset_height!=this._content.offsetHeight)this.last_offset_height=this._content.offsetHeight;},_buildDialogContent:function(){CSS.addClass(this._obj,'pop_dialog');if(intl_locale_is_rtl())CSS.addClass(this._obj,'pop_dialog_rtl');var a;if(ua.ie()<=6){a='<div class="pop_squarecontainer">'+'<div class="pop_squareborder pop_borderopacity"></div>'+'<div class="pop_content pop_content_old" id="pop_content"></div>'+'</div>';}else if(ua.firefox()>=3||ua.safari()>=3){a='<div class="pop_container_advanced">'+'<div class="pop_content" id="pop_content"></div>'+'</div>';}else a='<div class="pop_container">'+'<div class="pop_verticalslab"></div>'+'<div class="pop_horizontalslab"></div>'+'<div class="pop_topleft"></div>'+'<div class="pop_topright"></div>'+'<div class="pop_bottomright"></div>'+'<div class="pop_bottomleft"></div>'+'<div class="pop_content pop_content_old" id="pop_content"></div>'+'</div>';set_inner_html(this._popup,a);this._frame=DOM.find(this._popup,'div.pop_content');this._content=this._frame;},_buildIframe:function(){if(!this._iframe&&!(this._iframe=ge('generic_dialog_iframe')))this._iframe=$N('iframe',{id:'generic_dialog_iframe',src:'//www.facebook.com/common/blank.html',style:{display:'none'}});this._iframe.frameBorder='0';onloadRegister(function(){DOM.getRootElement().appendChild(this._iframe);}.bind(this));},_buildOverlay:function(){this._overlay=$N('div',{id:'generic_dialog_overlay'});if(this._modal_class)CSS.addClass(this._overlay,this._modal_class);if(this._semi_modal)Event.listen(this._overlay,'click',this.hide.bind(this));if(ua.ie()<7)this._overlay.style.height=Vector2.getDocumentDimensions().y+'px';onloadRegister(function(){DOMScroll.getScrollRoot().appendChild(this._overlay);}.bind(this));},_focusFirstTextboxOrButton:function(){var d=['input[type="text"]','textarea','input[type="password"]','input[type="button"]','input[type="submit"]'];var c=[];for(var a=0;a<d.length&&c.length==0;a++)c=DOM.scry(this._content,d[a]);if(c.length>0){var b=c[0];try{if(elementY(b)>0&&elementX(b)>0)b.focus();}catch(e){}}return true;},_resetDialog:function(){if(!this._popup)return;this._resetDialogObj();this._buildIframe();this._resetIframe();},_resetIframe:function(){if(!this._shouldUseIframe())return;if(this._modal){this._iframe.style.left='0px';this._iframe.style.top='0px';this._iframe.style.width='100%';var a=Math.max(10000,Vector2.getDocumentDimensions().y);this._iframe.style.height=a+'px';}else{Vector2.getElementDimensions(this._frame).setElementDimensions(this._iframe);Vector2.getElementPosition(this._frame).setElementPosition(this._iframe);}this._iframe.style.display='';},_resetDialogObj:function(){var c=this._popup.find('div.pop_content');var b=Vector2.getScrollPosition().y;var e=Vector2.getViewportDimensions().y;var d=b+this._top+'px';if(e<=400){this._popup.style.top='20px';return;}if(this._top+c.clientHeight>e){var a=Math.max(e-c.clientHeight,0);d=((a/2)+b)+'px';}this._popup.style.top=d;},_fadeOut:function(a){if(!this._popup)return;try{animation(this._obj).duration(0).checkpoint().to('opacity',0).hide().duration(250).ondone(this._hide.bind(this,a)).go();}catch(e){this._hide(a);}},_hide:function(c){if(this._obj)this._obj.style.display='none';if(this._overlay)if(c){this._overlay.style.display='none';}else{DOM.remove(this._overlay);this._overlay=null;}if(this._iframe)this._iframe.style.display='none';if(this.timeout){clearTimeout(this.timeout);this.timeout=null;}if(this._hidden_objects.length){for(var a=0,b=this._hidden_objects.length;a<b;a++)this._hidden_objects[a].style.visibility='';this._hidden_objects=[];}clearInterval(this.active_hiding);if(c)return;this.destroy();},destroy:function(){if(Dialog.dialogStack&&Dialog.dialogStack.length){var b=Dialog.dialogStack;for(var a=b.length-1;a>=0;a--)if(b[a]==this)b.splice(a,1);if(b.length)b[b.length-1]._showDialog();}if(this._obj){DOM.remove(this._obj);this._obj=null;}if(this._close_handler)this._close_handler();},_handleButton:function(a){if(typeof a=='string')a=Dialog._findButton(this._buttons,a);if(!a)return;var b=Dialog.call_or_eval(a,a.handler);if(b===false)return;if(a==Dialog.CANCEL){Dialog.call_or_eval(this,this._cancelHandler);}else if(Dialog.call_or_eval(this,this._handler,{button:a})===false)return;this.hide();},_submitForm:function(d,e,b){var c=this.getFormData();c[b.name]=b.label;if(this._extra_data)copy_properties(c,this._extra_data);var a=new AsyncRequest().setURI(e).setData(c).setMethod(d).setReadOnly(d=='GET');this.setAsync(a);return false;},_setFromModel:function(a){for(var c in a){if(c=='onloadRegister'){this.onloadRegister(a[c]);continue;}var b=this['set'+c.substr(0,1).toUpperCase()+c.substr(1)];if(!(!b))b.apply(this,arrayize(a[c]));}}});function ContextualDialog(a){this.parent.construct(this);}ContextualDialog.extend('Dialog');copy_properties(ContextualDialog,{ARROW_PADDING_X:5,ARROW_PADDING_Y:10,ARROW_WIDTH:13,_bottoms:[0],max_bottom:0,_updateMaxBottom:function(){ContextualDialog.max_bottom=Math.max.apply(Math,ContextualDialog._bottoms);}});ContextualDialog.prototype={setContext:Dialog._basicMutator('_context'),_buildDialogContent:function(){CSS.addClass(this._obj,'contextual_dialog');set_inner_html(this._popup,'<div class="contextual_arrow"><span>^_^keke1</span></div><div class="contextual_dialog_content"></div>');this._arrow=DOM.find(this._popup,'div.contextual_arrow');this._content=this._frame=DOM.find(this._popup,'div.contextual_dialog_content');},_resetDialogObj:function(){if(!this._context)return;var d=Vector2.getElementPosition(this._context);var c=DOMScroll.getScrollRoot().offsetWidth;var b=(c-this._popup.offsetWidth)/2;var e,a;if(d.x<c/2){this._arrow.className='contextual_arrow_rev';e=Math.min(b,d.x+this._context.offsetWidth-ContextualDialog.ARROW_PADDING_X);a=d.x-e+this._context.offsetWidth+ContextualDialog.ARROW_PADDING_X;}else{this._arrow.className='contextual_arrow';e=Math.max(b,d.x-this._popup.offsetWidth+ContextualDialog.ARROW_PADDING_X);a=d.x-e-ContextualDialog.ARROW_PADDING_X-ContextualDialog.ARROW_WIDTH;}e=e||0;a=a||0;new Vector2(e,d.y+this._context.offsetHeight-this._arrow.offsetHeight+ContextualDialog.ARROW_PADDING_Y,'document').setElementPosition(this._popup);this._arrow.style.backgroundPosition=a+'px';},_renderDialog:function(b){if(window!=top)this._auto_focus=false;this.parent._renderDialog(b);var a=Vector2.getElementDimensions(this._content).y+Vector2.getElementPosition(this._content).y;ContextualDialog._bottoms.push(a);this._bottom=a;ContextualDialog._updateMaxBottom();},_hide:function(){this.parent._hide();if(this._bottom){var a=ContextualDialog._bottoms;a.splice(a.indexOf(this._bottom),1);ContextualDialog._updateMaxBottom();}}};function ErrorDialog(){this.parent.construct(this);this.setClassName('errorDialog').setModal(true);this.setStackable(true);return this;}ErrorDialog.extend('Dialog');copy_properties(ErrorDialog,{showAsyncError:function(a){if(window.send_error_signal){var b=env_get('vip');if(b===undefined)b='-';send_error_signal('async_error',a.getError()+":"+b);}try{return (new ErrorDialog()).showError(a.getErrorSummary(),a.getErrorDescription());}catch(ex){aiert(a);}}});copy_properties(ErrorDialog.prototype,{showError:function(b,a){return this.setTitle(b).setBody(a).setButtons([Dialog.OK]).show();}});var DialogBootstrapEndpoints={LIST_EDITOR:'/friends/ajax/edit_list.php',EDIT_APPS_DIALOG:'/ajax/editapp_dialog.php'};function BorderlessDialog(a){this.parent.construct(this);this._auto_focus=false;}BorderlessDialog.extend('Dialog');BorderlessDialog.prototype={setContext:Dialog._basicMutator('_context'),_buildDialogContent:function(){CSS.addClass(this._obj,'borderless_dialog');set_inner_html(this._popup,'<div class="borderless_dialog_content"></div>');this._content=this._frame=DOM.find(this._popup,'div.borderless_dialog_content');},_resetDialogObj:function(){if(!this._context)return;var c=Vector2.getElementPosition(this._context);var b=DOMScroll.getScrollRoot().offsetWidth;var a=(b-this._popup.offsetWidth)/2;var d;if(c.x<b/2){d=Math.min(a,c.x+this._context.offsetWidth);}else d=Math.max(a,c.x-this._popup.offsetWidth);d=d||0;new Vector2(d,c.y+this._context.offsetHeight,'document').setElementPosition(this._popup);}};
function sprintf(){if(arguments.length==0)return '';var a=['This is an argument vector.'];for(var b=arguments.length-1;b>0;b--)if(typeof(arguments[b])=="undefined"){a.push('');}else if(arguments[b]===null){a.push('');}else if(arguments[b]===true){a.push('true');}else if(arguments[b]===false){a.push('false');}else{if(!arguments[b].toString)return '';a.push(arguments[b]);}var n=arguments[0];n=n.toString().split('%');var m=n.length;var r=n[0];for(var b=1;b<m;b++){if(a.length==0)return '';if(!n[b].length){r+="%";continue;}var h=0;var f=0;var p='';var i=' ';var j=null;var g=null;var q='';var o=0;if(f=n[b].match(/^('.)?(?:(-?\d+\.)?(-?\d+)?)/)){if(f[2]!==undefined&&f[2].length)j=parseInt(q=f[2]);if(f[3]!==undefined&&f[3].length)if(j!==null){g=parseInt(f[3]);}else j=parseInt(q=f[3]);o=f[0].length;if(f[1]!==undefined&&f[1].length){i=f[1].charAt(1);}else if(q.charAt(0)==0)i='0';}switch(n[b].charAt(o)){case 's':case '#':raw=htmlspecialchars(a.pop().toString());break;case 'h':raw=a.pop().toString();break;case 'd':raw=parseInt(a.pop()).toString();break;case 'f':raw=parseFloat(a.pop()).toString();break;case 'q':raw="`"+htmlspecialchars(a.pop().toString())+"'";break;case 'e':raw="'"+escape_js_quotes(a.pop().toString())+"'";break;case 'L':var d=a.pop();for(var b=0;b<d.length;b++)d[b]="`"+htmlspecialchars(a.pop().toString())+"'";if(d.length>1)d[d.length-1]='and '+d[d.length-1];raw=d.join(', ');break;case 'x':var u=a.pop();var c=null;var t=null;try{if(typeof(u['line'])!='undefined'){c=u.line;}else if(typeof(u['lineNumber'])!='undefined')c=u.lineNumber;if(typeof(u['sourceURL'])!='undefined'){t=u.sourceURL;}else if(typeof(u['fileName'])!='undefined')t=u.fileName;}catch(exception){}var s='[An Exception]';try{s=u.message||u.toString();}catch(exception){}raw=s+' [at '+Stack.frameSrcToString(t,c)+']';break;default:raw="%"+n[b].charAt(o+1);break;}if(j!==null)if(raw.length<Math.abs(j)){var k='';var l=(Math.abs(j)-raw.length);for(var e=0;e<l;e++)k+=i;if(j<0){raw+=k;}else raw=k+raw;}if(g!==null)if(raw.length>g)raw=raw.substr(0,g);r+=raw+n[b].substring(o+1);}a.length>1;return r;}
function AsyncRequest(uri){var dispatchResponse=bind(this,function(a){if(!this._asyncResponse)this._asyncResponse=a;try{this.clearStatusIndicator();if(this.initialHandler(a)!==false){clearTimeout(this.timer);if(this.handler)try{var f=this.handler(a);}catch(exception){this.finallyHandler(a);throw exception;}this.finallyHandler(a);if(f!==AsyncRequest.suppressOnloadToken){var e=a.onload;if(e)for(var b=0;b<e.length;b++)try{(new Function(e[b]))();}catch(exception){}var d=a.onafterload;if(d)for(var b=0;b<d.length;b++)try{(new Function(d[b]))();}catch(exception){}}var c=a.invalidate_cache;if(c&&c.length)Arbiter.inform(Arbiter.PAGECACHE_INVALIDATE,c);}if(a.cacheObservation&&typeof(TabConsoleCacheobserver)!='undefined'&&TabConsoleCacheobserver.instance)TabConsoleCacheobserver.getInstance().addAsyncObservation(a.cacheObservation);}catch(exception){}});var replayResponse=bind(this,function(){if(!this._asyncResponse){return;}else if(this._asyncResponse.dontReplay)return;this._asyncResponse.setReplay(true);dispatchResponse(this._asyncResponse);});var dispatchErrorResponse=bind(this,function(a,c){try{this.clearStatusIndicator();var b=a.getError();if(b==kError_Async_ConfirmationRequired||b==kError_Async_InternalCaptchaRequired||b==kError_Verification_ConfirmEmail){var d=false;if(b==kError_Async_ConfirmationRequired||b==kError_Async_InternalCaptchaRequired)d=true;var e=a.getPayload();this._displayServerDialog(e.__dialog,d);}else if(this.initialHandler(a)!==false){clearTimeout(this.timer);try{if(c){this.transportErrorHandler(a);}else this.errorHandler(a);}catch(exception){this.finallyHandler(a);throw exception;}this.finallyHandler(a);}}catch(exception){}});var _interpretTransportResponse=bind(this,function(){if(this.getOption('suppressEvaluation')){var r=new AsyncResponse(this,this.transport);return {asyncResponse:r};}var shield="for (;;);";var shieldlen=shield.length;if(this.transport.responseText.length<=shieldlen){var kind=this.transport.responseText.length?('a '+this.transport.responseText.length+' byte'):'an empty';return {transportError:sprintf('An error occurred when making an AsyncRequest to %q. '+'The server returned '+kind+' response.',this.getURI())};}var text=this.transport.responseText;var offset=0;while(text.charAt(offset)==" "||text.charAt(offset)=="\n")offset++;offset&&text.substring(offset,offset+shieldlen)==shield;var safeResponse=text.substring(offset+shieldlen);try{var response=eval('('+safeResponse+')');}catch(exception){return {transportError:sprintf('Evaluation failed for <a href="javascript:aiert(%e);">'+'response from %q</a>: %x.',this.transport.responseText,this.getURI(),exception)};}return interpretResponse(response);});var interpretResponse=bind(this,function(b){if(b.redirect)return {redirect:b.redirect};var a=new AsyncResponse(this);if(typeof(b.payload)=='undefined'||typeof(b.error)=='undefined'||typeof(b.errorDescription)=='undefined'||typeof(b.errorSummary)=='undefined'||typeof(b.errorIsWarning)=='undefined'){a.payload=b;}else copy_properties(a,b);return {asyncResponse:a};});var invokeResponseHandler=bind(this,function(b){if(typeof(b.redirect)!='undefined'){(function(){this.setURI(b.redirect).send();}).bind(this).defer();return;}if(this.handler||this.errorHandler||this.transportErrorHandler)if(typeof(b.asyncResponse)!='undefined'){var d=b.asyncResponse;if(d.inlinejs)eval_global(d.inlinejs);if(d.instrument)this.cavalry=CavalryLogger.getInstance(d.instrument);if(d.getError()&&!d.getErrorIsWarning()){var a=dispatchErrorResponse;}else var a=dispatchResponse;Bootloader.setResourceMap(d.resource_map);if(d.bootloadable)Bootloader.enableBootload(d.bootloadable);a=a.shield(null,d);a=a.defer.bind(a);var c=false;if(this.preBootloadHandler)c=this.preBootloadHandler(d);if(d.css||d.js){d.css=d.css||[];d.js=d.js||[];Bootloader.loadResources(d.css.concat(d.js),a,c,this.getURI());}else a();}else if(typeof(b.transportError)!='undefined')invokeErrorHandler(1008);});var invokeErrorHandler=bind(this,function(c){try{if(!window.loaded)return;}catch(ex){return;}var d=new AsyncResponse(this);var b;try{b=c||this.transport.status||1004;}catch(ex){b=1005;}try{if(this.responseText=='')b=1002;}catch(ignore){}if(this.transportErrorHandler){var a,e;if(false===navigator.onLine){e=_tx("No Network Connection");a=_tx("Il tuo browser sembra sia impostato offline. Controlla la tua connessione Internet e riprova.");b=1006;}else{e=_tx("Ops!");a=_tx("Si \u00e8 verificato un problema. Stiamo cercando di risolverlo il prima possibile. Prova pi\u00f9 tardi.");}!this.getOption('suppressErrorAlerts');copy_properties(d,{error:b,errorSummary:e,errorDescription:a});dispatchErrorResponse(d,true);}});var handleResponse=function(b){var a=this.interpretResponse(b);this.invokeResponseHandler(a);};var onStateChange=function(){try{if(this.transport.readyState==4){if(this.transport.status>=200&&this.transport.status<300){invokeResponseHandler(_interpretTransportResponse());}else if(ua.safari()&&(typeof(this.transport.status)=='undefined')){invokeErrorHandler(1002);}else invokeErrorHandler();if(this.getOption('asynchronous')!==false)delete this.transport;}}catch(exception){try{if(!window.loaded)return;}catch(ex){return;}delete this.transport;if(this.remainingRetries){--this.remainingRetries;this.send(true);}else{!this.getOption('suppressErrorAlerts');invokeErrorHandler(1007);}}};copy_properties(this,{onstatechange:onStateChange,replayResponse:replayResponse,invokeResponseHandler:invokeResponseHandler,interpretResponse:interpretResponse,handleResponse:handleResponse,transport:null,method:'POST',uri:'',timeout:null,timer:null,initialHandler:bagofholding,handler:null,errorHandler:null,transportErrorHandler:null,timeoutHandler:null,finallyHandler:bagofholding,statusElement:null,data:{},context:{},readOnly:false,writeRequiredParams:['post_form_id'],remainingRetries:0,option:{asynchronous:true,suppressErrorHandlerWarning:false,suppressEvaluation:false,suppressErrorAlerts:false,retries:1,jsonp:false,bundle:false,useIframeTransport:false,tfbEndpoint:true},_replayable:undefined,_replayKey:''});if(typeof ErrorDialog!="undefined"){this.errorHandler=ErrorDialog.showAsyncError;this.transportErrorHandler=ErrorDialog.showAsyncError;}if(uri!=undefined)this.setURI(uri);return this;}copy_properties(AsyncRequest,{getHTTPErrorSummary:function(a){return AsyncRequest._getHTTPError(a).summary;},getHTTPErrorDescription:function(a){return AsyncRequest._getHTTPError(a).description;},pingURI:function(c,a,b){a=a||{};return new AsyncRequest().setURI(c).setData(a).setOption('asynchronous',!b).setOption('suppressErrorHandlerWarning',true).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).send();},receiveJSONPResponse:function(e,a,d){if(this._JSONPReceivers[e]){var c=(this._JSONPReceivers[e].is_first===undefined);this._JSONPReceivers[e].is_first=c;for(var b=0;b<this._JSONPReceivers[e].length;b++){var g=this._JSONPReceivers[e][b];if(g.transportIframe&&!d)(function(h){DOMScroll.getScrollRoot().removeChild(h);}).bind(null,g.transportIframe).defer();var f=g.interpretResponse(a);f.asyncResponse.is_first=c;f.asyncResponse.is_last=!d;g.invokeResponseHandler(f);}if(!d)delete this._JSONPReceivers[e];}},_hasBundledRequest:function(){return !is_empty(AsyncRequest._allBundledRequests);},stashBundledRequest:function(){var a=AsyncRequest._allBundledRequests;AsyncRequest._allBundledRequests={};return a;},setBundledRequestProperties:function(b){var c=null;if(b.stashedRequests)copy_properties(AsyncRequest._allBundledRequests,b.stashedRequests);if(!AsyncRequest._hasBundledRequest()){var a=b.callback;a&&a();}else{copy_properties(AsyncRequest._bundledRequestProperties,b);if(b.start_immediately)c=AsyncRequest._sendBundledRequests();}return c;},_bundleRequest:function(c){if(c.getOption('jsonp')||c.getOption('useIframeTransport')){c.setOption('bundle',false);return false;}else if(!c.uri.isFacebookURI()){c.setOption('bundle',false);return false;}else if(!c.getOption('asynchronous')){c.setOption('bundle',false);return false;}var b=c.uri.getPath();if(b in AsyncRequest._allBundledRequests){var a=AsyncRequest._allBundledRequests[b];a.setOption('bundle',false).send();}if(is_empty(AsyncRequest._allBundledRequests))AsyncRequest._bundleTimer=setTimeout(function(){AsyncRequest._sendBundledRequests();},0);AsyncRequest._allBundledRequests[b]=c;return true;},_sendBundledRequests:function(){clearTimeout(AsyncRequest._bundleTimer);AsyncRequest._bundleTimer=null;var a=AsyncRequest._allBundledRequests;AsyncRequest._allBundledRequests={};var e={};copy_properties(e,AsyncRequest._bundledRequestProperties);AsyncRequest._bundledRequestProperties={};if(is_empty(e)&&count(a)==1)for(var d in a){a[d].setOption('bundle',false).send();return a[d];}var c=function(){e.callback&&e.callback();};if(is_empty(a)){c();return null;}var b={};for(var d in a){var g=a[d];b[d]=URI.implodeQuery(g.data);}var f={data:b};if(e.extra_data)copy_properties(f,e.extra_data);var g=new AsyncRequest();g.setURI('/ajax/proxy.php').setData(f).setMethod('POST').setInitialHandler(e.onInitialResponse||bagof(true)).setHandler(function(k){var j=k.getPayload();var n=j.responses;for(var i in a){var l=a[i];if(i in n){var h=l.interpretResponse(n[i]);l.invokeResponseHandler(h);}else{var m={transportError:sprintf('An error occurred when making an AsyncRequest to %q '+' in a bundled request.',i)};l.invokeResponseHandler(m);}}}).setTransportErrorHandler(function(l){var j=[];var h={transportError:l.errorDescription};for(var i in a){j.push(i);var k=a[i];k.invokeResponseHandler(h);}}).setFinallyHandler(function(h){c();}).send();return g;},responseOpsHandler:function(a,b){if(b.dom_ops)b.dom_ops.forEach(function(d){var c=a.find(d.where);if(c){var e=d.raw?d.what:HTML(d.what);DOM[d.how](c,e);}});invoke_callbacks(b.relative_ops,a);},bootstrap:function(c,b){var d='GET';var e=true;var a={};c=URI(c);if(b&&b.rel=='async-post'){d='POST';e=false;a=c.getQueryData();c.setQueryData({});}new AsyncRequest(c).setReadOnly(e).setMethod(d).setData(a).setStatusElement(b).setHandler(AsyncRequest.responseOpsHandler.bind(null,b)).send();return false;},post:function(b,a){new AsyncRequest(b).setReadOnly(false).setMethod('POST').setData(a).send();return false;},_getHTTPError:function(b){var a=AsyncRequest._HTTPErrors[b]||AsyncRequest._HTTPErrors[b-(b%100)]||{summary:'HTTP Error',description:'Unknown HTTP error #'+b};return a;},_HTTPErrors:{400:{summary:'Bad Request',description:'Bad HTTP request.'},401:{summary:'Unauthorized',description:'Not authorized.'},403:{summary:'Forbidden',description:'Access forbidden.'},404:{summary:'Not Found',description:'Web address does not exist.'},1000:{summary:'Bad Response',description:'Invalid response.'},1001:{summary:'No Network',description:'A network error occurred. Check that you are connected to the '+'internet.'},1002:{summary:'No Data',description:'The server did not return a response.'},1003:{summary:'Eval Error',description:'Exception thrown during JSON evaluation.'},1004:{summary:'Null status (transient network error)',description:'XMLHTTP response has status = null(0), likely you have a '+'unstable network connection (with transient errors)'},1005:{summary:'Response status reading error',description:'An exception was thrown when reading response.status'},1006:{summary:'No network (offline)',description:'Network connection has been lost. You are in offline mode'},1007:{summary:'Unknown exception',description:'An exception was thrown when handling XMLHTTP response or '+'status errors; the exception stays even after retries'},1008:{summary:'Empty or invalid response',description:'An empty or illegal XMLHTTP response was returned from the'+' server, likely the server is down ...'}},_JSONPReceivers:{},_allBundledRequests:{},_bundledRequestProperties:{},_bundleTimer:null,suppressOnloadToken:{},REPLAYABLE_AJAX:'ajax/replayable'});copy_properties(AsyncRequest.prototype,{setMethod:function(a){this.method=a.toString().toUpperCase();return this;},getMethod:function(){return this.method;},setData:function(a){this.data=a;return this;},getData:function(){return this.data;},setContextData:function(b,c,a){a=a===undefined?true:a;if(a)this.context['_log_'+b]=c;return this;},setURI:function(a){var b=URI(a);if(this.getOption('useIframeTransport')&&!b.isFacebookURI())return this;if(!this.getOption('jsonp')&&!this.getOption('useIframeTransport')&&!b.isSameOrigin())return this;this.uri=b;return this;},getURI:function(){return this.uri.toString();},setInitialHandler:function(a){this.initialHandler=a;return this;},setHandler:function(a){if(!(typeof(a)!='function'))this.handler=a;return this;},getHandler:function(){return this.handler;},setErrorHandler:function(a){if(!(typeof(a)!='function'))this.errorHandler=a;return this;},setTransportErrorHandler:function(a){this.transportErrorHandler=a;return this;},getErrorHandler:function(){return this.errorHandler;},getTransportErrorHandler:function(){return this.transportErrorHandler;},setTimeoutHandler:function(b,a){if(!(typeof(a)!='function')){this.timeout=b;this.timeoutHandler=a;}return this;},resetTimeout:function(a){if(!(this.timeoutHandler===null))if(a===null){this.timeout=null;clearTimeout(this.timer);this.timer=null;}else{this.timeout=a;clearTimeout(this.timer);this.timer=this._handleTimeout.bind(this).defer(this.timeout);}return this;},_handleTimeout:function(){this.abandon();this.timeoutHandler(this);},setFinallyHandler:function(a){this.finallyHandler=a;return this;},setPreBootloadHandler:function(a){this.preBootloadHandler=a;return this;},setReadOnly:function(a){if(!(typeof(a)!='boolean'))this.readOnly=a;return this;},setFBMLForm:function(){this.writeRequiredParams=["fb_sig"];return this;},getReadOnly:function(){return this.readOnly;},setStatusElement:function(a){this.statusElement=a;return this;},getStatusElement:function(){return this.statusElement;},clearStatusIndicator:function(){if(this.getStatusElement())CSS.removeClass($(this.getStatusElement()),'async_saving');},addStatusIndicator:function(){if(this.getStatusElement())CSS.addClass($(this.getStatusElement()),'async_saving');},specifiesWriteRequiredParams:function(){return this.writeRequiredParams.every(function(a){this.data[a]=this.data[a]||Env[a]||(ge(a)||{}).value;if(this.data[a]!==undefined)return true;return false;},this);},setReplayable:function(b,a){this._replayable=b;this._replayKey=a||'';return this;},setOption:function(a,b){if(typeof(this.option[a])!='undefined')this.option[a]=b;return this;},getOption:function(a){typeof(this.option[a])=='undefined';return this.option[a];},abort:function(){if(this.transport){var a=this.getTransportErrorHandler();this.setOption('suppressErrorAlerts',true);this.setTransportErrorHandler(bagofholding);this.transport.abort();this.setTransportErrorHandler(a);}},abandon:function(){clearTimeout(this.timer);this.setOption('suppressErrorAlerts',true).setHandler(bagofholding).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding);if(this.transport)this.transport.abort();},setNectarActionData:function(a){if(this.data.nctr===undefined)this.data.nctr={};this.data.nctr._ia=1;if(a){if(this.data.nctr._as===undefined)this.data.nctr._as={};copy_properties(this.data.nctr._as,a);}return this;},setNectarData:function(a){if(a){if(this.data.nctr===undefined)this.data.nctr={};copy_properties(this.data.nctr,a);}return this;},send:function(a){a=a||false;if(!this.uri)return false;!this.errorHandler&&!this.getOption('suppressErrorHandlerWarning');if(this.getOption('jsonp')&&this.method!='GET')this.setMethod('GET');if(this.getOption('useIframeTransport')&&this.method!='GET')this.setMethod('GET');this.timeoutHandler!==null&&(this.getOption('jsonp')||this.getOption('useIframeTransport'));if(!this.getReadOnly()){if(!this.specifiesWriteRequiredParams())return false;if(this.method!='POST')return false;}if(this.method=='POST'&&this.getOption('tfbEndpoint'))this.data.fb_dtsg=Env.fb_dtsg;if((!this.getReadOnly()&&this._replayable!==false)||this._replayable)Arbiter.inform(AsyncRequest.REPLAYABLE_AJAX,this);if(!is_empty(this.context)&&this.getOption('tfbEndpoint')){copy_properties(this.data,this.context);this.data.ajax_log=1;}if(!this.getReadOnly()&&this.getOption('tfbEndpoint')&&this.method=='POST'&&this.data.post_form_id_source===undefined)this.data.post_form_id_source='AsyncRequest';if(this.getOption('tfbEndpoint'))this.data.__a=1;if(this.getOption('bundle')&&AsyncRequest._bundleRequest(this))return true;var g,c;if(this.method=='GET'){g=this.uri.addQueryData(this.data).toString();c='';}else{g=this.uri.toString();c=URI.implodeQuery(this.data);}if(this.getOption('jsonp')||this.getOption('useIframeTransport')){var b=this.uri.getPath();if(!AsyncRequest._JSONPReceivers[b])AsyncRequest._JSONPReceivers[b]=[];AsyncRequest._JSONPReceivers[b].push(this);if(this.getOption('jsonp')){(function(){DOMScroll.getScrollRoot().appendChild($N('script',{src:g,type:"text/javascript"}));}).bind(this).defer();}else{var d={position:'absolute',top:'-1000px',left:'-1000px',width:'80px',height:'80px'};g=this.uri.addQueryData({_fb_iframe_path:b});this.transportIframe=$N('iframe',{src:g,style:d});DOMScroll.getScrollRoot().appendChild(this.transportIframe);}return true;}if(this.transport)return false;var f=null;try{f=new XMLHttpRequest();}catch(ignored){}if(!f)try{f=new ActiveXObject("Msxml2.XMLHTTP");}catch(ignored){}if(!f)try{f=new ActiveXObject("Microsoft.XMLHTTP");}catch(ignored){}if(!f)return false;f.onreadystatechange=bind(this,'onstatechange');if(!a){this.remainingRetries=0;if(this.getReadOnly())this.remainingRetries=this.getOption('retries');}this.transport=f;try{this.transport.open(this.method,g,this.getOption('asynchronous'));}catch(ex){return false;}var e=env_get('svn_rev');if(e)this.transport.setRequestHeader('X-SVN-Rev',String(e));if(this.method=='POST')this.transport.setRequestHeader('Content-Type','application/x-www-form-urlencoded');this.addStatusIndicator();this.transport.send(c);if(this.timeout!==null)this.resetTimeout(this.timeout);return true;},_displayServerDialog:function(c,b){var a=new Dialog(c);if(b)a.setHandler(this._displayConfirmationHandler.bind(this,a));a.setCloseHandler(this.finallyHandler.bind(this)).show();},_displayConfirmationHandler:function(a){this.data.confirmed=1;copy_properties(this.data,a.getFormData());this.send();}});function AsyncResponse(b,a){copy_properties(this,{error:0,errorSummary:null,errorDescription:null,onload:null,replay:false,relative_ops:[],payload:a||null,request:b||null});return this;}copy_properties(AsyncResponse.prototype,{getRequest:function(){return this.request;},getPayload:function(){return this.payload;},getError:function(){return this.error;},getErrorSummary:function(){return this.errorSummary;},getErrorDescription:function(){return this.errorDescription;},getErrorIsWarning:function(){return this.errorIsWarning;},setReplay:function(a){a=(a===undefined?true:a);this.replay=!!a;return this;},isReplay:function(){return this.replay;}});
function DOMControl(a){copy_properties(this,{root:a&&$(a),updating:false});if(a)a.getControl=identity.bind(null,this);}copy_properties(DOMControl.prototype,{getRoot:function(){return this.root;},beginUpdate:function(){if(this.updating)return false;this.updating=true;return true;},endUpdate:function(){this.updating=false;},update:function(a){if(!this.beginUpdate())return this;this.onupdate(a);this.endUpdate();}});
function TextInputControl(b){this.parent.construct(this,b);copy_properties(this,{placeholderText:null,maxLength:this.getRoot().maxLength||null,radio:null,focused:false,interval:null,nativePlaceholder:false});var a=this.getRoot();if((String(a.type).toLowerCase()=='search')&&ua.safari()){this.nativePlaceholder=true;this.setPlaceholderText(a.getAttribute('placeholder'));}addEventBase(a,'focus',this.onfocus.bind(this));addEventBase(a,'blur',this.onblur.bind(this));var c=this.update.bind(this);Event.listen(a,{keyup:c,keydown:c,keypress:c});this.setFocused(false);}TextInputControl.extend('DOMControl');copy_properties(TextInputControl.prototype,{associateWithRadioButton:function(a){this.radio=a&&$(a);return this;},setMaxLength:function(a){var b=this.getRoot();this.maxLength=a;if(a){b.maxLength=a;}else b.removeAttribute('maxlength');return this;},getValue:function(){if(!this.focused&&this.getRoot().value==this.placeholderText)return null;return this.getRoot().value;},isEmpty:function(){var a=this.getValue();return (a===null||a=='');},setValue:function(a){this.getRoot().value=a;this.update();return this;},clear:function(){return this.setValue('');},isFocused:function(){return this.focused;},setFocused:function(b){var a=this.isEmpty();this.focused=b;if(this.placeholderText&&!this.nativePlaceholder){var c=this.getRoot();var d=c.value;if(this.focused){CSS.removeClass(c,'DOMControl_placeholder');if(a)this.clear();}else if(a){CSS.addClass(c,'DOMControl_placeholder');this.setValue(this.placeholderText);}}this.update();return this;},setPlaceholderText:function(a){this.placeholderText=a;if(this.nativePlaceholder)this.getRoot().setAttribute('placeholder',a);return this.setFocused(this.isFocused());},getPlaceholderText:function(){return this.placeholderText;},onupdate:function(){if(this.radio)if(this.focused)this.radio.checked=true;var d=this.getRoot();if(this.maxLength>0)if(d.value.length>this.maxLength){var e=d.value;var c=e.length-this.maxLength;var a=DOM.getCaretPosition(d);var b=a.end||e.length;d.value=e.substring(0,b-c)+e.substring(b);if(typeof a.start!='undefined')DOM.setCaretPosition(d,a.start-c,Math.max(a.start,a.end)-c);}this.setFocused(this.focused);},onfocus:function(){this.setFocused(true);if(this.interval)clearInterval(this.interval);this.interval=setInterval(this.update.bind(this),150);return this;},onblur:function(){this.setFocused(false);if(this.interval)this.interval=clearInterval(this.interval);return this;}});function placeholderSetup(a){if(!ge(a))return;if(!$(a).getAttribute('placeholder'))return;return new TextInputControl($(a)).setPlaceholderText($(a).getAttribute('placeholder'));}
function TextAreaControl(a){copy_properties(this,{autogrow:false,clearHeightOnBlur:false,shadow:null,originalHeight:null,metricsValue:null});this.parent.construct(this,a);}TextAreaControl.extend('TextInputControl');copy_properties(TextAreaControl.prototype,{setAutogrow:function(a,b){this.autogrow=a;this.clearHeightOnBlur=b;this.refreshShadow();CSS.addClass(this.getRoot(),'DOMControl_autogrow');return this;},setFocused:function(a){if(this.autogrow&&!a&&this.isEmpty()&&this.clearHeightOnBlur)this.getRoot().style.height='';return this.parent.setFocused(a);},setOriginalHeight:function(a){this.originalHeight=a;return this;},onupdate:function(){this.parent.onupdate();var a=this.getRoot();if(this.autogrow&&a.value!=this.metricsValue){this.metricsValue=a.value;if(CSS.getStyle(a,'fontSize')=="")return false;copy_properties(this.shadow.style,{fontSize:parseInt(CSS.getStyle(a,'fontSize'),10)+'px',fontFamily:CSS.getStyle(a,'fontFamily'),width:Math.max(Vector2.getElementDimensions(a).x-8,0)+'px'});DOM.setContent(this.shadow,HTML(htmlize(a.value)));if(this.isEmpty()){a.style.height='';}else a.style.height=Math.max(this.originalHeight,Vector2.getElementDimensions(this.shadow).y+15)+'px';}},refreshShadow:function(){if(this.autogrow){this.shadow=$N('div',{className:'DOMControl_shadow'});DOM.getRootElement().appendChild(this.shadow);var a=this.getRoot();if(!this.originalHeight)this.originalHeight=parseInt(CSS.getStyle(a,'height'),10)||Vector2.getElementDimensions(this.getRoot()).y;}else{if(this.shadow)DOM.remove(this.shadow);this.shadow=null;}}});function autogrow_textarea(a){a=$(a);if(!a._hascontrol){a._hascontrol=true;new TextAreaControl(a).setAutogrow(true);}}
!function(){var a={isEmpty:function(b){return (b.value||'').match(/^\s*$/)||CSS.hasClass(b,'DOMControl_placeholder');},getValue:function(b){return a.isEmpty(b)?'':b.value;}};NodeAugment.add(a,'INPUT');NodeAugment.add(a,'TEXTAREA');}();
function ElementController(){this.handlers=[[],[]];}copy_properties(ElementController,{ALL:1,TARGETS:2,MODIFIERS:4,BUTTONS:8});ElementController.prototype={initialize:function(){this.initialize=bagofholding;onloadRegister(this.register.bind(this));},handle:function(e,event,a){a=a||bagof(true);var b=this.handlers[0].concat(this.handlers[1]);for(var c=0,d=b.length;c<d;c++)if(a(b[c].filters,e,event)&&b[c].callback(e,event)===false)return event.kill();},_registerHandler:function(b,a,c,d){this.initialize();b[d?'unshift':'push']({callback:a,filters:c||0});},registerHandler:function(a,b,c){this._registerHandler(this.handlers[0],a,b,c);},registerFallbackHandler:function(a,b,c){this._registerHandler(this.handlers[1],a,b,c);}};var LinkController=new ElementController();copy_properties(LinkController,{key:'LinkControllerHandler',register:function(){Event.listen(document.documentElement,'mousedown',this.handler.bind(this));Event.listen(document.documentElement,'keydown',this.handler.bind(this));},handler:function(event){var b=DOM.getNearest(event.getTarget(),'a');var a=b&&b.getAttribute('href',2);if(!a||b.rel||!this.usesWebProtocol(a)||DataStore.get(b,this.key))return;DataStore.set(b,this.key,Event.listen(b,'click',function(event){if(a.charAt(a.length-1)=='#'){event.prevent();return;}this.handle(b,event,this.filter);}.bind(this)));},filter:function(a,b,event){if(a&ElementController.ALL)return true;if((!(a&ElementController.TARGETS)&&b.target)||(!(a&ElementController.MODIFIERS)&&event.getModifiers().any)||(!(a&ElementController.BUTTONS)&&ua.safari()>=525&&event.which!=1))return false;return true;},usesWebProtocol:function(a){var b=a.match(/^(\w+):/);return !b||b[1].match(/^http/i);}});var FormController=new ElementController();copy_properties(FormController,{register:function(){Event.listen(document.documentElement,'submit',this.handler.bind(this));},handler:function(event){return this.handle(event.getTarget(),event);}});
function AsyncSignal(b,a){this.data=a||{};this.uri=b;this.handler=null;}AsyncSignal.prototype.setHandler=function(a){this.handler=a;return this;};AsyncSignal.prototype.send=function(){var c=this.handler,b=this.data,g=this.uri,f=[],d=new Image(),a=document.getElementById('post_form_id');b.asyncSignal=Math.floor(Math.random()*10000)+1;if(a)b.post_form_id=a.value;for(var e in b)f.push(encodeURIComponent(e)+'='+encodeURIComponent(b[e]));if(g.indexOf('?')==-1)g+='?';g+=f.join('&');if(c)d.onload=d.onerror=(function(i,h){return function(){h((i.height==1));};})(d,c);d.src=g;return this;};
function setCookie(a,b,g,h){if(g){var j=new Date();var d=new Date();d.setTime(j.getTime()+g);}document.cookie=a+"="+encodeURIComponent(b)+"; "+(g?"expires="+d.toGMTString()+"; ":"")+"path="+(h||'/')+"; domain=."+window.location.hostname.replace(/^.*(facebook\..*)$/i,'$1');if(Math.floor(Math.random()*10000)==0){var f='';for(var e=0;e<arguments.length;e++)f+=arguments[e]+'|';var c={c:'set_cookie_js',m:f};var i=new URI('/common/scribe_endpoint.php').getQualifiedURI().toString();new AsyncSignal(i,c).send();}}function clearCookie(a){document.cookie=a+"=; expires=Sat, 01 Jan 2000 00:00:00 GMT; "+"path=/; domain=."+window.location.hostname.replace(/^.*(facebook\..*)$/i,'$1');}function getCookie(d){var e=d+"=";var b=document.cookie.split(';');for(var c=0;c<b.length;c++){var a=b[c];while(a.charAt(0)==' ')a=a.substring(1,a.length);if(a.indexOf(e)==0)return decodeURIComponent(a.substring(e.length,a.length));}return null;}function transferCookieToComTld(a,e){e=e||bagofholding;var b;if(a instanceof Array){b=a;}else b=[a];var c={};for(var f=0;f<b.length;f++){var h=getCookie(b[f]);if(h)c[b[f]]=h;}var d=window.location.hostname.replace(/facebook.*/,'facebook.com');var g='http://'+d+'/common/cookie_transfer.php';new AsyncSignal(g,c).setHandler(e).send();}
window.__UIControllerRegistry=window.__UIControllerRegistry||{};
function UIPagelet(c,d,a,b){this._id=c||null;this._element=ge(c||$N('div'));this._src=d||null;this._context_data=a||{};this._data=b||{};this._handler=bagofholding;this._request=null;return this;}copy_properties(UIPagelet.prototype,{getElement:function(a){a=a||false;if(a)this._element=ge(this._id);return this._element;},setHandler:function(a){this._handler=a;return this;},go:function(b,a){if(arguments.length>=2||typeof b=='string'){this._src=b;this._data=a||{};}else if(arguments.length==1)this._data=b;this.refresh();return this;},refresh:function(b){var a=function(c){this._request=null;if(b&&this._id)this._element=ge(this._id);this._element.setContent(HTML(c.getPayload()));this._handler();}.bind(this);this._request=new AsyncRequest().setURI(this._src).setMethod('GET').setData({data:JSON.encode(merge(this._context_data,this._data))}).setReadOnly(true).setHandler(a).setOption('bundle',true);this._request.send();return this;},cancel:function(){if(this._request)this._request.abort();}});
function UISelectList(){this._callback=bagofholding;this.container=$N('div',{className:'UISelectList clearfix'});this._mode=UISelectList.MULTI_SELECT_MODE;this._inputName='UISelectList_name_'+(+new Date());this._items={};}copy_properties(UISelectList,{MULTI_SELECT_MODE:1,SINGLE_SELECT_MODE:2,MULTI_SELECT_MODE_CHECKED_CLASS_NAME:'UISelectList_check_Checked',SINGLE_SELECT_MODE_CHECKED_CLASS_NAME:'UISelectList_radio_Checked'});UISelectList.prototype={setMode:function(a){if(a!=UISelectList.MULTI_SELECT_MODE&&a!=UISelectList.SINGLE_SELECT_MODE)return this;if(!is_empty(this._items))return this;this._mode=a;return this;},setCallback:function(a){this._callback=a;return this;},addItem:function(d,a,c){var b={label:d,checked:a,key:c};this._renderItem(b);return this;},addItems:function(b){for(var a=0;a<b.length;a++)this.addItem(b[a].label,b[a].checked,b[a].key);return this;},clearItems:function(){this._items={};DOM.empty(this.container);return this;},setSelected:function(b,c){if(this._items[b]){var a=this._items[b].input;a.checked=!c;a.click();}return this;},getElement:function(){return this.container;},reset:function(){for(var b in this._items){var a=this._items[b].input;var c=this._items[b].label;a.checked=a.defaultChecked;CSS.conditionClass(c,this._getCheckedClass(),a.checked);}},_renderItem:function(b){var a=$N('input',{type:this._getInputType(),name:this._inputName});a.checked=b.checked;a.defaultChecked=b.checked;var c=$N('a',{className:'UISelectList_Label',href:'#'},b.label);if(b.checked)c.addClass(this._getCheckedClass());c.listen('click',this._linkClicked.bind(this,a));a.listen('click',this._clicked.bind(this,a,c,b.key));this.container.appendContent($N('div',{className:'UISelectList_Item'},[a,c]));b.input=a;b.label=c;this._items[b.key]=b;},_getInputType:function(){if(this._mode==UISelectList.MULTI_SELECT_MODE)return 'checkbox';return 'radio';},_getCheckedClass:function(){if(this._mode==UISelectList.MULTI_SELECT_MODE)return UISelectList.MULTI_SELECT_MODE_CHECKED_CLASS_NAME;return UISelectList.SINGLE_SELECT_MODE_CHECKED_CLASS_NAME;},_linkClicked:function(b,a){b.click();},_clicked:function(d,g,f,c){var b;if(this._mode==UISelectList.SINGLE_SELECT_MODE){for(var e in this._items){var a=d==this._items[e].input;CSS.conditionClass(this._items[e].label,this._getCheckedClass(),a);}b=true;}else{b=d.checked;CSS.conditionClass(g,this._getCheckedClass(),d.checked);}this._callback(b,f);$E(c).stop();}};
function Scroller(a){this.canvas=a;this.scrollZone=50;this.velocity=100;this.coefficient=1;}Scroller.findScrollParent=function(a){var b;a=a.parentNode;while(a){if(a.scrollHeight!=a.offsetTop){b=CSS.getStyle(a,'overflowY');if(b=='scroll'||b=='auto')return a;}a=a.parentNode;}return document.body;};Scroller.prototype.activate=function(){this.activate=bagofholding;this.event=Event.listen(document,'mousemove',this._onmousemove.bind(this));this.interval=this._intervalHandler.bind(this).recur(50);this.cursor=null;};Scroller.prototype.deactivate=function(){delete this.activate;this.event&&this.event.remove();this.event=null;clearInterval(this.interval);};Scroller.prototype._onmousemove=function(event){this.cursor=new Vector2.getEventPosition(event);};Scroller.prototype._intervalHandler=function(){if(!this.cursor)return;var c=this.canvas==document.body?Rect.getViewportBounds():Rect(this.canvas);var a=new Rect(this.cursor.y-c.t,c.r-this.cursor.x,c.b-this.cursor.y,this.cursor.x-c.l);var b=new Vector2(0,0);if(a.t<a.b&&a.t<this.scrollZone){b.y=-this.scrollZone+a.t;}else if(a.b<this.scrollZone)b.y=this.scrollZone-a.b;b.y=this._doMath(b.y);if(a.l<a.r&&a.l<this.scrollZone){b.x=-this.scrollZone+a.l;}else if(a.r<this.scrollZone)b.x=this.scrollZone-a.r;b.x=this._doMath(b.x);if(b.x||b.y){b.scrollElementBy(this.canvas);if(document.body==this.canvas)this.cursor=this.cursor.add(b);Arbiter.inform('scroller/scroll',this.cursor);}};Scroller.prototype._doMath=function(a){return Math.floor(Math.pow((a>=0?Math.min(a,this.scrollZone):Math.max(a,-this.scrollZone))/this.scrollZone*this.velocity,this.coefficient));};
var HistoryManager={_IFRAME_BASE_URI:'http://static.ak.facebook.com/common/history_manager.php',history:null,current:0,fragment:null,_setIframeSrcFragment:function(b){b=b.toString();var a=HistoryManager.history.length-1;HistoryManager.iframe.src=HistoryManager._IFRAME_BASE_URI+'?|index='+a+'#'+encodeURIComponent(b);return HistoryManager;},getIframeSrcFragment:function(){return decodeURIComponent(URI(HistoryManager.iframe.contentWindow.document.location.href).getFragment());},nextframe:function(a,b){if(b){HistoryManager._setIframeSrcFragment(a);return;}if(a!==undefined){HistoryManager.iframeQueue.push(a);}else{HistoryManager.iframeQueue.splice(0,1);HistoryManager.iframeTimeout=null;HistoryManager.checkURI();}if(HistoryManager.iframeQueue.length&&!HistoryManager.iframeTimeout){var c=HistoryManager.iframeQueue[0];HistoryManager.iframeTimeout=setTimeout(function(){HistoryManager._setIframeSrcFragment(c);},100,false);}},isInitialized:function(){return !!HistoryManager._initialized;},init:function(){if(URI.getRequestURI(false).getProtocol().toLowerCase()=='https')return;if(!env_get('ALLOW_TRANSITION_IN_IFRAME')&&window!=window.top)return;if(HistoryManager._initialized)return HistoryManager;var b=URI();var a=b.getFragment()||'';copy_properties(HistoryManager,{_initialized:true,fragment:a,orig_fragment:a,history:[b],callbacks:[],lastChanged:new Date().getTime(),canonical:URI('#'),fragmentTimeout:null,user:0,iframeTimeout:null,iframeQueue:[],enabled:true,debug:bagofholding});if(ua.safari()<500||ua.firefox()<2){HistoryManager.enabled=false;return HistoryManager;}if(ua.ie()<8){HistoryManager.iframe=document.createElement('iframe');copy_properties(HistoryManager.iframe.style,{width:'0',height:'0',frameborder:'0',left:'0',top:'0',position:'absolute'});onloadRegister(function(){HistoryManager._setIframeSrcFragment(a);document.body.insertBefore(HistoryManager.iframe,document.body.firstChild);});}else if('onhashchange' in window){Event.listen(window,'hashchange',HistoryManager.checkURI.bind(HistoryManager));}else setInterval(HistoryManager.checkURI,42,false);HistoryManager._updateRefererURI(URI.getRequestURI(false));return HistoryManager;},registerURIHandler:function(a){HistoryManager.callbacks.push(a);return HistoryManager;},setCanonicalLocation:function(a){HistoryManager.canonical=URI(a);return HistoryManager;},notify:function(b){if(b==HistoryManager.orig_fragment)b=HistoryManager.canonical.getFragment();for(var a=0;a<HistoryManager.callbacks.length;a++)try{if(HistoryManager.callbacks[a](b))return true;}catch(ex){}return false;},checkURI:function(){if(new Date().getTime()-HistoryManager.lastChanged<400)return;if(ua.ie()<8&&HistoryManager.iframeQueue.length)return;if(ua.safari()&&window.history.length==200){if(!HistoryManager.warned)HistoryManager.warned=true;return;}var a=URI().getFragment();if(a.charAt(0)=='!')a=a.substr(1);if(ua.ie()<8)a=HistoryManager.getIframeSrcFragment();if(a!=HistoryManager.fragment){HistoryManager.debug([a,' vs ',HistoryManager.fragment,'whl: ',window.history.length,'QHL: ',HistoryManager.history.length].join(' '));for(var b=HistoryManager.history.length-1;b>=0;--b)if(HistoryManager.history[b].getFragment()==a)break;++HistoryManager.user;if(b>=0){HistoryManager.go(b-HistoryManager.current);}else HistoryManager.go('#'+a);--HistoryManager.user;}delete a;},_updateRefererURI:function(c){c=c.toString();if(c.charAt(0)!='/'&&c.indexOf('//')==-1)return;var b=new URI(window.location);if(b.isFacebookURI()){var a=b.getPath()+window.location.search;}else var a='';setCookie('x-referer',URI(c).getQualifiedURI().setFragment(a).toString());},go:function(c,e,f){HistoryManager.debug('go: '+c);if(e===undefined)e=true;if(!HistoryManager.enabled)if(!e)return false;if(typeof(c)=='number'){if(!c)return false;var b=c+HistoryManager.current;var d=Math.max(0,Math.min(HistoryManager.history.length-1,b));HistoryManager.current=d;b=HistoryManager.history[d].getFragment()||HistoryManager.orig_fragment;HistoryManager.fragment=b;HistoryManager.lastChanged=new Date().getTime();if(ua.ie()<8){if(HistoryManager.fragmentTimeout)clearTimeout(HistoryManager.fragmentTimeout);HistoryManager._temporary_fragment=b;HistoryManager.fragmentTimeout=setTimeout(function(){window.location.hash='#!'+b;delete HistoryManager._temporary_fragment;},750,false);if(!HistoryManager.user)HistoryManager.nextframe(b,f);}else if(!HistoryManager.user)go_or_replace(window.location,window.location.href.split('#')[0]+'#!'+b,f);if(e)HistoryManager.notify(b);HistoryManager._updateRefererURI(b);return false;}c=URI(c);if(c.getDomain()==URI().getDomain())c=URI('#'+c.getUnqualifiedURI());var a=HistoryManager.history[HistoryManager.current].getFragment();var g=c.getFragment();if(g==a||(a==HistoryManager.orig_fragment&&g==HistoryManager.canonical.getFragment())){if(e)HistoryManager.notify(g);HistoryManager._updateRefererURI(g);return false;}if(f)HistoryManager.current--;var h=(HistoryManager.history.length-HistoryManager.current)-1;HistoryManager.history.splice(HistoryManager.current+1,h);HistoryManager.history.push(URI(c));return HistoryManager.go(1,e,f);},getCurrentFragment:function(){var a=HistoryManager._temporary_fragment!==undefined?HistoryManager._temporary_fragment:URI.getRequestURI(false).getFragment();return a==HistoryManager.orig_fragment?HistoryManager.canonical.getFragment():a;}};var PageTransitions={_transition_handlers:[],_scroll_positions:{},isInitialized:function(){return !!PageTransitions._initialized;},_init:function(){if(URI.getRequestURI(false).getProtocol().toLowerCase()=='https')return;if(!env_get('ALLOW_TRANSITION_IN_IFRAME')&&window!=window.top)return;if(PageTransitions._initialized)return PageTransitions;PageTransitions._initialized=true;var c=URI.getRequestURI(false);var a=c.getUnqualifiedURI();var d=URI(a).setFragment(null);if(d.toString()===a.getFragment())a=d;copy_properties(PageTransitions,{_current_uri:a,_most_recent_uri:a,_next_uri:a});var b;if(c.getFragment().startsWith('/')){b=c.getFragment();}else b=a;HistoryManager.init().setCanonicalLocation('#'+b).registerURIHandler(PageTransitions._historyManagerHandler);LinkController.registerFallbackHandler(PageTransitions._rewriteHref,LinkController.TARGETS|LinkController.MODIFIERS);LinkController.registerFallbackHandler(PageTransitions._onlinkclick);FormController.registerFallbackHandler(PageTransitions._onformsubmit);window.onscroll=chain(window.onscroll,function(){var e=HistoryManager.getCurrentFragment();if(PageTransitions._current_uri==e)PageTransitions._scroll_positions[e]=Vector2.getScrollPosition();});return PageTransitions;},registerHandler:function(b,a){PageTransitions._init();a=a||5;if(!PageTransitions._transition_handlers[a])PageTransitions._transition_handlers[a]=[];PageTransitions._transition_handlers[a].push(b);},getCurrentURI:function(a){if(!PageTransitions._current_uri&&!a)return new URI(PageTransitions._most_recent_uri);return new URI(PageTransitions._current_uri);},getMostRecentURI:function(){return new URI(PageTransitions._most_recent_uri);},getNextURI:function(){return new URI(PageTransitions._next_uri);},_rewriteHref:function(a){var c=a.getAttribute('href');var b=_computeRelativeURI(PageTransitions._most_recent_uri.getQualifiedURI(),c).toString();if(c!=b)a.setAttribute('href',b);},_onlinkclick:function(a){_BusyUIManager.lookBusy(a);PageTransitions.go(a.getAttribute('href'));return false;},_onformsubmit:function(a){var c=new URI(a.getAttribute('action')||''),b=_computeRelativeURI(PageTransitions._most_recent_uri,c);a.setAttribute('action',b.toString());if(!a.method||a.method.toUpperCase()=='GET'){PageTransitions.go(b.addQueryData(serialize_form(a)));return false;}},_rewriteSubDomain:function(c){c=URI(c);var b=c.getDomain();if(b.indexOf('apps.')===0){var a=URI.getRequestURI().getDomain();c.addQueryData({_fb_qsub:b}).setDomain(a);}return c;},_revertSubDomain:function(c){c=URI(c);var b=c.getQueryData();if('_fb_qsub' in b){var a=b._fb_qsub;c.removeQueryData('_fb_qsub').setDomain(a).setProtocol(URI().getProtocol());}return c;},go:function(d,b){var a=new URI(d).removeQueryData('quickling').getQualifiedURI();a=PageTransitions._rewriteSubDomain(a);var c=a.getUnqualifiedURI();delete PageTransitions._scroll_positions[c];_BusyUIManager.lookBusy();PageTransitions._loadPage(a,function(e){if(e){HistoryManager.go(a.toString(),false,b);}else{a=PageTransitions._revertSubDomain(a);go_or_replace(window.location,a,b);}});},_historyManagerHandler:function(a){if(a.charAt(0)!='/')return false;PageTransitions._loadPage(new URI(a),function(b){if(!b){a=PageTransitions._revertSubDomain(a);go_or_replace(window.location,a,true);}});return true;},_loadPage:function(e,c){if(e.getFragment()&&are_equal(URI(e).setFragment(null).getQualifiedURI(),URI(PageTransitions._current_uri).setFragment(null).getQualifiedURI())){PageTransitions._current_uri=PageTransitions._most_recent_uri=e;PageTransitions.restoreScrollPosition();_BusyUIManager.stopLookingBusy();return;}var d=PageTransitions._scroll_positions[PageTransitions._current_uri];PageTransitions._current_uri=null;PageTransitions._next_uri=e;if(d)DOMScroll.scrollTo(d,false);var b=function(){var f=PageTransitions._handleTransition(e);c&&c(f);};var a=_runHooks('onbeforeleavehooks');if(a){_BusyUIManager.stopLookingBusy();PageTransitions._warnBeforeLeaving(a,b);}else b();},_handleTransition:function(e){window.onbeforeleavehooks=undefined;_BusyUIManager.lookBusy();for(var b=PageTransitions._transition_handlers.length-1;b>=0;--b){var a=PageTransitions._transition_handlers[b];if(!a)continue;for(var c=a.length-1;c>=0;--c)if(a[c](e)===true){var d={sender:this,uri:e};Arbiter.inform(Arbiter.PAGE_TRANSITION,d);return true;}else a.splice(c,1);}return false;},unifyURI:function(){PageTransitions._current_uri=PageTransitions._most_recent_uri=PageTransitions._next_uri;},transitionComplete:function(){_BusyUIManager.stopLookingBusy();PageTransitions.unifyURI();PageTransitions.restoreScrollPosition();},_warnBeforeLeaving:function(b,a){new Dialog().setTitle(_tx("Are you sure you want to navigate away from this page?")).setSummary(_tx("Premi {ok} per continuare, o {cancel} per restare nella pagina corrente.",{ok:_tx("OK"),cancel:_tx("Annulla")})).setBody(htmlize(b)).setButtons(Dialog.OK_AND_CANCEL).setHandler(a).setModal().show();},restoreScrollPosition:function(){var c=PageTransitions._current_uri;var e=PageTransitions._scroll_positions[c];if(e){DOMScroll.scrollTo(e,false);return;}function d(f){return (f||null)&&(DOM.find(document,sprintf('a[name=%e]',f))||ge(f));}var a=d(c.getFragment());if(a){var b=Vector2.getElementPosition(a);b.x=0;DOMScroll.scrollTo(b);}}};function _computeRelativeURI(d,b){var e=new URI(),c=b;d=new URI(d);b=new URI(b);if(!b.isFacebookURI())return c;var f=d;var a=['Protocol','Domain','Port','Path','QueryData','Fragment'];a.forEach(function(h){var g=h=='Path'&&f===d;if(g)e.setPath(_computeRelativePath(d.getPath(),b.getPath()));if(!is_empty(b['get'+h]()))f=b;if(!g)e['set'+h](f['get'+h]());});return e;}function _computeRelativePath(b,a){if(!a)return b;if(a.charAt(0)=='/')return a;var c=b.split('/').slice(0,-1);c[0]!=='';a.split('/').forEach(function(d){if(!(d=='.'))if(d=='..'){if(c.length>1)c=c.slice(0,-1);}else c.push(d);});return c.join('/');}function go_or_replace(a,d,c){var e=new URI(d);if(a.pathname=='/'&&e.getPath()!='/'&&e.isQuicklingEnabled()){var b=a.search?{}:{q:''};e=new URI().setPath('/').setQueryData(b).setFragment(e.getUnqualifiedURI()).toString();d=e.toString();}if(c&&!(ua.ie()<8)){a.replace(d);}else if(a.href==d){a.reload();}else a.href=d;}var _BusyUIManager={_looking_busy:false,_original_cursors:[],lookBusy:function(a){if(a)_BusyUIManager._giveProgressCursor(a);if(_BusyUIManager._looking_busy)return;_BusyUIManager._looking_busy=true;_BusyUIManager._giveProgressCursor(document.body);},stopLookingBusy:function(){if(!_BusyUIManager._looking_busy)return;_BusyUIManager._looking_busy=false;while(_BusyUIManager._original_cursors.length){var c=_BusyUIManager._original_cursors.pop();var b=c[0];var a=c[1];if(b.style)b.style.cursor=a||'';}},_giveProgressCursor:function(a){if(!ua.safari()){_BusyUIManager._original_cursors.push([a,a.style.cursor]);a.style.cursor='progress';}}};
onloadRegister(function(){Event.listen(document.documentElement,'submit',function(b){var a=b.getTarget().getElementsByTagName('*');for(var c=0;c<a.length;c++)if(a[c].getAttribute('required')&&$(a[c]).isEmpty()){a[c].focus();return false;}},Event.Priority.URGENT);});
var PhotostreamConstants={ShowPhoto:'photostream/showPhoto'};
function pages_show_block_app(b,a,d){var c=new AsyncRequest().setMethod('POST').setData({app_id:b,action:a,source:d}).setURI('/ajax/apps/block.php');new Dialog().setAsync(c).show();}
PYMK={addOthers:function(a){var b=$$('input[name="pymk_replace"]').pull('value').join(',');var c=$N('input',{name:'unwanted',type:'hidden',value:b});$(a).appendContent(c);}};
if(!this.JSON)this.JSON=function(){function f(a){return a<10?'0'+a:a;}Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z';};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};function stringify(f,g){var a,b,c,d,e;switch(typeof f){case 'string':return (new RegExp('[\x00-\x1f\\\\"]')).test(f)?'"'+f.replace(/[\x00-\x1f\\"]/g,function(h){var i=m[h];if(i)return i;i=h.charCodeAt();return '\\u00'+Math.floor(i/16).toString(16)+(i%16).toString(16);})+'"':'"'+f+'"';case 'number':return isFinite(f)?String(f):'null';case 'boolean':return String(f);case 'null':return 'null';case 'object':if(DOM.isNode(f))return null;if(!f)return 'null';if(typeof f.toJSON==='function')return stringify(f.toJSON());a=[];if(typeof f.length==='number'&&!(propertyIsEnumerable(f,'length'))){d=f.length;for(b=0;b<d;b+=1)a.push(stringify(f[b],g)||'null');return '['+a.join(',')+']';}if(g){d=g.length;for(b=0;b<d;b+=1){c=g[b];if(typeof c==='string'){e=stringify(f[c],g);if(e)a.push(stringify(c)+':'+e);}}}else for(c in f)if(typeof c==='string'){e=stringify(f[c],g);if(e)a.push(stringify(c)+':'+e);}return '{'+a.join(',')+'}';}}return {stringify:stringify,parse:function(text,filter){var j;function walk(b,d){var a,c;if(d&&typeof d==='object')for(a in d)if(Object.prototype.hasOwnProperty.apply(d,[a])){c=walk(a,d[a]);if(c!==undefined)d[a]=c;}return filter(b,d);}if(text&&/^[\],:{}\s]*$/.test(text.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof filter==='function'?walk('',j):j;}throw new SyntaxError('decodeJSON');}};}();this.JSON.encode=this.JSON.stringify;this.JSON.decode=this.JSON.parse;function propertyIsEnumerable(a,b){if(a.propertyIsEnumerable)return a.propertyIsEnumerable(b);for(var c in a)if(c==b)return true;return false;}
function ufi_add_textarea_control(c,d){var a=DOM.scry($('content'),'textarea.add_comment_text');var b=function(e){if(!e._has_control){new TextAreaControl(e).setMaxLength(c).setAutogrow(true,true).setPlaceholderText(d).onfocus();e._has_control=true;}};a.forEach(function(e){if(!e.hasClass('DOMControl_placeholder')){b(e);}else if(!e._has_control)Event.listen(e,"focus",bind(null,b,e));});}
Arbiter.inform("template\/registerTemplate", {"name":"\/templates\/UIActionMenu.tmpl","template":"\n<div class=\"UIActionMenu\" bindPoint=\"root\">\n  <a class=\"UIActionMenu_Wrap\" bindPoint=\"wrap\" href=\"#\">\n    <span class=\"UIActionMenu_Icon\" bindPoint=\"icon\"><\/span>\n    <span class=\"UIActionMenu_Text\" bindPoint=\"text\"><\/span>\n    <span class=\"UIActionMenu_Chevron\"><\/span>\n  <\/a>\n  <div class=\"UIActionMenu_Menu\" bindPoint=\"menu\"><\/div>\n<\/div>\n"}, Arbiter.BEHAVIOR_PERSISTENT);

if (window.Bootloader) { Bootloader.done(["js\/4anxote5hmm84s84.pkg.js"]); }