/*
HTTP Host: static.ak.fbcdn.net
Generated: March 18th 2010 9:32:10 AM PDT
Machine: 10.16.139.104
Locale: nu_ll
Path: js/cvx78euofpwss0wk.pkg.js
*/

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

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 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 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,d,e){if(d){var f=new Date();var c=new Date();c.setTime(f.getTime()+d);}document.cookie=a+"="+encodeURIComponent(b)+"; "+(d?"expires="+c.toGMTString()+"; ":"")+"path="+(e||'/')+"; domain=."+window.location.hostname.replace(/^.*(facebook\..*)$/i,'$1');}function clearCookie(a){document.cookie=a+"=; expires=Mon, 26 Jul 1997 05:00:00 GMT; "+"path=/; domain=."+window.location.hostname.replace(/^.*(facebook\..*)$/i,'$1');}function getCookie(c){var d=c+"=";var b=document.cookie.split(';');for(i=0;i<b.length;i++){var a=b[i];while(a.charAt(0)==' ')a=a.substring(1,a.length);if(a.indexOf(d)==0)return decodeURIComponent(a.substring(d.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();}
function adjustImage(c){var a=c.parentNode;while(CSS.getStyle(a,'display')!='block'&&a.parentNode)a=a.parentNode;var d=a.offsetWidth;if(c.offsetWidth>d)try{if(ua.ie()<8){var b=document.createElement('div');b.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+c.src.replace('"','%22')+'", sizingMethod="scale")';b.style.width=d+'px';b.style.height=Math.floor(((d/c.offsetWidth)*c.offsetHeight))+'px';if(c.parentNode.tagName=='A')b.style.cursor='pointer';c.parentNode.insertBefore(b,c);c.parentNode.removeChild(c);}else throw 1;}catch(e){c.style.width=d+'px';}CSS.removeClass(c,'img_loading');}function imageConstrainSize(e,b,c,d){var a=new Image();a.onload=function(){if(a.width>0&&a.height>0){var k=a.width;var h=a.height;if(k>b||h>c){var g=c/b;var f=h/k;if(f>g){k=k*(c/h);h=c;}else{h=h*(b/k);k=b;}}var j=ge(d);if(j){var i=document.createElement('img');i.src=e;i.width=k;i.height=h;j.parentNode.insertBefore(i,j);j.parentNode.removeChild(j);}}};a.src=e;}function image_has_loaded(a){if(a.naturalWidth!==undefined){return a.complete&&a.width!=0;}else if(a.height==20&&a.width==20&&a.complete){return false;}else if(a.complete===undefined&&ua.safari()<500){var b=new Image();b.src=a.src;return b.complete;}return a.complete;}function image_has_failed(a){if((a.complete==null&&a.width==20&&a.height==20)||(a.mimeType!=null&&a.complete&&a.mimeType=='')||(a.naturalHeight!=null&&a.complete&&a.naturalHeight==0))return true;}
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.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=DOM.getBoxHeight(this.obj);if(b.attrs[a].by)b.attrs[a].value+=m;break;case 'width':var m=DOM.getBoxWidth(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=DOM.getBoxHeight(this.obj);if(b.attrs.width&&b.attrs.width.auto)b.attrs.width.value=DOM.getBoxWidth(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 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];}});
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 getRadioFormValue(a){for(i=0;i<a.length;i++)if(a[i].checked)return a[i].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;if(ge('fb_dtsg'))b.fb_dtsg=$('fb_dtsg').value;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("T\u00e1 go maith")},CANCEL:{name:'cancel',label:_tx("Cealaigh"),className:'inputaux'},CLOSE:{name:'close',label:_tx("D\u00fan")},NEXT:{name:'next',label:_tx("Next")},SAVE:{name:'save',label:_tx("S\u00e1bh\u00e1il")},SUBMIT:{name:'submit',label:_tx("Cuir Isteach")},CONFIRM:{name:'confirm',label:_tx("Confirm")},DELETE:{name:'delete',label:_tx("Scrios")}});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("Confirmation Required")).setBody(c||_tx("An bhfuil t\u00fa cinnte gur mhaith leat an gn\u00edomh seo a dh\u00e9anamh?")).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("Ag l\u00f3d\u00e1il...")));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 b=[];if((this._buttons&&this._buttons.length>0)||this._buttons_message){var b=[];if(this._buttons_message)b.push($N('div',{className:'dialog_buttons_msg'},this._format(this._buttons_message)));if(this._buttons)for(var d=0;d<this._buttons.length;d++){var a=this._buttons[d];var c=$N('input',{className:'inputsubmit',type:'button',name:a.name||'',value:a.label});CSS.addClass(c,a.className);c.listen('click',this._handleButton.bind(this,a.name));b.push(c);}}return b;},_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){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;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.bootload){Bootloader.loadResources(d.bootload,a,c);}else a();}});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||1001;}catch(ex){b=1001;}try{if(this.responseText=='')b=1002;}catch(ignore){}if(this.transportErrorHandler){var a,e;a=_tx("Something went wrong. We're working on getting this fixed as soon as we can. You may be able to try again.");e=_tx("Hoips");!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(1001);}}};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={};var 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.'}},_JSONPReceivers:{},_allBundledRequests:{},_bundledRequestProperties:{},_bundleTimer:null,suppressOnloadToken:{}});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;},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(Arbiter.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 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);}});
window.__UIControllerRegistry=window.__UIControllerRegistry||{};
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();}};
var HistoryManager={_IFRAME_BASE_URI:'http://static.ak.facebook.com/common/history_manager.html',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 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(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(a){a=a.toString();if(a.charAt(0)!='/'&&a.indexOf('//')==-1)return;setCookie('x-referer',URI(a).getQualifiedURI().setFragment('').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();PageTransitions._transition_handlers.contains(b);if(a){PageTransitions._transition_handlers.unshift(b);}else PageTransitions._transition_handlers.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(c){window.onbeforeleavehooks=undefined;_BusyUIManager.lookBusy();for(var a=PageTransitions._transition_handlers.length-1;a>=0;--a)if(PageTransitions._transition_handlers[a](c)===true){var b={sender:this,uri:c};Arbiter.inform(Arbiter.PAGE_TRANSITION,b);return true;}else PageTransitions._transition_handlers.splice(a,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("Press {ok} to continue, or {cancel} to stay on the current page.",{ok:_tx("T\u00e1 go maith"),cancel:_tx("Cealaigh")})).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';}}};
PresenceMessage={STARTED:'presence/started',SHUTDOWN:'presence/shutdown',RESTARTED:'presence/restarted',WINDOW_RESIZED:'presence/window-resized',TAB_CLOSED:'presence/tab-closed',TAB_OPENED:'presence/tab-opened',PRESENCE_UPDATER_READY:'presence/updater-ready',getAppMessageType:function(a,b){return 'presence/app_message:'+a+':'+b;},getArbiterMessageType:function(a){return 'presence/message:'+a;}};
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;}

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