/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 9th 2010 12:00:35 PM PST                            */
/*      Machine:  10.16.140.107                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/akx0s95ll4w0cgo0.pkg.js h:6ukla7d3                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/akx0s95ll4w0cgo0.pkg.js                                   */

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

function ProfilePhotosTabController(_L0,id,_L2,_L3,vm){copy_properties(this,{user:_L0,id:id||_L0,viewas:_L2||_L0,view:_L3,vm:vm||'',pagerSections:{}});ProfilePhotosTabController.viewControllers[_L3]=this;}copy_properties(ProfilePhotosTabController,{viewControllers:{},registerPagerSection:function(_L0){if(!ProfilePhotosTabController.viewControllers[_L0.view])return false;ProfilePhotosTabController.viewControllers[_L0.view].registerPagerSection(_L0);},resetPagerSections:function(_L0){if(ProfilePhotosTabController.viewControllers[_L0])ProfilePhotosTabController.viewControllers[_L0].resetPagerSections();},transitionHandler:function(_L0,uri,_L2){if(ProfilePhotosTabController.viewControllers[_L0]&&ProfilePhotosTabController.viewControllers[_L0].transitionHandler(uri,_L2))return true;var _L3=uri.getQueryData();var _L4=_L3.v||_L2;var _L5=ProfilePhotosTabController.viewControllers[_L4];if(_L4!=_L0&&_L5&&_L5.matchesURI(uri))return null;if(_L5)tab_controller.dirtyCachedView(_L4);if(_L3.s>0||_L3.so>0||_L3.sb>0||_L3.vm)return false;return null;}});copy_properties(ProfilePhotosTabController.prototype,{registerPagerSection:function(_L0){this.pagerSections[_L0.start_param]=_L0;},resetPagerSections:function(){this.pagerSections={};},transitionHandler:function(uri,_L1){var _L2=uri.getQueryData();if(((_L2.id||this.user)!=this.id)||((_L2.viewas||this.user)!=this.viewas)||((_L2.v)!=this.view))return false;var _L3=(_L2.vm||'');if(_L3!=this.vm){var _L4={};copy_properties(_L4,_L2);copy_properties(_L4,{action:'vm'});new AsyncRequest().setURI('/ajax/photos.php').setMethod('GET').setReadOnly(true).setData(_L4).setHandler(this._changeViewMode.bind(this,_L3)).setFinallyHandler(function(){PageTransitions.transitionComplete();}).send();return true;}var _L5=this.pagerSections;var _L6=null;for(var _L7 in _L5){var _L8=_L5[_L7];if((_L2[_L7]||0)!=_L8.start){if(_L6!==null)return false;_L6=_L7;}}if(_L6===null)return false;var _L9=_L5[_L6];var _La=_L9.in_transition;var _Lb=_L9.start;var _Lc=parseInt(_L2[_L6]||0,10);if(_La||_Lb==_Lc)return false;pagers={};for(var _L7 in _L5){if(_L7==_L6)continue;var _L8=_L5[_L7];pagers[_L8.name]={count:_L8.count,start:_L2[_L8.start_param]||0,page_size:_L8.page_size,start_param:_L8.start_param};}var _L4={};copy_properties(_L4,_L2);copy_properties(_L4,{action:'page',section:_L9.name,pagers:JSON.encode(pagers),extra_data:JSON.encode(_L9.extra_data)});new AsyncRequest().setURI('/ajax/photos.php').setMethod('GET').setReadOnly(true).setData(_L4).setHandler(this._updateSections.bind(this,_L6,_Lb,_Lc)).setFinallyHandler(function(){PageTransitions.transitionComplete();}).send();return true;},_changeViewMode:function(_L0,_L1){if(this.view!=tab_controller.currentView)return;var _L2=$('tab_canvas').firstChild;var _L3=_L1.getPayload();DOM.setContent(_L2,HTML(_L3.html));this.resetPagerSections();this.vm=_L0;},_updateSections:function(_L0,_L1,_L2,_L3){if(this.view!=tab_controller.currentView)return;var _L4=_L3.getPayload();var _L5=this.pagerSections;var _L6=_L5[_L0];for(var _L7 in this.pagerSections){var _L8=_L5[_L7];var _L9=_L4[_L8.name];if(_L7==_L0)_L8.updateContent(_L1,_L2,_L9.content);_L8.updatePager(HTML(_L9.pager));}},matchesURI:function(uri){var _L1=uri.getQueryData();if((_L1.vm||'')!=this.vm)return false;var _L2=this.pagerSections;for(var _L3 in _L2){var _L4=_L2[_L3];if((_L1[_L3]||0)!=_L4.start)return false;}return true;}});function ProfilePhotosTabPagerSection(_L0,_L1,_L2,_L3,_L4,_L5,_L6,_L7,_L8){copy_properties(this,{view:_L0,name:_L1,start_param:_L2,start:_L3||0,count:_L4,in_transition:false,page_size:_L5,pager:ge(_L6),content_wrapper:ge(_L7),extra_data:_L8||{}});if(!this.pager||!this.content_wrapper)return;ProfilePhotosTabController.registerPagerSection(this);}copy_properties(ProfilePhotosTabPagerSection,{ANIM_DURATION:400,CONTENT_WIDTH:750});copy_properties(ProfilePhotosTabPagerSection.prototype,{updatePager:function(_L0){DOM.setContent(this.pager,_L0);},updateContent:function(_L0,_L1,_L2){if(this.in_transition||this.start==_L1)return;this.in_transition=true;this.start=_L1;var _L3=_L1>_L0;this._unloaded_count=0;this.old_content=this.content_wrapper.firstChild;var _L4=Vector2.getElementDimensions(this.old_content).y;this.content_wrapper.style.height=''+_L4+'px';this.old_content.style.position='absolute';this.old_content.style.left='0px';this.old_content.style.top='0px';var _L5=HTML(_L2).getRootNode();var _L6=(ProfilePhotosTabPagerSection.CONTENT_WIDTH*(_L3?1:-1));_L5.style.top='0px';_L5.style.left=_L6+'px';_L5.style.position='absolute';this.new_content=_L5;this.content_wrapper.appendChild(_L5);var _L7=Vector2.getElementDimensions(_L5).y;setTimeout(bind(this,this._transition,_L5),5000);var _L8=DOM.scry(_L5,'img');var _L9=0;for(var i=0;i<_L8.length;i++)if(!_L8[i].fb_loaded){_L8[i].onload=bind(this,this._image_monitor,_L8.length);_L9++;}this._unloaded_count=_L9;this._try_transition(_L8.length);},_image_monitor:function(_L0){this._unloaded_count--;this._try_transition(_L0);},_try_transition:function(_L0){if(this._unloaded_count<(_L0/5)||this._unloaded_count<2){this._transition();this._fix_height();}},_transition:function(){if(!this.in_transition)return;animation(this.new_content).to('left',0).duration(ProfilePhotosTabPagerSection.ANIM_DURATION).ease(animation.ease.both).go();animation(this.old_content).to('left',0-parseInt(this.new_content.style.left)).duration(ProfilePhotosTabPagerSection.ANIM_DURATION).ondone(bind(this,this._finish)).ease(animation.ease.both).go();},_fix_height:function(){var _L0=Vector2.getElementDimensions(this.new_content).y;var _L1=Vector2.getElementDimensions(this.old_content).y;if(Math.abs(_L0-_L1)<=10){this.content_wrapper.style.height=_L0+'px';}else animation(this.content_wrapper).to('height',_L0).duration(ProfilePhotosTabPagerSection.ANIM_DURATION/2).go();},_finish:function(){this.content_wrapper.removeChild(this.old_content);this.in_transition=false;}});
function select_album(ele){var _L1=$('selected_album');if(_L1.value&&ge(_L1.value))CSS.removeClass($(_L1.value),'selected_album');CSS.addClass(ele,'selected_album');_L1.value=ele.id;}

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