/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  December 11th 2009 3:34:04 PM PST                            */
/*      Machine:  10.16.140.102                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/ay3tw6trbawwokw4.pkg.js h:54c37t09                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/ay3tw6trbawwokw4.pkg.js                                   */

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

var Configurable={getOption:function(opt){if(typeof(this.option[opt])=='undefined'){Util.warn('Failed to get option %q; it does not exist.',opt);return null;}return this.option[opt];},setOption:function(opt,v){if(typeof(this.option[opt])=='undefined'){Util.warn('Failed to set option %q; it does not exist.',opt);}else this.option[opt]=v;return this;},getOptions:function(){return this.option;}};
function Nectar(){}copy_properties(Nectar,{linkHandler:function(_L0,_L1){var _L2=Nectar.getNectarParams();_L2['ia']=1;var url=_L1.href;if(!url){url=URI.getRequestURI().toString();_L2['err']=1;}_L2['url']=url;var uri='/ajax/nectar.php'+'?'+URI.implodeQuery({'nctr':_L2})+'&';new AsyncSignal(uri,{}).send();return _L0;},getNectarParams:function(){var _L0={};var _L1=env_get('nctrlid');if(_L1)_L0['id']=_L1;var _L2=env_get('nctrlnid');if(_L2)_L0['nid']=_L2;if(_L1||_L2)_L0['ct']=(new Date()).getTime();copy_properties(_L0,Nectar.extraData.get_query_data());return _L0;},extraData:function(){var _L0={};var _L1=[];return {set_item:function(_L2,_L3,_L4){var _L5=_L0[_L2];if(_L5===undefined){if(_L4)_L1.push(_L2);_L5=[];_L0[_L2]=_L5;}return _L5.push(_L3);},get_item:function(_L2){return _L0[_L2]||[];},get_query_data:function(){var ii,_L3,_L4,_L5={};for(ii=0;ii<_L1.length;ii++){_L4=_L1[ii];_L3=_L0[_L4];if(_L3)_L5[_L4]=_L3.join(',');}_L0=[];_L1=[];return _L5;}};}()});
var PhotostreamConstants={ShowPhoto:'photostream/showPhoto'};
function NectarPhotosLog(){}copy_properties(NectarPhotosLog,{PHOTOS_BUF_LEN:20,showPhotoHandler:function(_L0,_L1){var pid,_L3,aid,ss;_L3=_L1.node;pid=_L1.pid;aid=_L1.aid;ss=_L1.ss;var _L6=Nectar.extraData.get_item('pts');if(pid!==undefined){if(_L6.length==0){Nectar.extraData.set_item('url',_L3.href,false);Nectar.extraData.set_item('aid',aid,true);Nectar.extraData.set_item('ss',ss,false);}Nectar.extraData.set_item('pts',pid,true);}_L6=Nectar.extraData.get_item('pts');if(_L6.length>=NectarPhotosLog.PHOTOS_BUF_LEN)NectarPhotosLog.flushLog();return false;},flushLog:function(){var _L0=Nectar.extraData.get_item('pts');if(_L0.length>0){var url=Nectar.extraData.get_item('url')[0];Nectar.linkHandler(false,{'href':url});}return false;}});onloadRegister(function(){Arbiter.subscribe(PhotostreamConstants.ShowPhoto,NectarPhotosLog.showPhotoHandler);});onbeforeunloadRegister(function(){NectarPhotosLog.flushLog();},false);
function Task(_L0,_L1){copy_properties(this,{task:_L0,option:{synchronous:!!_L1},status:Task.WAITING,result:null,queue:null});}copy_properties(Task,{WAITING:0,READY:1,RUNNING:2,DONE:3,ERROR:4});copy_properties(Task.prototype,Configurable);copy_properties(Task.prototype,{run:function(){this.status=Task.RUNNING;try{var _L0=this.task();}catch(exception){this.status=Task.ERROR;exception._task=this;throw exception;}if(this.getOption('synchronous'))this.didComplete(_L0);},didComplete:function(_L0){this.result=_L0;this.status=Task.DONE;if(this.queue)this.queue.didCompleteTask(this);return this;}});function TaskQueue(){copy_properties(this,{queue:[],executingTasks:0,executionDepth:0,option:{synchronous:true,concurrency:2}});}copy_properties(TaskQueue.prototype,Configurable);copy_properties(TaskQueue.prototype,{addTask:function(_L0){this.queue.push(_L0);_L0.queue=this;return _L0;},didCompleteTask:function(_L0){this.executingTasks--;this.reapQueue();if(!this.executionDepth)this.start();},runTask:function(_L0){this.executingTasks++;if(this.getOption('synchronous')){try{_L0.run();}catch(exception){Util.error('Exception thrown while running task: %x.',exception);this.didCompleteTask();}}else setTimeout(bind(_L0,'run'),10);},reapQueue:function(){var _L0;var ii,len;for(ii=0,len=this.queue.length;ii<len;ii++){_L0=this.queue[ii].status;if(_L0!=Task.DONE&&_L0!=Task.ERROR)break;}if(ii)this.queue=this.queue.slice(ii);},start:function(){this.executionDepth++;while(this.executingTasks<this.getOption('concurrency')){for(var ii=0,len=this.queue.length;ii<len;ii++)if(this.queue[ii].status==Task.READY){this.runTask(this.queue[ii]);break;}if(ii==len)break;}this.executionDepth--;},ready:function(n){n=n||1;for(var ii=0,len=this.queue.length;ii<len;ii++)if(this.queue[ii].status==Task.WAITING){this.queue[ii].status=Task.READY;if(!(--n))break;}this.start();}});
PhotoTagSelector=function(){var _L0;var _L1;var _L2;var _L3=false;var _L4=null;var _L5=[];var _L6=[];var _L7=false;var _L8=null;var _L9=null;var _La=null;var _Lb=false;var _Lc=false;var _Ld=bagofholding;var _Le=bagofholding;var _Lf=[];var _L10=0;var _L11=function(){_L1.value='';_L2.value='';PhotoTagSelector.exitInviteMode();};var _L12=function(){if(!_L3)return;var _L1e=_L1.value.toLowerCase().trim();_L1e=typeahead_source.flatten_string(_L1e);var _L1f=[];var _L20=[];for(var i=0,len=_L5.length;i<len;i++){var _L23=_L5[i];if(!_L1e||-1!=_L23['flat_name'].indexOf(_L1e))(_L23['rel']?_L20:_L1f).push(_L23['fragment']);}_L10=_L1f.length+_L20.length;if(0==_L10||_Lc){hide('pts_userlist','pts_userlistlabel','pts_choose_text','pts_invite_msg');if(_Lb){_L1d();}else hide('pts_invite_section');return;}show('pts_userlist','pts_userlistlabel','pts_choose_text');hide('pts_invite_section');if(_Lb)show('pts_invite_msg');var _L24='';if(0!=_L1f.length&&0!=_L20.length)_L24='<hr />';var _L25=_L20.join('')+_L24+_L1f.join('');$('pts_userlist').setContent(HTML(_L25));if((1==_L10)&&_L1e)DOM.find($('pts_userlist'),'input[type="checkbox"]').checked=true;};var _L13=function(){if(_L4){return _L19();}else if(_L7)return false;_L7=true;new AsyncRequest().setHandler(_L15).setErrorHandler(_L16).setTransportErrorHandler(_L16).setFinallyHandler(function(){_L7=false;}).setURI('/ajax/photos_tag_options.php').setData({pid:_L9,id:_L8,oid:_La}).setMethod('GET').setReadOnly(true).send();};var _L14=function(){_L5=_L4;if(!_Lf)return;for(var i=0,len=_Lf.length;i<len;i++)if(_Lf[i]['id']>0){_L5=_L5.filter(function(f){return _Lf[i]['id']!=f['id'];});}else _L5=_L5.filter(function(f){return _Lf[i]['id']!=f['id']||_Lf[i]['name'].toLowerCase()!=f['name'].toLowerCase();});};var _L15=function(_L1e){_L5=_L4=_L1e.getPayload();for(var i=0,len=_L4.length;i<len;i++)_L17(_L4[i]);_L19();};var _L16=function(_L1e){PhotoTagSelector.hide();ErrorDialog.showAsyncError(_L1e);};var _L17=function(_L1e){_L1e['flat_name']=typeahead_source.flatten_string(_L1e['name']);_L1e['fragment']=['<label><input type="checkbox" onclick="',sprintf('PhotoTagSelector._checkboxClick(this, %d, \'%s\')',_L1e['id'],escape_js_quotes(_L1e['name'])),'" />',htmlize(_L1e['name']),'</label>'].join('');};var _L18=function(_L1e){_L6.push(_L1e);};var _L19=function(){for(var i=0,len=_L6.length;i<len;i++)_L6[i]();_L6=[];};var _L1a=function(_L1e){switch(Event.getKeyCode(_L1e)){case KEYS.RETURN:_L1b();break;case KEYS.ESC:PhotoTagSelector.hide();break;default:setTimeout(_L12,0);}};var _L1b=function(){var id=0;var name='';var _L20='';if(''!=_L2.value.trim()){_L20=_L2.value.trim();name=_L1.value.trim();}else if(1==_L10){var _L21=DOM.find($('pts_userlist'),'input[type="checkbox"]');if(_L21.checked){return _L21.onclick();}else name=_L1.value.trim();}else name=_L1.value.trim();_L1c(id,name,_L20);};var _L1c=function(id,name,_L20){id=id||0;name=name||'';_L20=_L20||'';if(!name&&!id)return;_Ld(id,name,_L20);PhotoTagSelector.hide();if(id){for(var i=0,len=_L4.length;i<len;i++)if(_L4[i]['id']==id){_L4[i]['rel']=true;break;}}else if(!_L20){var _L23=false;for(var i=0,len=_L4.length;i<len;i++)if(!_L4[i].id&&_L4[i].name==name){_L4[i].rel=true;_L23=true;break;}if(!_L23){var _L24={name:name,rel:true,id:0};_L17(_L24);_L4.unshift(_L24);}}};var _L1d=function(){var _L1e=_L1.value.trim();var _L1f;if(_L1e){var _L20=_L1e.indexOf(' ');_L1f=_L20>-1?_L1e.substr(0,_L20):_L1e;}else _L1f=_tx("your friend");$('pts_invite_name').setContent(_L1f);show('pts_invite_section');};return {init:function(_L1e){if(_L3)return;_L3=true;_L0=$N('div',null,HTML(_L1e));_L0.id='photo_tag_selector';DOMScroll.getScrollRoot().appendChild(_L0);_L2=$('pts_invite_email');_L1=$('pts_name_input');_L1.onkeyup=_L1a;DOM.find(_L0,'input[name="tag"]').onclick=_L1b;DOM.find(_L0,'input[name="cancel"]').onclick=this.hide;},prime:function(){_L13();return this;},hide:function(){_Le();if(!_L3)return;_L0.style.display='none';_Ld=bagofholding;_Le=bagofholding;_L8=null;_L9=null;_La=null;_Lf=[];_L10=0;_L11();return this;},showAt:function(_L1e){_L1e.setElementPosition(_L0);_L0.style.display='block';_L18(_L14);_L18(_L12);_L18(function(){_L1.focus();});_L13();return this;},setTagCallback:function(_L1e){_Ld=_L1e;return this;},setHideCallback:function(_L1e){_Le=_L1e;return this;},setTaggedPeople:function(_L1e){_Lf=_L1e;return this;},setPhotoOwner:function(_L1e){_L8=_L1e;return this;},setPhotoId:function(_L1e){_L9=_L1e;return this;},setPhotoObjectId:function(_L1e){_La=_L1e;return this;},setAllowEmailTags:function(_L1e){_Lb=_L1e;return this;},enterInviteMode:function(){_Lc=true;hide('pts_userlist','pts_userlistlabel','pts_choose_text','pts_invite_msg');_L1d();if(_L1.value){var _L1e=DOM.find($('pts_invite_section'),'input[name="pts_invite_email"]');_L1e.focus();}else _L1.focus();return this;},exitInviteMode:function(){_Lc=false;hide('pts_invite_section');if(_Lb)show('pts_invite_msg');return this;},_checkboxClick:function(_L1e,id,name){if(!_L1e||!_L1e.checked)return;_L1c(id,name);}};}();function PhotoTagController(_L0){if(PhotoTagController._instances[_L0])return PhotoTagController._instances[_L0];copy_properties(this,{minTagDistance:83,photoOwnerId:null,photoId:null,photoObjectId:null,tagShowCallback:bagofholding,tagHideCallback:bagofholding,showingTag:null,tagFrame:null,nameFrame:null,_taggingEnabled:false,_tagCallbackFn:bagofholding,_autoSubmitTags:true,_tags:[]});this._getPhotoElement=bind(null,ge,_L0);this._destruct=function(){_L2.remove();this.hideTag();this.tagHideCallback();PhotoTagSelector.hide();delete PhotoTagController._instances[_L0];};this._wait_for_load=function(_L4){_L4.deferUntil(image_has_loaded.bind(this,this._getPhotoElement()),100);};if(!this._getPhotoElement())throw new Error('No images with the id `'+_L0+'\' '+'found on the page.  PhotoTagController Abort.');var _L1=bind(this,this._photoMouseMove);var _L2=Event.listen(document,'mousemove',_L1);onunloadRegister(bind(this,this._destruct));var _L3=this._getPhotoElement();_L3.onclick=chain(bind(this,this._photoClick),_L3.onclick);PhotoTagController._instances[_L0]=this;}copy_properties(PhotoTagController,{_instances:{},getInstance:function(_L0){return PhotoTagController._instances[_L0];}});copy_properties(PhotoTagController.prototype,{setPhotoData:function(_L0,_L1){this.photoOwnerId=_L0;this.photoId=_L1;PhotoTagSelector.hide();this.hideTag();this.tagHideCallback();return this;},setPhotoObjectId:function(_L0){this.photoObjectId=_L0;return this;},setMinTagDistance:function(_L0){this.minTagDistance=_L0;return this;},registerTagHover:function(_L0,_L1){if(!_L0&&!_L1){this.tagShowCallback=bind(this,this.showTagText);this.tagHideCallback=bind(this,this.hideTagText);}else{this.tagShowCallback=_L0;this.tagHideCallback=_L1;}return this;},enableTagging:function(_L0,_L1){if(!this._getPhotoElement())return this._destruct();this._taggingEnabled=true;this._tagCallbackFn=_L0||bagofholding;this._autoSubmitTags=(_L1===undefined)||_L1;this._getPhotoElement().style.cursor='crosshair';PhotoTagSelector.setPhotoOwner(this.photoOwnerId).setPhotoId(this.photoId).setPhotoObjectId(this.photoObjectId).prime();return this;},disableTagging:function(){if(!this._getPhotoElement())return this._destruct();this._taggingEnabled=false;this._tagCallbackFn=bagofholding;this._autoSubmitTags=true;this._getPhotoElement().style.cursor='';PhotoTagSelector.hide();return this;},showTag:function(tag){if(!this._getPhotoElement())return this._destruct();if(!tag)return;if(this._isPhotoCropOn())return;this._wait_for_load(this._showTag.bind(this,tag));},_showTag:function(tag){if(!this.tagFrame){var _L1=document.createElement('div');_L1.style.width=(2*this.minTagDistance)+'px';_L1.style.height=(2*this.minTagDistance)+'px';CSS.addClass(_L1,'photo_tag_frame_inside');this.tagFrame=$N('div',null,_L1);CSS.addClass(this.tagFrame,'photo_tag_frame');this.tagFrame.onclick=bind(this,this._photoClick);DOMScroll.getScrollRoot().appendChild(this.tagFrame);}var _L2=Vector2.getElementPosition(this._getPhotoElement());var _L3=Vector2.getElementDimensions(this._getPhotoElement());var _L4=tag.absoluteCenter(_L3.x,_L3.y);var _L5=this._calculateWithinBounds(_L4,2*this.minTagDistance,this._getPhotoElement());var _L6=new Vector2(_L5.size,_L5.size);var _L7=_L6.mul(.5,.5);_L6.setElementDimensions(DOM.find(this.tagFrame,'div.photo_tag_frame_inside'));new Vector2(-10000,-100000,'document').setElementPosition(this.tagFrame);show(this.tagFrame);var _L8=Vector2.getElementDimensions(this.tagFrame).sub(_L5.size,_L5.size).mul(.5,.5);_L2.add(_L5.tagPosition).sub(_L7).sub(_L8).setElementPosition(this.tagFrame);},hideTag:function(){hide(this.tagFrame);},showTagText:function(tag){if(!this._getPhotoElement())return this._destruct();if(!tag||this._taggingEnabled)return;this._wait_for_load(this._showTagText.bind(this,tag));},_showTagText:function(tag){if(this.nameFrame)this.hideTagText();if(this._isPhotoCropOn())return;this.nameFrame=$N('div',null,$N('span',null,tag.getText()));CSS.addClass(this.nameFrame,'photo_tag_name_frame');DOMScroll.getScrollRoot().appendChild(this.nameFrame);var _L1=Vector2.getElementPosition(this._getPhotoElement());var _L2=Vector2.getElementDimensions(this._getPhotoElement());var _L3=tag.absoluteCenter(_L2.x,_L2.y);var _L4=this._calculateWithinBounds(_L3,2*this.minTagDistance,this._getPhotoElement());var _L5=Vector2.getElementDimensions(this.nameFrame);var _L6=new Vector2(_L5.x/2,8+_L5.y-_L4.size/2);_L1.add(_L4.tagPosition).sub(_L6).setElementPosition(this.nameFrame);show(this.nameFrame);},addTag:function(tag){this._tags.push(tag);},drawTags:function(){for(var i=0,_L1=this._tags.length;i<_L1;i++)this.showTag(this._tags[i]);},hideTagText:function(){if(this.nameFrame)DOM.remove(this.nameFrame);this.nameFrame=null;},_forceWithinBounds:function(_L0,_L1,_L2){_L0=_L0.sub(0,0);if(_L0.x<_L1){_L0.x=Math.min(_L1,_L2.x);}else if(_L0.x>_L2.x-_L1)_L0.x=Math.max(0,_L2.x-_L1);if(_L0.y<_L1){_L0.y=Math.min(_L1,_L2.y);}else if(_L0.y>_L2.y-_L1)_L0.y=Math.max(0,_L2.y-_L1);return _L0;},_calculateWithinBounds:function(_L0,_L1,_L2){var _L3=Vector2.getElementPosition(_L2);var _L4=Vector2.getElementDimensions(_L2);var _L5=Math.max(_L0.x-_L1/2,0);var _L6=Math.min(_L0.x+_L1/2,_L4.x);var top=Math.max(_L0.y-_L1/2,0);var _L8=Math.min(_L0.y+_L1/2,_L4.y);var _L0=new Vector2((_L6+_L5)/2,(top+_L8)/2);var _L9=Math.min(_L6-_L5,_L8-top);return {tagPosition:_L0,size:_L9};},_photoClick:function(_L0){if(!this._getPhotoElement())return this._destruct();if(!this._taggingEnabled)return true;var _L1=PhotoTag.tagsForPhoto(this.photoId,this.photoOwnerId);if(PhotoTag.MAX_TAGS_PER_PHOTO<=_L1.length){new ErrorDialog().showError(_tx("Too Many Tags"),_tx("A photo may only have up to {limit} tags. To add a new tag, you must first remove one of the existing tags on the photo.",{limit:PhotoTag.MAX_TAGS_PER_PHOTO}));return $E(_L0).kill();}PhotoTagSelector.hide();var _L2=Vector2.getEventPosition(_L0);var _L3=Vector2.getElementPosition(this._getPhotoElement());var _L4=Vector2.getElementDimensions(this._getPhotoElement());var _L5=_L2.sub(_L3);var tag=new PhotoTag(100*_L5.x/_L4.x,100*_L5.y/_L4.y,this.photoOwnerId,this.photoId);this.showTag(tag);var _L7=Vector2.getElementPosition(this.tagFrame);if(_L5.x>(_L4.x/2)||_L4.x<300){_L7=_L7.sub(210,0);}else{var _L8=Vector2.getElementDimensions(this.tagFrame);_L7=_L7.add(_L8.x+10,0);}var _L9=[];for(var i=0,len=_L1.length;i<len;i++)_L9.push({name:_L1[i].getText(),id:_L1[i].getTaggeeId()});PhotoTagSelector.setTagCallback(bind(this,this._photoTagCallback,tag)).setHideCallback(bind(this,this.hideTag,tag)).setPhotoOwner(this.photoOwnerId).setPhotoId(this.photoId).setPhotoObjectId(this.photoObjectId).setTaggedPeople(_L9).showAt(_L7);return $E(_L0).kill();},_photoTagCallback:function(tag,id,_L2,_L3){if(id)tag.setTaggeeId(id);if(_L2)tag.setTaggeeName(_L2);if(_L3)tag.setTaggeeEmail(_L3);if(this._autoSubmitTags){tag.submit(this._tagCallbackFn);}else{tag.setLocalSave();this._tagCallbackFn(tag,{});}},_photoMouseMove:function(_L0){if(!this._getPhotoElement())return this._destruct();if(this._taggingEnabled)return;if(!this.tagShowCallback&&!this.tagHideCallback)return;var _L1=PhotoTag.tagsForPhoto(this.photoId,this.photoOwnerId);if(!_L1)return;var _L2=Vector2.getEventPosition(_L0);var _L3=Vector2.getElementPosition(this._getPhotoElement());var _L4=Vector2.getElementDimensions(this._getPhotoElement());var _L5=_L2.sub(_L3);if(_L5.x>0&&_L5.x<_L4.x&&_L5.y>0&&_L5.y<_L4.y){var _L6=_L4.magnitude();var _L7=null;for(var i=0;i<_L1.length;i++){var _L9=_L1[i].absoluteCenter(_L4.x,_L4.y);var _La=_L9.sub(_L5);var _Lb=_La.magnitude();if(Math.abs(_La.x)<=this.minTagDistance&&Math.abs(_La.y)<=this.minTagDistance&&_Lb<=_L6){_L6=_Lb;_L7=_L1[i];if(0==_Lb)break;}}}if(!_L7&&this.showingTag&&this.tagHideCallback){this.showingTag=null;this.tagHideCallback(this.showingTag);}else if(_L7&&this.tagShowCallback&&_L7!=this.showingTag){this.showingTag=_L7;this.tagShowCallback(_L7);}},_isPhotoCropOn:function(){return window['photocrop']&&window['photocrop'].instance&&true;}});function PhotoTag(_L0,_L1,_L2,_L3){copy_properties(this,{centerPoint:new Vector2(_L0/100,_L1/100),photoOwnerId:_L2,photoId:_L3});copy_properties(this,{taggeeName:'',taggeeId:null,taggeeEmail:'',_saved:false,_pendingAsync:false});}copy_properties(PhotoTag,{SYNCING_ENDPOINT:'/ajax/photo_tagging_ajax.php',MAX_TAGS_PER_PHOTO:50,_tagList:{},_photoKey:function(_L0,_L1){return _L0+':'+_L1;},tagsForPhoto:function(_L0,_L1){var _L2=PhotoTag._photoKey(_L0,_L1);return PhotoTag._tagList[_L2]||[];},clearTagsForPhoto:function(_L0,_L1){var _L2=PhotoTag._photoKey(_L0,_L1);PhotoTag._tagList[_L2]=[];}});copy_properties(PhotoTag.prototype,{setTaggeeEmail:function(_L0){if(this.saved){Util.log('You cannot edit the email of a saved tag');return this;}else this.taggeeEmail=_L0;return this;},setTaggeeName:function(_L0){if(this.saved){Util.log('You cannot edit the name of a saved tag');return this;}else this.taggeeName=_L0;return this;},setTaggeeId:function(_L0){if(this.saved){Util.log('You cannot edit the id of a saved tag');}else this.taggeeId=_L0;return this;},absoluteCenter:function(_L0,_L1){return this.centerPoint.mul(_L0,_L1);},submit:function(_L0){if(!this.taggeeName&&!this.taggeeId){Util.log('No user, email, or string has been tagged yet');return;}else if(this._saved){Util.log('This tag has already been saved to the server.  You cannot '+'save it again');return;}else if(this._pendingAsync){return;}else if(PhotoTag.MAX_TAGS_PER_PHOTO<=PhotoTag.tagsForPhoto(this.photoId,this.photoOwnerId).length){Util.log('Cannot add more than %d tags to any given photo.  (pid: %d, '+'id: %d) is already at the limit.',PhotoTag.MAX_TAGS_PER_PHOTO,this.photoId,this.photoOwnerId);return;}_L0=_L0||bagofholding;var _L1={pid:this.photoId,id:this.photoOwnerId,subject:this.taggeeId,name:this.taggeeName,email:this.taggeeEmail,action:'add',x:this.centerPoint.x*100,y:this.centerPoint.y*100};this._pendingAsync=true;new AsyncRequest().setURI(PhotoTag.SYNCING_ENDPOINT).setData(_L1).setHandler(bind(this,this._submitHandler,_L0)).setErrorHandler(bind(this,this._submitHandler,_L0)).setFinallyHandler(bind(this,function(){this._pendingAsync=false;})).send();},remove:function(_L0,_L1){if(!this.taggeeName&&!this.taggeeId){Util.log('No user or name has been tagged yet');return;}else if(this._pendingAsync){return;}else if(!this._saved){this._removeLocal();return _L0(this,{});}_L0=_L0||bagofholding;var _L2={pid:this.photoId,id:this.photoOwnerId,subject:this.taggeeId,name:this.taggeeName,action:_L1||'remove'};this._pendingAsync=true;new AsyncRequest().setURI(PhotoTag.SYNCING_ENDPOINT).setData(_L2).setHandler(bind(this,this._removeHandler,_L0)).setFinallyHandler(bind(this,function(){this._pendingAsync=false;})).send();return false;},invite:function(_L0){var _L1={pid:this.photoId,id:this.photoOwnerId,subject:this.taggeeId,name:this.taggeeName,email:this.taggeeEmail,x:this.centerPoint.x*100,y:this.centerPoint.y*100};_L0=_L0||bagofholding;var _L2=new AsyncRequest().setURI('/ajax/invite_photo_tag.php').setHandler(_L0).setData(_L1);var _L3=new Dialog().setAsync(_L2).show();return false;},_removeLocal:function(){var _L0=PhotoTag._photoKey(this.photoId,this.photoOwnerId);var _L1=PhotoTag._tagList[_L0]||[];for(var i=0,len=_L1.length;i<len;i++)if(_L1[i]==this){_L1.splice(i,1);break;}},setLocalSave:function(){var _L0=PhotoTag._photoKey(this.photoId,this.photoOwnerId);var _L1=PhotoTag._tagList[_L0]=PhotoTag._tagList[_L0]||[];PhotoTag._tagList[_L0][_L1.length]=this;return this;},setSaved:function(){this._saved=true;return this.setLocalSave();},getText:function(){return this.taggeeName||this.taggeeEmail;},getTaggeeId:function(){return this.taggeeId;},_submitHandler:function(_L0,_L1){var _L2=_L1.getError();var _L3=_L1.getPayload();if(_L2){ErrorDialog.showAsyncError(_L1);if(!_L3['tag_success'])return;}this.setSaved();this.taggeeName=_L3.taggeeName;this.taggeeId=_L3.taggeeId;_L0(this,_L3);},_removeHandler:function(_L0,_L1){this._removeLocal();(_L0||bagofholding)(this,_L1.getPayload());}});
var PhotoPageTags={removeCallback:function(_L0,_L1){var _L2=ge('phototags');if(_L2&&undefined!==_L1.tag_html)_L2.setContent(HTML(_L1.tag_html));PhotoTagController.getInstance('myphoto').hideTag();PhotoPageTags.resetInstructions();},addCallback:function(_L0,_L1){var _L2=ge('phototags');if(_L2&&undefined!==_L1.tag_html)_L2.setContent(HTML(_L1.tag_html));var _L3=htmlize(_L0.getText());var _L4=htmlize(_L1.photoOwnerName);var _L5='';if(_L1.tag_success){_L5='<b>';if(!_L1.tags_need_approval){if(_L1.user==_L0.getTaggeeId()){_L5+=_tx("Tag for yourself saved");}else _L5+=_tx("Tag for {name} saved",{'name':_L3});}else if(_L1.user==_L0.getTaggeeId()){_L5+=_tx("Tag request for yourself sent to {photo-owner} for approval",{'photo-owner':_L4});}else _L5+=_tx("Tag request for {name} sent to {photo-owner} for approval",{'name':_L3,'photo-owner':_L4});_L5+='</b>.<br/>';}else _L5='<b style="color:red">'+_tx("There was an error tagging this photo. Try again later.")+'</b><br />';if(_L1.invite_sent)_L5+='<b style="color: green">'+_tx("An invitation and friend request have been sent to {name}",{name:_L3})+'</b><br/>';if(!_L1.tags_need_approval){_L5+=_tx("You can continue to tag the photo below.");}else _L5+=_tx("You can continue to request tags in the photo below.");_L5+='<br/>'+_tx("When you are done, click the \"Done Tagging\" button to resume browsing.");hide('tagging_instructions_default_message');set_inner_html($('tagging_instructions_status_message'),_L5);PhotoPageTags.focusInstructions();},showTaggingUI:function(){window['photocrop']&&window['photocrop'].destroy();PhotoTagController.getInstance('myphoto').enableTagging(PhotoPageTags.addCallback);show('tagging_instructions');PhotoPageTags.resetInstructions();PhotoPageTags.focusInstructions();},resetInstructions:function(){$('tagging_instructions_status_message').empty();show('tagging_instructions_default_message');},hideTaggingUI:function(){hide('tagging_instructions');PhotoTagController.getInstance('myphoto').disableTagging();},focusInstructions:function(){var _L0=Vector2.getElementPosition($('tagging_instructions'));if(Vector2.getScrollPosition().y>_L0.y)DOMScroll.scrollTo(_L0.sub(0,8));}};

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