// File: b_p_cookie_1128.js

PCookie=function(){this.no_cookie=false;this.read=false;this.res=new Array()};PCookie.prototype.is_set=function(F,C){if(this.no_cookie){return }if(!this.read){if(!this._parse()){this.no_cookie=true;return }}if(!this.res[F]){this.res[F]=new Array();var I=F+":";var H=I.length;for(var G=0,E=this.s.length;G<E;G++){if(this.s[G].substring(0,H)==I){var A=this.s[G].split(":");g_trace.log("found username = "+I+" .. and username="+A[0]);A.shift();for(var D=0,B=A.length;D<B;D++){g_trace.log("pushing "+D+" "+A[D]);this.res[F][A[D]]=1}break}}}g_trace.log(this.res[F][C]);return this.res[F][C]};PCookie.prototype._parse=function(){var C=new Cookie("pc");var B=C.get();g_trace.log("cookie value is "+B);if(B==null){return false}var A=B.split("*");if(A.shift().length!=18){return false}this.s=A;return true};


// File: b_popup_969.js

Popup=function(){this._blank_e=null};Popup.prototype.confirm=function(B){this._show_blank();var A=confirm(B);this._hide_blank();return A};Popup.prototype.alert=function(B){this._show_blank();var A=alert(B);this._hide_blank();return A};Popup.prototype._show_blank=function(){if(document.getElementById("popup_blank")==null){var A=document.createElement("div");document.body.appendChild(A,0);A.id="popup_blank"}this._blank_e=document.getElementById("popup_blank");this._blank_e.style.display="block"};Popup.prototype._hide_blank=function(){var A=document.getElementById("popup_blank");A.style.display="none"};Popup.prototype.blank_resize=function(){var A;var B;if(document.all){A=document.body.offsetWidth;B=document.body.offsetHeight}else{if(document.getElementById||document.layers){A=window.innerWidth;B=window.innerHeight}}this._blank_e.style.width=A;this._blank_e.style.height=B};Popup.prototype.create=function(H,E,F,A,I){g_utils.preload_drag_cursors();this.mouse_x=null;this.mouse_y=null;this.width=400;this.height=250;this.pos_x=100;this.pos_y=100;if(F){this.hide_flag=true}else{this.hide_flag=false}if(A){this.close_callback=A;this.close_callback_scope=I}var D=H.replace(/\n/g,"<br />");var G=this.width;var B=this.height;var C="";C+='<div id="popup_w" class="shw" style="width: '+(G+12)+"px; left: "+this.pos_x+"px; top: "+this.pos_y+'px;">';C+=' <div id="poptl" class="shtl" style="width: '+G+'px;"><div></div></div>';C+=' <div class="shtr"><div></div></div>';C+=' <div id="popl" class="shl" style="height: '+B+'px;"><div></div></div>';C+=' <div id="popup_c1" class="shc" style="width: '+(G-2)+'px;">';C+='  <div id="popup_left_margin" class="to_move" style="height: '+(B-2)+'px;"><div></div></div>';C+='  <div id="popup_c2" style="float: left; width: '+(G-12)+'px;">';C+='   <div id="popup_hdr">';C+='    <div id="popup_title" class="to_move" style="width: '+(G-70)+'px;">'+E+"</div>";C+='    <div id="popup_close"><a href="#">close</a></div>';C+='    <div style="clear: both"><div></div></div>';C+="   </div>";C+='   <div id="popup_content_w" + style="height: '+(B-56)+'px;">';C+='    <div id="popup_content">'+D+"</div>";C+="   </div>";C+='   <div id="popup_footer">';C+='    <div id="popup_resize"><div></div></div>';C+='    <div id="popup_more">- more -</div>';C+='    <div style="visibility: hidden;"><div>&nbsp;</div></div>';C+="   </div>";C+="  </div>";C+=" </div>";C+=' <div id="popr" class="shr" style="height: '+B+'px;"><div></div></div>';C+=' <div id="popbl" class="shbl" style="width: '+G+'px;"><div></div></div>';C+=' <div id="popbr" class="shbr"><div></div></div>';C+="</div>";this.div_popup=this._attach_div(C);this._show_hide_more();g_events.add("popup_close","onclick",this._close_clicked,this);g_events.add("popup_left_margin","onmousedown",this._move_ondown,this,"popup_left_margin");g_events.add("popup_title","onmousedown",this._move_ondown,this,"popup_title");g_events.add("popup_resize","onmousedown",this._resize_ondown,this)};Popup.prototype.show=function(){document.getElementById("popup_w").style.display="block"};Popup.prototype._show_hide_more=function(){var A=parseInt(document.getElementById("popup_content").offsetHeight);var B=parseInt(document.getElementById("popup_content_w").offsetHeight);if(B<A){document.getElementById("popup_more").style.visibility="visible"}else{document.getElementById("popup_more").style.visibility="hidden"}};Popup.prototype.close=function(){g_events.remove("popup_close","onclick",this._close_clicked);g_events.remove("popup_left_margin","onmousedown",this._move_ondown);g_events.remove("popup_title","onmousedown",this._move_ondown);g_events.remove("popup_resize","onmousedown",this._resize_ondown);this._remove_div(this.div_popup)};Popup.prototype._attach_div=function(B){var A=document.createElement("div");document.body.appendChild(A,0);A.innerHTML=B;return A};Popup.prototype._remove_div=function(A){A.parentNode.removeChild(A)};Popup.prototype._close_clicked=function(A){if(this.hide_flag){document.getElementById("popup_w").style.display="none"}else{this.close()}if(this.close_callback){this.close_callback.apply(this.close_callback_scope,[])}return false};Popup.prototype._move_ondown=function(C,B){var A=g_utils.gimme_mouse_x_y(C);g_trace.log(A);this.mouse_x=A[0];this.mouse_y=A[1];g_utils.cursor_dragging(B);g_events.add("document","onmousemove",this._move_move,this,B);g_events.add("document","onmouseup",this._move_release,this,B);g_trace.log("popup move clicked");return false};Popup.prototype._move_release=function(B,A){g_utils.cursor_to_drag(A);g_events.remove("document","onmousemove",this._move_move,this);g_events.remove("document","onmouseup",this._move_release,this);return false};Popup.prototype._move_move=function(B){var A=g_utils.gimme_mouse_x_y(B);var H=A[0];var G=A[1];if(H<0){H=0}if(G<0){G=0}var F=H-this.mouse_x;var C=G-this.mouse_y;this.mouse_x=H;this.mouse_y=G;var E=(this.pos_x+=F);var D=(this.pos_y+=C);document.getElementById("popup_w").style.left=(this.pos_x);document.getElementById("popup_w").style.top=(this.pos_y);return false};Popup.prototype._resize_ondown=function(B){var A=g_utils.gimme_mouse_x_y(B);g_trace.log(A);this.mouse_x=A[0];this.mouse_y=A[1];g_events.add("document","onmousemove",this._resize_move,this);g_events.add("document","onmouseup",this._resize_release,this);g_trace.log("popup resize clicked");return false};Popup.prototype._resize_release=function(A){this.width=this.new_width;this.height=this.new_height;g_events.remove("document","onmousemove",this._resize_move,this);g_events.remove("document","onmouseup",this._resize_release,this);return false};Popup.prototype._resize_move=function(E){var B=g_utils.gimme_mouse_x_y(E);var G=B[0]-this.mouse_x;var F=B[1]-this.mouse_y;var A=this.width+G;var C=this.height+F;if(A<120){A=120}if(C<60){C=60}this.new_width=A;this.new_height=C;document.getElementById("popup_w").style.width=(A+12)+"px";document.getElementById("poptl").style.width=A+"px";document.getElementById("popbl").style.width=A+"px";document.getElementById("popup_c1").style.width=(A-2)+"px";document.getElementById("popup_c2").style.width=(A-12)+"px";document.getElementById("popup_title").style.width=(A-70)+"px";document.getElementById("popup_content_w").style.height=(C-56)+"px";var D=parseInt(document.getElementById("popup_c2").offsetHeight);document.getElementById("popup_left_margin").style.height=D+"px";document.getElementById("popl").style.height=(D+2)+"px";document.getElementById("popr").style.height=(D+2)+"px";this._show_hide_more();return false};


// File: b_tools_1543.js

Tools=function(){this.enabled=false;this.open=1;this.col=false;this.cookie=new Cookie("tc");this.width=159;this.tab_width=14;this.rendered=false};Tools.prototype.init=function(A,B){this.enabled=A;this.col=B;this.open=1;if(A&&B){this._get_open_state()}if(A&&this.open){ji.enable_tools();this.div_left=0;this.tab_div_left=this.tab_width}else{ji.disable_tools();this.div_left=-1*this.width;this.tab_div_left=this.tab_width}};Tools.prototype.enable=function(A){this.init(true,A);var B=document.getElementById("tools_w");B.innerHTML="";B.style.display="block";if(this.open){ji.enable_tools()}else{ji.disable_tools()}};Tools.prototype.disable=function(){this.cleanup();this.init(false,false);var A=document.getElementById("tools_w");this.tools_enabled=false;A.style.display="none";A.innerHTML="";ji.disable_tools()};Tools.prototype.cleanup=function(){if(this.enabled&&this.col){g_events.remove("tools_options","onmouseover",this._options_over);g_events.remove("tools_options","onmouseout",this._options_out);g_events.remove("tools_options","onclick",this._open);g_events.remove("tools_close","onclick",this._close)}};Tools.prototype._set_events=function(){if(this.col){g_events.add("tools_options","onmouseover",this._options_over,this);g_events.add("tools_options","onmouseout",this._options_out,this);g_events.add("tools_options","onclick",this._open,this);g_events.add("tools_close","onclick",this._close,this);this.tab_div=document.getElementById("tools_options")}this.div=document.getElementById("tools")};Tools.prototype.write=function(A){var B=this._output_contents(A);document.write(B);this.rendered=true;this._set_events()};Tools.prototype.update=function(A){var B=this._output_contents(A);document.getElementById("tools_w").innerHTML=B;this._set_events()};Tools.prototype._output_contents=function(C){if(this.open){if(this.col){var A=""}else{var A='style="display: none;"'}var B='style="left: '+(this.tab_div_left)+';"'}else{var A='style="display: none;"';var B=""}var D="";D+='<div id="tools" style="left: '+this.div_left+'px;">';D+='<div id="tools_close" '+A+'><a href="#"><img src="/i/s.gif" /></a></div>';D+='<div id="options_tab"><div><a href="#"><img id="tools_options" '+B+' src="/i/s.gif" /></a></div></div>';D+=C;D+="</div>";return D};Tools.prototype._get_open_state=function(){var A=this.cookie.get();if(A===null||(A!="00"&&A!="01"&&A!="10"&&A!="11")){A="11";this.cookie.set(A)}if(ji.is_owner()){this.open=parseInt(A.charAt(0))}else{this.open=parseInt(A.charAt(1))}};Tools.prototype._set_open_state=function(B){var C=this.cookie.get();var A;if(ji.is_owner()){A=B+""+C.charAt(1)}else{A=C.charAt(0)+""+B}this.cookie.set(A)};Tools.prototype._options_over=function(){this.tab_div.style.backgroundPosition="-14px 0px"};Tools.prototype._options_out=function(){this.tab_div.style.backgroundPosition="0px 0px"};Tools.prototype._open=function(){this.tab_div.style.backgroundPosition="0px 0px";var A=this;this.pos=parseInt(this.div.style.left);this.to_move=0-this.pos;this.final_pos=0;this.step=0;this.div.style.left=(this.pos-3)+"px";this.interval=setInterval(function(){A._scroll(A.div,3,A._handle_tab)},10);this._set_open_state(1);ji.enable_tools();g_events.trigger_resize();return false};Tools.prototype._close=function(){var A=this;this.pos=parseInt(this.div.style.left);this.to_move=this.width*-1;this.final_pos=this.to_move;this.step=0;this.interval=setInterval(function(){A._scroll(A.div,3,A._handle_tab)},10);this._set_open_state(0);setTimeout(function(){ji.disable_tools();g_events.trigger_resize()},140);return false};Tools.prototype._scroll=function(A,C,D){if(this.step==0){this.step=1;return }if(this.to_move<0){this.step=Math.ceil(this.to_move/C)}else{this.step=Math.floor(this.to_move/C)}this.to_move-=this.step;if(this.step==0){clearInterval(this.interval);A.style.left=this.final_pos+"px";if(D){var B=this;setTimeout(function(){D.call(B,[])},150)}return }this.pos+=this.step;A.style.left=this.pos+"px"};Tools.prototype._handle_tab=function(){if(this.open){this.open=0;this.pos=(this.tab_width)*-1;this.to_move=this.tab_width;this.final_pos=0;var B=this._handle_close_button;this.div_left=-1*this.width;this.tab_div_left=this.tab_width}else{this.open=1;this.pos=0;this.to_move=(this.tab_width)*-1;this.final_pos=this.to_move;var B=this._handle_close_button;this.div_left=0;this.tab_div_left=this.tab_width}var A=this;this.step=0;this.interval=setInterval(function(){A._scroll(A.tab_div,3,B)},30)};Tools.prototype._handle_close_button=function(){if(this.open){document.getElementById("tools_close").style.display="block"}else{document.getElementById("tools_close").style.display="none"}};


// File: b_mode_album_1543.js

var g_ModeAlbum_obj=null;ModeAlbum=function(B,A){if(B){Mode.apply(this,[B,A]);this.index=0;this.action="";this.last_albums_per_page=0;this.albums_per_page=0;this.current_page=1;this.num_pages=0;this.act_rows=0;this.max_rows=0;this.layout_timer=null;this.popup=null;this.desc_popup_needed=false;this.desc_popup_open=false;this.p_cookie=new PCookie()}};ModeAlbum.prototype=new Mode();ModeAlbum.prototype.are_tools_enabled=function(){if(ji.is_owner()){return 2}else{return false}};ModeAlbum.prototype.can_you_handle_empty=function(A){return true};ModeAlbum.prototype.init=function(B,A){g_trace.log("ModeAlbum init - "+A+"*"+B);this.index=A;this.action=B;g_ModeAlbum_obj=this};ModeAlbum.prototype.load=function(){g_events.add("document","onboardresize",this._adjust,this)};ModeAlbum.prototype.cleanup=function(){g_events.remove("document","onboardresize",this._adjust);if(this.popup!=null){this.popup.close()}};ModeAlbum.prototype.change_page=function(C,B){g_trace.log("history change with "+B);var A=Math.floor(B/this.albums_per_page)+1;var D=this.index;this.index=B;if(A!=this.current_page){g_trace.log("layout new albums");this.layout_new_albums();g_events.trigger_resize()}this._set_hash_in_tools(ji.gimme_subalbum_url_name(B))};ModeAlbum.prototype.output_tools=function(){var C="";var A=ji.gimme_subalbum_url_name(this.index);var D=ji.gimme_album_path();var B=ji.gimme_subalbum_count();C+="<h1>Tools</h1>";C+="<ul>";C+=' <li><a href="/create_album.html?p='+D+'">Create album</a></li>';if(D!=""){C+=' <li><a href="/edit_album.html?p='+D+'">Edit album settings</a></li>'}C+=' <li><a class="hashable" onclick="return g_ModeAlbum_click(this);" href="#'+this.hash_var+"="+A+'*x">Add photos</a></li>';C+='<div class="bottom_spacer"><div></div></div>';if(B>1){C+=' <li><a class="hashable" onclick="return g_ModeAlbum_click(this);" href="#'+this.hash_var+"="+A+'*a">Arrange albums</a></li>'}C+=' <li><a class="hashable" onclick="return g_ModeAlbum_click(this);" href="#'+this.hash_var+"="+A+'*d">Delete albums</a></li>';C+=' <li><a class="hashable" onclick="return g_ModeAlbum_click(this);" href="#'+this.hash_var+"="+A+'*m">Move albums</a></li>';C+=' <div class="spacer"><div></div></div>';C+=' <li><a class="hashable" onclick="return g_ModeAlbum_click(this);" href="#'+this.hash_var+"="+A+'*r">Share this album</a></li>';C+="</ul>";C+='<div class="bottom_spacer"><div></div></div>';return C};ModeAlbum.prototype.output_board=function(){var A="";this._calc_layout();if(ji.gimme_subalbum_count()==0){A+='<div id="board_header">';A+=this._output_board_header();A+='<div style="clear: both;"></div>';A+="</div>";A+="<div><div></div></div>";A+='<div id="empty_board">This album is empty.</div><div style="clear: both;"><div></div></div>';return A}this.current_page=Math.floor(this.index/this.albums_per_page)+1;this.last_albums_per_page=this.albums_per_page;A+='<div id="board_header">';A+=this._output_board_header();A+="</div>";A+='<div style="clear: both;"><div></div></div>';A+='<div id="album_set">';A+=this._output_albums();A+="</div>";return A};ModeAlbum.prototype._output_board_header=function(){var B="";var A=this._output_header();if((ji.gimme_album_desc()=="")&&this.num_pages==1&&A==""){B+='<div id="empty_board_title"><div></div></div>'}else{B+=' <div id="board_title_c">';B+=A;B+='  <div id="page_numbers">';B+=this._output_page_numbers();B+="  </div>";B+='  <div style="clear:both;"><div></div></div>';B+=" </div>"}return B};ModeAlbum.prototype._output_header=function(){var B=ji.gimme_album_desc();var C;if(B==""){if(ji.gimme_album_path()==""){C=ji.gimme_album_username()+"'s home"}else{C=ji.gimme_album_name()}}else{if(!this.desc_popup_open){var A=B.length;if(A>50){this.desc_popup_needed=true;C=B.substr(0,40)}else{this.desc_popup_needed=false;C=B}if(this.desc_popup_needed){C+='...&nbsp;&nbsp;<a id="preview_desc_expand" href="#" onclick="return g_ModeAlbum_open_desc();">(more)</a>'}}}return'<div id="preview_desc">'+C+"</div>"};g_ModeAlbum_open_desc=function(){g_ModeAlbum_obj._more_desc_clicked();return false};ModeAlbum.prototype._more_desc_clicked=function(){document.getElementById("preview_desc").style.visibility="hidden";this.desc_popup_open=true;if(this.popup!=null){this.popup.show()}else{this.popup=new Popup();this.popup.create(ji.gimme_album_desc(),ji.gimme_album_name(),1,this._desc_popup_closed,this)}return false};ModeAlbum.prototype._desc_popup_closed=function(){this.desc_popup_open=false;document.getElementById("board_header").innerHTML=this._output_board_header()};ModeAlbum.prototype._output_page_numbers=function(){var G="&nbsp;";var F=this.current_page-1;var E=this.num_pages-1;var D=3;var B;if(E<=0){return G}if(F>0){B=(F-1)*this.albums_per_page;G+='<a href="#'+this.hash_var+"="+ji.gimme_subalbum_url_name(B)+'" onclick="return g_ModeAlbum_clicked('+B+');">&lt; prev&nbsp;&nbsp;</a>'}var H=F-D;var A=F+D;if(H<0){H=0}if(A>E){A=E}g_trace.log("start is "+H+"  end is "+A);B=H*this.albums_per_page;if(F==H){G+='<span class="current_page">&nbsp;'+(H+1)+"&nbsp;</span>"}else{G+='<a href="#'+this.hash_var+"="+ji.gimme_subalbum_url_name(B)+'" onclick="return g_ModeAlbum_clicked('+B+');">&nbsp;'+(H+1)+"&nbsp;</a>"}for(var C=(H+1);C<=A;C++){B=C*this.albums_per_page;if(C==F){G+=' &nbsp; | &nbsp; <span class="current_page">&nbsp;'+(C+1)+"&nbsp;</span>"}else{G+=' &nbsp; | &nbsp; <a href="#'+this.hash_var+"="+ji.gimme_subalbum_url_name(B)+'" onclick="return g_ModeAlbum_clicked('+B+');">&nbsp;'+(C+1)+"&nbsp;</a>"}}if(F<E){B=(F+1)*this.albums_per_page;G+='<a href="#'+this.hash_var+"="+ji.gimme_subalbum_url_name(B)+'" onclick="return g_ModeAlbum_clicked('+B+');">&nbsp;&nbsp;next &gt;</a>'}else{G+='<a style="visibility:hidden" href="#'+ji.gimme_subalbum_url_name(0)+'" onclick="return g_ModeAlbum_clicked('+0+');">&nbsp;&nbsp;next &gt;</a>'}return G};ModeAlbum.prototype._output_albums=function(){var D="";var C=ji.gimme_subalbum_count();var E=this.albums_per_page*(this.current_page-1);var A=E+this.albums_per_page;if(A>C){A=C}if(this.num_pages>1){var B=this.max_rows*si.album_total_height()}else{var B=this.act_rows*si.album_total_height()}g_trace.log("min height = "+B);D+='<div class="min_height_bar" style="height: '+(B)+'px;"><div></div></div>';D+=this._output_just_albums(E,A);return D};ModeAlbum.prototype._output_just_albums=function(B,D){var K="/"+ji.gimme_user_album_path()+"/";var M=ji.files_base_url()+"/";var I=ji.gimme_album_path()+"/";var C=ji.is_owner();var J="";var H,G,A;var F=ji.gimme_album_username();var L;for(var E=B;E<D;E++){J+='<div class="album">';H=ji.gimme_subalbum_num_subalbums(E);A=K+ji.gimme_subalbum_url_name(E);L=ji.is_subalbum_locked(E);if(!C&&L){if(!this.p_cookie.is_set(F,ji.gimme_subalbum_pwd_id(E))){J+='<div class="album_lock"><a href="'+A+'"><img src="/i/s.gif" /></a></div>';J+="<h1>"+ji.gimme_subalbum_name(E)+"</h1>"}else{J+='<div class="album_img"><a href="'+A+'"><img src="/i/s.gif" style="background: url(\'/api.html?path='+A+"&v="+ji.gimme_subalbum_teaser_ver(E)+"') 0px -6px;\" /></a></div>";J+="<h1>"+ji.gimme_subalbum_name(E)+"</h1>";J+='<div class="unlock"><div></div></div>'}}else{if(H>0){J+='<div class="album_subalbums"><a href="'+A+'"><img src="/i/s.gif" /></a></div>';if(H==1){G="album"}else{G="albums"}}else{H=ji.gimme_subalbum_num_files(E);if(H==0){J+='<div class="album_empty"><a href="'+A+'"><img src="/i/s.gif" /></a></div>'}else{J+='<div class="album_img"><a href="'+A+'"><img src="/i/s.gif" style="background: url(\''+M+ji.gimme_subalbum_teaser_fid_path(E)+"_sq.jpg?v="+ji.gimme_subalbum_teaser_ver(E)+"') 0px -6px;\" /></a></div>"}if(H==1){G="photo"}else{G="photos"}}J+="<h1>"+ji.gimme_subalbum_name(E)+"</h1>";if(C){J+="<p>("+H+") ";switch(ji.gimme_subalbum_privacy(E)){case"p":J+='<span class="public">public</span>';break;case"v":J+='<span class="private">private</span>';break;case"h":J+='<span class="hidden">hidden</span>';break;default:g_trace.log("ERROR - invalid subalbum privacy of "+ji.gimme_subalbum_privacy(E))}if(L){J+='<div class="lock"><div></div></div>'}}else{J+="<p>"+H+" "+G}}J+="</p></div>"}return J};ModeAlbum.prototype._adjust=function(){this._calc_layout();if(this.layout_timer!=null){clearInterval(this.layout_timer);this.layout_timer=null}if(this.last_albums_per_page!=this.albums_per_page){var A=this;this.layout_timer=setInterval(function(){clearInterval(A.layout_timer);A.layout_new_albums();g_events.trigger_resize()},500)}};ModeAlbum.prototype._calc_layout=function(){var D=g_board.gimme_good_board_height();var G=si.album_total_height();this.max_rows=Math.floor(D/G);var C=ji.gimme_subalbum_count();if(C==0){return }var F=g_board.gimme_board_width()-1;var B=si.album_board_padding_left()+si.album_board_padding_right();var A=si.album_total_width();var E=Math.floor((F-B)/A);this.act_rows=Math.ceil(C/E);this.albums_per_page=E*this.max_rows;this.num_pages=Math.ceil(C/this.albums_per_page)};ModeAlbum.prototype.layout_new_albums=function(){this.last_albums_per_page=this.albums_per_page;this.current_page=Math.floor(this.index/this.albums_per_page)+1;document.getElementById("album_set").innerHTML=this._output_albums();document.getElementById("board_header").innerHTML=this._output_board_header()};g_ModeAlbum_click=function(A){return g_ModeAlbum_obj._click(A)};ModeAlbum.prototype._click=function(C){var B=C.href;var D=B.indexOf("#"+this.scene_obj.hash_var+"=");var A=B.substr(D+3);this.scene_obj.navigate_hash(A);return false};g_ModeAlbum_clicked=function(A){return g_ModeAlbum_obj.clicked(A)};ModeAlbum.prototype.clicked=function(A){this.scene_obj.navigate(A);return false};


// File: b_mode_choose_a_1543.js

var g_ModeChooseA_obj;ModeChooseA=function(B,A){if(B){Mode.apply(this,[B,A]);this.scene_obj=B;this.hash_var=A;this.index=null;this.action=null;this.r_data=null;this.mode_obj=null;this.exclude_list=null;this.base_album=null;this.waiting=false;this.connect_o=null}};ModeChooseA.prototype=new Mode();ModeChooseA.prototype.are_tools_enabled=function(){return true};ModeChooseA.prototype.can_you_handle_empty=function(){return true};ModeChooseA.prototype.change_page=function(B,A){};ModeChooseA.prototype.static_generate_related_data=function(G,C,F,E,D,H,A){var B=new Object();B.param=G;B.mode_name=C;B.choose_type=F;B.exclude_base_flag=E;B.highlight_base_flag=D;B.exclude_list=H;B.highlight_list_flag=A;return B};ModeChooseA.prototype.init=function(action,index,r_data){if(r_data==null){return 1}g_ModeChooseA_obj=this;this.index=index;this.action=action;this.r_data=r_data;eval("this.mode_obj = new "+this.r_data.mode_name+"(this.scene_obj, this.hash_var)")};ModeChooseA.prototype.load=function(){this._generate_albums();this._call("achoose_load")};ModeChooseA.prototype.cleanup=function(){if(this.waiting){this.waiting=false;YAHOO.util.Connect.abort(this.connect_o)}this._call.achoose_cleanup};ModeChooseA.prototype.output_board=function(){var A="";A+='<div id="board_header">';A+=' <div id="board_title_c">';A+=this._call("achoose_output_header");A+='  <div style="clear: both;"></div>';A+=" </div>";A+="</div>";A+='<div class="tiny_album_min_height"><div></div></div>';A+='<div id="tiny_album_div">';A+='<div id="empty_board">Loading ...</div><div style="clear: both;"><div></div></div>';A+="</div>";return A};ModeChooseA.prototype.output_tools=function(){return this._call("achoose_output_tools")};ModeChooseA.prototype.output_centered_msg=function(A){return'<div id="empty_board">'+A+'</em></div><div style="clear: both;"><div></div></div>'};ModeChooseA.prototype._call=function(A,B){if(A){return this.mode_obj[A].apply(this.mode_obj,[this.r_data.param,B])}};ModeChooseA.prototype._generate_albums=function(){var A={success:this.success_resp,failure:this.failure_resp,scope:this};this.connect_o=YAHOO.util.Connect.asyncRequest("GET","/gimme_albums.json?p=",A);this.waiting=true};ModeChooseA.prototype.success_resp=function(o){if(!this.waiting){return }this.waiting=false;g_trace.log("o.responseText = "+o.responseText);if(o.responseText.substr(0,1)!="{"){g_trace.log("ERROR - bad json msg received");document.getElementById("tiny_album_div").innerHTML=this.output_centered_msg("<em>Bad message received.  Try again later.</em>");return }eval("var resp="+o.responseText);if(resp.status==0){this.base_album=ji.gimme_album_path();var str=this.output_subalbum(resp.subf,1,"",false);str+='<div style="clear: both;"><div></div></div>';document.getElementById("tiny_album_div").innerHTML=str;g_events.trigger_resize()}else{this._handle_bad_json_resp(resp);document.getElementById("tiny_album_div").innerHTML=this.output_centered_msg("<em>Albums did not load.</em>")}};ModeChooseA.prototype.failure_resp=function(A){this.waiting=false;document.getElementById("tiny_album_div").innerHTML=this.output_centered_msg("<em>Error loading albums ("+A.statusText+").  Try again later</em>")};ModeChooseA.prototype.output_subalbum=function(A,B,P,R){var L="";var O,N,I,E,K,G,M,F;var C=this.r_data.choose_type;var H=this.r_data.exclude_list;var J=this.r_data.exclude_base_flag;if(P!=""){P+="/"}if(H){G=H.length}for(O=0,N=A.length;O<N;O++){M="f_"+A[O].priv.substr(0,1);if(A[O].numf>0){M+="_photo"}if(A[O].priv.length==4){M+="_lock"}f_path=P+A[O].urln;E=false;var D=false;var Q=false;if(R){E=true;Q=true;if(this.r_data.highlight_list_flag){D=true}}else{if(H!=null){for(K=0;K<G;K++){if(H[K]==f_path){E=true;Q=true;if(this.r_data.highlight_list_flag){D=true}}}}if(!E&&((C==1&&A[O].nums>0)||(C==2&&A[O].numf>0))){E=true}}if(J&&f_path==this.base_album){E=true;if(this.r_data.highlight_base_flag){D=true}}if(E){M+=" f_icon_fade"}if(D){F="tiny_album_line tiny_album_line_highlight"}else{F="tiny_album_line"}L+='<div class="'+F+'" style="margin-left: '+(B*20)+'px;"><div class="f_icon '+M+'"><div></div></div><div class="tiny_album_anchor">';if(!E){L+='<a href="#" onclick="return g_ModeChooseA_click(\''+P+A[O].urln+"');\" >"}if(A[O].nums==0){L+=A[O].name+'&nbsp; <span class="num_photos"> ('+A[O].numf+" photos)</span>"}else{L+=A[O].name}if(!E){L+="</a>"}L+="</div></div>";if(A[O].subf){L+=this.output_subalbum(A[O].subf,B+1,P+A[O].urln,Q)}}return L};g_ModeChooseA_click=function(A){g_ModeChooseA_obj._click(A);return false};ModeChooseA.prototype._click=function(A){return this._call("achoose_done",A)};


// File: b_mode_a_select_1543.js

ModeASelect=function(B,A){if(B){ModeAlbum.apply(this,[B,A]);this.sel_class=null;this.not_sel_class=null;this.no_done_button=false}};ModeASelect.prototype=new ModeAlbum();ModeASelect.prototype.init=function(D,A){ModeAlbum.prototype.init.apply(this,[D,A]);this.select_count=0;this.last_click_state=null;this.initial_index=A;this.select_list=new Array();var C=ji.gimme_subalbum_count();for(var B=0;B<C;B++){this.select_list[B]=false}};ModeASelect.prototype.are_tools_enabled=function(){return true};ModeASelect.prototype.can_you_handle_empty=function(A){return false};ModeASelect.prototype.load=function(){ModeAlbum.prototype.load.apply(this,[]);if(!this.no_done_button){g_events.add("tools_done","onclick",this._done_clicked,this)}g_events.add("tools_cancel","onclick",this._cancel_clicked,this)};ModeASelect.prototype.cleanup=function(){ModeAlbum.prototype.cleanup.apply(this,[]);if(!this.no_done_button){g_events.remove("tools_done","onclick",this._done_clicked)}g_events.remove("tools_cancel","onclick",this._cancel_clicked)};ModeASelect.prototype._done_clicked=function(){};ModeASelect.prototype._cancel_clicked=function(){this.scene_obj.navigate(this.initial_index);return false};ModeASelect.prototype.output_tools=function(){var A="";A+='<div class="tools_buttons"><a id="tools_done" href="#"><img src="/i/s.gif" /></a><a id="tools_cancel" href="#"><img src="/i/s.gif" /></a></div>';return A};ModeASelect.prototype._output_header=function(){var A="";A+='<div class="board_title">Select album</div>';return A};ModeASelect.prototype._output_just_thumbs=function(D,A){var C="";for(var B=D;B<A;B++){if(this.select_list[B]){C+='<div id="sqc'+B+'" class="sqc"><div onclick="return g_ModeASelect_thumb_selected(event, '+B+');" class="'+this.sel_class+'" style="background: url(\''+ji.gimme_image_url(B,"sq")+"');\" /><div></div></div></div>"}else{C+='<div id="sqc'+B+'" class="sqc"><div onclick="return g_ModeASelect_thumb_selected(event, '+B+');" class="'+this.no_sel_class+'" style="background: url(\''+ji.gimme_image_url(B,"sq")+"');\" /><div></div></div></div>"}}return C};ModeASelect.prototype._output_just_albums=function(H,C){var B="/"+ji.gimme_user_album_path()+"/";var F=ji.files_base_url()+"/";var D;var G="";var A="";for(var E=H;E<C;E++){G+='<div id="album'+E+'" class="album">';if(this.select_list[E]){A=this.sel_class}else{A=this.not_sel_class}D=ji.gimme_subalbum_num_subalbums(E);if(D>0){G+='<div class="album_subalbums '+A+'" onclick="return g_ModeASelect_album_selected(event, '+E+');"><div><div></div></div></div><div style="clear:both;"><div></div></div>'}else{D=ji.gimme_subalbum_num_files(E);if(D==0){G+='<div class="album_empty '+A+'" onclick="return g_ModeASelect_album_selected(event, '+E+');"><div><div></div></div></div><div style="clear:both;"><div></div></div>'}else{G+='<div class="album_img '+A+'" onclick="return g_ModeASelect_album_selected(event, '+E+');"><div style="background: url(\''+F+ji.gimme_subalbum_teaser_fid_path(E)+"_sq.jpg?v="+ji.gimme_subalbum_teaser_ver(E)+'\') 0px -6px;"><div></div></div></div><div style="clear:both;"><div></div></div>'}}G+="<h1>"+ji.gimme_subalbum_name(E)+"</h1>";G+="<p>("+D+") ";switch(ji.gimme_subalbum_privacy(E)){case"p":G+='<span class="public">public</span>';break;case"v":G+='<span class="private">private</span>';break;case"h":G+='<span class="hidden">hidden</span>';break;default:g_trace.log("ERROR - invalid subalbum privacy of "+ji.gimme_subalbum_privacy(E))}if(ji.is_subalbum_locked(E)){G+='<div class="lock"><div></div></div>'}G+="</p></div>"}return G};ModeASelect.prototype.clicked=function(A){this.scene_obj.navigate_with_no_history(A,this.action);this.last_click_state=null;return false};g_ModeASelect_album_selected=function(B,A){return g_ModeAlbum_obj._album_selected(B,A)};ModeASelect.prototype._album_selected=function(D,A){if(D&&D.shiftKey&&(this.last_click_state!=null)&&(this.index!=A)){var C,E,B;if(A>this.index){E=this.index;B=A}else{E=A;B=this.index}for(C=E;C<=B;C++){this._change_selection(C,this.last_click_state)}}else{this.last_click_state=!this.select_list[A];this._change_selection(A,this.last_click_state)}this.index=A;this._calc_layout();return false};ModeASelect.prototype._change_selection=function(A,C){var D=document.getElementById("album"+A);var B;if(ji.gimme_subalbum_num_subalbums(A)>0){baseclass="album_subalbums "}else{if(ji.gimme_subalbum_num_files(A)>0){baseclass="album_img "}else{baseclass="album_empty "}}if(C){this.select_list[A]=true;D.firstChild.className=baseclass+this.sel_class;this.select_count++;this._do_history_prevention()}else{this.select_list[A]=false;D.firstChild.className=baseclass+this.not_sel_class;this.select_count--;this._do_history_prevention()}};ModeASelect.prototype._do_history_prevention=function(){if(this.select_count>0){this.scene_obj.protect_from_navigation()}else{this.scene_obj.unprotect_from_navigation()}};


// File: b_mode_a_move_969.js

ModeAMove=function(B,A){if(B){ModeASelect.apply(this,[B,A]);this.sel_class="aselect_to_move";this.not_sel_class="aselect"}};ModeAMove.prototype=new ModeASelect();ModeAMove.prototype.init=function(D,B,E){ModeASelect.prototype.init.apply(this,[D,B]);if(E!=null){this.select_list=E.param.select_list;var C,A;for(C=0,A=this.select_list.length;C<A;C++){if(this.select_list[C]){this.select_count++}}}};g_ModeAMove_next_click=function(){g_ModeAlbum_obj._next_click();return false};ModeAMove.prototype._next_click=function(){g_trace.log("next clicked!");if(this.select_count==0){alert("You must first select the albums you want to move.");return false}var E={select_list:this.select_list,index:this.index,action:this.action};var F=new Array();var D=ji.gimme_album_path();if(D!=""){D+="/"}var C,A;for(C=0,A=this.select_list.length;C<A;C++){if(this.select_list[C]){F[F.length]=D+ji.gimme_subalbum_url_name(C)}}var B=ModeChooseA.prototype.static_generate_related_data(E,"ModeAMove",2,true,false,F,true);this.scene_obj.navigate_related(this.index,"hm",B);return false};ModeAMove.prototype.output_tools=function(){return this._int_output_tools(1)};ModeAMove.prototype._int_output_tools=function(B){g_trace.log("output tools - step="+B);var D="";var A=ji.gimme_album_path();if(B==2){var C=' class="faded"'}else{var C=""}D+="<h1>Move albums</h1>";D+='<div class="half_spacer"><div></div></div>';D+="<p"+C+"><b>Step 1</b>: check the albums you want to move.</p>";D+='<div class="two_spacers"><div></div></div>';if(B==1){D+=' <p><a href="#" onclick="return g_ModeAMove_next_click()">Next Step >></a></p>';D+=' <div class="two_spacers"><div></div></div>'}else{D+="<p><b>Step 2</b>: click on the destination album to finish.</p>";D+=' <div class="spacer"><div></div></div>'}D+='<div class="tools_buttons"><a id="tools_cancel" href="/'+ji.gimme_user_album_path()+'"><img src="/i/s.gif" /></a></div>';return D};ModeAMove.prototype._output_header=function(){return'<div class="board_title">Select albums to move</div>'};ModeAMove.prototype.achoose_load=function(A){};ModeAMove.prototype.achoose_cleanup=function(A){};ModeAMove.prototype.achoose_output_tools=function(A){return this._int_output_tools(2)};ModeAMove.prototype.achoose_output_header=function(A){g_trace.log("_output_choose_header");return'<div class="board_title">Select the destination album</div>'};ModeAMove.prototype.achoose_done=function(E,C){this.index=E.index;this.action=E.action;this.select_list=E.select_list;g_trace.log("done choose.... - "+C);g_trace.log(this.select_list);this.scene_obj.unprotect_from_navigation();var D="";var B,A;for(B=0,A=ji.gimme_subalbum_count();B<A;B++){g_trace.log("select_list["+B+"] = "+this.select_list[B]);if(this.select_list[B]){D+=","+ji.gimme_subalbum_url_name(B)}}this._json_post("/move_albums.json","p="+ji.gimme_album_path()+"&dest_album="+C+"&album_list="+D);return false};


// File: b_mode_a_delete_1001.js

ModeADelete=function(B,A){if(B){ModeASelect.apply(this,[B,A]);this.sel_class="aselect_to_delete";this.not_sel_class="aselect"}};ModeADelete.prototype=new ModeASelect();ModeADelete.prototype._done_clicked=function(){g_trace.log("done clicked");var E=this.select_count+" album";if(this.select_count>1){E+="s"}var B=confirm("You are about to delete "+E+".  This operation cannot be undone.  Do you wish to continue?");if(B==false){return false}this.scene_obj.unprotect_from_navigation();var D="";var C,A;for(C=0,A=ji.gimme_subalbum_count();C<A;C++){g_trace.log("select_list["+C+"] = "+this.select_list[C]);if(this.select_list[C]){D+=","+ji.gimme_subalbum_url_name(C)}}this._json_post("/delete_albums.json","p="+ji.gimme_album_path()+"&album_list="+D);return false};ModeADelete.prototype.output_tools=function(){var A="";A+="<h1>Delete albums</h1>";A+="<p>Click on the albums to highlight those you want to delete.</p>";A+="<p>Use <em>shift</em> key to highlight many with one click.</p>";A+="<p>When finished, click <em> Done</em> to submit.</p>";A+=ModeASelect.prototype.output_tools.apply(this,[]);return A};ModeADelete.prototype._output_header=function(){var A="";A+='<div class="board_title">Delete albums</div>';return A};


// File: b_mode_arrange_969.js

var g_ModeArrange_obj=null;ModeArrange=function(B,A){if(B){Mode.apply(this,[B,A]);this.pick_prefix=null;this.post_url=null}};ModeArrange.prototype=new Mode();ModeArrange.prototype.init=function(D,B){var C,A;g_ModeArrange_obj=this;this.overlay_prefix="overlay";this.index=B;this.pick_t_div=null;this.pick_t_num=null;this.pick_o_num=null;this.mouse_dx=null;this.mouse_dy=null;this.overlay_div=null;this.drag_div=null;this.board_resize_timer=null;this.scroll_timer=null;this.win_height=null;this.doc_height=null;this.init_x=0;this.init_y=0;this.drag_home_timer=null;this.switch_timer=null;this.switch_delay=70;this.saved_on_o_num;this.drop_check=false;this.anything_changed=false;this.overlay=new Array;this._gimme_mouse_x_y=g_utils.gimme_mouse_x_y;for(C=0,A=this._gimme_count();C<A;C++){this.overlay[C]=C}};ModeArrange.prototype.output_tools=function(){};ModeArrange.prototype.output_board=function(){};ModeArrange.prototype._gimme_count=function(){};ModeArrange.prototype._gimme_id=function(A){};ModeArrange.prototype._pick_t_now=function(){};ModeArrange.prototype._delete_the_drag=function(){};ModeArrange.prototype._create_drag_div=function(B,A){};ModeArrange.prototype.are_tools_enabled=function(){return true};ModeArrange.prototype.can_you_handle_empty=function(A){return false};ModeArrange.prototype.load=function(){g_events.add("document","onboardresize",this._adjust,this);g_events.add("tools_done","onclick",this._done_clicked,this);g_events.add("tools_cancel","onclick",this._cancel_clicked,this);this._create_overlay();this._hide_overlay()};ModeArrange.prototype.cleanup=function(){g_events.remove("document","onboardresize",this._adjust);g_events.remove("tools_done","onclick",this._done_clicked);g_events.remove("tools_cancel","onclick",this._cancel_clicked);this._delete_overlay()};ModeArrange.prototype._adjust=function(){var A=this;if(this.board_resize_timer!=null){clearTimeout(this.board_resize_timer)}this.board_resize_timer=setTimeout(function(){A.board_resize_timer=null;A._delete_overlay();A._create_overlay();A._hide_overlay()},500)};g_ModeArrange_thumb_clicked=function(B,A){g_ModeArrange_obj._pick(B,A);return false};ModeArrange.prototype._pick=function(A,B){if(this.drag_home_timer!=null){clearInterval(this.drag_home_timer);this.drag_home_timer=null;this._delete_the_drag()}this.pick_t_num=B;this.pick_t_div=document.getElementById(this.pick_prefix+this.pick_t_num);this._pick_t_now();this._create_the_drag(A);this._move(A);this._show_overlay();g_events.add("document","onmousemove",this._move,this);g_events.add("document","onmouseup",this._drop,this);this._create_scroll_overlays()};ModeArrange.prototype._drop=function(A){if(this.drop_check==true){this._overlay_over(A,null,1)}g_events.remove("document","onmousemove",this._move);g_events.remove("document","onmouseup",this._drop);this._send_drag_home();this._delete_scroll_overlays();this._hide_overlay();this._has_anything_changed()};ModeArrange.prototype._move=function(B){var A=this._gimme_mouse_x_y(B);this.drag_div.style.left=A[0]-this.mouse_dx+"px";this.drag_div.style.top=A[1]-this.mouse_dy+"px";return false};ModeArrange.prototype._send_drag_home=function(){var A=g_utils.gimme_elem_x_y(this.pick_t_div);var E=this;var I=A[0];var H=A[1];var G=parseInt(this.drag_div.style.left);var F=parseInt(this.drag_div.style.top);var C,B;var D=function(){C=Math.round((I-G)/4);B=Math.round((H-F)/7);G+=C;F+=B;E.drag_div.style.left=G+"px";E.drag_div.style.top=F+"px";if(C>-2&&C<2&&B>-2&&B<2&&E.drag_home_timer){clearInterval(E.drag_home_timer);E.drag_home_timer=null;E._delete_the_drag()}};this.drag_home_timer=setInterval(D,10)};ModeArrange.prototype._create_the_drag=function(D){var C=this._gimme_mouse_x_y(D);var E=g_utils.gimme_elem_x_y(this.pick_t_div);var A=E[0];var G=E[1];this.mouse_dx=C[0]-A;this.mouse_dy=C[1]-G;this._create_drag_div(A,G);var B=this.pick_t_num;if(this.overlay[B]==B){this.pick_o_num=B}else{for(var F=0;F<this.overlay.length;F++){if(this.overlay[F]==B){this.pick_o_num=F}}}};ModeArrange.prototype._create_overlay=function(){var G="";var B=document.createElement("div");var F=g_utils.gimme_elem_x_y;var H,A,C,E,D;for(H=0,A=this.overlay.length;H<A;H++){D=this.overlay[H];E=F(document.getElementById(this.pick_prefix+D));G=[G,'<div class="overlay" id="overlay" onmouseover="return g_ModeArrange_mouse_over(event, ',H,');" style="top:',E[1],"px; left:",E[0],"px; width:",E[2],"px; height:",E[3],'px; position: absolute;"><div></div></div>'].join("")}document.body.appendChild(B,0);B.innerHTML=G;this.overlay_div=B};ModeArrange.prototype._delete_overlay=function(){this.overlay_div.parentNode.removeChild(this.overlay_div)};ModeArrange.prototype._hide_overlay=function(){this.overlay_div.style.display="none"};ModeArrange.prototype._show_overlay=function(){this.overlay_div.style.display="block"};g_ModeArrange_mouse_over=function(B,A){return g_ModeArrange_obj._overlay_over(B,A)};ModeArrange.prototype._overlay_over=function(B,C,A){this.drop_check=true;if(A==1){clearTimeout(this.switch_timer);this._do_the_switch(this.saved_on_o_num);return }this.saved_on_o_num=C;if(this.switch_timer!=null){clearTimeout(this.switch_timer)}this.switch_timer=setTimeout(g_ModeArrange_do_the_switch,this.switch_delay)};g_ModeArrange_do_the_switch=function(A){g_ModeArrange_obj._do_the_switch()};ModeArrange.prototype._do_the_switch=function(){on_o_num=this.saved_on_o_num;this.drop_check=false;this.switch_timer=null;var C=this.overlay[on_o_num];if(on_o_num==this.pick_o_num){return }var B=document.getElementById(this.pick_prefix+C);this.pick_t_div.parentNode.removeChild(this.pick_t_div);if(on_o_num<this.pick_o_num){B.parentNode.insertBefore(this.pick_t_div,B);for(var A=this.pick_o_num-1;A>=on_o_num;A--){this.overlay[A+1]=this.overlay[A]}}else{B.parentNode.insertBefore(this.pick_t_div,B.nextSibling);for(var A=this.pick_o_num+1;A<=on_o_num;A++){this.overlay[A-1]=this.overlay[A]}}this.overlay[on_o_num]=this.pick_t_num;this.pick_o_num=on_o_num};ModeArrange.prototype._create_scroll_overlays=function(){var B=document.createElement("div");var A=document.createElement("div");B.setAttribute("id","top_scroll_overlay");A.setAttribute("id","bottom_scroll_overlay");document.body.appendChild(B);document.body.appendChild(A);this.win_height=g_board.gimme_window_height();this.doc_height=document.body.scrollHeight;g_events.add("top_scroll_overlay","onmouseover",this._scroll_up,this);g_events.add("top_scroll_overlay","onmouseout",this._stop_scroll,this);g_events.add("bottom_scroll_overlay","onmouseover",this._scroll_down,this);g_events.add("bottom_scroll_overlay","onmouseout",this._stop_scroll,this)};ModeArrange.prototype._delete_scroll_overlays=function(){this._stop_scroll();g_events.remove("top_scroll_overlay","onmouseover",this._scroll_up);g_events.remove("top_scroll_overlay","onmouseout",this._stop_scroll);g_events.remove("bottom_scroll_overlay","onmouseover",this._scroll_down);g_events.remove("bottom_scroll_overlay","onmouseout",this._stop_scroll);var A;A=document.getElementById("top_scroll_overlay");A.parentNode.removeChild(A);A=document.getElementById("bottom_scroll_overlay");A.parentNode.removeChild(A)};ModeArrange.prototype._scroll_up=function(C){var B=this;var A=function(){var E=document.body.scrollTop;if(E==0){B._stop_scroll()}else{if(E<10){var D=E}else{var D=10}scrollBy(0,-1*D);B.drag_div.style.top=parseInt(B.drag_div.style.top)-D+"px"}};this._stop_scroll();this.scroll_timer=setInterval(A,10)};ModeArrange.prototype._scroll_down=function(C){var B=this;var A=function(){if((B.doc_height-document.body.scrollTop-1)<=B.win_height){B._stop_scroll()}else{scrollBy(0,10);B.drag_div.style.top=parseInt(B.drag_div.style.top)+10+"px"}};this._stop_scroll();this.scroll_timer=setInterval(A,10)};ModeArrange.prototype._stop_scroll=function(){if(this.scroll_timer!=null){clearInterval(this.scroll_timer)}};ModeArrange.prototype._has_anything_changed=function(){var B,A;this.anything_changed=false;for(B=0,A=this.overlay.length;B<A;B++){if(this.overlay[B]!=B){this.anything_changed=true}}if(this.anything_changed){this.scene_obj.protect_from_navigation()}else{this.scene_obj.unprotect_from_navigation()}};ModeArrange.prototype._done_clicked=function(){if(this.anything_changed==false){return this._cancel_clicked()}this.scene_obj.unprotect_from_navigation();var C,B;var F=new Array;for(var D=0;D<this.overlay.length;D++){var A=new Object;A.o_pos=this.overlay[D];A.id=this._gimme_id(A.o_pos);F[D]=A}var E=F.toJSONString();this._json_post(this.post_url,"p="+ji.gimme_album_path()+"&arrange_list="+E);return false};ModeArrange.prototype._json_success=function(A){this.scene_obj.reload_specific(this.index)};ModeArrange.prototype._cancel_clicked=function(){this.scene_obj.navigate(this.index);return false};ModeArrange.prototype.change_page=function(B,A){};


// File: b_mode_a_arrange_1543.js

ModeAArrange=function(B,A){if(B){ModeArrange.apply(this,[B,A]);this.pick_prefix="album";this.post_url="/arrange_albums.json"}};ModeAArrange.prototype=new ModeArrange();ModeAArrange.prototype._gimme_count=function(){return ji.gimme_subalbum_count()};ModeAArrange.prototype._gimme_id=function(A){return ji.gimme_subalbum_url_name(A)};ModeAArrange.prototype._pick_t_now=function(){this.pick_t_div=document.getElementById("album"+this.pick_t_num);this.pick_t_div.className="album a_arrange_target"};ModeAArrange.prototype._delete_the_drag=function(){this.pick_t_div.className="album";this.drag_div.parentNode.removeChild(this.drag_div)};ModeAArrange.prototype._create_drag_div=function(D,A){var C=document.createElement("div");C.id="a_arrange_dragme";C.className="album";C.style.left=D+"px";C.style.top=A+"px";var E=ji.files_base_url()+"/";var B=this.pick_t_num;var F="";if(ji.gimme_subalbum_num_subalbums(B)>0){F+='<div class="album_subalbums"><a onclick="return false" href="#"><img src="/i/s.gif" /></a></div>';F+="<h1>"+ji.gimme_subalbum_name(B)+"</h1>"}else{if(ji.gimme_subalbum_num_files(B)==0){F='<div class="album_empty"><a onclick="return false" href="#"><img src="/i/s.gif" /></a></div>'}else{F='<div class="album_img"><a onclick="return false" href="#"><img src="/i/s.gif" style="background: url(\''+E+ji.gimme_subalbum_teaser_fid_path(B)+"_sq.jpg?v="+ji.gimme_subalbum_teaser_ver(B)+"') 0px -6px;\" /></a></div>"}F+="<h1>"+ji.gimme_subalbum_name(B)+"</h1>"}C.innerHTML=F;document.body.appendChild(C,0);this.drag_div=C};ModeAArrange.prototype.output_tools=function(){var C="";var B=ji.gimme_album_path();var A=ji.gimme_subalbum_count();C+="<h1>Arrange albums</h1>";C+="<p>Drag the albums to arrange.</p>";C+='<div class="tools_buttons"><a id="tools_done" href="#"><img src="/i/s.gif" /></a><a id="tools_cancel" href="'+ji.gimme_user_album_path()+'"><img src="/i/s.gif" /></a></div>';return C};ModeAArrange.prototype.output_board=function(){var A="";A+='<div id="board_header">';A+=' <div id="board_title_c">';A+='  <div class="board_title">Arrange albums</div>';A+='  <div style="clear: both;"></div>';A+=" </div>";A+="</div>";A+='<div id="album_set">';A+=this._output_just_albums(0,ji.gimme_subalbum_count());A+="</div>";return A};ModeAArrange.prototype._output_just_albums=function(G,B){var A="/"+ji.gimme_user_album_path()+"/";var E=ji.files_base_url()+"/";var C;var F="";for(var D=G;D<B;D++){F+='<div class="album" id="album'+D+'">';C=ji.gimme_subalbum_num_subalbums(D);if(ji.gimme_subalbum_num_subalbums(D)>0){F+='<div class="album_subalbums"><a onclick="return false" href="'+A+ji.gimme_subalbum_url_name(D)+'"><img onmousedown="return g_ModeArrange_thumb_clicked(event, '+D+');" src="/i/s.gif" /></a></div>'}else{C=ji.gimme_subalbum_num_files(D);if(C==0){F+='<div class="album_empty"><a onclick="return false" href="'+A+ji.gimme_subalbum_url_name(D)+'"><img onmousedown="return g_ModeArrange_thumb_clicked(event, '+D+');" src="/i/s.gif" /></a></div>'}else{F+='<div class="album_img"><a onclick="return false" href="'+A+ji.gimme_subalbum_url_name(D)+'"><img onmousedown="return g_ModeArrange_thumb_clicked(event, '+D+');" src="/i/s.gif" style="background: url(\''+E+ji.gimme_subalbum_teaser_fid_path(D)+"_sq.jpg?v="+ji.gimme_subalbum_teaser_ver(D)+"') 0px -6px;\" /></a></div>"}}F+="<h1>"+ji.gimme_subalbum_name(D)+"</h1>";F+="<p>("+C+") ";switch(ji.gimme_subalbum_privacy(D)){case"p":F+='<span class="public">public</span>';break;case"v":F+='<span class="private">private</span>';break;case"h":F+='<span class="hidden">hidden</span>';break;default:g_trace.log("ERROR - invalid subalbum privacy of "+ji.gimme_subalbum_privacy(D))}if(ji.is_subalbum_locked(D)){F+='<div class="lock"><div></div></div>'}F+="</p></div>"}return F};ModeAArrange.prototype.change_page=function(B,A){};


// File: b_mode_a_add_choose_969.js

ModeAAddChoose=function(B,A){if(B){Mode.apply(this,[B,A]);this.scene_obj=B;this.hash_var=A;this.index=null;this.action=null;this.r_data=null;this.mode_obj=null;this.exclude_list=null;this.base_album=null}};ModeAAddChoose.prototype=new ModeChooseA();ModeAAddChoose.prototype.can_you_handle_empty=function(){return false};ModeAAddChoose.prototype.init=function(B,A){g_ModeChooseA_obj=this;this.index=A;this.action=B;this.r_data=this.static_generate_related_data(null,null,1,false,true,null,false);this.mode_obj=this};ModeAAddChoose.prototype.achoose_load=function(A){};ModeAAddChoose.prototype.achoose_cleanup=function(A){};ModeAAddChoose.prototype.achoose_output_tools=function(B){var A="";A+="<h1>Add photos</h1>";A+='<div class="half_spacer"><div></div></div>';A+="<p>Photos can only be added to albums that do not contain other albums.</p>";A+="<p>Select a destination album, or cancel and create a new empty album.</p>";A+='<div class="spacer"><div></div></div>';A+='<div class="tools_buttons"><a id="tools_cancel" href="/'+ji.gimme_user_album_path()+'"><img src="/i/s.gif" /></a></div>';return A};ModeAAddChoose.prototype.achoose_output_header=function(A){return'<div class="board_title">Select a destination album for your new photos</div>'};ModeAAddChoose.prototype.achoose_done=function(B,A){window.location="/add_files.html?p="+A;return false};


// File: b_mode_a_share_969.js

ModeAShare=function(B,A){if(B){this.scene_obj=B}};ModeAShare.prototype.init=function(B,A,C){this.index=A};ModeAShare.prototype.can_you_handle_empty=function(A){return true};ModeAShare.prototype.are_tools_enabled=function(A){return true};ModeAShare.prototype.change_page=function(){};ModeAShare.prototype.load=function(){g_events.add("tools_cancel","onclick",this._cancel_clicked,this)};ModeAShare.prototype.cleanup=function(){g_events.remove("tools_cancel","onclick",this._cancel_clicked)};ModeAShare.prototype._cancel_clicked=function(){this.scene_obj.navigate(this.index);return false};ModeAShare.prototype.output_tools=function(){var A="";A+="<h1>Share</h1>";A+="<p>The URL to this album is shown.</p>";A+='<div class="spacer"><div></div></div>';A+='<ul><li><a href="/'+ji.gimme_user_album_path()+'" id="tools_cancel">go back to album</a></li></ul>';A+='<div class="two_spacers"><div></div></div>';return A};ModeAShare.prototype.output_board=function(){var C="http://www.flickaway.com/"+ji.gimme_user_album_path();var A="/i/s.gif";var B="";B+='<div class="share">';B+="<h1>To share this album:</h1>";B+='<p style="margin-left: 30px;">Use this URL : <a href="'+C+'">'+C+"</a></td></p>";B+="</div>";B+='<div class="spacer"><div>&nbsp;</div></div>';return B};


// File: b_scene_album_969.js

SceneAlbum=function(A){if(A){this.hash_var="s";this.mode_list={f:{mode_name:"ModeAlbum",sign_in:false},a:{mode_name:"ModeAArrange",sign_in:true},m:{mode_name:"ModeAMove",sign_in:true},d:{mode_name:"ModeADelete",sign_in:true},x:{mode_name:"ModeAAddChoose",sign_in:true},h:{mode_name:"ModeChooseA",sign_in:true},r:{mode_name:"ModeAShare",sign_in:true}};Scene.apply(this,[true])}};SceneAlbum.prototype=new Scene();SceneAlbum.prototype.constructor=SceneAlbum;SceneAlbum.prototype._gimme_count=function(){return ji.gimme_subalbum_count()};SceneAlbum.prototype._gimme_index=function(A){return ji.gimme_index_from_subalbum(A)};SceneAlbum.prototype._gimme_id=function(A){return ji.gimme_subalbum_url_name(A)};g_scene_album=new SceneAlbum(true);g_scene_album._initialize_scene();g_events.add("window","ondomload",g_scene_album._onload,g_scene_album);


