var snag=1;F._group_vanisher={remove_photo:function(G,C,D,E){if(this.already_removing==undefined){this.already_removing=false}if(this.photosA==undefined&&_ge("div_hold_photos")){this.photosA=new Array();var A=_ge("div_hold_photos");for(var B=0;B<A.childNodes.length;B++){if(A.childNodes[B].nodeType==1&&A.childNodes[B].className=="PoolList"){this.photosA.push(_pi(A.childNodes[B].id.replace("pool_","")))}}}this.new_photo_id=null;this.total_photos=null;this.photo_load_offset=0;if(!this.already_removing&&window.confirm(F.output.get("grouppool_are_you_sure"))){this.already_removing=true;this.group_id=G;this.photo_id=C;this.load_replacement_photo=D;this.photo_url=E;this.vanish_photo()}},vanish_photo:function(){var A=function(){_ge("pool_"+F._group_vanisher.photo_id).innerHTML=""};anim_do_opacity_to(_ge("pool_"+this.photo_id),50,20,0,"easeOutQuad",A);F._group_vanisher.api_remove_photo()},api_remove_photo:function(){var A={flickr_groups_pools_remove_onLoad:function(G,E,C,D){if(G){if(F._group_vanisher.load_replacement_photo==true){F._group_vanisher.load_new_photo(F._group_vanisher.photo_load_offset)}else{F._group_vanisher.photo_load_offset=0;F._group_vanisher.already_removing=false}}else{alert(F.output.get("grouppool_sorry_not_remove"));F._group_vanisher.un_vanish_photo()}}};var B=new Object();B.photo_id=F._group_vanisher.photo_id;B.group_id=F._group_vanisher.group_id;F.API.callMethod("flickr.groups.pools.remove",B,A,null,null,0)},un_vanish_photo:function(){_ge("pool_"+this.photo_id).style.display="block";anim_do_opacity_to(_ge("pool_"+this.photo_id),50,20,100,"easeInQuad");this.photo_load_offset=0;this.already_removing=false},load_new_photo:function(C){var A={flickr_groups_pools_getPhotos_onLoad:function(H,G,D,E){F._group_vanisher.responseXML=G;if(H){try{F._group_vanisher.total_photos=_pi(G.documentElement.getElementsByTagName("photos")[0].getAttribute("total"));if(isNaN(F._group_vanisher.total_photos)){F._group_vanisher.total_photos=0}if(!_groups_improv){if(_ge("a_see_all")){_ge("a_see_all").innerHTML=(F._group_vanisher.total_photos>1)?F.output.get("grouppool_see_all_link_plural",F._group_vanisher.group_id,F._group_vanisher.total_photos):F.output.get("grouppool_see_all_link_single",F._group_vanisher.group_id)}else{_ge("span_see_all").innerHTML=(F._group_vanisher.total_photos>1)?F.output.get("grouppool_see_no_link_plural",F._group_vanisher.total_photos):F.output.get("grouppool_see_no_link_single")}}else{if(_ge("a_see_all")){_ge("a_see_all").innerHTML=(F._group_vanisher.total_photos!=1)?F.output.get("count_items_plural",F._group_vanisher.total_photos):F.output.get("count_items",F._group_vanisher.total_photos)}else{_ge("span_see_all").innerHTML=(F._group_vanisher.total_photos!=1)?F.output.get("count_items_plural",F._group_vanisher.total_photos):F.output.get("count_items",F._group_vanisher.total_photos)}}}catch(I){}}else{}F._group_vanisher.photo_load_offset=0;F._group_vanisher.already_removing=false}};var B=new Object();B.group_id=F._group_vanisher.group_id;B.per_page=1;B.page=6+C;if(this.total_photos!=null&&this.total_photos<6){B.page=this.total_photos}if(this.total_photos!=null&&this.total_photos<6&&C>2){F._group_vanisher.photo_load_offset=0;F._group_vanisher.already_removing=false;return }F.API.callMethod("flickr.groups.pools.getPhotos",B,A,null,null,0)},show_new_photo:function(){for(var A=0;A<this.photosA.length;A++){if(this.photosA[A]==this.new_photo_id){this.photo_load_offset++;if(this.photo_load_offset<=5){this.load_new_photo(this.photo_load_offset)}else{this.photo_load_offset=0;this.already_removing=false}return }}this.photosA.push(this.new_photo_id);var B="";B+='<div id="pool_'+this.new_photo_id+'" class="PoolList">';B+='<a href="'+this.photo_url.replace(this.photo_id,this.new_photo_id)+'"><img src="'+_get_photo_src(global_photos[this.new_photo_id],"t")+'" /></a><br>';if(global_last_log_in!=null&&this.date_added>global_last_log_in){B+='<span class="New">'+F.output.get("grouppool_new")+"</span> "}B+=F.output.get("grouppool_from",global_photos[this.new_photo_id].owner_nsid,global_photos[this.new_photo_id].owner_name);if(global_can_remove||global_nsid==global_photos[this.new_photo_id].owner_nsid){B+=' <a href="#" title="'+F.output.get("grouppool_remove_photo")+'" onclick="F._group_vanisher.remove_photo(\''+this.group_id+"','"+this.new_photo_id+"', true, '"+this.photo_url.replace(this.photo_id,this.new_photo_id)+'\'); return false;" class="delete-x-inline"><img src="'+_images_root+'/spaceout.gif" width="14" height="14" align="top" alt="[x]"></a>'}B+="</div>";_ge("div_hold_photos").innerHTML+=B;this.photo_load_offset=0;this.already_removing=false}};F.PhotoPicker=function(){var B=this;var A=null;var C=global_group_name.truncate_with_ellipses(40).escape_for_display();this.selectedPhotos=[];this.selectedPhotosHash=[];this.addedAPIResponses=[];this.oPhotosFound=null;this.pendingRequest=false;this.resetMode=false;this.idCounter=0;this.apiData={currentPage:1,pages:0,lastCallParams:null};this.rulesMaxWidth=600;this.rulesMaxHeight=400;this.parseCollection=function(J){var R=J.documentElement.getElementsByTagName("photo");if(R.length==0){B.showPhotosFound(0);return }else{var K=J.documentElement.getElementsByTagName("photos")[0];if(!K){K=J.documentElement.getElementsByTagName("photoset")[0]}B.apiData.currentPage=parseInt(K.getAttribute("page"));B.apiData.pages=parseInt(K.getAttribute("pages"));B.showPhotosFound(K.getAttribute("total"));var G=[];var L,O,P,H,I,M,N,T,S;for(var Q=0;Q<R.length;Q++){L=R[Q].getAttribute("id");O=R[Q].getAttribute("secret");P=R[Q].getAttribute("server");I=R[Q].getAttribute("farm");M=R[Q].getAttribute("media");N=R[Q].getAttribute("media_status");T=R[Q].getAttribute("ispublic");S=R[Q].getAttribute("title");H=_photo_root.replace("farm","farm"+I)+P+"/"+L+"_"+O+"_s.jpg";G.push({id:L,src:H,media:M,ispublic:T,title:S});global_photos[L]=R[Q]}if(G.length>0){}}return G};this.photoItem=document.createElement("li");this.photoItem.appendChild(document.createElement("img"));this.photoItem.getElementsByTagName("img")[0].src=_images_root+"/spaceout.gif";this.photoItem.getElementsByTagName("img")[0].className="pp_thumb";this.photoItem.appendChild(document.createElement("img"));this.photoItem.getElementsByTagName("img")[1].src=_images_root+"/simple_close_default.gif";this.photoItem.getElementsByTagName("img")[1].className="pp_close";this.photoItem.getElementsByTagName("img")[1].title=F.output.get("remove");this.photoItem.appendChild(document.createElement("span"));this.photoItem.getElementsByTagName("span")[0].className="pp_status";this.photoItem.appendChild(document.createElement("img"));this.photoItem.getElementsByTagName("img")[2].src=_images_root+"/video_play_icon_small.png.v1";this.photoItem.getElementsByTagName("img")[2].className="pp_video trans_png";this.cloneItem=function(){var G=B.photoItem.cloneNode(true);G.getElementsByTagName("img")[1].id="pp-tt-"+(B.idCounter++);G.getElementsByTagName("img")[1].img_id=G.getElementsByTagName("img")[1].id;return G};this.setSearchField=function(H){var I=_ge("pp-search");var G=_ge("pp-btn-search");G.disabled=(!H);I.disabled=(!H);if(H!=true){I.className="pp-disabled";G.className="DisabledButt";I.value=""}else{I.className="";G.className="Butt"}};this.enableSearchField=function(){B.setSearchField(true)};this.disableSearchField=function(){B.setSearchField(false)};this.lastSearchTypeIndex=0;this.searchType=null;this.search_handler={generic_api_onLoad:function(N,M,K,L){B.setLoading(false);B.pendingRequest=false;if(!N){if(M){var G=M.documentElement.getElementsByTagName("err")[0];var J=G.getAttribute("code");var H=G.getAttribute("msg");if(J==1&&H.toLowerCase()=="photoset not found"){B.showPhotosFound(0)}return }alert("there was an error:\n"+K);return }var I=B.parseCollection(M);B.makePhotosList(I)}};this.doSearchAll=function(H){var G=_ge("pp-search-filter");G.selectedIndex=0;B.setSearchType(true);Y.E.stopEvent(H||event);return false};this.setSearchType=function(J){var I=_ge("pp-search-filter");var H=I.options[I.selectedIndex].value;var G=I.options[I.selectedIndex].text;if(J){_ge("pp-search").value=""}if(H==""){I.selectedIndex=B.lastSearchTypeIndex;return }if(H=="all"&&_ge("pp-search").value==""){_ge("pp-stream-title").innerHTML=F.output.get("group_photopickr_photostream")}else{_ge("pp-stream-title").innerHTML=F.output.get("group_photopickr_search_results")}B.searchType=H;if(B.searchType.indexOf("photoset")>-1){B.set_id=B.searchType.replace("photoset","");B.searchType="in_set"}else{if(B.searchType.indexOf("group")>-1){B.group_id=B.searchType.replace("group","");B.searchType="in_group"}else{if(B.searchType.indexOf("upload_day")>-1){B.upload_day=F.convert_MYSQLDateTime_into_unix_time_stamp(B.searchType.replace("upload_day",""));B.searchType="in_upload_day"}else{if(B.searchType.indexOf("batch_")>-1){B.batch_id=B.searchType.replace("batch_","");B.searchType="from_batch"}}}}_ge("pp-show-all").style.display="inline";switch(B.searchType){case"all":B.enableSearchField();if(_ge("pp-search").value==""){_ge("pp-show-all").style.display="none"}B.call_API=function(L,K){F.API.callMethod("flickr.photos.search",L,B.search_handler,undefined,undefined,undefined,K)};break;case"not_tagged":B.disableSearchField();B.call_API=function(L,K){F.API.callMethod("flickr.photos.getUntagged",L,B.search_handler,undefined,undefined,undefined,K)};break;case"y_photos":B.enableSearchField();B.call_API=function(L,K){L.y_photos=1;F.API.callMethod("flickr.photos.search",L,B.search_handler,undefined,undefined,undefined,K)};break;case"not_located":B.enableSearchField();B.call_API=function(L,K){if(L.text||L.tags){L.nogeo=1;F.API.callMethod("flickr.photos.search",L,B.search_handler,undefined,undefined,undefined,K)}else{F.API.callMethod("flickr.photos.getWithoutGeodata",L,B.search_handler,undefined,undefined,undefined,K)}};break;case"located":B.disableSearchField();B.call_API=function(L,K){F.API.callMethod("flickr.photos.getWithGeodata",L,B.search_handler,undefined,undefined,undefined,K)};break;case"not_in_set":B.disableSearchField();B.call_API=function(L,K){F.API.callMethod("flickr.photos.getNotInSet",L,B.search_handler,undefined,undefined,undefined,K)};break;case"in_upload_day":B.enableSearchField();B.call_API=function(L,K){L.min_upload_date=B.upload_day;L.max_upload_date=(B.upload_day*1)+86399;F.API.callMethod("flickr.photos.search",L,B.search_handler,undefined,undefined,undefined,K)};break;case"in_set":B.disableSearchField();B.call_API=function(L,K){L.photoset_id=B.set_id;F.API.callMethod("flickr.photosets.getPhotos",L,B.search_handler,undefined,undefined,undefined,K)};break;case"from_batch":B.disableSearchField();B.call_API=function(L,K){setTimeout(function(){_ge("findr").show_self_batch(_ge("findr").batch_id)},1000)};break;case"in_group":B.disableSearchField();B.call_API=function(L,K){L.group_id=B.group_id;F.API.callMethod("flickr.groups.pools.getPhotos",L,B.search_handler,undefined,undefined,undefined,K)};break;default:return }B.lastSearchTypeIndex=I.selectedIndex;B.doSearch()};this.call_API=function(H,G){F.API.callMethod("flickr.photos.search",H,B,undefined,undefined,undefined,G)};this.showPhotosFound=function(G){if(G==1){B.oPhotosFound.innerHTML=F.output.get("group_photopickr_found_single",G)}else{B.oPhotosFound.innerHTML=F.output.get("group_photopickr_found_plural",G)}};this.makePhotosList=function(H){var Q=_ge("pp-source");if(H&&H.length){var P=document.createElement("ul");P.className="pp-list";var O=null;var L=null;var M=null;for(var J=0;J<H.length;J++){if(H[J].media_status!="ready"){O=B.cloneItem();L=O.getElementsByTagName("img")[0];L.id="source_"+H[J].id;L.src=H[J].src;L.title=H[J].title;if(B.isSelected(L.id.replace("source","target"))){O.className="pp_type_"+H[J].media+" selected"}else{O.className="pp_type_"+H[J].media}P.appendChild(O)}}Q.appendChild(P);var G=Q.scrollHeight-Q.offsetHeight;if(Q.scrollHeight&&Q.scrollTop>=G){Q.scrollTop=G-1}}else{var K=_ge("pp-search");var I=_ge("pp-search-filter");if(I.value=="all"&&!K.value){Q.innerHTML='<div class="pp_empty"><h3>'+F.output.get("group_photopickr_empty_account")+"</h3></div>"}else{Q.innerHTML='<div class="pp_empty"><h3>'+F.output.get("no_photos_found")+"</h3>"+(K.value?"<div>"+F.output.get("other_than","<b>"+K.value.escape_for_display()+"</b>")+"</div>":"")+"</div>";try{K.select();K.focus()}catch(N){}}}};this.flickr_photos_search_onLoad=function(K,J,H,I){B.setLoading(false);B.pendingRequest=false;if(!K){alert("there was an error: "+H);return }var G=B.parseCollection(J);B.makePhotosList(G)};this.setLoading=function(G,I){var H=_ge("pp-source");var J=_ge("pp-loading");if(I){H.innerHTML=""}if(G){Y.D.addClass(_ge("pp"),"pp-cursor-loading")}else{Y.D.removeClass(_ge("pp"),"pp-cursor-loading")}document.body.style.cursor=(G?"wait":"auto");J.className=(G?"active":"")};this.doSearch=function(I){if(!B.pendingRequest){var H=null;if(_ge("pp-search").value!=""){H=_ge("pp-search").value;_ge("pp-show-all").style.display="inline"}B.setLoading(true,true);B.pendingRequest=true;var G={user_id:global_nsid,text:H,per_page:102,extras:"media"};if(_group_add_accepted_media!=null){G.media=_group_add_accepted_media}B.apiData.lastCallParams=G;B.call_API(G)}if(typeof I!="undefined"||typeof (event)!="undefined"){Y.E.stopEvent(I?I:event)}return false};this.getNextPage=function(){B.setLoading(true);B.pendingRequest=true;B.apiData.lastCallParams.page=B.apiData.currentPage;B.call_API(B.apiData.lastCallParams)};this.didScroll=function(){if(this.scrollHeight&&this.scrollTop>=this.scrollHeight-this.offsetHeight){B.scrolledToBottom()}};this.scrolledToBottom=function(){if(!B.pendingRequest&&B.apiData.currentPage<B.apiData.pages){B.apiData.currentPage++;B.getNextPage()}else{}};this.isSelected=function(G){return(typeof B.selectedPhotosHash[G]!="undefined")};this.sourceClick=function(K){var L=(K?K.target||K.srcElement:event.srcElement);if(L.nodeName.toLowerCase()!=""){var G=F.find_parent_node_by_name(L,"li")}if(!Y.D.hasClass(G,"pp_type_photo")&&!Y.D.hasClass(G,"pp_type_video")){return false}var H=(L.nodeName.toLowerCase()=="li"?L:F.find_parent_node_by_name(L,"li"));L=Y.D.getElementsByClassName("pp_thumb","img",H)[0];var I=null;var M=L.nodeName.toLowerCase();if(M=="img"&&Y.D.hasClass(L,"pp_thumb")){I=L.id}else{return true}if(B.resetMode){B.removeSelectedItems()}var J=I.replace("source","target");var H=_ge(J);if(H){B.removeItem(I,J)}else{B.addItem(F.find_parent_node(_ge(I)))}B.setResetMode(false);Y.E.stopEvent(K);return false};this.targetClick=function(L){var M=(L?L.target||event.srcElement:event.srcElement);var H=(M.nodeName.toLowerCase()=="li"?M:F.find_parent_node_by_name(M,"li"));if(!H){return true}if(!Y.D.hasClass(M,"pp_close")){return true}var K=null;var I=null;M=Y.D.getElementsByClassName("pp_thumb","img",H)[0];K=M.id;I=K.replace("target","source");if(B.resetMode){B.removeSelectedItems();B.setResetMode(false);B.setButtonState();return false}M.id="";M.src=_images_root+"/spaceout.gif";M.title="";H.className="";for(var J=0;J<B.selectedPhotos.length;J++){if(B.selectedPhotos[J].srcID==I){B.selectedPhotos.splice(J,1)}}if(!B.selectedPhotos.length){B.setButtonState()}delete B.selectedPhotosHash[K];var G=_ge(I);if(G){Y.D.removeClass(F.find_parent_node(G),"selected")}B.setResetMode(false)};this.addItem=function(G){var H=B.getNextTarget();if(!H||B.selectedPhotos.length>=E){B.setModalMode(true);if(E<D){global_comm_div.start_comming(F.output.get("group_photopickr_selection_limit",E),undefined,undefined,true,true,undefined,B.setModalMode,false,undefined,undefined,undefined,true,false)}else{global_comm_div.start_comming(F.output.get("group_photopickr_limit",E),undefined,undefined,true,true,undefined,B.setModalMode,false,undefined,undefined,undefined,true,false)}return false}var J=H.getElementsByTagName("img")[0];J.id=G.getElementsByTagName("img")[0].id.replace("source","target");var I=J.id;J.src=G.getElementsByTagName("img")[0].src;J.title=G.getElementsByTagName("img")[0].title;Y.D.addClass(G,"selected");H.className=G.className;try{}catch(K){}B.selectedPhotos[B.selectedPhotos.length]={srcID:G.getElementsByTagName("img")[0].id,targetID:H.id,id:I.substr(7)};B.setButtonState(true);B.selectedPhotosHash[I]=true};this.removeItem=function(L){var G=F.find_parent_node(_ge(L));var I=L.replace("source","target");var H=F.find_parent_node(_ge(I));var K=H.getElementsByTagName("img")[0];K.src=_images_root+"/spaceout.gif";K.id="";Y.D.removeClass(G,"selected");H.className="";for(var J=0;J<B.selectedPhotos.length;J++){if(B.selectedPhotos[J].srcID==L){B.selectedPhotos.splice(J,1)}}if(!B.selectedPhotos.length){B.setButtonState()}delete B.selectedPhotosHash[I]};this.setButtonState=function(G){_ge("pp-add-photos").className=(G?"Butt":"DisabledButt")};this.getNextTarget=function(){var I=_ge("pp-target").getElementsByTagName("li");var H=null;for(var G=0;G<I.length;G++){H=I[G].getElementsByTagName("img")[0];if(!H.id||H.id==""){return I[G]}}return null};this.createTargetList=function(){var J=_ge("pp-target");if(!J){return false}J.innerHTML="";var G=document.createElement("ul");G.className="pp-list";var H=[];for(var I=E;I--;){H.push(B.cloneItem());G.appendChild(H[H.length-1])}J.appendChild(G);for(I=H.length;I--;){F.decorate(H[I].getElementsByTagName("img")[1],F._simple_button).button_go_go_go();F.make_new_mouse_tip(H[I].getElementsByTagName("img")[1])}};this.flickr_groups_pools_add_onLoad=function(J,I,G,H){B.setLoading(false);B.addedAPIResponses[B.addedAPIResponses.length]={success:J,responseXML:I,responseText:G,params:H};if(B.addedAPIResponses.length>=B.selectedPhotos.length){B.handleAddAPIResponses()}};this.isQueued=function(G){return(G.responseText.indexOf("Your Photo has been added to the Pending Queue for this Pool")!=-1)};this.handleAddAPIResponses=function(){var M=0;var K=0;var G=0;var H=B.addedAPIResponses.length;var I="";for(var J=0;J<H;J++){if(B.addedAPIResponses[J].success){M++}else{if(B.isQueued(B.addedAPIResponses[J])){M++;G++}else{K++}}}var N=(G==0?"add_to_group_added":"batch_end_pending_adding_to_group");if(!K){if(M==1){I=F.output.get(N,C)}else{I=F.output.get(N+"_plural",parseInt(M),C)}}else{if(K<H){I='<ul style="margin-left:0px;padding-left:2em;margin-bottom:0px">';I+=("<li>"+F.output.get("group_photopickr_could_only_add",H-K)+"</li>");I+=("<li>"+F.output.get((K>1?"group_photopickr_could_not_add_mixed_plural":"group_photopickr_could_not_add_mixed_single"),K)+"</li>");I+=("<li>"+F.output.get("group_photopickr_taken_out")+"</li>");I+="</ul>"}else{if(K==1){I=F.output.get("group_photopickr_could_not_add_single")}else{I=F.output.get("group_photopickr_could_not_add_any")}}}if(window.s_addPhotoVideo&&typeof s_addPhotoVideo==="function"){s_addPhotoVideo("p",M);var O=1}B.results={ok:M,queued:G,failed:K,allFailed:(K&&K==H)};var L=null;for(var J=0;J<B.addedAPIResponses.length;J++){L=F.find_parent_node(_ge("target_"+B.addedAPIResponses[J].params.photo_id));Y.D.addClass(L,(B.addedAPIResponses[J].success||B.isQueued(B.addedAPIResponses[J])?"pp_ok":"pp_error"))}B.updateRemaining(M);setTimeout(function(){if(K||G){if(!B.results.allFailed){B.removeFailedItems()}B.setModalMode(true);global_comm_div.start_comming(I,undefined,undefined,true,true,undefined,B.onFinish,false,undefined,undefined,undefined,true,false)}else{B.onFinish()}},250)};this.updateRemaining=function(G){var J=_ge("pp-limit-remaining");var I=_ge("pp-remaining-count");if(J){var H=parseInt(global_group_limit_remaining);if(!isNaN(H)&&H!=101&&G){H-=G;E=H;I.innerHTML=F.output.get("group_photopickr_can_add",H);J.style.visibility="visible"}else{if(!isNaN(H)){if(H==101){I.innerHTML=F.output.get("group_photopickr_can_add_at_a_time",D)}else{I.innerHTML=F.output.get("group_photopickr_can_add",H)}J.style.visibility="visible"}else{J.style.visibility="hidden"}}}};this.onFinish=function(){if(B.results.allFailed){B.removeFailedItems()}B.setModalMode(false);B.addedAPIResponses=[];if(!B.results.allFailed){window.location.href=("/groups/"+global_group_nsid+"/?added="+B.results.ok)}};this.setModalMode=function(G){var H=_ge("pp-source");H.style.overflow=(G?"hidden":"auto");if(!G&&isIE){H.style.overflow="hidden";H.style.overflowY="scroll"}B.setSelectVisibility(!G)};this.setSelectVisibility=function(G){if(isIE){var I=document.getElementsByTagName("select");var J=(G?"visible":"hidden");for(var H=I.length;H--;){I[H].style.visibility=J}}};this.setResetMode=function(G){if(B.resetMode==G){return false}var H=_ge("pp-add-photos");if(G){H.value=F.output.get("clear_selection")}else{H.value=F.output.get("group_photopickr_add")}B.resetMode=G};this.removeAddedItems=function(){for(var G=0;G<B.addedAPIResponses.length;G++){if(B.addedAPIResponses[G].success&&B.isQueued(B.addedAPIResponses[G])){B.removeItem("source_"+B.addedAPIResponses[G].params.photo_id)}}};this.removeFailedItems=function(){for(var G=0;G<B.addedAPIResponses.length;G++){if(!B.addedAPIResponses[G].success&&!B.isQueued(B.addedAPIResponses[G])){B.removeItem("source_"+B.addedAPIResponses[G].params.photo_id)}}};this.removeSelectedItems=function(){if(B.resetMode==true){for(var G=0;G<B.selectedPhotos.length;G++){B.removeItem(B.selectedPhotos[G].srcID);G--}}};this.doAddPhotos=function(){if(B.resetMode==true){B.removeSelectedItems();B.setResetMode(false);return false}if(!B.selectedPhotos.length){global_comm_div.start_comming(F.output.get("group_photopickr_need_selection","/photos/organize/?start_tab=one_group"+global_group_nsid),undefined,undefined,true,true,undefined,B.setModalMode,false,undefined,undefined,undefined,true,false);return false}var H=0;for(var G=B.selectedPhotos.length;G--;){if(global_photos[B.selectedPhotos[G].id].getAttribute("ispublic")==0){H++}}if(H==0){B.doAddPhotosAPICall()}else{B.setModalMode(true);global_comm_div.start_comming(F.output.get((H>1?"batch_confirm_adding_to_group_plural":"batch_confirm_adding_to_group"),C),undefined,undefined,true,true,undefined,B.doAddPhotosAPICall,true,undefined,B.setModalMode,undefined,true,false)}};this.doAddPhotosAPICall=function(){var G=[];var I=null;for(var H=0;H<B.selectedPhotos.length;H++){I={photo_id:B.selectedPhotos[H].id,group_id:global_group_nsid};B.setModalMode(true);global_comm_div.start_comming(F.output.get("group_photopickr_adding"),undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,true,false);F.API.callMethod("flickr.groups.pools.add",I,B,null,null,0)}};this.showGroupRules=function(G){B.setSelectVisibility(false);global_comm_div.start_comming(_ge("pp-group-rules-content").innerHTML,undefined,undefined,true,true,undefined,B.setModalMode,false,undefined,undefined,undefined,true,false,B.rulesMaxWidth,undefined);Y.E.stopEvent(G);return false};this.attachEvents=function(){Y.E.addListener(_ge("pp-search-filter"),"change",function(){B.setSearchType(true)});Y.E.addListener(_ge("emptyform"),"submit",B.doSearch);Y.E.addListener(_ge("pp-add-photos"),"click",B.doAddPhotos);Y.E.addListener(_ge("pp-target"),"click",B.targetClick);Y.E.addListener(_ge("pp-source"),"mousedown",B.sourceClick);Y.E.addListener(_ge("pp-source"),"scroll",B.didScroll);Y.E.addListener(_ge("pp-show-all"),"click",B.doSearchAll);var I=_ge("pp-group-rules");var G=_ge("pp-group-rules-content");if(I&&G){var H=G.getElementsByTagName("div")[0];Y.E.addListener(I,"click",B.showGroupRules);if(isIE&&parseInt(H.offsetHeight)>B.rulesMaxHeight){H.style.height=B.rulesMaxHeight+"px";H.style.overflow="auto";H.style.overflowY="scroll"}if(isIE&&parseInt(H.offsetWidth)>B.rulesMaxWidth){H.style.width=B.rulesMaxWidth+"px"}}};this.init=function(G){if(!global_comm_div){_make_comm_div("10001")}B.oPhotosFound=_ge("pp-photos-found");if(!B.oPhotosFound){return false}B.createTargetList();B.attachEvents();B.setButtonState();B.setSearchType();B.updateRemaining()};var D=6;var E=Math.max(0,(Math.min(D,parseInt(global_group_limit_remaining))))};Y.E.addListener(window,"load",function(){if(_ge("pp")&&!Y.D.hasClass(_ge("pp"),"disabled")){F.photopickr=new F.PhotoPicker();F.photopickr.init()}});F.group_add_to_pool_disabled=function(A){if(!global_comm_div){_make_comm_div("10001")}global_comm_div.start_comming(F.output.get("group_pool_add_limit","/photos/organize/?start_tab=one_group"+global_group_nsid),undefined,undefined,true,true,undefined,self.setModalMode,false,undefined,undefined,undefined,true,false);Y.E.stopEvent(A);return false};