function place_menu(C,B){var A=Y.U.Dom.getX(B);var D=Y.U.Dom.getY(B)+24;if(F.is_ie){A-=2;D-=2}C.style.left=A+"px";C.style.top=D+"px"}var sendToBlogDialogDiv;function show_sendToBlogDialog(B){if(!_ok_for_scrumjax_xml()){document.location="/blog.gne?photo="+B;return }if(_ge("photo_props")){_ge("photo_props").style.display="none"}var C=_ge("photo_gne_button_blog_this");C.disable_others();if(sendToBlogDialogDiv==undefined){make_send_to_div("sendToBlog",B)}place_menu(sendToBlogDialogDiv,C);sendToBlogDialogDiv.style.display="block";if(navigator.userAgent.indexOf("Mozilla/5.0")!=-1&&navigator.userAgent.indexOf("KHTML")==-1){var A=_ge("sendToBlogDialogListDiv").offsetHeight;if(A>=220){_ge("sendToBlogDialogListDiv").style.overflow="-moz-scrollbars-vertical"}}}var sendToGroupDialogDiv;function show_sendToGroupDialog(B){if(!_ok_for_scrumjax_xml()){document.location="/photo_sendto_group.gne?id="+B;return }if(_ge("photo_props")){_ge("photo_props").style.display="none"}var C=_ge("photo_gne_button_send_to_group");C.disable_others();if(sendToGroupDialogDiv==undefined){make_send_to_div("sendToGroup",B)}place_menu(sendToGroupDialogDiv,C);sendToGroupDialogDiv.style.display="block";if(navigator.userAgent.indexOf("Mozilla/5.0")!=-1&&navigator.userAgent.indexOf("KHTML")==-1){var A=_ge("sendToGroupDialogListDiv").offsetHeight;if(A>=220){_ge("sendToGroupDialogListDiv").style.overflow="-moz-scrollbars-vertical"}}}var sendToSetDialogDiv;function show_sendToSetDialog(B){if(!_ok_for_scrumjax_xml()){document.location="/photo_sendto_set.gne?id="+B;return }if(_ge("photo_props")){_ge("photo_props").style.display="none"}var C=_ge("photo_gne_button_send_to_set");C.disable_others();if(sendToSetDialogDiv==undefined){make_send_to_div("sendToSet",B)}place_menu(sendToSetDialogDiv,C);sendToSetDialogDiv.style.display="block";if(navigator.userAgent.indexOf("Mozilla/5.0")!=-1&&navigator.userAgent.indexOf("KHTML")==-1){var A=_ge("sendToSetDialogListDiv").offsetHeight;if(A>=220){_ge("sendToSetDialogListDiv").style.overflow="-moz-scrollbars-vertical"}}}var printDialogDiv;function show_printDialog(A){if(!_ok_for_scrumjax_xml()){document.location="/photo_print.gne?id="+A;return }if(_ge("photo_props")){_ge("photo_props").style.display="none"}var B=_ge("photo_gne_button_print");B.disable_others();if(printDialogDiv==undefined){make_send_to_div("print",A)}place_menu(printDialogDiv,B);printDialogDiv.style.display="block"}var addToGalleryDialogDiv;function show_addToGalleryDialog(C){if(_ge("photo_props")){_ge("photo_props").style.display="none"}var D=_ge("photo_gne_button_add_to_gallery");D.disable_others();if(addToGalleryDialogDiv==undefined){make_send_to_div("addToGallery",C)}place_menu(addToGalleryDialogDiv,D);addToGalleryDialogDiv.style.display="block";if(window.gallery_ids_for_user){var A=window.gallery_ids_for_user.length;F.existing_gallery_ids={};if(A>0){for(var B=0;B<A;B++){F.existing_gallery_ids[window.gallery_ids_for_user[B]]={}}}}}function hide_printDialog(){hide_send_to_div(printDialogDiv,_ge("photo_gne_button_print"));var A=_ge("print_form");if(A&&A.clear){A.clear()}}function hide_sendToSetDialog(){hide_send_to_div(sendToSetDialogDiv,_ge("photo_gne_button_send_to_set"),_ge("sendToSetDialogFormDiv"));var A=_ge("new_set_form");A.set_title.value="";A.set_description.value=""}function hide_sendToGroupDialog(){hide_send_to_div(sendToGroupDialogDiv,_ge("photo_gne_button_send_to_group"))}function hide_sendToBlogDialog(){hide_send_to_div(sendToBlogDialogDiv,_ge("photo_gne_button_blog_this"))}function hide_addToGalleryDialog(){hide_send_to_div(addToGalleryDialogDiv,_ge("photo_gne_button_add_to_gallery"))}hide_send_to_div=function(D,C,B){C.enable_others();C.lock_down=0;C.handle_mouseout();D.style.display="none";window.should_I_ignore_stuff_because_of_button_action=0;_ge(D.id.replace("Div","")+"HeaderDiv").innerHTML=D.get_click_a_text();var A=_ge(D.id.replace("Div","")+"ListDiv");if(B&&B.style.display=="block"){A.style.display="block";B.style.display="none"}};make_send_to_div=function(G,D){var I=G+"Dialog";var N=I+"Div";if(G=="sendToSet"){var J="set";var L=F.output.get("photo_what_set");var C=F.output.get("photo_what_set_plural");var B=49;var H="flickr.photosets.getList";var M=F.output.get("photo_create_new_one",N)}else{if(G=="sendToGroup"){var J="group";var L=F.output.get("photo_what_group");var C=F.output.get("photo_what_group_plural");var B=54;var H="flickr.groups.pools.getGroups";var M=F.output.get("photo_dont_belong")}else{if(G=="sendToBlog"){var J="blog";var L=F.output.get("photo_what_blog");var C=F.output.get("photo_what_blog_plural");var B=48;var H="flickr.blogs.getList";var M=F.output.get("photo_configure_blog_now")}else{if(G=="print"){var J="print";var L=F.output.get("photo_what_print");var C=F.output.get("photo_what_print_plural");var B=58;var H="";var M=""}else{if(G=="addToGallery"){var J="gallery";var L=F.output.get("photo_what_print");var C=F.output.get("photo_what_print_plural");var B=52;var H="flickr.galleries.getList";var M=""}else{return }}}}}var A=window[N]=document.createElement("div");A.id=N;A.style.position="absolute";A.style.padding="0 0px 0px 0px";A.style.border="1px solid #999";A.style.borderWidth="0 1px 1px 1px";A.style.fontFamily="arial";A.style.fontSize="12px";A.style.textAlign="left";A.style.backgroundColor="#fff";A.style.width="250px";A.style.overflow="visible";A.style.zIndex="1000";if(G=="print"){A.style.width="270px";var K='<div style="border:1px solid #999; border-width:1px 0 0 0;height:1px; margin-left:'+B+'px; font-size:1px;"></div>';K+='<div id="'+I+'HeaderDiv" style="text-align:center; padding:3px 0 3px 0;">'+F.output.get("photo_loading_print_options")+"</div>";K+='<div id="'+I+'ListWrapperDiv" style="display:none; background-color:#fff; padding:4px 2px 4px 2px; border-bottom: 1px solid #ddd; border-top: 1px solid #ddd;">';K+='<div id="'+I+'ListDiv" style="padding-right:2px; max-height:450px; overflow:auto;"></div>';K+="</div>";K+='<div id="'+I+'BottomDiv" style="margin:0px; display:none; background-color:#f7f7f7; font-family:arial; font-size:11px; padding:13px 13px 8px 13px;">';K+="<!--"+F.output.get("photo_printing_services_provided_by");K+='<br><img src="'+_images_root+'/icon_cart.gif" width="16" height="16" border="0" style="border:0; float:right; display:block;"><br clear="all">';K+="--></div>"}else{var K='<div style="border:1px solid #999; border-width:1px 0 0 0;height:1px; margin-left:'+B+'px; font-size:1px;"></div>';if(J=="set"){K+='<div id="'+I+'HeaderDiv" style="text-align:center; padding:3px 0 3px 0;">'+F.output.get("photo_loading_what_set")+"</div>"}if(J=="group"){K+='<div id="'+I+'HeaderDiv" style="text-align:center; padding:3px 0 3px 0;">'+F.output.get("photo_loading_what_group")+"</div>"}if(J=="blog"){K+='<div id="'+I+'HeaderDiv" style="text-align:center; padding:3px 0 3px 0;">'+F.output.get("photo_loading_what_blog")+"</div>"}if(J=="print"){K+='<div id="'+I+'HeaderDiv" style="text-align:center; padding:3px 0 3px 0;">'+F.output.get("photo_loading_what_print")+"</div>"}if(J=="gallery"){K+='<div id="'+I+'HeaderDiv" style="text-align:center; padding:3px 0 3px 0;">'+F.output.get("photo_loading_what_gallery")+"</div>"}K+='<div style="display:none; background-color:#fff; padding:4px 2px 4px 2px; border-bottom: 1px solid #ddd; border-top: 1px solid #ddd;">';K+='<div id="'+I+'ListDiv" style="padding-right:2px; max-height:220px; overflow:auto;"></div>';K+='	<div id="'+I+'FormDiv" style="margin:10px; display:none; height:200px">';if(G=="sendToSet"){K+='<form id="new_set_form" onsubmit="_ge(\''+N+"').create_new_set(); return false;\">";K+=F.output.get("photo_title")+'<br><input type="text" name="set_title" style="width:220px;"><br><br>';K+=F.output.get("photo_description")+'<br><textarea type="text" name="set_description" style="width:220px; height:105px;"></textarea><br>';K+='<input type="button" class="Butt" value="'+F.output.get("photo_create_new_set")+'" onclick="_ge(\''+N+'\').create_new_set(); this.blur();" style="margin:5px 0 0 0;">';K+="</form>"}if(G=="addToGallery"){K+='<form id="new_gallery_form" onsubmit="_ge(\''+N+"').create_new_gallery(); return false;\">";K+=F.output.get("photo_title")+'<br><input type="text" name="gallery_title" style="width:220px;"><br><br>';K+=F.output.get("photo_description")+'<br><textarea type="text" name="gallery_description" style="width:220px; height:105px;"></textarea><br>';K+='<input type="button" class="Butt" value="'+F.output.get("photo_create_new_gallery")+'" onclick="_ge(\''+N+'\').create_new_gallery(); this.blur();" style="margin:5px 0 0 0; text-transform:uppercase;">';K+="</form>"}K+="</div>";K+="</div>";K+='<div id="'+I+'BottomDiv" style="margin:3px; display:none; text-align:center;">';K+='<a href="" onclick="hide_'+I+'(); return false;">'+F.output.get("cancel")+"</a>";K+="</div>"}A.innerHTML=K;document.body.appendChild(A);A.get_click_a_text=function(){var O="";if(G=="sendToSet"){if(user_can_create_sets){O+=F.output.get("photo_choose_a_set_or","_ge('"+N+"').show_new_set_form();return false;")}else{O+=F.output.get("photo_choose_a_set")}}else{if(G=="addToGallery"){O+=F.output.get("photo_choose_a_gallery_or","_ge('"+N+"').show_new_gallery_form(); return false;")}else{if(G=="print"){O=F.output.get("photo_choose_a_size")}else{if(J=="set"){O=F.output.get("photo_choose_a_what_set")}if(J=="group"){O=F.output.get("photo_choose_a_what_group")}if(J=="blog"){O=F.output.get("photo_choose_a_what_blog")}if(J=="print"){O=F.output.get("photo_choose_a_what_print")}if(J=="gallery"){O=F.output.get("photo_choose_a_what_gallery")}}}}return O};A.show_new_set_form=function(){_ge(I+"ListDiv").parentNode.style.display="block";_ge(I+"HeaderDiv").innerHTML=F.output.get("photo_create_new_set_ups");_ge(I+"ListDiv").style.display="none";_ge(I+"FormDiv").style.display="block";_ge("new_set_form").set_title.focus()};A.show_new_gallery_form=function(){_ge(I+"ListDiv").parentNode.style.display="block";_ge(I+"HeaderDiv").innerHTML=F.output.get("photo_create_new_gallery");_ge(I+"ListDiv").style.display="none";_ge(I+"FormDiv").style.display="block";_ge("new_gallery_form").gallery_title.focus()};A.create_new_set=function(){var O=_ge("new_set_form");var Q=O.set_title.value;var P=O.set_description.value;if(Q==""){alert(F.output.get("photo_must_enter_set_title"));return }this.send_to_action(null,Q,"create",P)};A.create_new_gallery=function(){var O=_ge("new_gallery_form");var Q=O.gallery_title.value;var P=O.gallery_description.value;if(Q==""){alert(F.output.get("photo_must_enter_gallery_title"));return }this.send_to_action(null,Q,"create",P)};A.send_to_action=function(Q,V,R,X,T){var S=_ge("photo_notes");if(G=="sendToGroup"&&R=="add"&&!global_photos[D].isPublic&&!T){window["hide_"+I]();var O=function(){A.send_to_action(Q,V,R,X,1)};var W=F.output.get("photo_private_photo_to_group",V);S.start_comming(W,1,1,F.output.get("yes_up"),O,1,F.output.get("no_up"),null);return }deja_view_uh_huh();if(G=="print"){var P=F.output.get("photo_adding_prints_to_cart")}else{if(R=="remove"){var P="";if(J=="set"){P=F.output.get("photo_removing_photo_from_what_set")}if(J=="group"){P=F.output.get("photo_removing_photo_from_what_group")}if(J=="blog"){P=F.output.get("photo_removing_photo_from_what_blog")}}else{if(R=="create"){var P="";if(J=="set"){P=F.output.get("photo_creating_new_what_set")}if(J=="group"){P=F.output.get("photo_creating_new_what_group")}if(J=="blog"){P=F.output.get("photo_creating_new_what_blog")}}else{var P="";if(J=="set"){P=F.output.get("photo_adding_photo_to_what_set")}if(J=="group"){P=F.output.get("photo_adding_photo_to_what_group")}if(J=="blog"){P=F.output.get("photo_adding_photo_to_what_blog")}}}}window["hide_"+I]();this.id_dealing_with=Q;this.id_for_gallery_url=(G=="addToGallery"&&Q)?Q.substring(Q.lastIndexOf("-")+1):null;this.title_dealing_with=V;if(G=="sendToSet"){if(R=="create"){F.API.callMethod("flickr.photosets.create",{title:V,description:X,primary_photo_id:D},A)}else{if(R=="remove"){F.API.callMethod("flickr.photosets.removePhoto",{photoset_id:Q,photo_id:D},A)}else{F.API.callMethod("flickr.photosets.addPhoto",{photoset_id:Q,photo_id:D},A)}}}else{if(G=="addToGallery"){if(R=="create"){F.API.callMethod("flickr.galleries.create",{title:V,description:X,primary_photo_id:D},A)}else{if(R=="remove"){F.API.callMethod("flickr.galleries.removePhoto",{gallery_id:Q,photo_id:D},A)}else{if(parseInt(A.galleries_collection[Q].count_photos)<18){F.API.callMethod("flickr.galleries.addPhoto",{gallery_id:Q,photo_id:D},A)}else{S.start_comming("This gallery has reached its limit of 18 items and your photo cannot be added.",1,1);return }}}}else{if(G=="sendToGroup"){if(R=="remove"){F.API.callMethod("flickr.groups.pools.remove",{group_id:Q,photo_id:D},A)}else{F.API.callMethod("flickr.groups.pools.add",{group_id:Q,photo_id:D},A)}}else{if(G=="sendToBlog"){var U=_ge("blog_form");U.blog.value=Q;U.submit();return }else{if(G=="print"){A.addToCart_responses_expected=page_print_orderA.length;A.addToCart_responses=0;A.addToCart_error_count=0;A.addToCart_problem_product_ids=[];A.addToCart_cart_url="";A.addToCart_last_error="";A.send_another_printing_product()}else{return }}}}}if(S&&S.start_comming){S.start_comming(P)}};A.send_another_printing_product=function(){var O=page_print_orderA[A.addToCart_responses].split(":");var P={provider_id:page_printing_provider,photo_ids:D,product_id:O[0].replace("prod",""),quantity:O[1]};F.API.callMethod("flickr.printing.addToCart",P,A)};A.flickr_printing_addToCart_onLoad=function(X,W,V,Q){A.addToCart_responses++;if(X){A.addToCart_cart_url=W.documentElement.getElementsByTagName("cart")[0].firstChild.nodeValue}else{A.addToCart_error_count++;A.addToCart_problem_product_ids.push(Q.product_id);if(V){A.addToCart_last_error=V}else{A.addToCart_last_error=F.output.get("unknown_err")}}if(A.addToCart_responses!=A.addToCart_responses_expected){A.send_another_printing_product();return }var T=_ge("photo_notes");writeDebug("div.addToCart_responses "+A.addToCart_responses+" "+A.addToCart_error_count);if(A.addToCart_responses>A.addToCart_error_count){if(A.addToCart_error_count>0){var R=F.output.get("photo_adding_some_errors",global_photos[D].title,A.addToCart_error_count,A.addToCart_last_error.truncate_with_ellipses(400).replace("&","[wbr]&").replace("/","/[wbr]").replace("=","=[wbr]").escape_for_display_and_wrap().replace("[wbr]","<wbr>"))}else{var R=F.output.get("photo_added_prints_to_cart",global_photos[D].title,A.addToCart_cart_url)}R+='<ul style="padding-left:20px;">';for(var S=0;S<page_print_orderA.length;S++){var P=page_print_orderA[S].split(":");if(F.array_index_of(A.addToCart_problem_product_ids,A.productsO[P[0]].id)>-1){R+='<li style="color:red;"><b>'+0+"</b> @ "+A.productsO[P[0]].id+" "+A.productsO[P[0]].name+"</li>"}else{R+="<li><b>"+P[1]+"</b> @ "+A.productsO[P[0]].name+" <nobr>("+format_price(P[1]*(A.productsO[P[0]].price.replace(".","")))+")</nobr></li>"}}R+="</ul>";R+='<form id="print_cart_form"><input type="button" id="print_ok_button" class="Butt" value="'+F.output.get("photo_continue_browsing")+'" style="margin:5px 0 10px 0;"><br>'+F.output.get("photo_or_are_you_ready")+'<br><input type="button" id="print_cart_button" class="Butt" value="'+F.output.get("photo_proceed")+'" style="margin:5px 0 10px 0;"></form><div id="print_cart_prompt"><img src="'+_images_root+'/icon_cart.gif" width="16" height="16" border="0" style="margin:0 6px 20px 0; border:0; float:left; display:block;"><div>'+F.output.get("photo_get_to_cart")+"</div></div>";T.start_comming(R,1,0,F.output.get("photo_go_to_cart"),1,F.output.get("close_up"),null);var U=_ge("print_ok_button");if(navigator.userAgent.indexOf("KHTML")==-1){U.focus()}U.onclick=function(){T.stop_comming();this.blur()};var O=_ge("print_cart_button");O.onclick=function(){T.stop_comming();this.blur();document.location=A.addToCart_cart_url}}else{alert(F.output.get("photo_errors_adding_prints")+" "+A.addToCart_last_error);if(T&&T.stop_comming){T.stop_comming(1)}}};A.flickr_photosets_removePhoto_onLoad=A.flickr_groups_pools_remove_onLoad=A.flickr_galleries_removePhoto_onLoad=function(U,T,S){var P=_ge("photo_notes");var O=_ge("add_to_"+J+"_"+this.id_dealing_with+"_div");var Q=_ge("add_to_"+J+"_"+this.id_dealing_with+"_td");if(U||S.indexOf("not in pool")!=-1||S.indexOf("not in set")!=-1){if(O){O.make_me_for_adding()}if(P&&P.p_id&&G=="sendToSet"){var R=F.output.get("photo_removed_from_set",global_photos[D].ownersUrl,this.id_dealing_with,this.title_dealing_with);remove_context_widget("set",this.id_dealing_with);F.API.callMethod(H,{},A)}else{if(P&&P.p_id&&G=="sendToGroup"){var R=F.output.get("photo_removed_from_pool",this.id_dealing_with,this.title_dealing_with);remove_context_widget("pool",this.id_dealing_with)}else{if(P&&P.p_id&&G=="addToGallery"){var R=F.output.get("photo_removed_from_gallery",this.id_for_gallery_url,this.title_dealing_with)}}}P.start_comming(R,1,1,F.output.get("ok"))}else{alert(F.output.get("api_err_generic")+" "+S);if(P&&P.stop_comming){P.stop_comming(1)}}};A.flickr_photosets_addPhoto_onLoad=A.flickr_groups_pools_add_onLoad=A.flickr_galleries_addPhoto_onLoad=function(X,W,T,P){var S=_ge("photo_notes");var V=_ge("add_to_"+J+"_"+this.id_dealing_with+"_div");var Q=_ge("add_to_"+J+"_"+this.id_dealing_with+"_td");if(X||T.indexOf("already in pool")!=-1||T.indexOf("already in set")!=-1||T.indexOf("already in gallery")!=-1||T.indexOf("Your Photo has been added to the Pending Queue for this Pool")!=-1){if(V){V.make_me_for_removing()}if(S&&S.p_id&&G=="sendToSet"){var R=F.output.get("photo_added_to_set",global_photos[D].ownersUrl,this.id_dealing_with,this.title_dealing_with);add_context_widget("set",this.id_dealing_with,D)}else{if(S&&S.p_id&&G=="sendToGroup"){if(T.indexOf("Your Photo has been added to the Pending Queue for this Pool")!=-1){var R=F.output.get("photo_added_to_pool_pending",this.id_dealing_with,this.title_dealing_with)}else{var R=F.output.get("photo_added_to_pool",this.id_dealing_with,this.title_dealing_with)}add_context_widget("pool",this.id_dealing_with,D,(T.indexOf("Your Photo has been added to the Pending Queue for this Pool")!=-1)?true:false)}else{if(S&&S.p_id&&G=="addToGallery"){var R=F.output.get("photo_added_to_gallery",photos_url+"galleries/"+this.id_for_gallery_url,this.title_dealing_with)}}}var U=function(){V.confirm_remove()};S.start_comming(R,1,1,F.output.get("ok"),null,1,F.output.get("undo"),U)}else{if(!W){alert(F.output.get("api_err_generic")+" "+T);if(S&&S.stop_comming){S.stop_comming(1)}return }var O=W.documentElement.getElementsByTagName("err")[0];if(O&&O.getAttribute("code")=="5"&&J=="group"){this.flickr_groups_getInfo_onLoad=function(g,f,c,e){var b=f.documentElement.getElementsByTagName("throttle")[0];var Z=b.getAttribute("count");var a=b.getAttribute("mode");if(a=="disabled"){var d=F.output.get("photo_adding_disabled",this.title_dealing_with)}else{if(a=="ever"){if(Z*1>1){var d=F.output.get("photo_limits_1",Z,this.title_dealing_with,Z)}else{var d=F.output.get("photo_limits_2",Z,this.title_dealing_with,Z)}}else{if(Z*1>1){var d=F.output.get("photo_limits_3_"+a,Z,this.title_dealing_with,Z)}else{var d=F.output.get("photo_limits_4_"+a,Z,this.title_dealing_with,Z)}}}d+="<br><br>"+F.output.get("photo_see_group_for_info",_site_root,this.id_dealing_with,this.title_dealing_with);S.start_comming(d,1,1)};F.API.callMethod("flickr.groups.getInfo",{group_id:this.id_dealing_with},this)}else{if(O&&O.getAttribute("code")=="4"&&J=="group"){S.start_comming(F.output.get("photo_max_groups",global_group_limit,this.title_dealing_with),1,1)}else{if(O&&O.getAttribute("code")=="6"&&J=="group"){S.start_comming(F.output.get("photo_max_groups",global_group_limit,this.title_dealing_with),1,1)}else{if(O&&O.getAttribute("code")=="7"&&J=="group"){S.start_comming(F.output.get("photo_added_to_pool_already_pending",global_group_limit,this.title_dealing_with),1,1);if(V){V.make_me_for_removing()}}else{if(O&&O.getAttribute("code")=="8"&&J=="group"){this.pool_restrictions_fragment_onLoad=function(c,Z,b){var a=F.output.get("photo_not_added_to_pool_restrictions",this.id_dealing_with,this.title_dealing_with);a+=restrictions_html='<ul class="batch_edit_pool_restrictions">'+Z+"</ul>";a+=""+F.output.get("photo_see_group_for_info",_site_root,this.id_dealing_with,this.title_dealing_with);S.start_comming(a,1,1)};F.fragment_getter.get("/fragment_groups_pool_restrictions.gne",{nsid:this.id_dealing_with},this,"pool_restrictions_fragment_onLoad")}else{alert(F.output.get("api_err_generic")+" "+T);if(S&&S.stop_comming){S.stop_comming(1)}}}}}}}};A.flickr_photosets_create_onLoad=function(T,S,R){var P=_ge("photo_notes");if(T){var O=S.documentElement.getElementsByTagName("photoset")[0];if(P&&P.p_id&&G=="sendToSet"){var Q=F.output.get("photo_added_to_set2",O.getAttribute("url"),this.title_dealing_with);add_context_widget("set",O.getAttribute("id"),D)}P.start_comming(Q,1,1,F.output.get("ok"),null);F.API.callMethod(H,{new_set_id_passthrough:O.getAttribute("id")},A)}else{alert(F.output.get("api_err_generic")+" "+R);if(P&&P.stop_comming){P.stop_comming(1)}}};A.flickr_galleries_create_onLoad=function(T,S,R){var O=_ge("photo_notes");if(T){var P=S.documentElement.getElementsByTagName("gallery")[0];if(O&&O.p_id&&G=="addToGallery"){var Q=F.output.get("photo_added_to_new_gallery",P.getAttribute("url"),this.title_dealing_with)}O.start_comming(Q,1,1,F.output.get("ok"),null);F.API.callMethod(H,{new_gallery_id_passthrough:P.getAttribute("id")},A)}else{alert(F.output.get("api_err_generic")+" "+R);if(O&&O.stop_comming){O.stop_comming(1)}}};A.flickr_photosets_getList_onLoad=A.flickr_blogs_getList_onLoad=A.flickr_groups_pools_getGroups_onLoad=A.flickr_galleries_getList_onLoad=function(V,O,Z,o){if(!V){alert(F.output.get("api_err_generic")+" "+Z)}var j=1;var T=1;if(G=="sendToSet"){var b=O.documentElement.getElementsByTagName("photoset");user_can_create_sets=(O.documentElement.getElementsByTagName("photosets")[0].getAttribute("cancreate")=="1")?1:0;_ge(I+"HeaderDiv").innerHTML=this.get_click_a_text()}else{if(G=="sendToGroup"){var b=O.documentElement.getElementsByTagName("group");j=O.documentElement.getElementsByTagName("groups")[0].getAttribute("pages")*1;T=O.documentElement.getElementsByTagName("groups")[0].getAttribute("page")*1}else{if(G=="sendToBlog"){var b=O.documentElement.getElementsByTagName("blog")}else{if(G=="addToGallery"){var b=O.documentElement.getElementsByTagName("gallery")}else{return }}}}if(b.length==0){if(G=="sendToSet"){A.show_new_set_form()}else{if(G=="addToGallery"){A.show_new_gallery_form()}else{_ge(I+"BottomDiv").innerHTML="<br>"+M+"<br><br>"+_ge(I+"BottomDiv").innerHTML+"";_ge(I+"HeaderDiv").style.display="none"}}}else{if(T==1){_ge(I+"ListDiv").innerHTML=""}var r=_page_timer.add("before collection iteration");A.galleries_collection=[];for(var k=0;k<b.length;k++){_page_timer.add("before handle one");var n=b[k];var m=n.getAttribute("id");if((G=="sendToSet")||(G=="addToGallery")){if(G=="addToGallery"){A.galleries_collection[n.getAttribute("id")]={};A.galleries_collection[n.getAttribute("id")].count_photos=n.getAttribute("count_photos")}var a="contextDiv_set"+m;var P="set";var f=O.documentElement.getElementsByTagName("title")[k].firstChild.nodeValue;var d=n.getAttribute("server");var W=Math.ceil(d/1000);var q=(G=="sendToSet")?"primary":"primary_photo_id";var e=_photo_root.replace("http://farm","http://farm"+W);var S=e+d+"/"+n.getAttribute(q)+"_"+n.getAttribute("secret")+"_s.jpg";var X=25;var Q=25}else{if(G=="sendToGroup"){var a="contextDiv_pool"+m;var P="pool";var f=n.getAttribute("name");var d=n.getAttribute("iconserver");var S=_images_root+"/buddyicon.jpg";if(d&&d!="0"){var W=Math.ceil(d/1000);var e=_photo_root.replace("http://farm","http://farm"+W);S=e+d+"/buddyicons/"+n.getAttribute("id")+".jpg"}var X=24;var Q=24}else{if(G=="sendToBlog"){var a="";var P="";var f=n.getAttribute("name");var S=_images_root+"/spaceball.gif";var X=20;var Q=2}}}var R=(k==0||(F.is_ie))?"0px":"-2px";var c=make_menu_item(J,m,f,R,S,Q,X,I);_ge(I+"ListDiv").appendChild(c);var l=false;if(G=="sendToGroup"){for(var h=0;h<in_groupsA.length;h++){if(in_groupsA[h].nsid==m&&(in_groupsA[h].status==1||in_groupsA[h].status==2)){l=true}}}if(G=="sendToGroup"&&l){c.make_me_for_removing()}else{if(G=="sendToSet"&&(_ge(a)&&_ge(a).style.display=="block"||nextprev_currentContextID==P+m)||o.new_set_id_passthrough==m){c.make_me_for_removing()}else{if(G=="addToGallery"&&((o.new_gallery_id_passthrough==m)||F.existing_gallery_ids[m])){c.make_me_for_removing()}else{c.make_me_for_adding()}}}_page_timer.add("after handle one")}_page_timer.add("after collection iteration");if(T<j){o.page=T+1;F.API.callMethod(o.method,o,this);return }_ge(I+"ListDiv").parentNode.style.display="block";if(F.is_ie){_ge(I+"ListDiv").style.height="auto";var U=_ge(I+"ListDiv").offsetHeight;if(U&&U>220){_ge(I+"ListDiv").style.height="220px"}}_ge(I+"HeaderDiv").innerHTML=A.get_click_a_text()}_ge(I+"BottomDiv").style.display="block";_page_timer.dump(r)};A.flickr_printing_getProducts_onLoad=function(Q,O,T,f){if(!Q){alert(F.output.get("api_err_generic")+" "+T)}calculate_photo_props(D);var X=global_photos[D];var W=O.documentElement.getElementsByTagName("product");if(W.length==0){hide_printDialog();return false}else{window.page_print_prices={};A.productsO={};for(var c=0;c<W.length;c++){var d=W[c];var V=d.getAttribute("id");var a=d.getAttribute("price");var h=d.getAttribute("name");var b=d.getAttribute("description");var S=d.getAttribute("minresx")*1;var R=d.getAttribute("minresy")*1;var Z=d.getAttribute("aspect")*1;var P=d.getAttribute("panorama")*1;var e=0;if(X.huge){if(F.array_index_of(global_huge_photo_print_ids,V)>-1){e=1}}else{if(F.array_index_of(global_wallet_photo_print_ids,V)>-1){e=1}}if(X.square){if(F.array_index_of(global_square_photo_print_ids,V)>-1){e=1}}if(X.dig_dims){if(F.array_index_of(global_dig_photo_print_ids,V)>-1){e=1}}else{if(F.array_index_of(global_reg_photo_print_ids,V)>-1){e=1}}writeDebug("min rec size:"+S+"x"+R+" size:"+X.o_w+"x"+X.o_h);if(Z==1){var U=(Math.min(X.o_w,X.o_h)>=S)?1:0}else{var U=(Math.max(X.o_w,X.o_h)>=Math.max(S,R)&&Math.min(X.o_w,X.o_h)>=Math.min(S,R))?1:0}writeDebug("recommended:"+U);A.productsO["prod"+V]={id:V,name:h.replace("Digital Aspect",""),description:b,price:a,recommended:U,show:e,minresx:S,minresy:R};page_print_prices["prod"+V]=a.replace(".","")}}A.show_printing_products()};A.flickr_printing_setPrefs_onLoad=function(R,Q,O,P){if(R){F.API.callMethod("flickr.printing.getProviders",{country_code:page_printing_country_code},A)}else{alert(F.output.get("api_err_generic")+" "+O)}};A.flickr_printing_getProviders_onLoad=function(S,R,O,Q){if(S){var P=R.documentElement.getElementsByTagName("provider");if(P.length==0){page_printing_provider=0}else{page_printing_provider=P[0].getAttribute("id")}if(!page_printing_provider||page_printing_provider=="0"){A.show_no_providers()}else{A.show_printing_products()}}else{alert(F.output.get("api_err_generic")+" "+O)}};A.show_print_screen_changing=function(O){_ge(I+"HeaderDiv").innerHTML="<br>"+O+"<br><br>";_ge(I+"ListDiv").parentNode.style.display="none"};A.set_country_select=function(R){if(!R){R=0}var P=_ge("country");if(!P){return }for(var O=0;O<P.options.length;O++){var Q=P.options[O];if(R==Q.value){P.selectedIndex=O;return }}};A.show_no_providers=function(){_ge(I+"HeaderDiv").innerHTML=F.output.get("photo_apologize");_ge(I+"HeaderDiv").style.display="none";_ge(I+"ListWrapperDiv").style.border="0px solid red";_ge("choose_a_country_div").style.display="none";if(A.no_providers_text==undefined){A.no_providers_text=_ge("no_providers_div").innerHTML}var O=function(P){P=P.replace("REP_COUNTRY",page_printing_country_name);return P};_ge("no_providers_div").innerHTML=O(A.no_providers_text);_ge("no_providers_div").style.display="block";_ge(I+"ListDiv").parentNode.style.display="block"};A.show_country_form=function(){_ge(I+"HeaderDiv").innerHTML=F.output.get("photo_first_things_first");_ge(I+"HeaderDiv").style.display="none";_ge(I+"ListWrapperDiv").style.border="0px solid red";_ge("no_providers_div").style.display="none";_ge("print_form").style.display="none";A.set_country_select(page_printing_country_code);var O=_ge("country_submit");var P=_ge("country_form");if(P){P.onsubmit=O.onclick=function(){var R=P.country.selectedIndex;if(P.country.options[R].value==0){return false}A.show_print_screen_changing(F.output.get("photo_setting_country"));page_printing_country_code=P.country.options[R].value;page_printing_country_name=P.country.options[R].text;F.API.callMethod("flickr.printing.setPrefs",{country_code:page_printing_country_code},A)};var Q=_ge("country");Q.onchange=function(){if(navigator.userAgent.indexOf("KHTML")==-1){O.focus()}}}_ge("choose_a_country_div").style.display="block";_ge(I+"ListDiv").parentNode.style.display="block";if(P){if(navigator.userAgent.indexOf("KHTML")==-1){Q.focus()}}};A.show_all_printing_products=function(){printDialogDiv.style.display="none";for(p in A.productsO){var O=A.productsO[p];if(O.show){continue}_ge("prod_"+O.id+"_tr").style.display=(F.is_ie)?"block":"table-row";if(!O.recommended){_ge("print_not_rec_tr").style.display=(F.is_ie)?"block":"table-row"}}show_printDialog(D)};A.show_printing_products=function(){if(A.productsO==undefined){F.API.callMethod("flickr.printing.getProducts",{provider_id:page_printing_provider},A);return }_ge(I+"HeaderDiv").innerHTML=A.get_click_a_text();_ge(I+"HeaderDiv").style.display="block";_ge("choose_a_country_div").style.display="none";_ge("no_providers_div").style.display="none";var R=_ge("print_product_tr");var S=R.parentNode;var X=function(b,a){var d=a.description+" "+F.output.get("photo_we_recommend",a.minresx,a.minresy);global_js_tip_count++;var c=F.get_tip_html(d,"js_tooltip_"+global_js_tip_count,"tip_print_menu");b=b.replace("REP_TIP",c);b=b.replace("REP_NAME",a.name);b=b.replace("REP_PRODUCT","prod"+a.id);b=b.replace("REP_PRICE",a.price);return b};for(p in A.productsO){var U=A.productsO[p];var V=document.createElement("tr");V.id="prod_"+U.id+"_tr";if(!U.show){V.style.display="none"}var Q=document.createElement("td");Q.className="print_dropdown_td";Q.innerHTML=X(R.childNodes[0].innerHTML,U);V.appendChild(Q);var P=document.createElement("td");P.className=(U.recommended)?"print_item_td":"print_item_notrec_td";P.innerHTML=X(R.childNodes[1].innerHTML,U);V.appendChild(P);var O=document.createElement("td");O.className=(U.recommended)?"print_price_td":"print_price_notrec_td";O.innerHTML=X(R.childNodes[2].innerHTML,U);V.appendChild(O);if(U.recommended){S.insertBefore(V,_ge("print_not_rec_tr"))}else{if(U.show){_ge("print_not_rec_tr").style.display=(F.is_ie)?"block":"table-row"}S.appendChild(V)}}var T=_ge("print_cancel");var Z=_ge("print_add");var W=_ge("print_form");W.clear=function(){for(var a=0;a<W.elements.length;a++){if(W.elements[a].type=="select-one"){W.elements[a].selectedIndex=0}}update_print_prices()};page_print_orderA=[];T.onclick=hide_printDialog;Z.onclick=function(){page_print_orderA=[];for(var a=0;a<W.elements.length;a++){if(W.elements[a].type=="select-one"){if(W.elements[a].value*1>0){writeDebug("print_form.elements[i].value "+W.elements[a].value);page_print_orderA.push(W.elements[a].name+":"+W.elements[a].value)}}}if(page_print_orderA.length>0){A.send_to_action(D,"cart","add")}return false};if(_ge("change_country_link2")){_ge("change_country_link2").onclick=function(){A.show_country_form();return false}}if(_ge("more_print_options")){_ge("more_print_options").onclick=function(){this.style.display="none";A.show_all_printing_products();return false}}_ge("print_form").style.display="block";_ge(I+"ListDiv").parentNode.style.display="block"};A.print_fragment_onLoad=function(Q,O,P){_ge(I+"ListDiv").innerHTML=O;if(page_printing_provider&&page_printing_provider!="0"){A.show_printing_products()}else{if(page_printing_country_code!=""){A.show_no_providers()}else{A.show_country_form()}}};if(G=="print"){var E={photo_id:D};if(page_qoop_url!=undefined){E.qoop_url=page_qoop_url}if(page_hp_url!=undefined){E.hp_url=page_hp_url}if(page_tinyprints_url!=undefined){E.tinyprints_url=page_tinyprints_url}F.fragment_getter.get("/photo_print_fragment.gne",E,A,"print_fragment_onLoad")}else{F.API.callMethod(H,{},A)}};make_menu_item=function(J,G,B,A,D,C,L,H){var I=(F.is_ie)?217:220;var K=document.createElement("DIV");K.id="add_to_"+J+"_"+G+"_div";K.style.marginTop=A;K.highlight=function(){this.style.backgroundColor="#0063DC";_ge("add_to_"+J+"_"+G+"_td").style.color="#fff"};K.unhighlight=function(){this.style.backgroundColor="transparent";_ge("add_to_"+J+"_"+G+"_td").style.color="#0063DC"};K.add_action=function(){window[H+"Div"].send_to_action(G,B,"add")};K.remove_action=function(){window[H+"Div"].send_to_action(G,B,"remove")};K.confirm_remove=function(){window["hide_"+H]();var M=function(){K.remove_action()};var N=_ge("photo_notes");N.start_comming(F.output.get("photo_are_you_sure",B),1,1,F.output.get("yes_up"),M,1,F.output.get("cancel"),null)};K.make_me_for_removing=function(){this.unhighlight();this.style.cursor="default";_ge("add_to_"+J+"_"+G+"_td").style.color="#999";if(J=="set"){remove_link='<a title="'+F.output.get("photo_remove_from_set",B.replace("<","&lt;").replace('"',"&quot;"))+'" class="remove_thing delete-x-inline" href="" onclick="_ge(\''+K.id+'\').confirm_remove();return false;"><img src="'+_images_root+'/spaceball.gif" width="14" height="14" align="top" alt="[x]"></a>'}else{if(J=="group"){remove_link='<a title="'+F.output.get("photo_remove_from_pool",B.replace("<","&lt;").replace('"',"&quot;"))+'" class="remove_thing delete-x-inline" href="" onclick="_ge(\''+K.id+'\').confirm_remove();return false;"><img src="'+_images_root+'/spaceball.gif" width="14" height="14" align="top" alt="[x]"></a>'}else{if(J=="gallery"){remove_link='<a title="'+F.output.get("photo_remove_from_gallery",B.replace("<","&lt;").replace('"',"&quot;"))+'" class="remove_thing" href="" onclick="_ge(\''+K.id+"').confirm_remove();return false;\">[X]</a>"}}}_ge("add_to_"+J+"_"+G+"_td").innerHTML=B.truncate_with_ellipses(25)+" "+remove_link;this.onmouseout=null;this.onmouseover=null;this.onclick=null};K.make_me_for_adding=function(){this.unhighlight();this.style.cursor=(F.is_ie)?"hand":"pointer";_ge("add_to_"+J+"_"+G+"_td").style.color="#0063DC";_ge("add_to_"+J+"_"+G+"_td").innerHTML="<span>"+B.truncate_with_ellipses(31)+"</span>";this.onmouseout=this.unhighlight;this.onmouseover=this.highlight;this.onclick=this.add_action};var E="";E+='<table border="0" cellspacing="0" cellpadding="0" width="'+I+'"><tr>';E+='<td valign="top" style="padding:0; width:'+(C+7)+'px;">';E+='<img src="'+D+'" width="'+C+'" height="'+L+'" style="border:0; display:block; margin: 2px 0 2px 2px;"></td>';E+='<td id="add_to_'+J+"_"+G+'_td">';E+="</td></tr></table>";K.innerHTML=E;return K};remove_context_widget=function(I,C){if(I=="pool"){for(var A=0;A<in_groupsA.length;A++){if(in_groupsA[A].nsid==C){in_groupsA[A].status=0;break}}}var G=_ge("contextDiv_"+I+C);if(G){G.style.display="none";if(nextprev_currentContextID==I+C){var E=_ge("nextprev_button_stream"+global_nsid);if(E&&!E.isOpen){E.handle_click()}}var B=_ge("other_contexts_p");var D=Y.U.Dom.getElementsByClassName("contextDiv","DIV");var H=0;for(var A=0;A<D.length;A++){if(D[A].style.display=="block"&&D[A].parentNode==B.parentNode){H++;break}}if(!H){B.style.display="none"}}};add_context_widget=function(J,A,D,C){if(C==null){C=false}if(J=="pool"){var I=false;for(var G=0;G<in_groupsA.length;G++){if(in_groupsA[G].nsid==A){in_groupsA[G].status=(C)?2:1;I=true;break}}if(!I){in_groupsA.push(new in_groupsObj(A,(C)?2:1))}}if(C==true){return }var E=_ge("contextDiv_"+J+A);var B=_ge("other_contexts_p");B.style.display="block";if(E){E.style.display="block";if(nextprev_currentContextID==J+A){var H=_ge("nextprev_button_stream"+global_nsid);if(H&&H.isOpen){H.handle_mouseup();H.handle_mouseout()}}}else{B.add_context_widget=function(O,L,N){if(L==""){return }if(L.indexOf('id="contextLink_"')>0){return }var K=document.createElement("div");K.id="contextDiv_"+J+A;K.style.display="block";K.innerHTML=L;var M=this.parentNode.getElementsByTagName("DIV");if(M.length>0){this.parentNode.insertBefore(K,M[0])}else{this.parentNode.appendChild(K)}F.decorate(_ge("nextprev_button_"+J+A),F._nextprev_button).button_go_go_go(J,A,D)};F.fragment_getter.get("/photo_context_fragment.gne",{photo_id:D,context_type:J,context_id:A},B,"add_context_widget")}};increment_print_dropdown=function(D){var A=_ge(D);var B=A.selectedIndex;B++;if(B>=A.options.length){for(var C=0;C<10;C++){A.options.length++;A.options[A.options.length-1].value=A.options[A.options.length-1].text=A.options.length-1}}A.selectedIndex=B;update_print_prices(D)};decrement_print_dropdown=function(C){var A=_ge(C);var B=A.selectedIndex;B--;if(B<0){return }A.selectedIndex=B;update_print_prices(C)};format_price=function(A){var B=A/100;if(B==0){B="0.00"}else{if(B<1){B=B.toString()}}dpA=B.toString().split(".");if(dpA.length==1){B=B.toString()+".00"}else{if(dpA[1].length==1){B=B.toString()+"0"}}B="$ "+B;return B};update_print_prices=function(G){var A=_ge("print_form");var E=_ge("price_print_total_td");var C=0;for(var B=0;B<A.elements.length;B++){if(A.elements[B].type=="select-one"){if(A.elements[B].value*1>0){var D=page_print_prices[A.elements[B].name];C=C+(D*A.elements[B].value)}}}var H=format_price(C);if(C>0){H="<nobr><b>"+H+"</b></nobr>";if(A.last_total!=C){anim_do_blink_pink(E)}}else{E.style.color="rgb(0, 0, 0)"}E.innerHTML=H;A.last_total=C};var place_notes_text_div=function(B){if(!F.is_ie){return }var A=_ge("photo_notes");if(A){A.place_notes_text_div();_set_single_shadow_height(_ge("notes_text_table"))}return };var adjust_textarea_height=function(A){return ;temp_div.innerHTML=A.value.replace("<","&lt;").replace("\n","<br>")+"g";A.style.height=(temp_div.offsetHeight)+"px";return ;if(A.scrollHeight>A.clientHeight){A.style.height=A.scrollHeight}};function show_notes_initially(){if(window.should_I_ignore_stuff_because_of_button_action||window.should_I_ignore_stuff_because_of_editable_div_action){return }var A=_ge("photo_notes");if(A&&A.p_id){A.shown_initially=1;A.style.visibility="visible";if(!A.tried_to_show_before_shown_initially){A.go_away_in_a_bit()}}}function calculate_photo_props(A){var D=global_photos[A];if(!D){return }var B=Math.max(D.o_w,D.o_h);var C=Math.min(D.o_w,D.o_h);D.aspect=B/C;D.panorama=(D.aspect>=2)?1:0;D.dig_dims=(D.aspect<1.36)?1:0;D.square=(D.aspect>0.96&&D.aspect<1.04)?1:0;D.small=(B<=1024)?1:0;D.huge=(C>=3000&&B>=4500)?1:0;if(writeDebug){writeDebug("aspect "+D.aspect)}if(writeDebug){writeDebug("panorama "+D.panorama)}if(writeDebug){writeDebug("dig_dims "+D.dig_dims)}if(writeDebug){writeDebug("square "+D.square)}if(writeDebug){writeDebug("small "+D.small)}if(writeDebug){writeDebug("huge "+D.huge)}}function ok_accept(A,B){_ge("div_invite_confirm_"+A).style.display="none";_ge("div_invite_confirm_loading_"+A).style.display="block";var C={flickr_groups_invite_photo_accept_onLoad:function(L,K,H,J){if(L){add_context_widget("pool",B,page_photo_id,false);_ge("div_invite_confirm_"+A).style.display="none";_ge("div_invite_confirm_loading_"+A).style.display="none";_ge("div_invite_confirm_hooray_"+A).style.display="block";in_groupsA.push(new in_groupsObj(B,1));var E=_ge("add_to_group_"+B+"_div");if(E){E.make_me_for_removing()}}else{var G=K.documentElement.getElementsByTagName("err")[0];if(G){var I=G.getAttribute("msg");if(photo_notes&&photo_notes.stop_comming){photo_notes.stop_comming(1)}photo_notes.start_comming(F.output.get("api_err_generic")+" "+I.escape_for_display(),1,1);_ge("div_invite_confirm_"+A).style.display="block";_ge("div_invite_confirm_loading_"+A).style.display="none"}}}};var D=new Object();D.user_id=global_nsid;D.photo_id=page_photo_id;D.comment_id=A;D.group_id=B;F.API.callMethod("flickr.groups.invite.photo.accept",D,C,null,null,0)}function no_deny(A,B){_ge("div_invite_confirm_"+A).style.display="none";var C={flickr_groups_invite_photo_decline_onLoad:function(K,J,G,I){if(K){}else{var E=J.documentElement.getElementsByTagName("err")[0];if(E){var H=E.getAttribute("msg");if(photo_notes&&photo_notes.stop_comming){photo_notes.stop_comming(1)}photo_notes.start_comming(F.output.get("api_err_generic",G.escape_for_display()),1,1)}}}};var D=new Object();D.user_id=global_nsid;D.photo_id=page_photo_id;D.comment_id=A;D.group_id=B;F.API.callMethod("flickr.groups.invite.photo.decline",D,C,null,null,0)}function admin_group_obj(A,C,B){this.nsid=A;this.title=C;this.status=B}function new_admin_group_obj(A,C,B){this.nsid=A;this.title=C;this.status=B}F._admin_group_loader={admin_group_loader_go_go_go:function(){this.old_group_nsid=null;this.old_group_title=null;this.old_comment_block="";this.first_time=true;this.style.display="block";this.admin_groups=new Array();F.decorate(_ge("a_group_loader"),F.admin_group_invite_clicker);F.decorate(_ge("div_invite_list_loading"),F.admin_group_loading);F.decorate(_ge("div_invite_dropdown"),F.admin_group_dropdown_div).admin_group_dropdown_div_go_go_go();var A=false;if(_ge("hdn_group_invite")&&_ge("hdn_group_invite").value.length>0){_ge("div_invite_loader").admin_groups=JSON.parse(_ge("hdn_group_details").value);var C=_ge("div_invite_loader").admin_groups;_ge("slct_invite_to_group").options[0]=new Option(F.output.get("photo_select_a_group"),"");_ge("slct_invite_to_group").options[1]=new Option("--------------","");for(var B=0;B<C.length;B++){if(C[B].status=="1"){_ge("slct_invite_to_group").options[B+2]=new Option(C[B].title,C[B].nsid)}else{_ge("slct_invite_to_group").options[B+2]=new Option(C[B].title+" ("+F.output.get("photo_already_invited")+")","");_ge("slct_invite_to_group").options[B+2].style.color="silver"}_ge("slct_invite_to_group").options[B+2].id=C[B].status;if(C[B].nsid==_ge("hdn_group_invite").value){_ge("slct_invite_to_group").options[B+2].selected=true;_ge("div_invite_loader").old_group_nsid=C[B].nsid;_ge("div_invite_loader").old_group_title=C[B].title;A=true}}}if(A){_ge("div_pre_invite").style.display="none";_ge("div_invite_list_loading").style.display="none";_ge("div_invite_dropdown").style.display="block";_ge("chk_invite_to_group").checked=true}},load_groups:function(){_ge("div_invite_list_loading").load_admin_groups()},set_invite:function(C){var A=F.output.get("page_photo_hi_im_admin",_site_root,this.old_group_nsid,this.old_group_title);if(C>=0&&this.admin_groups[C].status=="1"){var B=F.output.get("page_photo_hi_im_admin",_site_root,this.admin_groups[C].nsid,this.admin_groups[C].title);this.old_group_nsid=this.admin_groups[C].nsid;this.old_group_title=this.admin_groups[C].title}if(_ge("message").value.indexOf(A)>=0&&C<0){_ge("message").value=_ge("message").value.replace(A,"")}else{if(_ge("message").value.indexOf(A)>=0){_ge("message").value=_ge("message").value.replace(A,B);this.old_comment_block=_ge("message").value}else{if(_ge("message").value==this.old_comment_block||_ge("message").value==""){_ge("message").value=B;this.old_comment_block=_ge("message").value}else{if(this.first_time){_ge("message").value=B+String.fromCharCode(13)+String.fromCharCode(13)+_ge("message").value;this.old_comment_block=_ge("message").value}}}}_ge("message").value=_ge("message").value.replace("undefined","");this.first_time=false;if(C>=0&&this.admin_groups[C].status=="1"){_ge("hdn_group_invite").value=this.admin_groups[C].nsid;_ge("hdn_group_old_nsid").value=this.admin_groups[C].nsid;_ge("hdn_group_old_title").value=this.admin_groups[C].title}else{_ge("hdn_group_invite").value="";_ge("hdn_group_old_nsid").value="";_ge("hdn_group_old_title").value=""}}};F.admin_group_invite_clicker={onclick:function(){_ge("div_pre_invite").style.display="none";_ge("div_invite_loader").load_groups();return false}};F.admin_group_loading={load_admin_groups:function(){var A={flickr_groups_getAdministeredGroups_onLoad:function(M,L,J,G){if(M){_ge("div_invite_list_loading").admin_groups=new Array();var C=L.getElementsByTagName("group");for(var H=0;H<C.length;H++){var I=C[H].getAttribute("nsid");var K=C[H].getAttribute("title");var E=C[H].getAttribute("able_to_invite_photo");var D=new new_admin_group_obj(I,K,E);_ge("div_invite_loader").admin_groups.push(D)}if(_ge("div_invite_loader").admin_groups.length>0){_ge("div_invite_dropdown").render_dropdown();_ge("hdn_group_details").value=JSON.stringify(_ge("div_invite_loader").admin_groups);return }}_ge("div_invite_list_loading").style.display="none";_ge("div_pre_invite").style.display="block"}};if(_ge("div_invite_loader").admin_groups.length==0){this.style.display="block";var B=new Object();B.user_id=global_nsid;B.photo_id=page_photo_id;F.API.callMethod("flickr.groups.getAdministeredGroups",B,A,null,null,0)}else{_ge("div_invite_dropdown").render_dropdown()}}};F.admin_group_dropdown_div={admin_group_dropdown_div_go_go_go:function(){F.decorate(_ge("chk_invite_to_group"),F.chk_invite_to_group);F.decorate(_ge("slct_invite_to_group"),F.slct_invite_to_group);if(_ge("slct_invite_to_group")&&_ge("hdn_group_details")){_ge("slct_invite_to_group").innerHTML=_ge("hdn_group_details").value}},render_dropdown:function(){var B=_ge("div_invite_loader").admin_groups;if(B.length==0){_ge("div_pre_invite").style.display="block";_ge("div_invite_list_loading").style.display="none";this.style.display="none";return }_ge("div_pre_invite").style.display="none";_ge("div_invite_list_loading").style.display="none";_ge("slct_invite_to_group").options.length=0;_ge("slct_invite_to_group").options[0]=new Option(F.output.get("photo_select_a_group"),"");_ge("slct_invite_to_group").options[1]=new Option("--------------","");for(var A=0;A<B.length;A++){if(B[A].status=="1"){_ge("slct_invite_to_group").options[A+2]=new Option(B[A].title,B[A].nsid)}else{_ge("slct_invite_to_group").options[A+2]=new Option(B[A].title+" ("+F.output.get("photo_already_invited")+")","");_ge("slct_invite_to_group").options[A+2].style.color="silver"}_ge("slct_invite_to_group").options[A+2].id=B[A].status}_ge("chk_invite_to_group").checked=true;this.style.display="block"}};F.chk_invite_to_group={onchange:function(){if(!this.checked){_ge("div_pre_invite").style.display="block";_ge("div_invite_list_loading").style.display="none";_ge("div_invite_dropdown").style.display="none";_ge("hdn_group_invite").value="";_ge("slct_invite_to_group").options.selectedIndex=0;var A=F.output.get("page_photo_hi_im_admin",_site_root,_ge("div_invite_loader").old_group_nsid,_ge("div_invite_loader").old_group_title);if(_ge("message").value.indexOf(A)>=0){_ge("message").value=_ge("message").value.replace(A,"")}}},onclick:function(){this.onchange()}};F.slct_invite_to_group={onchange:function(){this.check_value()},onkeyup:function(){this.check_value()},check_value:function(){_ge("div_invite_loader").set_invite(this.selectedIndex-2)}};function script_has_loaded(){}F.picnik={loadSwfObjJs:function(){if(!this.swfJsWritten){this.loadJs(page_p.swfObjSrc);this.swfJsWritten=true}return(window.SWFObject)?true:false},loadUrlkitJs:function(){if(!this.urlkiJsWritten){this.loadJs(picnik_urlkit_path);this.urlJsWritten=true}},loadJs:function(B){var A=document.createElement("script");A.src=B;A.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(A);writeDebug("picnik js source: "+A.src)},initSwf:function(){if(!this.p_div){this.header_height=35;this.p_div=document.createElement("div");this.p_div.id="picnik-div";var H=document.createElement("div");H.id="picnik-div-header";H.style.height=this.header_height+"px";var C=document.createElement("div");C.id="picnik-div-header-inner";H.appendChild(C);var E=_ge("FlickrLogo").parentNode.cloneNode(true);try{E.firstChild.id="FlickrLogo2";E.style.background="none"}catch(G){}C.appendChild(E);var B=document.createElement("span");var D=document.createTextNode(F.output.get("picnik_mode"));B.appendChild(D);C.appendChild(B);this.p_swf_cont=document.createElement("div");this.p_swf_cont.id="picnik-cont";this.p_swf_cont.style.height=(Y.U.Dom.getViewportHeight()-this.header_height)+"px";this.p_div.appendChild(H);this.p_div.appendChild(this.p_swf_cont);this.p_div.style.height=Math.max(document.body.offsetHeight,document.body.scrollHeight)+"px";this.p_div.style.width="100%";this.p_div.style.position="absolute";this.p_div.style.top="0px";this.p_div.style.left="0px";document.getElementsByTagName("body")[0].appendChild(this.p_div);var A=deconcept.SWFObjectUtil.getPlayerVersion();if(A.major<9){Y.U.Dom.addClass(this.p_swf_cont,"picnik_no_flash");this.p_swf_cont.innerHTML=F.output.get("picnik_no_flash")}else{this.writeSwf()}}else{this.writeSwf();this.p_div.style.top="0px";this.p_div.style.left="0px"}Y.U.Event.addListener(window,"resize",this.resize,this)},writeSwf:function(){var A=new SWFObject(picnik_swf_path,"picnik","100%","100%","9.0.28","#ffffff",true);A.addParam("allowFullScreen","true");A.addParam("allowScriptAccess","always");A.addVariable("serverurl","http://www.picnik.com");A.addVariable("loglevel","30");A.addVariable("lite","true");A.addVariable("host","Flickr lite");A.addVariable("authservice","Flickr");A.addVariable("userid",global_nsid);A.addVariable("token",picnik_token);A.addVariable("_ss_itemid",page_photo_id);A.addVariable("_ss_setid",picnik_set_id);if(A.write(this.p_swf_cont)){var B=new SWFMacMouseWheel(A)}F.changes_count=true},go_go_go:function(){if(picnik_token){this.show()}else{F.fragment_getter.get("/photo_picnik_auth_fragment.gne",{},this,"fragment_onLoad")}},fragment_onLoad:function(E,B,D){this.lightBoxBg=_ge("contactChangerBackground");this.lightBox=document.createElement("div");this.lightBox.style.position="absolute";var A=500;var C=290;this.lightBox.style.width=A+"px";this.lightBox.style.height=C+"px";this.lightBox.style.top=((Y.U.Dom.getViewportHeight()/2)-(C/2))-30;this.lightBox.style.left=(Y.U.Dom.getViewportWidth()/2)-(A/2);this.lightBox.style.zIndex=20001;this.lightBoxBg.style.display="block";document.getElementsByTagName("body")[0].appendChild(this.lightBox);this.lightBox.innerHTML=B},resize:function(B,A){A.p_div.style.height=Math.max(document.body.offsetHeight,document.body.scrollHeight)+"px";A.p_swf_cont.style.height=(Y.U.Dom.getViewportHeight()-A.header_height)+"px"},show:function(){if(this.loadSwfObjJs()){this.initSwf();this.loadUrlkitJs()}else{setTimeout(function(){F.picnik.show()},300)}},doAuth:function(){window.page_always_post_fragment_requests=true;F.fragment_getter.get("/services/auth/picnik.gne",{magic_cookie:global_auth_hash},this,"digestAuthResponse")},digestAuthResponse:function(success,responseText,params){var rsp=eval("("+responseText+")");this.lightBox.style.display="none";this.lightBoxBg.style.display="none";if(rsp.picnik_auth.stat){picnik_token=rsp.picnik_auth.token;this.go_go_go()}else{F.photo_confirm_msg.add(1,F.output.get("picnik_auth_fail"))}},cancelAuth:function(){this.lightBoxBg.style.display="none";this.lightBox.style.display="none";F.photo_confirm_msg.add(1,F.output.get("picnik_cancel_auth"))},its_raining:function(A){writeDebug("1) its_raining response: "+A);F.changes_count=false;if(A){if(A==page_photo_id){window.location.replace(page_p.url+"?editreplace=1")}else{window.location.href=page_p.ownersUrl+A+"/?eOrig="+page_photo_id}}else{_ge("Main").style.display="";_ge("MainFooterClear").style.display="";_ge("FooterWrapper").style.display="";this.p_div.style.top="-9999px";this.p_div.style.left="-9999px";F.photo_confirm_msg.add(1,F.output.get("picnik_cancel_edit"))}}};F.photo_confirm_msg={add:function(A,D){this.remove();var B=document.createElement("p");B.id="photo_confirm_msg_p";B.className=(A)?"Confirm":"Problem";if(D){B.innerHTML=D}var C=_ge("Photo");C.parentNode.insertBefore(B,C)},remove:function(){var A=_ge("photo_confirm_msg_p");if(A){A.parentNode.removeChild(A)}}};F._photo_notes={get_note_ratio:function(){if(window.page_note_ratio){return window.page_note_ratio}return 1},notes_go_go_go:function(J,B,E){var H=this;this.hex_colors={yellow:"#ffffd3",green:"#d0fdaf",blue:"#e8f1fc",pink:"#ffe8f4"};this.isOver=this.editing=this.dragging=0;this.hide_while_dragging=0;this.which_note=null;this.p_id=J;this.rotate_version=E;this.snag_it=1;this.thumb_url=B+"?cb="+new Date().getTime();var C=_ge("photoImgDiv"+J);C.onmouseover=function(){H.onmouseover()};C.onmouseout=function(M){var L=_get_event_src(M);if(window.should_I_ignore_stuff_because_of_button_action||window.should_I_ignore_stuff_because_of_editable_div_action||global_comm_div.comming){return }_ge("photo_notes").hide_tim=setTimeout("_ge('photo_notes').take_her_away('photo_div.onmouseout timer');",200)};var A=_ge("notes_text_div");A.style.zIndex="1000";A.style.display="none";A.style.width="220px";A.style.position="relative";if(!F.border_radius){var G='<table id="notes_text_table" cellpadding="0" cellspacing="0" border="0" style="padding:0px;background-color:transparent"><tr><td><img width="3" height="3" src="'+_images_root+'/spaceout.gif" class="f-note-yellow-sprite fs-tl"></td><td class="td_note_yeller"></td><td><img width="3" height="3" src="'+_images_root+'/spaceout.gif" class="f-note-yellow-sprite fs-tr"></td></tr><tr><td class="td_note_yeller"></td><td class="td_note_yeller" style="padding:3px"><span id="notes_text_span" style="font-family:arial; font-size:12px;"></span><form id="notes_text_form"><div id="notes_text_content"></div><input type="hidden" name="magic_cookie" value="'+global_auth_hash+'" /><textarea onkeydown="_limit_textarea(this, 300); _ge(\'photo_notes\').check_note_for_prop()" onkeyup="place_notes_text_div(); adjust_textarea_height(this); _limit_textarea(this, 300); _ge(\'photo_notes\').check_note_for_prop()" id="notes_text_area" rows='+1+'; style="overflow:visible; width: 200px; font-family:arial; font-size:12px; padding:0px; border:0px inset #e9e9ae; background-color:#ffffd3;" wrap="virtual"></textarea></form></td><td class="td_note_yeller"></td></tr><tr><td><img width="3" height="3" src="'+_images_root+'/spaceout.gif" class="f-note-yellow-sprite fs-bl"></td><td class="td_note_yeller"></td><td><img width="3" height="3" src="'+_images_root+'/spaceout.gif" class="f-note-yellow-sprite fs-br"></td></tr></table><form id="notes_text_buttons_form"><input type="button" class="Butt" value="'+F.output.get("save")+'" onclick="_ge(\'photo_notes\').save_editing(); this.blur();" style="margin:5px 5px 0 0;"><input type="button" class="CancelButt" value="'+F.output.get("cancel")+'" onclick="_ge(\'photo_notes\').cancel_editing(); this.blur();" style="margin:5px 5px 0 0;"><input type="button" class="CancelButt" value="'+F.output.get("deletee")+'" id="delete_note_button" onclick="_ge(\'photo_notes\').delete_note(); this.blur();" style="margin:5px 5px 0 0;"></form><div id="temp_div" style="visibility:hidden;"></div>'}else{var G='<div id="notes_text_table" style="padding:0px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:1px;background-color:#ffffd3;display:inline-block;display:table"><div class="td_note_yeller" style="padding:3px"><span id="notes_text_span" style="font-family:arial; font-size:12px;"></span><form id="notes_text_form"><div id="notes_text_content"></div><input type="hidden" name="magic_cookie" value="'+global_auth_hash+'" /><textarea onkeydown="_limit_textarea(this, 300); _ge(\'photo_notes\').check_note_for_prop()" onkeyup="place_notes_text_div(); adjust_textarea_height(this); _limit_textarea(this, 300); _ge(\'photo_notes\').check_note_for_prop()" id="notes_text_area" rows='+1+'; style="overflow:visible; width: 212px; font-family:arial; font-size:12px; padding:0px; border:0px inset #e9e9ae; background-color:#ffffd3;" wrap="virtual"></textarea></form></div></div><form id="notes_text_buttons_form"><input type="button" class="Butt" value="'+F.output.get("save")+'" onclick="_ge(\'photo_notes\').save_editing(); this.blur();" style="margin:5px 5px 0 0;"><input type="button" class="CancelButt" value="'+F.output.get("cancel")+'" onclick="_ge(\'photo_notes\').cancel_editing(); this.blur();" style="margin:5px 5px 0 0;"><input type="button" class="CancelButt" value="'+F.output.get("deletee")+'" id="delete_note_button" onclick="_ge(\'photo_notes\').delete_note(); this.blur();" style="margin:5px 5px 0 0;"></form><div id="temp_div" style="visibility:hidden;"></div>'}A.innerHTML=G;var D=_ge("notes_text_table");D.onmouseover=function(){if(H.editing){return }if(H.which_note){clearTimeout(H.which_note.hide_timmy)}};D.onmouseout=function(L){if(H.editing){return }if(H.which_note){H.which_note.handle_mouseout()}};D.onmouseup=function(M){if(H.editing){return }var L=_get_event_src(M);if(L&&_el_is_in_a_link(L)){return }if(H.which_note&&H.which_note.can_edit){H.which_note.editing=1;H.which_note.change_display();H.start_editing_one(H.which_note)}};var I=_ge("notes_text_area");if(!F.is_ie||navigator.userAgent.indexOf("Opera")!=-1){I.style.height="58px"}window.temp_div=_ge("temp_div");temp_div.style.width=I.style.width;var K=_ge("rotate_div");K.style.zIndex="1003";K.style.display="none";if(!F.border_radius){var G='<table id="rotate_table" cellpadding="0" cellspacing="0" border="0" style="width:218px; padding:0px;"><tr><td width="3"><img width="3" height="3" src="'+_images_root+'/spaceout.gif" class="f-rotate-sprite fs-tl"></td><td class="td_note_white"></td><td width="3"><img width="3" height="3" src="'+_images_root+'/spaceout.gif" class="f-rotate-sprite fs-tr"></td></tr><tr><td class="td_note_white"></td><td class="td_note_white" style="padding:0px; height:155px"><span id="rotate_span" style="font-family:arial; font-size:12px;"></span></td><td class="td_note_white"></td></tr><tr><td><img width="3" height="3" src="'+_images_root+'/spaceout.gif" class="f-rotate-sprite fs-bl"></td><td class="td_note_white"></td><td><img width="3" height="3" src="'+_images_root+'/spaceout.gif" class="f-rotate-sprite fs-br"></td></tr></table>'}else{var G='<div id="rotate_table" style="width:218px;background:#fff;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:1px"><div class="td_note_white" style="padding:0px;text-align:center;margin-top:3px"><span id="rotate_span" style="font-family:arial; font-size:12px;"></span></div></div>'}K.innerHTML=G;_make_comm_div("1002");global_comm_div.button_cancel.onclick_plus=global_comm_div.button_ok.onclick_plus=function(){_ge("photo_notes").stop_comming()};window.hide_rotate_div=function(){H.hide_rotate_div()};window.save_rotation=function(L){H.save_rotation(L)};this.restack_notes()},onmouseover:function(){clearTimeout(this.hide_tim);if(!this.shown_initially){this.tried_to_show_before_shown_initially=1;return }if(window.should_I_ignore_stuff_because_of_button_action||window.should_I_ignore_stuff_because_of_editable_div_action||global_comm_div.comming){return }this.isOver=1;this.change_display()},go_away_in_a_bit:function(){this.hide_tim=setTimeout("_ge('photo_notes').take_her_away('go_away_in_a_bit');",1300)},restack_notes:function(){var G=function(A){return A.box.w*A.box.h};var C=function(I,H){var A=G(I);var J=G(H);return(A<J)?1:((A>J)?-1:0)};var B=global_photos[this.p_id].notesA;B.sort(C);for(var D=0;D<B.length;D++){var E=_ge("photo_note_"+B[D].id);if(E){this.appendChild(F.prepare_for_insertion(E))}}var B=global_photos[this.p_id].personNotesA;if(B&&B.length){B.sort(C);for(var D=0;D<B.length;D++){var E=_ge("person-note-"+B[D].nsid);if(E){this.appendChild(F.prepare_for_insertion(E))}}}},take_her_away:function(A){clearTimeout(this.hide_tim);if(this.editing||global_comm_div.comming||this.dragging){return }this.isOver=0;this.stop_showing_one("take_her_away "+A);this.change_display()},show_rotate_div:function(D){var C=_ge("rotate_div");if(C.style.display!="none"){return }C.style.display="block";C.style.visibility="hidden";global_single_shadow_div.style.visibility="hidden";this.button_acting=D;var A=_pi((this.get_image_w()-_pi(_ge("rotate_table").offsetWidth))/2);var G=_pi((this.get_image_h()-150)/2);if(G<10){G=10}if(A<10){A=10}C.style.marginLeft=A+"px";C.style.marginTop=G+"px";var B="/apps/rotate/rotate.swf?cancel_str="+escape_utf8(F.output.get("cancel_up"))+"&ok_str="+escape_utf8(""+F.output.get("ok")+"  ")+"&thumb_url="+this.thumb_url+"&v="+this.rotate_version+"&cb="+new Date().getTime();this.take_her_away("show_rotate_div");window.should_I_ignore_stuff_because_of_button_action=1;if(!this.rotate_swf_html){var E='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';E+='WIDTH="212" HEIGHT="145" id="photo" ALIGN="">';E+='<PARAM NAME=movie VALUE="'+B+'"><PARAM NAME=quality VALUE=high>';E+="<PARAM NAME=bgcolor VALUE=#ffffff>";E+='<EMBED src="'+B+'" quality=high bgcolor=#ffffff  WIDTH="212" HEIGHT="145" NAME="photo"';E+=' ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';this.rotate_swf_html=E}if(navigator.userAgent.indexOf("KHTML")!=-1){this.insert_rotate_swf_and_show_tim=setTimeout("_ge('photo_notes').insert_rotate_swf_and_show()",50)}else{if(_ge("rotate_span").innerHTML==""){this.insert_rotate_swf_and_show()}else{C.style.visibility="visible";global_single_shadow_div.style.visibility="visible"}}global_single_shadow_div.style.display="block";_set_single_shadow_x(A);_set_single_shadow_y(G);_set_single_shadow_height(_ge("rotate_table"));_set_single_shadow_width(_ge("rotate_table"))},insert_rotate_swf_and_show:function(){_ge("rotate_span").innerHTML=this.rotate_swf_html;_ge("rotate_div").style.visibility="visible";_set_single_shadow_height(_ge("rotate_table"));global_single_shadow_div.style.visibility="visible"},hide_rotate_div:function(){_ge("rotate_div").style.display="none";global_single_shadow_div.style.display="none";window.should_I_ignore_stuff_because_of_button_action=0;if(this.button_acting){this.button_acting.enable_others()}},save_rotation:function(A){this.hide_rotate_div();if(A=="-90"){A=270}if(A=="-180"){A=180}this.start_comming(F.output.get("photo_notes_rotate"));var B={photo_id:this.p_id,degrees:A};F.API.callMethod("flickr.photos.transform.rotate",B,this)},flickr_photos_transform_rotate_onLoad:function(C,B,A){if(C){document.location=page_current_url+"?rotated=1&cb="+new Date().getTime()}else{alert(F.output.get("api_err_generic")+" "+A);this.stop_comming()}},make_note_this_color:function(A){var D=(this.last_note_color)?this.last_note_color:"yellow";if(D==A){return }if(F.border_radius){_ge("notes_text_table").style.backgroundColor=this.hex_colors[A]}_ge("notes_text_area").style.backgroundColor=this.hex_colors[A];var C=null;if(!F.border_radius){C=this.getElementsByTagName("td");var E=this.getElementsByTagName("IMG");for(var B=0;B<E.length;B++){if(E[B].className){Y.D.removeClass(E[B],"f-note-"+D+"-sprite");Y.D.addClass(E[B],"f-note-"+A+"-sprite")}}}else{C=this.getElementsByTagName("div")}for(var B=0;B<C.length;B++){if(C[B].className=="td_note_yeller"){C[B].style.backgroundColor=this.hex_colors[A]}}this.last_note_color=A},start_showing_one:function(C){if(C.configured_for_showing&&(C.prompting_user||C.selecting_person)){return }clearTimeout(this.hide_tim);if(this.which_note){clearTimeout(this.which_note.hide_timmy)}if(this.which_note!=C){this.stop_showing_one()}this.make_note_this_color(C.use_color);var B=C.render_text_for_display();if(C.deleted){if(!C.from_owner&&!C.person){B+="  - <i>"+C.author_name+"</i> ["+F.output.get("deleted")+"]"}}else{if(!C.from_owner&&!C.person){B+='  - <a href="/photos/'+C.author+'"><i>'+C.author_name+"</i></a>"}}_ge("notes_text_span").innerHTML=B;this.which_note=C;var A=_ge("notes_text_area");if(this.editing){_ge("notes_text_span").style.display="none";_ge("notes_text_form").style.display="block";_ge("notes_text_buttons_form").style.display="block";if(this.which_note.id=="photo_note_temp"||this.which_note.new_note){_ge("delete_note_button").style.display="none"}else{_ge("delete_note_button").style.display="inline"}if(C!=this.which_note||A.value==""){A.value=C.saved_txt;adjust_textarea_height(A)}}else{_ge("notes_text_span").style.display="inline";_ge("notes_text_form").style.display="none";_ge("notes_text_buttons_form").style.display="none"}if(C.person){_ge("notes_text_area").style.display="none";_ge("notes_text_content").style.display="block";_ge("notes_text_content").innerHTML=C.saved_txt}else{_ge("notes_text_area").style.display="";_ge("notes_text_content").style.display="none";_ge("notes_text_content").innerHTML=""}_ge("notes_text_div").style.display="block";global_single_shadow_div.style.display="block";_set_single_shadow_height(_ge("notes_text_table"));_set_single_shadow_width(_ge("notes_text_table"));this.place_notes_text_div();if(this.editing&&!C.person){A.focus();A.select()}C.configured_for_showing=true},check_note_for_prop:function(){if(_ge("photo_props")&&typeof (page_p)!="undefined"&&page_p.isOwner&&page_p.isOwner==true){var A=_ge("notes_text_area");if(A.value=="ho ho ho beard"||A.value=="ho ho ho hat"){if(_ge("photo_prop_"+this.which_note.note_id)&&_ge("photo_prop_"+this.which_note.note_id).style.display=="none"){if(A.value=="ho ho ho beard"){_ge("photo_prop_img_"+this.which_note.note_id).src=_images_root+"/prop_santa_beard.png";_ge("photo_prop_"+this.which_note.note_id).style.display="block"}if(A.value=="ho ho ho hat"){_ge("photo_prop_img_"+this.which_note.note_id).src=_images_root+"/prop_santa_hat.png";_ge("photo_prop_"+this.which_note.note_id).style.display="block"}}}else{if(_ge("photo_prop_"+this.which_note.note_id)&&_ge("photo_prop_"+this.which_note.note_id).style.display=="block"){_ge("photo_prop_img_"+this.which_note.note_id).src=_images_root+"/spaceball.gif";_ge("photo_prop_"+this.which_note.note_id).style.display="none"}}}},place_notes_text_div:function(G,E){var B=_ge("notes_text_div");if(G&&E){var A=G;var H=E+this.which_note.get_note_h()+5}else{if(this.editing){var C=0;var D=200}else{var C=100;var D=200}var A=_pi(this.which_note.style.left);var H=_pi(this.which_note.style.top)+this.which_note.get_note_h()+5;if(H+B.offsetHeight>this.get_image_h()+C){H=_pi(this.which_note.style.top)-B.offsetHeight-10;if(F.is_ie&&navigator.userAgent.indexOf("Opera")==-1){H+=15}}if(H<-D){H=_pi(this.which_note.style.top)+this.which_note.get_note_h()+5}}B.style.left=A+"px";B.style.top=H+"px";_set_single_shadow_x(A);_set_single_shadow_y(H)},stop_showing_one:function(A){_ge("notes_text_div").style.display="none";global_single_shadow_div.style.display="none";if(F.people_taggr&&F.people_taggr.dragProxy){Y.D.setStyle(F.people_taggr.dragProxy,"display","")}if(this.which_note){this.which_note.isOver=0;this.which_note.change_display()}},start_dragging_one:function(){this.dragging=1;window.should_I_ignore_stuff_because_note_editing=1;if(F.people_taggr&&F.people_taggr.dragProxy){Y.D.setStyle(F.people_taggr.dragProxy,"display","none")}},start_editing_one:function(A){this.editing=1;this.dragging=0;window.should_I_ignore_stuff_because_note_editing=1;if(F.people_taggr&&F.people_taggr.dragProxy){Y.D.setStyle(F.people_taggr.dragProxy,"display","none")}this.start_showing_one(A)},hide_notes_text_div:function(){_ge("notes_text_div").style.display="none";global_single_shadow_div.style.display="none"},refresh_notes:function(A){if(_ok_for_scrumjax_xml()){var B={photo_id:this.p_id};if(A){F.API.callMethod("flickr.photos.people.getList",B,this)}else{F.API.callMethod("flickr.photos.getInfo",B,this)}}else{document.location=page_current_url+"?changednotes=1&cb="+new Date().getTime()}},flickr_photos_people_getList_onLoad:function(Q,P,M,G){if(Q){var D=global_photos[this.p_id].personNotesA=[];var O=P.documentElement.getElementsByTagName("person");var N;for(var E=0,L=O.length;E<L;E++){N=O[E];var J=N.getAttribute("x")*this.get_note_ratio();var H=N.getAttribute("y")*this.get_note_ratio();var K=N.getAttribute("w")*this.get_note_ratio();var B=N.getAttribute("h")*this.get_note_ratio();var I=N.getAttribute("nsid");if(K&&B){D.push({nsid:I,box:{x:J,y:H,w:K,h:B}});var C=_ge("person-note-"+I);if(C){C.refresh_info(null,J,H,K,B)}}}this.restack_notes()}else{alert(F.output.get("api_err_generic")+" "+M)}if(global_comm_div.comming){this.stop_comming()}if(_ge("photo_prop_temp")){F.remove_el(_ge("photo_prop_temp"),_ge("photo_props"))}},flickr_photos_getInfo_onLoad:function(E,B,J,U){if(E){var M=global_photos[this.p_id].notesA=[];var S={};var O=B.documentElement.getElementsByTagName("owner")[0].getAttribute("nsid");var K=B.documentElement.getElementsByTagName("note");for(var L=0;L<K.length;L++){var G=K[L].firstChild.nodeValue;var V=K[L].getAttribute("x")*this.get_note_ratio();var T=K[L].getAttribute("y")*this.get_note_ratio();var X=K[L].getAttribute("w")*this.get_note_ratio();var D=K[L].getAttribute("h")*this.get_note_ratio();var Q=K[L].getAttribute("id");var R=K[L].getAttribute("author");var W=K[L].getAttribute("authorname");S[Q]=Q;M.push({id:Q,box:{x:V,y:T,w:X,h:D}});var N=_ge("photo_note_"+Q);if(N){N.refresh_info(Q,V,T,X,D,G);if(_ge("photo_props")&&typeof (page_p)!="undefined"&&page_p.ownerNsid&&page_p.ownerNsid==R){if(!_ge("photo_prop_"+Q)){var Z=document.createElement("DIV");Z.className="photo_prop";Z.id="photo_prop_"+Q;Z.style.left=(V+3)+"px";Z.style.top=(T+3)+"px";Z.style.width=(X-4)+"px";Z.style.height=(D-4)+"px";if(G=="ho ho ho beard"||G=="ho ho ho hat"){Z.style.display="block"}else{Z.style.display="none"}var I=document.createElement("IMG");I.className="trans_png";I.id="photo_prop_img"+Q;I.style.width=(X-4)+"px";I.style.height=(D-4)+"px";if(G=="ho ho ho beard"){I.src=_images_root+"/prop_santa_beard.png"}else{if(G=="ho ho ho hat"){I.src=_images_root+"/prop_santa_hat.png"}else{I.src=_images_root+"/spaceball.gif"}}Z.appendChild(F.prepare_for_insertion(I));_ge("photo_props").appendChild(F.prepare_for_insertion(Z))}}}else{var H=(global_nsid==R||global_photos[this.p_id].isOwner)?1:0;var C=(O==R);this.create_note(Q,V,T,X,D,G,H,C,W,R)}}for(var P=this.childNodes.length-1;P>=0;P--){if(Y.D.hasClass(this.childNodes[P],"photo_note")&&this.childNodes[P].id.search(/person-note/)===-1){if(!S[this.childNodes[P].note_id]){F.remove_el(this.childNodes[P],this)}}}this.restack_notes()}else{alert(F.output.get("api_err_generic")+" "+J)}if(global_comm_div.comming){this.stop_comming()}if(_ge("photo_prop_temp")){F.remove_el(_ge("photo_prop_temp"),_ge("photo_props"))}},start_pulsing:function(){var B=_ge("button_pulser");if(!B){var A=document.createElement("IMG");A.width=32;A.height=15;A.src=_images_root+"/pulser2.gif";A.style.border="0";A.border="0";B=document.createElement("DIV");B.id="button_pulser";B.style.position="absolute";B.style.backgroundColor="white";if(global_intl_lang=="en-us"){B.style.padding="4px 12px"}else{B.style.padding="4px 0px"}B.appendChild(A);document.body.appendChild(B)}var C=_ge("button_bar");B.style.left=Y.U.Dom.getX(C)+"px";B.style.top=Y.U.Dom.getY(C)+"px";B.style.display="block"},stop_pulsing:function(){if(_ge("button_pulser")){_ge("button_pulser").style.display="none"}},start_comming:function(C,G,L,E,B,K,H,I,D){if(D){F.eb_broadcast("stewart_pause_if_need_to_hide_video")}else{F.eb_broadcast("stewart_pause")}window.should_I_ignore_stuff_because_note_editing=1;this.style.visibility="hidden";var J=function(){var M=_pi((_ge("photo_notes").get_w()-_pi(global_comm_div.table.offsetWidth))/2);if(M<10){M=10}return M};var A=function(){var M=_pi((_ge("photo_notes").get_h()-global_comm_div.table.offsetHeight)/2);if(M<10){M=10}return M};global_comm_div.start_comming(C,J,A,G,L,E,B,K,H,I)},stop_comming:function(A){window.should_I_ignore_stuff_because_note_editing=0;global_comm_div.stop_comming();if(!A){this.style.visibility="visible"}F.eb_broadcast("stewart_play_if_was_playing")},start_adding_note:function(){if(this.editing){alert(F.output.get("photo_notes_one_note"));return }this.empty_notes_text_area();this.onmouseover();var A=this.create_note("temp",20,20,50,50,F.output.get("photo_notes_add_notes_here"),1,global_photos[this.p_id].isOwner,"","");A.start_editing();this.start_editing_one(A)},start_adding_person_note:function(D,I,K,J,L,G,A){if(this.editing){alert(F.output.get("photo_notes_one_note"));return }this.empty_notes_text_area();this.onmouseover();var E=K||20;var C=J||20;var B=L||50;var M=G||50;var H=this.create_note("temp",E,C,B,M,I,1,global_photos[this.p_id].isOwner,"","",D);H.start_editing();this.start_editing_one(H);if(A){this.save_editing()}},create_note:function(P,K,I,L,C,B,A,N,D,G,O){var J=document.createElement("DIV");J.className="photo_note";J.id="photo_note_"+P;J.style.left=(K)+"px";J.style.top=(I)+"px";var H='<div class="photo_note_box_div"><div class="photo_note_box_inner_div">';H+='<div class="photo_note_box_inner_inner_div"><div style="width:'+(L-4)+"px; height:"+(C-4)+'px;">';H+='</div></div></div></div><div class="photo_note_text_div"></div>';J.innerHTML=H;this.appendChild(J);F.decorate(J,F._photo_note).note_go_go_go(P,A,N,D,G,B,O,0);if(_ge("photo_props")&&typeof (page_p)!="undefined"&&page_p.isOwner&&page_p.isOwner==true){if(_ge("photo_prop_temp")){F.remove_el(_ge("photo_prop_temp"),_ge("photo_props"))}var E=document.createElement("DIV");E.className="photo_prop";E.id="photo_prop_"+P;E.style.left=(K+3)+"px";E.style.top=(I+3)+"px";E.style.width=(L-4)+"px";E.style.height=(C-4)+"px";if(B=="ho ho ho beard"||B=="ho ho ho hat"){E.style.display="block"}else{E.style.display="none"}var M=document.createElement("IMG");M.className="trans_png";M.id="photo_prop_img_"+P;M.style.width=(L-4)+"px";M.style.height=(C-4)+"px";M.src=_images_root+"/spaceball.gif";if(B=="ho ho ho beard"){M.src=_images_root+"/prop_santa_beard.png"}else{if(B=="ho ho ho hat"){M.src=_images_root+"/prop_santa_hat.png"}else{M.src=_images_root+"/spaceball.gif"}}E.appendChild(F.prepare_for_insertion(M));_ge("photo_props").appendChild(F.prepare_for_insertion(E))}return J},delete_note:function(A){deja_view_uh_huh();this.which_note.stop_editing(0);this.editing=0;this.stop_showing_one();this.empty_notes_text_area();this.start_comming(F.output.get(this.which_note.person?"photo_notes_deleting_face_boundry":"photo_notes_deleting"));if(_ge("photo_prop_"+this.which_note.note_id)&&_ge("photo_props")){F.remove_el(_ge("photo_prop_"+this.which_note.note_id),_ge("photo_props"))}if(this.which_note.person&&!A){var B={user_id:this.which_note.nsid,photo_id:this.p_id};F.API.callMethod("flickr.photos.people.deleteCoords",B,this)}else{if(!A){var B={note_id:this.which_note.note_id};F.API.callMethod("flickr.photos.notes.delete",B,this)}else{if(this.which_note.person){this.removeChild(_ge("person-note-"+this.which_note.nsid))}}}},flickr_photos_notes_delete_onLoad:function(C,B,A){if(!C&&(!A||A.indexOf("not found")==-1)){alert(F.output.get("api_err_generic")+" "+A);this.stop_comming()}this.refresh_notes()},flickr_photos_people_deleteCoords_onLoad:function(D,C,A,B){if(!D&&(!A||A.indexOf("not found")==-1)){alert(F.output.get("api_err_generic")+" "+A);this.stop_comming()}if(D&&B.user_id){F.people_taggr.resetRemoveLinkByNsid(B.user_id);this.removeChild(_ge("person-note-"+B.user_id))}this.refresh_notes(true)},cancel_editing:function(){this.which_note.stop_editing(1);this.editing=0;window.should_I_ignore_stuff_because_note_editing=0;this.stop_showing_one();this.empty_notes_text_area();if(this.which_note.id=="photo_note_temp"||this.which_note.new_note){F.remove_el(this.which_note,this);if(_ge("photo_prop_temp")&&_ge("photo_props")){F.remove_el(_ge("photo_prop_temp"),_ge("photo_props"))}}if(this.which_note.new_note&&this.which_note.person){F.people_taggr.resetRemoveLinkByNsid(this.which_note.nsid)}},empty_notes_text_area:function(){_ge("notes_text_area").value=""},save_editing:function(){var A=_ge("notes_text_area");if(A.value==""&&!this.which_note.person){A.focus();A.select();return }deja_view_uh_huh();this.which_note.stop_editing(0);this.editing=0;this.stop_showing_one();if(this.which_note.person){this.start_comming(F.output.get("photo_notes_saving_face_boundry"));var B={photo_id:this.p_id,user_id:this.which_note.nsid,person_x:this.which_note.get_note_x()/this.get_note_ratio(),person_y:this.which_note.get_note_y()/this.get_note_ratio(),person_w:(this.which_note.get_note_w())/this.get_note_ratio(),person_h:(this.which_note.get_note_h())/this.get_note_ratio()};this.which_note.new_note=false;F.API.callMethod("flickr.photos.people.editCoords",B,this)}else{if(this.which_note.id=="photo_note_temp"){this.start_comming(F.output.get("photo_notes_saving_note"));var B={photo_id:this.p_id,note_x:this.which_note.get_note_x()/this.get_note_ratio(),note_y:this.which_note.get_note_y()/this.get_note_ratio(),note_w:(this.which_note.get_note_w())/this.get_note_ratio(),note_h:(this.which_note.get_note_h())/this.get_note_ratio(),note_text:A.value};F.API.callMethod("flickr.photos.notes.add",B,this);F.remove_el(this.which_note,this)}else{this.start_comming(F.output.get("saving"));var B={note_id:this.which_note.note_id,note_x:this.which_note.get_note_x()/this.get_note_ratio(),note_y:this.which_note.get_note_y()/this.get_note_ratio(),note_w:(this.which_note.get_note_w())/this.get_note_ratio(),note_h:(this.which_note.get_note_h())/this.get_note_ratio(),note_text:A.value};F.API.callMethod("flickr.photos.notes.edit",B,this)}}this.empty_notes_text_area()},flickr_photos_notes_add_onLoad:function(C,B,A){if(C){this.refresh_notes()}else{alert(F.output.get("api_err_generic")+" "+A);this.stop_comming();if(_ge("photo_prop_temp")){F.remove_el(_ge("photo_prop_temp"),_ge("photo_props"))}}},flickr_photos_notes_edit_onLoad:function(C,B,A){if(C){this.refresh_notes()}else{alert(F.output.get("api_err_generic")+" "+A);this.stop_comming()}},flickr_photos_people_editCoords_onLoad:function(C,B,A){if(C){this.refresh_notes(true)}else{alert(F.output.get("api_err_generic")+" "+A);this.stop_comming()}},flickr_test_echo_onLoad:function(C,B,A){if(!C){alert(F.output.get("api_err_generic")+" "+A);this.stop_comming()}},get_w:function(){return _ge("photoImgDiv"+this.p_id).offsetWidth},get_h:function(){return _ge("photoImgDiv"+this.p_id).offsetHeight},get_image_w:function(){var B=_ge("photoImgDiv"+this.p_id);var A=B.getElementsByTagName("img");if(A[0]&&A[0].width){return A[0].width}else{return 0}},get_image_h:function(){var B=_ge("photoImgDiv"+this.p_id);var A=B.getElementsByTagName("img");if(A[0]&&A[0].height){return A[0].height}else{return 0}},change_display:function(){if(this.isOver){this.style.visibility="visible";if(_ge("photo_props")){_ge("photo_props").style.display=""}}else{this.style.visibility="hidden"}},check_for_mouseover:function(){var A=Y.D.getElementsByClassName("photo-note-mouseover","div",this);if(A.length===0){Y.D.removeClass(this,"dim")}}};F._photo_note={note_go_go_go:function(J,A,H,D,E,B,I,C){var G=this;this.note_id=J;this.can_edit=A;this.author_name=D;this.author=E;this.from_owner=H;this.use_color=(this.from_owner)?"yellow":"green";this.isOver=0;this.editing=0;this.isDragging=0;this.resize_box_size=8;this.last_rendered_txt="";this.deleted=C;this.box_div=this.childNodes[0];this.innermost_div=this.box_div.childNodes[0].childNodes[0].childNodes[0];if(F.is_ie){this.innermost_div.style.backgroundColor="#fff";this.innermost_div.style.filter="alpha(opacity:0)"}this.text_div=this.childNodes[1];this.saved_txt=B;this.saved_x=_pi(this.style.left);this.saved_y=_pi(this.style.top);this.saved_w=_pi(this.innermost_div.style.width);this.saved_h=_pi(this.innermost_div.style.height);this.appendChild(this.make_resize_div("nw"));this.appendChild(this.make_resize_div("ne"));this.appendChild(this.make_resize_div("sw"));this.appendChild(this.make_resize_div("se"));Y.U.Event.addListener(this.box_div,"mouseover",this.handle_mouseover,this,true);Y.U.Event.addListener(this.box_div,"mouseout",this.handle_mouseout,this,true);if(this.can_edit){Y.U.Event.addListener(this.box_div,"mousedown",this.handle_mousedown,this,true);this.box_div.style.cursor=(F.is_ie)?"hand":"pointer"}if(I){F.decorate(this,F._person_note).note_go_go_go(I,J==="temp")}},make_resize_div:function(D){var C="resize_"+D+"_div";var A=this;var B=document.createElement("DIV");B.style.position="absolute";B.style.display="none";B.style.cursor=D+"-resize";B.style.top=(D=="ne"||D=="nw")?"0px":(this.get_note_h()-this.resize_box_size)+"px";B.style.left=(D=="sw"||D=="nw")?"0px":(this.get_note_w()-this.resize_box_size)+"px";B.style.backgroundColor="#fff";B.innerHTML='<div style="border:1px solid black"><div style="width:'+(this.resize_box_size-2)+"px; height:"+(this.resize_box_size-2)+'px; background-color:#fff; font-size:1px"></div></div>';B.onmousedown=function(E){E||(E=window.event);A.start_dragging_resize(E,D)};B.note=this;this[C]=B;return this[C]},render_text_for_display:function(){var A=this.saved_txt;if(this.last_saved_txt!=this.saved_txt){A=_hyperlink(A);A=A.trim().nl2br();this.last_saved_txt=this.saved_txt;this.last_rendered_txt=A}return this.last_rendered_txt},start_dragging_resize:function(I,G){I||(I=window.event);var C="resize_"+G+"_div";var L=this[C];_ge("photo_notes").start_dragging_one();_disable_select();L.lastClientX=I.clientX;L.lastClientY=I.clientY;if(G=="se"){var K=_pi(L.style.left);var J=_pi(L.style.top);var E=I.clientX-K+this.resize_box_size;var B=E+_ge("photo_notes").get_image_w()-_pi(this.style.left)-(this.resize_box_size*2);var D=I.clientY-J+this.resize_box_size;var A=D+_ge("photo_notes").get_image_h()-_pi(this.style.top)-(this.resize_box_size*2)}else{if(G=="sw"){var K=_pi(this.style.left);var J=_pi(L.style.top);var E=I.clientX-K;var B=E+K+this.get_note_w()-(this.resize_box_size*2);var D=I.clientY-J+this.resize_box_size;var A=D+_ge("photo_notes").get_image_h()-_pi(this.style.top)-(this.resize_box_size*2)}else{if(G=="nw"){var K=_pi(this.style.left);var J=_pi(this.style.top);var E=I.clientX-K;var B=E+K+this.get_note_w()-(this.resize_box_size*2);var D=I.clientY-J;var A=D+J+this.get_note_h()-(this.resize_box_size*2)}else{if(G=="ne"){var K=_pi(L.style.left);var J=_pi(this.style.top);var E=I.clientX-K+this.resize_box_size;var B=E+_ge("photo_notes").get_image_w()-_pi(this.style.left)-(this.resize_box_size*2);var D=I.clientY-J;var A=D+J+this.get_note_h()-(this.resize_box_size*2)}}}}this.isDragging=1;this.change_display();var H=this;document.dragee=L;document.onmouseup=function(M){if(document.dragee){H.stop_dragging_resize()}document.dragee=null};document.onmousemove=function(P){P||(P=window.event);if(_ge("photo_notes").hide_while_dragging){_ge("photo_notes").hide_notes_text_div()}var R=Math.min(Math.max(P.clientX,E),B);var Q=Math.min(Math.max(P.clientY,D),A);if(G=="se"){var U=_pi(L.style.left);var T=_pi(L.style.top);var O=U+(R-L.lastClientX);var N=T+(Q-L.lastClientY);L.style.left=O+"px";L.style.top=N+"px";H.innermost_div.style.width=(_pi(L.style.left)+H.resize_box_size-4)+"px";H.innermost_div.style.height=(_pi(L.style.top)+H.resize_box_size-4)+"px";H.resize_ne_div.style.left=L.style.left;H.resize_sw_div.style.top=L.style.top}else{if(G=="sw"){var U=_pi(H.style.left);var T=_pi(L.style.top);var O=U+(R-L.lastClientX);var N=T+(Q-L.lastClientY);H.style.left=O+"px";L.style.top=N+"px";H.innermost_div.style.width=(_pi(H.innermost_div.style.width)+U-O)+"px";H.innermost_div.style.height=(_pi(L.style.top)+H.resize_box_size-4)+"px";H.resize_ne_div.style.left=H.resize_se_div.style.left=(_pi(H.innermost_div.style.width)-H.resize_box_size+4)+"px";H.resize_se_div.style.top=L.style.top}else{if(G=="nw"){var U=_pi(H.style.left);var T=_pi(H.style.top);var O=U+(R-L.lastClientX);var N=T+(Q-L.lastClientY);H.style.left=O+"px";H.style.top=N+"px";H.innermost_div.style.width=(_pi(H.innermost_div.style.width)+U-O)+"px";H.innermost_div.style.height=(_pi(H.innermost_div.style.height)+T-N)+"px";H.resize_sw_div.style.left=L.style.left;H.resize_ne_div.style.top=L.style.top;H.resize_se_div.style.top=H.resize_sw_div.style.top=(_pi(H.innermost_div.style.height)-H.resize_box_size+4)+"px";H.resize_se_div.style.left=H.resize_ne_div.style.left=(_pi(H.innermost_div.style.width)-H.resize_box_size+4)+"px"}else{if(G=="ne"){var U=_pi(L.style.left);var T=_pi(H.style.top);var O=U+(R-L.lastClientX);var N=T+(Q-L.lastClientY);L.style.left=O+"px";H.style.top=N+"px";H.innermost_div.style.width=(_pi(L.style.left)+H.resize_box_size-4)+"px";H.innermost_div.style.height=(_pi(H.innermost_div.style.height)+T-N)+"px";H.resize_se_div.style.left=L.style.left;H.resize_se_div.style.top=H.resize_sw_div.style.top=(_pi(H.innermost_div.style.height)-H.resize_box_size+4)+"px"}}}}L.lastClientX=R;L.lastClientY=Q;var M=_ge("photo_prop_"+H.note_id);var S=_ge("photo_prop_img_"+H.note_id);if(M&&S){M.style.top=_pi(H.style.top)+2;M.style.left=_pi(H.style.left)+2;M.style.width=H.innermost_div.style.width;M.style.height=H.innermost_div.style.height;S.style.width=H.innermost_div.style.width;S.style.height=H.innermost_div.style.height}if(!_ge("photo_notes").hide_while_dragging){_ge("photo_notes").place_notes_text_div()}Y.E.stopEvent(P);return false}},stop_dragging_resize:function(){_enable_select();if(!this.isDragging){return }document.onmousemove=null;_ge("photo_notes").start_editing_one(this);this.isDragging=0;this.change_display()},show_resize_divs:function(){this.resize_nw_div.style.display=this.resize_ne_div.style.display=this.resize_sw_div.style.display=this.resize_se_div.style.display="block"},hide_resize_divs:function(){this.resize_nw_div.style.display=this.resize_ne_div.style.display=this.resize_sw_div.style.display=this.resize_se_div.style.display="none"},get_note_w:function(){return _pi(this.innermost_div.style.width)+4},get_note_h:function(){return _pi(this.innermost_div.style.height)+4},get_note_x:function(){return _pi(this.style.left)},get_note_y:function(){return _pi(this.style.top)},handle_mouseover:function(){if(_ge("photo_notes").editing||global_comm_div.comming||_ge("photo_notes").dragging){return }this.isOver=1;this.change_display();_ge("photo_notes").start_showing_one(this)},handle_mouseout:function(){if(this.id=="photo_note_temp"){return }clearTimeout(this.hide_timmy);this.hide_timmy=setTimeout("_ge('"+this.id+"').take_another_little_piece_of_my_heart('Photo_Note_EXT.onmouseout');",200);_ge("photo_notes").hide_tim=setTimeout("_ge('photo_notes').take_her_away('note.onmouseout timer');",200)},take_another_little_piece_of_my_heart:function(){if(_ge("photo_notes").editing||global_comm_div.comming||_ge("photo_notes").dragging){return }this.isOver=0;this.change_display();_ge("photo_notes").stop_showing_one()},start_editing:function(){if(this.editing){return }this.isOver=1;this.editing=1;this.change_display()},stop_editing:function(A){this.editing=0;if(A){this.style.left=this.saved_x+"px";this.style.top=this.saved_y+"px";this.innermost_div.style.width=this.saved_w+"px";this.innermost_div.style.height=this.saved_h+"px";this.resize_nw_div.style.top=this.resize_ne_div.style.top="0px";this.resize_sw_div.style.top=this.resize_se_div.style.top=(this.get_note_h()-this.resize_box_size)+"px";this.resize_nw_div.style.left=this.resize_sw_div.style.left="0px";this.resize_ne_div.style.left=this.resize_se_div.style.left=(this.get_note_w()-this.resize_box_size)+"px";_ge("photo_notes").start_showing_one(this);var C=_ge("photo_prop_"+this.note_id);var B=_ge("photo_prop_img_"+this.note_id);if(C&&B){C.style.top=_pi(this.style.top)+2;C.style.left=_pi(this.style.left)+2;C.style.width=this.innermost_div.style.width;C.style.height=this.innermost_div.style.height;B.style.width=this.innermost_div.style.width;B.style.height=this.innermost_div.style.height}}this.change_display()},handle_mousedown:function(A){A||(A=window.event);if(!_ge("photo_notes").editing&&!global_comm_div.comming&&!_ge("photo_notes").dragging){this.start_editing()}if(((!_ge("photo_notes").editing&&!_ge("photo_notes").dragging)||_ge("photo_notes").which_note==this&&!this.isDragging)&&!global_comm_div.comming){this.start_dragging(A)}},stop_dragging:function(){_enable_select();if(!this.isDragging){return }document.onmousemove=null;_ge("photo_notes").start_editing_one(this);this.isDragging=0;this.change_display()},start_dragging:function(G){G||(G=window.event);_ge("photo_notes").start_dragging_one();_disable_select();var B=_pi(this.style.left);var I=_pi(this.style.top);this.lastClientX=G.clientX;this.lastClientY=G.clientY;var A=G.clientX-B;var E=A+_ge("photo_notes").get_image_w()-this.get_note_w();var H=G.clientY-I;var D=H+_ge("photo_notes").get_image_h()-this.get_note_h();this.isDragging=1;this.change_display();var C=this;document.dragee=this;document.onmouseup=function(J){if(document.dragee){C.stop_dragging()}document.dragee=null};var C=this;document.onmousemove=function(N){N||(N=window.event);if(_ge("photo_notes").hide_while_dragging){_ge("photo_notes").hide_notes_text_div()}var K=_pi(C.style.left);var Q=_pi(C.style.top);var M=Math.min(Math.max(N.clientX,A),E);var L=Math.min(Math.max(N.clientY,H),D);var J=K+(M-C.lastClientX);var P=Q+(L-C.lastClientY);C.style.left=J+"px";C.style.top=P+"px";C.lastClientX=M;C.lastClientY=L;if(!_ge("photo_notes").hide_while_dragging){_ge("photo_notes").place_notes_text_div()}var O=_ge("photo_prop_"+C.note_id);if(O){O.style.top=_pi(C.style.top)+2+"px";O.style.left=_pi(C.style.left)+2+"px"}};Y.E.stopEvent(G);return false},refresh_info:function(B,D,C,G,A,E){this.note_id=B;this.id="photo_note_"+B;this.style.left=(D)+"px";this.style.top=(C)+"px";this.innermost_div.style.width=(G-4)+"px";this.innermost_div.style.height=(A-4)+"px";this.saved_txt=E;this.saved_x=_pi(this.style.left);this.saved_y=_pi(this.style.top);this.saved_w=_pi(this.innermost_div.style.width);this.saved_h=_pi(this.innermost_div.style.height)},change_display:function(){var C=this.box_div.childNodes[0];var B=C.childNodes[0];C.style.borderStyle="solid";B.style.borderStyle="solid";this.box_div.style.left=this.box_div.style.top="0px";this.box_div.style.borderWidth="0";if(F.people_taggr){Y.D.removeClass(this.box_div.parentNode,"photo-note-mouseover");var A=_ge("photo_notes");clearTimeout(A.remove_dim_timeout);A.remove_dim_timeout=setTimeout(function(){A.check_for_mouseover()},1)}this.hide_resize_divs();if(this.editing){this.show_resize_divs();B.style.borderStyle="dashed";C.style.borderStyle="dashed"}else{if(this.isOver){this.box_div.style.left=this.box_div.style.top="-1px";this.box_div.style.borderWidth="1px";if(F.people_taggr){Y.D.addClass(this.box_div.parentNode,"photo-note-mouseover");Y.D.addClass(A,"dim")}}}}};F._person_note={note_go_go_go:function(A,B){this.person=true;this.nsid=A;this.id="person-note-"+A;Y.D.addClass(this,"person-note");this.new_note=B;this.use_color=(A===global_nsid)?"blue":"blue"},refresh_info:function(B,D,C,E,A){this.style.left=(D)+"px";this.style.top=(C)+"px";this.innermost_div.style.width=(E-4)+"px";this.innermost_div.style.height=(A-4)+"px";this.saved_x=_pi(this.style.left);this.saved_y=_pi(this.style.top);this.saved_w=_pi(this.innermost_div.style.width);this.saved_h=_pi(this.innermost_div.style.height)},render_text_for_display:function(){var A=this.saved_txt;if(this.last_saved_txt!=this.saved_txt){this.last_saved_txt=this.saved_txt;this.last_rendered_txt=A}return this.last_rendered_txt}};F._photo_button_bar={bar_go_go_go:function(I,E){var H=this.getElementsByTagName("img");var K=Y.U.Dom.getElementsByClassName("photo_gne_button","a",this);for(var G=0;G<K.length;G++){Photo_Gne_button_action_check(K[G].id);var C=K[G].id.split("photo_gne_button_").join("");var J=(C=="add_to_faves")?"a_fave":C;var D=K[G].getAttribute("title");var B=K[G].getAttribute("title_off");B=(B)?B:D;var A=(C=="add_to_faves"&&E)?1:0;if(C=="print"&&K[G].className.indexOf("prints_")>-1){C="prints"}F.decorate(K[G],F._photo_button).button_go_go_go(I,C,J,A,D,B)}}};F._photo_button={button_go_go_go:function(G,B,A,C,E,D){this.lock_down=0;this.p_id=G;this.style.cursor=(F.is_ie)?"hand":"pointer";F.make_new_mouse_tip(this);this.base_name=B;this.base_class_name="sprite-";if(B=="add_note"&&!_ok_for_scrumjax()){this.style.display="none";return }this.on=[];this.on._className=this.base_class_name+B+"_grey";this.on_over=[];this.on_over._className=this.base_class_name+B+"_color";this.on_down=[];this.on_down._className=this.base_class_name+B+"_color_down";if(B=="send_to_group"||B=="send_to_set"||B=="print"||B=="prints"||B=="blog_this"||B=="add_to_gallery"){this.on_locked=[];this.on_locked._className=this.base_class_name+B+"_color button_locked"}this.off=[];this.off._className=this.base_class_name+A+"_grey";this.off_over=[];this.off_over._className=this.base_class_name+A+"_color";this.off_down=[];this.off_down._className=this.base_class_name+A+"_color_down";this.isOver=this.isDown=0;this.isOff=(C)?1:0;this.title_on=E;this.title_off=D;if(this.isOff){this.change_src();F.change_mouse_tip_txt(this,D)}Y.U.Event.addListener(this,"mouseover",this.handle_mouseover);Y.U.Event.addListener(this,"mouseout",this.handle_mouseout);Y.U.Event.addListener(this,"click",this.handle_click);Y.U.Event.addListener(this,"mousedown",this.handle_mousedown);this.prints_action=this.print_action},handle_mouseover:function(A){if(window.should_I_ignore_stuff_because_note_editing||window.should_I_ignore_stuff_because_tash_editing||window.should_I_ignore_stuff_because_of_editable_div_action){return }this.isOver=1;this.change_src()},handle_mouseout:function(A){this.isOver=0;if(!this.lock_down){this.isDown=0}this.change_src()},handle_mousedown:function(B){if(window.should_I_ignore_stuff_because_note_editing||window.should_I_ignore_stuff_because_tash_editing||window.should_I_ignore_stuff_because_of_editable_div_action){return }if(this.is_disabled){this.enable_others();this.enable_self()}this.isDown=1;this.isOver=1;var A=_ge("photo_notes");if(this.base_name!="rotate"&&A&&A.hide_rotate_div){A.hide_rotate_div()}if(this.base_name!="print"&&printDialogDiv){hide_printDialog()}if(this.base_name!="send_to_set"&&sendToSetDialogDiv){hide_sendToSetDialog()}if(this.base_name!="send_to_group"&&sendToGroupDialogDiv){hide_sendToGroupDialog()}if(this.base_name!="blog_this"&&sendToBlogDialogDiv){hide_sendToBlogDialog()}if(this.base_name!="add_to_gallery"&&addToGalleryDialogDiv){hide_addToGalleryDialog()}},handle_click:function(A){if(window.should_I_ignore_stuff_because_note_editing||window.should_I_ignore_stuff_because_tash_editing||window.should_I_ignore_stuff_because_of_editable_div_action){return }if(this.is_disabled){return }writeDebug("handle_click: "+this.base_name+"_action");writeDebug("handle_click: "+this[this.base_name+"_action"]);var B=this[this.base_name+"_action"]();this.isOver=1;if(B==1){this.isDown=1;this.lock_down=1}else{this.isDown=0}this.change_src()},disable_others:function(){var C=Y.U.Dom.getElementsByClassName("photo_gne_button","IMG");for(var B=0;B<C.length;B++){if(C[B].base_name!=this.base_name){C[B].disable_self()}}var A=_ge("photo_notes");if(A&&A.take_her_away){A.take_her_away("disable_others")}window.should_I_ignore_stuff_because_of_button_action=1;F.eb_broadcast("stewart_pause")},enable_others:function(){var B=Y.U.Dom.getElementsByClassName("photo_gne_button","IMG");for(var A=0;A<B.length;A++){if(B[A].base_name!=this.base_name){B[A].enable_self()}}window.should_I_ignore_stuff_because_of_button_action=0;F.eb_broadcast("stewart_play_if_was_playing")},disable_self:function(){this.is_disabled=1;this.style.cursor="default"},enable_self:function(){this.is_disabled=0;this.style.cursor=(F.is_ie)?"hand":"pointer"},change_src:function(){if(this.is_disabled){return }if(this.lock_down){this.className=this.on_locked._className}else{if(this.isOff){if(this.isDown){this.className=this.off_down._className}else{if(this.isOver){this.className=this.off_over._className}else{this.className=this.off._className}}}else{if(this.isDown){this.className=this.on_down._className}else{if(this.isOver){this.className=this.on_over._className}else{this.className=this.on._className}}}}},delete_action:function(){setTimeout("if (confirm('"+F.output.get("photo_buttons_are_you_sure")+"'))  document.location = global_photos['"+this.p_id+"'].deleteUrl;",50);return 0},rotate_action:function(){var A=_ge("photo_notes");if(A&&A.show_rotate_div){this.disable_others();A.show_rotate_div(this)}return 0},send_to_set_action:function(){if(_ok_for_scrumjax_xml()){if(this.lock_down){hide_sendToSetDialog();return 0}else{show_sendToSetDialog(this.p_id);return 1}}else{document.location="/photo_sendto_set.gne?id="+this.p_id}return 0},print_action:function(){if(_ok_for_scrumjax_xml()){if(this.lock_down){hide_printDialog();return 0}else{show_printDialog(this.p_id);return 1}}else{document.location="/photo_print.gne?id="+this.p_id}return 0},send_to_group_action:function(){if(_ok_for_scrumjax_xml()){if(this.lock_down){hide_sendToGroupDialog();return 0}else{show_sendToGroupDialog(this.p_id);return 1}}else{document.location="/photo_sendto_group.gne?id="+this.p_id}return 0},blog_this_action:function(){if(_ok_for_scrumjax_xml()){if(this.lock_down){hide_sendToBlogDialog();return 0}else{show_sendToBlogDialog(this.p_id);return 1}}else{document.location="/blog.gne?photo="+this.p_id}return 0},add_note_action:function(){var A=_ge("photo_notes");if(A&&A.start_adding_note){A.start_adding_note()}return 0},add_tash_action:function(){window.should_I_ignore_stuff_because_tash_editing=1;if(!_ge("photo_tash")&&page_photo_id!=null){var A=document.createElement("DIV");A.id="photo_tash";_ge("photoImgDiv"+page_photo_id).appendChild(A);F.decorate(A,photo_tash).go_go_go()}_ge("photo_tash").show();return 0},zoom_action:function(){document.location=_ge("photo_gne_button_zoom").href;var A;return 0},embed_action:function(){document.location=_ge("photo_gne_button_embed").href;return 0},edit_photo_action:function(){if(typeof (_is_picnik_basket)!="undefined"){F.picnik_2.go_go_go()}else{F.picnik.go_go_go()}},add_to_gallery_action:function(){if(_ok_for_scrumjax_xml()){if(this.lock_down){hide_addToGalleryDialog();return 0}else{show_addToGalleryDialog(this.p_id);return 1}}else{}return 0},add_to_faves_action:function(){var B=_ge("photo_notes");var A=_ge("fave_form");if(this.isOff){if(_ok_for_scrumjax()){F.API.callMethod("flickr.favorites.remove",{photo_id:this.p_id},this);if(window.disable_stewart){if(B&&B.start_comming){B.start_comming(F.output.get("photo_buttons_removing"),null,null,null,null,null,null,null,1)}}else{if(B&&B.start_pulsing){B.start_pulsing()}}}else{if(A){A.action=page_current_url;A.faveremove.value=1;A.submit()}}}else{if(_ok_for_scrumjax()){F.API.callMethod("flickr.favorites.add",{photo_id:this.p_id},this);if(window.disable_stewart){if(B&&B.start_comming){B.start_comming(F.output.get("photo_buttons_adding"),null,null,null,null,null,null,null,1)}}else{if(B&&B.start_pulsing){B.start_pulsing()}}}else{if(A){A.action=page_current_url;A.faveadd.value=1;A.submit()}}}return 0},flickr_favorites_add_onLoad:function(D,C,B){var A=_ge("photo_notes");this.isOff=!this.isOff;this.change_src();F.change_mouse_tip_txt(this,this.title_off);if(window.disable_stewart){if(A&&A.stop_comming){A.stop_comming(1)}}else{if(A&&A.stop_pulsing){A.stop_pulsing()}}},flickr_favorites_remove_onLoad:function(D,C,B){var A=_ge("photo_notes");this.isOff=!this.isOff;this.change_src();F.change_mouse_tip_txt(this,this.title_on);if(window.disable_stewart){if(A&&A.stop_comming){A.stop_comming(1)}}else{if(A&&A.stop_pulsing){A.stop_pulsing()}}},buy_this_photo_action:function(){var A=_ge("photo_gne_button_buy_this_photo").href;return F.getty_intl_warn(A)}};var Photo_Gne_button_action_check=function(B){try{if(B=="photo_gne_button_add_tash"){if(!_ge("photo_tash")&&page_photo_id!=null){setTimeout(function(){var C=document.createElement("DIV");C.id="photo_tash";_ge("photoImgDiv"+page_photo_id).appendChild(C);F.decorate(C,photo_tash).go_go_go()},2000)}}}catch(A){}};function tagrs_showForm(){_ge("tagadderlink").style.display="none";_ge("tagadder").style.display="block";_ge("addtagbox").focus();tagrs_startAutoComplete()}function tagrs_startAutoComplete(){if(_ge("tagSuggestions")&&window.TagCompleteWidget){new TagCompleteWidget(_ge("addtagbox"),_ge("tagSuggestions"),global_nsid).completer.startLoading()}tagrs_startAutoComplete=function(){}}function tagrs_hideForm(){tagrs_clearForm();_ge("tagadderlink").style.display="block";_ge("tagadder").style.display="none"}function tagrs_clearForm(){document.forms.tagadderform.tag.value=""}function tagrs_addTag(B,A){if(!_ok_for_scrumjax_xml()){return true}if(A==""){return false}deja_view_uh_huh();tagrs_clearForm();var C=_ge("tagadder");C.flickr_photos_addTags_onLoad=function(J,I,H){if(J){F.API.callMethod("flickr.photos.getInfo",{photo_id:B},this)}else{var D=F.output.get("tagrs_tag_not_added");var G=I.documentElement.getElementsByTagName("err");if(G){G=G[0];if(G.getAttribute("code")=="2"){D=F.output.get("tagrs_max_limit",global_tag_limit,global_tag_limit)}else{if(G[0].getAttribute("msg")){D+=" "+G[0].getAttribute("msg")}}}var E=_ge("photo_notes");if(E&&E.start_comming){alert(D)}else{alert(D)}}};F.API.callMethod("flickr.photos.addTags",{photo_id:B,tags:A},C);return false}function tagrs_rebuildTagsHTML(G,H,A,I,C,B,E){var D='<div id="tagdiv'+H+'"><a class="globe" onMouseOver="this.childNodes[0].src=\''+_images_root+"/icon_globe_over.gif';\" onMouseOut=\"this.childNodes[0].src='"+_images_root+'/icon_globe.gif\';" href="/photos/tags/'+A+'/" title="'+F.output.get("tagrs_click_icon_all_public",A)+'"><img src="'+_images_root+'/icon_globe.gif" width="16" height="16" class="icon" alt="'+F.output.get("tagrs_click_icon_all_public",A)+'" /></a> ';if(_tagged_by){if(B){D+='<a class="Plain" href="'+global_photos[G].ownersUrl+"tags/"+A+'/" title="'+F.output.get("tagged_by_you")+'">'+I.escape_for_display()+"</a>"}else{if(C!=""){D+='<a class="Plain" href="'+global_photos[G].ownersUrl+"tags/"+A+'/" title="'+F.output.get("tagged_by_user",C.escape_for_display())+'">'+I.escape_for_display()+"</a>"}else{D+='<a class="Plain" href="'+global_photos[G].ownersUrl+"tags/"+A+'/" title="'+F.output.get("tagged_by_someone")+'">'+I.escape_for_display()+"</a>"}}}else{D+='<a class="Plain" href="'+global_photos[G].ownersUrl+"tags/"+A+'/">'+I.escape_for_display()+"</a>"}if(E){D+='\r\n\t\t\t\t\t\t&nbsp;<a href="'+global_photos[G].url+"?magic_cookie="+global_auth_hash+"&deletetag="+H+'" title="'+F.output.get("tagrs_delete_this_tag")+'" class="delete-x" onclick="return tagrs_removeTag(\''+G+"', '"+H+"', '"+A+"', '"+I.escape_for_display().replace("'","\\'")+"')\"><span>[x]</span></a>"}D+="</div>";return D;tagrs_setPopularUsed(A)}function tagrs_removeTag(E,B,A,D){if(window.confirm(F.output.get("tagrs_are_you_sure_delete",D.escape_for_display()))){deja_view_uh_huh();if(!_ok_for_scrumjax_xml()){return true}var C=_ge("tagadder");C.flickr_photos_removeTag_onLoad=function(K,J,I){if(K){tagrs_removedTag(E,B,A)}else{var G=F.output.get("tagrs_tag_not_deleted");var H=J.documentElement.getElementsByTagName("err");if(H&&H[0].getAttribute("msg")){G+=" "+H[0].getAttribute("msg")}alert(G)}};F.API.callMethod("flickr.photos.removeTag",{tag_id:B},C);return false}else{return false}}function tagrs_removedTag(B,D,J){_ge("tagdiv"+D).style.display="none";var C=0;var H=0;if(_ge("thetags")){var G=_ge("thetags").getElementsByTagName("div").length;for(var E=0;E<G;E++){if(_ge("thetags").getElementsByTagName("div")[E].style.display!="none"){C++}}}if(_ge("themachinetags")){var G=_ge("themachinetags").getElementsByTagName("div").length;for(var E=0;E<G;E++){if(_ge("themachinetags").getElementsByTagName("div")[E].style.display!="none"){H++}}}tagrs_toggle_displays(C,H);tagrs_setPopularUnUsedIfNotInInput(J);var I=tagrs_whereIsThisTagInHere(global_photos[B].tagsA,J);for(var A=0;A<I.length;A++){global_photos[B].tagsA.splice(I[A],1);global_photos[B].tags_rawA.splice(I[A],1)}}function tagrs_clearTags(){_ge("thetags").innerHTML=""}function tagrs_updatePopularList(C){if(!_ok_for_scrumjax_xml()){return false}var I=_ge("addtagbox");var H=F.get_tags_from_input_str(I.value);var D=(global_photos[C]&&global_photos[C].tagsA)?global_photos[C].tagsA:[];var B=(global_photos[C]&&global_photos[C].tags_rawA)?global_photos[C].tags_rawA:[];for(var J=0;J<tagrs_popularA.length;J++){var K=tagrs_popularA[J];var E=tagrs_whereIsThisTagInHere(D,K);var A=tagrs_whereIsThisTagInHere(B,K);var G=tagrs_whereIsThisTagInHere(H,K);if(E.length==0&&A.length==0&&G.length==0){tagrs_setPopularUnUsed(K)}else{tagrs_setPopularUsed(K)}}setTimeout("tagrs_updatePopularList('"+C+"')",200)}tagrs_popularA=[];function tagrs_showPopular(C,B){if(!_ok_for_scrumjax_xml()){return false}var A=_ge("addtagbox");var D=F.get_tags_from_input_str(A.value);C=(C==undefined)?20:C;var E=_ge("tagpopular");global_nsid;E.innerHTML="<i>"+F.output.get("loading")+"</i>";E.flickr_tags_getListUserPopular_onLoad=function(L,K,J){if(L){tagrs_popularA=[];var O=K.documentElement.getElementsByTagName("tag");if(O.length==0){var M=F.output.get("tagrs_no_tags_yet")}else{var M=F.output.get("tagrs_click_a_tag");for(var N=0;N<O.length;N++){var G=O[N];var P=G.firstChild.nodeValue;tagrs_popularA.push(P);M+=' <a href="#" id="popTags'+P+'" onclick="tagrs_toggleTagInInput(\''+P+"', '"+B+"'); return false;\">"+P+"</a>"}if(O.length>C){M+='<br><br><a href="#" onclick="tagrs_showPopular('+(C+20)+", '"+B+"');return false;\">"+F.output.get("tagrs_get_more_your_tags")+'</a> | <a href="#" onclick="tagrs_showPopular('+(C+2000)+", '"+B+"');return false;\">"+F.output.get("tagrs_get_all_your_tags")+"</a>"}}this.innerHTML=M;tagrs_updatePopularList(B)}else{var I=F.output.get("tagrs_tags_not_loaded");var H=K.documentElement.getElementsByTagName("err");if(H&&H[0].getAttribute("msg")){I+=" "+H[0].getAttribute("msg")}alert(I)}};F.API.callMethod("flickr.tags.getListUserPopular",{count:C+1},E)}function tagrs_setPopularUsed(A){var B=_ge("popTags"+A);if(!B){return }B.className="tagrsUsed"}function tagrs_setPopularUnUsed(A){var B=_ge("popTags"+A);if(!B){return }B.className="tagrsUnUsed"}function tagrs_setPopularUnUsedIfNotInInput(A){var C=_ge("popTags"+A);if(!C){return }var B=_ge("addtagbox");var D=F.get_tags_from_input_str(B.value);var E=tagrs_whereIsThisTagInHere(D,A);if(E.length>0){return }tagrs_setPopularUnUsed(A)}function tagrs_toggleTagInInput(B,C){var D=(global_photos[C]&&global_photos[C].tagsA)?global_photos[C].tagsA:[];var H=_ge("addtagbox");var E=F.get_tags_from_input_str(H.value);var K=tagrs_whereIsThisTagInHere(E,B);if(K.length==0){if(tagrs_whereIsThisTagInHere(D,B).length==0){E.unshift(B)}tagrs_setPopularUsed(B)}else{for(var A=0;A<K.length;A++){E.splice(K[A],1)}tagrs_setPopularUnUsed(B)}var G=_ge("popTags"+B);if(G){G.blur()}var I="";for(var J=0;J<E.length;J++){I+=(E[J].indexOf(" ")==-1)?E[J]:'"'+E[J]+'"';if(J+1<E.length){I+=" "}}H.value=I}function tagrs_whereIsThisTagInHere(G,E){var C=[];for(var D=0;D<G.length;D++){var B=G[D];if(E.toLowerCase()==B.replace(" ","").toLowerCase()){C.unshift(D)}}return C}function tagrs_toggle_displays(B,A){if(!B&&!A){_ge("thetags").style.display="block";if(_ge("machine_tag_toggle")){_ge("machine_tag_toggle").style.display="none"}if(_ge("themachinetags")){_ge("themachinetags").style.display="none"}}if(B&&!A){_ge("thetags").style.display="block";if(_ge("machine_tag_toggle")){_ge("machine_tag_toggle").style.display="none"}if(_ge("themachinetags")){_ge("themachinetags").style.display="none"}}if(!B&&A){_ge("thetags").style.display="none";if(_ge("machine_tag_toggle")){_ge("machine_tag_toggle").style.display="none"}if(_ge("themachinetags")){_ge("themachinetags").style.display="block"}if(_ge("machine_tag_toggle_show")){_ge("machine_tag_toggle_show").style.display="none"}if(_ge("machine_tag_toggle_hide")){_ge("machine_tag_toggle_hide").style.display="none"}}if(B&&A&&_old_machine_tags!=A){_old_machine_tags=A;_ge("thetags").style.display="block";if(_ge("machine_tag_toggle")){_ge("machine_tag_toggle").style.display="block"}if(_ge("themachinetags")){_ge("themachinetags").style.display="block"}if(_ge("machine_tag_toggle_show")){_ge("machine_tag_toggle_show").style.display="none"}if(_ge("machine_tag_toggle_hide")){_ge("machine_tag_toggle_hide").style.display="block"}}if(_ge("span_machine_tags_show_count")){_ge("span_machine_tags_show_count").innerHTML=A}if(_ge("span_machine_tags_hide_count")){_ge("span_machine_tags_hide_count").innerHTML=A}}function tagrs_toggle_machine_tags(){if(_ge("machine_tag_toggle_show")&&_ge("machine_tag_toggle_hide")){if(_ge("machine_tag_toggle_show").style.display=="none"){tagrs_hide_machine_tags()}else{tagrs_show_machine_tags()}}return false}function tagrs_show_machine_tags(){if(_ge("machine_tag_toggle_show")){_ge("machine_tag_toggle_show").style.display="none"}if(_ge("machine_tag_toggle_hide")){_ge("machine_tag_toggle_hide").style.display="block"}if(_ge("themachinetags")){_ge("themachinetags").style.display="block"}}function tagrs_hide_machine_tags(){if(_ge("machine_tag_toggle_show")){_ge("machine_tag_toggle_show").style.display="block"}if(_ge("machine_tag_toggle_hide")){_ge("machine_tag_toggle_hide").style.display="none"}if(_ge("themachinetags")){_ge("themachinetags").style.display="none"}}function tagrs_writePopularLink(A){if(!_ok_for_scrumjax_xml()){return }document.write('<div style="margin-top:5px; font-size:12px" id="tagpopular"><a style="text-decoration: none;" href="#" onclick="tagrs_showPopular(20, \''+A+"');return false;\">"+F.output.get("tagrs_choose_from_tags")+"</a></div>");var B=_ge("tagadder");if(B){B.flickr_photos_getInfo_onLoad=function(L,J,G){if(L){var N=J.documentElement.getElementsByTagName("tag");_rebuild_tags_for_photos(A,N);var C=global_photos[A];var I="";var E="";var D=0;var K=0;var H=new RegExp("^(.+):(.+)=(.+)$");for(var M=0;M<C.tagsA.length;M++){if(H.test(C.tags_rawA[M])&&_ge("themachinetags")){K++;E+=tagrs_rebuildTagsHTML(A,C.tags_idA[M],C.tagsA[M],C.tags_rawA[M],C.tags_nameA[M],C.tags_isOwnerA[M],C.tags_canDeleteA[M])}else{D++;I+=tagrs_rebuildTagsHTML(A,C.tags_idA[M],C.tagsA[M],C.tags_rawA[M],C.tags_nameA[M],C.tags_isOwnerA[M],C.tags_canDeleteA[M])}}tagrs_toggle_displays(D,K);_ge("thetags").innerHTML=I;if(_ge("themachinetags")){_ge("themachinetags").innerHTML=E}}else{alert("info not got")}}}if(window.deja_view_should_refresh){_ge("thetags").innerHTML="...<br>"}}function machine_tag_toggle_init(){var D=0;var C=0;if(_ge("thetags")){var B=_ge("thetags").getElementsByTagName("div").length;for(var A=0;A<B;A++){if(_ge("thetags").getElementsByTagName("div")[A].style.display!="none"){D++}}}if(_ge("themachinetags")){var B=_ge("themachinetags").getElementsByTagName("div").length;for(var A=0;A<B;A++){if(_ge("themachinetags").getElementsByTagName("div")[A].style.display!="none"){C++}}}if(!D&&!C){_ge("thetags").style.display="block";if(_ge("machine_tag_toggle")){_ge("machine_tag_toggle").style.display="none"}if(_ge("themachinetags")){_ge("themachinetags").style.display="none"}}if(D&&!C){_ge("thetags").style.display="block";if(_ge("machine_tag_toggle")){_ge("machine_tag_toggle").style.display="none"}if(_ge("themachinetags")){_ge("themachinetags").style.display="none"}}if(!D&&C){_ge("thetags").style.display="none";if(_ge("machine_tag_toggle")){_ge("machine_tag_toggle").style.display="none"}if(_ge("themachinetags")){_ge("themachinetags").style.display="block"}if(_ge("machine_tag_toggle_show")){_ge("machine_tag_toggle_show").style.display="none"}if(_ge("machine_tag_toggle_hide")){_ge("machine_tag_toggle_hide").style.display="none"}}if(D&&C){_ge("thetags").style.display="block";if(_ge("machine_tag_toggle")){_ge("machine_tag_toggle").style.display="block"}if(_ge("themachinetags")){_ge("themachinetags").style.display="none"}if(_ge("machine_tag_toggle_show")){_ge("machine_tag_toggle_show").style.display="block"}if(_ge("machine_tag_toggle_hide")){_ge("machine_tag_toggle_hide").style.display="none"}}};var nextprev_currentContextLink;var nextprev_currentContextID;nextprev_toggle_set=function(B,A){if(!_ok_for_scrumjax()){return true}var D=_ge("nextprev_tr_set"+B);if(D.style.display=="none"){var C=nextprev_expand("set",B);if(!C.ready){C.flickr_photosets_getContext_onLoad=C.handleRsp;F.API.callMethod("flickr.photosets.getContext",{photoset_id:B,photo_id:A},C)}}else{nextprev_collapse("set",B)}return false};nextprev_toggle_pool=function(B,A){if(!_ok_for_scrumjax()){return true}var D=_ge("nextprev_tr_pool"+B);if(D.style.display=="none"){var C=nextprev_expand("pool",B);if(!C.ready){C.flickr_groups_pools_getContext_onLoad=C.handleRsp;F.API.callMethod("flickr.groups.pools.getContext",{group_id:B,photo_id:A},C)}}else{nextprev_collapse("pool",B)}return false};nextprev_toggle_stream=function(A,B){if(!_ok_for_scrumjax()){return true}var D=_ge("nextprev_tr_stream"+A);if(D.style.display=="none"){var C=nextprev_expand("stream",A);if(!C.ready){C.flickr_photos_getContext_onLoad=C.handleRsp;F.API.callMethod("flickr.photos.getContext",{user_id:A,photo_id:B},C)}}else{nextprev_collapse("stream",A)}return false};nextprev_collapse=function(D,E){var C=_ge("nextprev_tr_"+D+E);var B=_ge("nextprev_crumbs_tr_"+D+E);var A=_ge("contextTitle_"+D+E);C.style.display="none";if(B){B.style.display="none"}A.style.borderBottom="1px solid #f3f3f3";C.ready=1};nextprev_expand=function(H,B){var K=_ge("nextprev_tr_"+H+B);var C=_ge("nextprev_crumbs_tr_"+H+B);var D=_ge("nextprev_div_"+H+B);var J=_ge("nextprev_mover_div_"+H+B);var L=_ge("contextInfoInner_"+H+B);var I=_ge("photosNum_"+H+B);var E=_ge("photosText_"+H+B);var A=_ge("contextTitle_"+H+B);var G=_ge("slideshowLink_"+H+B);K.showYourself=function(){K.style.display=(F.is_ie)?"block":"table-row";if(C){C.style.display=(F.is_ie)?"block":"table-row"}A.style.borderBottom="0px";if(!K.ready){J.innerHTML='<img src="'+_images_root+'/context_loading.gif" width="75" height="75" alt="" />'}};K.showYourself();K.handleRsp=function(Z,M,b){if(Z){var f=M.documentElement.getElementsByTagName("prevphoto")[0];var i=f.getAttribute("id")*1;var P="";var S="";var Q="";var c="";var h=false;var a="";var R="";if(f&&i!="0"){P=f.getAttribute("url");S=f.getAttribute("thumb");Q=' href="'+P+'"';c=' title="'+F.output.get("nextprev_goto_prev",H)+'"';_ge("nextprev_arrows_prev_img_"+H+B).style.visibility="visible";if(f.getAttribute("media")=="video"){h=true;a='<img src="'+_images_root+'/video_play_icon_small.png.v1" class="trans_png nextprev_stew_indicator">'}if(window.global_widget_carets){R='<img src="'+_images_root+'/context_caret_left.gif" class="nextprev_caret">'}}else{S=_intl_images_root+"/placeholder_first_photo.gif"}var j="<a "+Q+' class="contextThumbLink" style="position:absolute; left:0px;"><img id="nextprev_thumb_'+H+B+i+'" class="nextprev_thumb" style="visibility:hidden;" onload="F.decorate(this, F._nextprev_thumb).thumb_go_go_go(\''+P+"', false, '"+H+"', '"+B+'\')" src="'+S+'" width="75" height="75" '+c+" />"+a+R+"</a>";D.prev_id=i;D.cache["p"+i]={id:i,url:P,src:S,is_video:h,is_before:1};var U=M.documentElement.getElementsByTagName("nextphoto")[0];var V=U.getAttribute("id")*1;var d="";var g="";var T="";var O="";var X=false;var e="";var N="";if(U&&V!="0"){d=U.getAttribute("url");g=U.getAttribute("thumb");T=' href="'+d+'"';O=' title="'+F.output.get("nextprev_goto_next",H)+'"';_ge("nextprev_arrows_next_img_"+H+B).style.visibility="visible";if(U.getAttribute("media")=="video"){X=true;e='<img src="'+_images_root+'/video_play_icon_small.png.v1" class="trans_png nextprev_stew_indicator">'}if(window.global_widget_carets){N='<img src="'+_images_root+'/context_caret_right.gif" class="nextprev_caret">'}}else{g=_intl_images_root+"/placeholder_last_photo.gif"}var k="<a "+T+' class="contextThumbLink" style="position:absolute; left:78px;"><img id="nextprev_thumb_'+H+B+V+'" class="nextprev_thumb" style="visibility:hidden;" onload="F.decorate(this, F._nextprev_thumb).thumb_go_go_go(this, \''+d+"', false, '"+H+"', '"+B+'\')" src="'+g+'" width="75" height="75" '+O+" />"+e+N+"</a>";D.next_id=V;D.cache["p"+V]={id:V,url:d,src:g,is_video:X,is_before:0};J.innerHTML=j+k;writeAPIDebug(J.innerHTML);var W=M.documentElement.getElementsByTagName("count")[0].firstChild.nodeValue;I.innerHTML=W.pretty_num();E.innerHTML=F.output.get_plural("mat_group_photo",W);G.style.display=(W<2)?"none":"block";L.style.visibility="visible"}else{alert("Error")}};return K};F._nextprev_button={button_go_go_go:function(B,A,C){this.c_type=B;this.c_id=A;this.p_id=C;this.closed={};this.closed.src=_images_root+"/context_closed.gif";this.closed_over={};this.closed_over.src=_images_root+"/context_closed_over.gif";this.closed_down={};this.closed_down.src=_images_root+"/context_closed_click.gif";this.open={};this.open.src=_images_root+"/context_open.gif";this.open_over={};this.open_over.src=_images_root+"/context_open_over.gif";this.open_down={};this.open_down.src=_images_root+"/context_open_click.gif";F.preload_images(this.closed.src,this.closed_over.src,this.closed_down.src,this.open.src,this.open_down.src);this.isOver=0;this.isDown=0;this.isOpen=(this.get_src_file()=="context_closed.gif")?0:1;Y.U.Event.addListener(this,"mouseover",this.handle_mouseover);Y.U.Event.addListener(this,"mouseout",this.handle_mouseout);Y.U.Event.addListener(this,"click",this.handle_click);Y.U.Event.addListener(this,"mousedown",this.handle_mousedown)},get_src_file:function(){return this.src.split("/").pop()},change_src:function(){if(this.isOpen){if(this.isDown){this.src=this.open_down.src}else{if(this.isOver){this.src=this.open_over.src}else{this.src=this.open.src}}}else{if(this.isDown){this.src=this.closed_down.src}else{if(this.isOver){this.src=this.closed_over.src}else{this.src=this.closed.src}}}},handle_mouseover:function(){this.isOver=1;this.change_src()},handle_mouseout:function(){this.isOver=0;this.change_src()},handle_mousedown:function(){this.isDown=1;this.isOver=1;this.change_src()},handle_click:function(){this.isDown=0;this.isOpen=!this.isOpen;this.isOver=!this.isOpen;this.change_src();window["nextprev_toggle_"+this.c_type](this.c_id,this.p_id)}};F._nextprev_thumb={thumb_go_go_go:function(A,D,C,B){this.url=A;this.c_type=C;this.c_id=B;this.current=(D)?1:0;this.style.visibility="visible";Y.U.Event.addListener(this,"click",this.handle_click)},handle_click:function(B){if(this.url==""){return false}if(!B){B=window.event}if(this.current){}else{if(nextprev_currentContextLink){nextprev_currentContextLink.style.fontWeight="normal";nextprev_currentContextLink.style.color="#666666"}var A=_ge("contextLink_"+this.c_type+this.c_id);A.style.fontWeight="bold";A.style.color="#0063DC";if(B.metaKey||B.ctrlKey){}else{if(B.preventDefault){B.preventDefault()}if(B.stopPropagation){B.stopPropagation()}setTimeout('document.location = "'+this.url+'"',500)}}}};F._nextprev_arrows_div={div_go_go_go:function(D){this.contextThumbsDiv=D;this.direction_to_move=0;for(var B=0;B<this.childNodes.length;B++){var C=this.childNodes[B];C.style.cursor=(F.is_ie)?"hand":"pointer";var E=["left","","right"];if(B==1){var A=C.childNodes[0];A.style.visibility="visible";A.over_src=_intl_images_root+"/context_view_page_over.gif.v1";A.out_src=_intl_images_root+"/context_view_page_out.gif.v1"}else{var A=C;A.over_src=_images_root+"/context_arrow_more_"+E[B]+"_over.gif.v1";A.out_src=_images_root+"/context_arrow_more_"+E[B]+"_out.gif.v1"}if(A.title){F.make_new_mouse_tip(A,"below")}Y.U.Event.addListener(A,"mouseover",function(G){this.src=this.over_src});Y.U.Event.addListener(A,"mouseout",function(G){this.src=this.out_src})}Y.U.Event.addListener(this,"click",this.handle_click)},handle_click:function(B){if(this.direction_to_move){return }var A=_get_event_src(B);if(A.className=="nextprev_arrows_img_prev"){this.direction_to_move="prev";this.contextThumbsDiv.slide_it(this.contextThumbsDiv.prev_id,this.direction_to_move)}else{if(A.className=="nextprev_arrows_img_next"){this.direction_to_move="next";this.contextThumbsDiv.slide_it(this.contextThumbsDiv.next_id,this.direction_to_move)}else{if(A.className=="contextThumbLink"){return }else{return }}}}};F._slideshow_button={_decotype:F._simple_button,button_go_go_go:function(){F.make_new_mouse_tip(this,"below");F._slideshow_button._decotype.button_go_go_go.apply(this)},button_default_onclick:function(A){this.blur();return true}};F._nextprev_div={div_go_go_go:function(L,H,J,A,D,C,K,N,G,E,I){this.prev_id=(L=="")?0:L;this.next_id=(H=="")?0:H;this.prev_url=J;this.next_url=A;this.c_type=K;this.c_id=N;this.current=G;this.p_id=E;this.url=I;this.pos=0;var M=_ge("nextprev_thumb_"+this.c_type+this.c_id+L);var B=_ge("nextprev_thumb_"+this.c_type+this.c_id+H);if(M){F.decorate(M,F._nextprev_thumb).thumb_go_go_go(this.prev_url,this.current,this.c_type,this.c_id)}if(B){F.decorate(B,F._nextprev_thumb).thumb_go_go_go(this.next_url,this.current,this.c_type,this.c_id)}this.arrows_div=_ge("nextprev_arrows_div_"+this.c_type+this.c_id);F.decorate(this.arrows_div,F._nextprev_arrows_div).div_go_go_go(this);this.cache={};if(M&&B&&M!=B){M.parentNode.style.position="absolute";M.parentNode.style.left="0px";B.parentNode.style.position="absolute";B.parentNode.style.left="78px";this.cache["p"+L]={id:this.prev_id,url:this.prev_url,src:M.src,is_video:D,is_before:1};this.cache["p"+H]={id:this.next_id,url:this.next_url,src:B.src,is_video:C,is_before:0};if(L!=""){_ge("nextprev_arrows_prev_img_"+this.c_type+this.c_id).style.visibility="visible"}if(H!=""){_ge("nextprev_arrows_next_img_"+this.c_type+this.c_id).style.visibility="visible"}}F.decorate(_ge("slideshow_link_"+this.c_type+this.c_id),F._slideshow_button).button_go_go_go()},is_before_page_photo:function(C){var A=this.cache["p"+C];for(var B in A){}if(A.is_before===0){return false}else{if(A.is_before===1){return true}else{if(!A.next_id){return false}else{if(A.next_id==page_photo_id){return true}else{return this.is_before_page_photo(A.next_id)}}}}},add_thumb:function(O,E,D,P,H,I,N){writeDebug(P+" ----- "+O);var A=_ge("nextprev_mover_div_"+this.c_type+this.c_id);if(O!=0){var M=_ge("nextprev_view_page_img_"+this.c_type+this.c_id).parentNode;M.href=this.url+"with/"+O+"/"}var J="nextprev_thumb_"+this.c_type+this.c_id+O;var T=_ge(J);var G=0;if(!T||O==0){var R=document.createElement("a");R.style.position="absolute";R.className="contextThumbLink";T=document.createElement("img");T.src=E;T.className="nextprev_thumb";T.id=J;T.width=T.height=75;G=1;R.appendChild(T);if(N){var S=document.createElement("img");S.src=_images_root+"/video_play_icon_small.png.v1";S.className="trans_png nextprev_stew_indicator";S.width=S.height=11;R.appendChild(S)}if(window.global_widget_carets){if(O&&O!=page_photo_id){var B=this.is_before_page_photo(O);var Q=document.createElement("img");Q.src=(B)?_images_root+"/context_caret_left.gif":_images_root+"/context_caret_right.gif";Q.className="nextprev_caret";R.appendChild(Q)}}}else{R=T.parentNode}if(O!=0){R.href=D}if(P=="prev"){this.pos--;var C=this.pos*78;R.style.left=C+"px";if(O!=0){T.title=F.output.get("nextprev_goto_prev",this.c_type)}if(G){A.appendChild(F.prepare_for_insertion(R));if(A.childNodes.length>4){for(var L=0;L<A.childNodes.length;L++){var K=A.childNodes[L];if(K.childNodes[0]==I){continue}if(K.childNodes[0]==H){continue}F.remove_el(K,A);break}}}this.next_id=this.prev_id;this.prev_id=O;_ge("nextprev_thumb_"+this.c_type+this.c_id+this.next_id).title=F.output.get("nextprev_goto_next",this.c_type)}else{if(P=="next"){this.pos++;var C=this.pos*78;R.style.left=(C+78)+"px";if(O!=0){T.title=F.output.get("nextprev_goto_next",this.c_type)}if(G){A.appendChild(F.prepare_for_insertion(R));if(A.childNodes.length>4){for(var L=0;L<A.childNodes.length;L++){var K=A.childNodes[L];if(K.childNodes[0]==I){continue}if(K.childNodes[0]==H){continue}F.remove_el(K,A);break}}}this.prev_id=this.next_id;this.next_id=O;_ge("nextprev_thumb_"+this.c_type+this.c_id+this.prev_id).title=F.output.get("nextprev_goto_prev",this.c_type)}else{return }}if(G){F.decorate(T,F._nextprev_thumb).thumb_go_go_go(D,this.current,this.c_type,this.c_id)}anim_do_slide_to_x(A,5,40,-C,"easeOutQuad",function(U){},[T])},slide_it:function(H,N,L){var M=false;var E="";var D="";var I=0;var A=this.cache["p"+H];var O=_ge("nextprev_thumb_"+this.c_type+this.c_id+this.prev_id);var C=_ge("nextprev_thumb_"+this.c_type+this.c_id+this.next_id);var G=_ge("nextprev_arrows_prev_img_"+this.c_type+this.c_id);var J=_ge("nextprev_arrows_next_img_"+this.c_type+this.c_id);if(N=="prev"&&A&&A.prev_id!=undefined){J.style.visibility="visible";J.style.cursor=(F.is_ie)?"hand":"pointer";if(A.prev_id!=0){var K=this.cache["p"+A.prev_id];E=K.url;D=K.src;I=K.id;M=K.is_video;G.style.visibility="visible";J.style.cursor=(F.is_ie)?"hand":"pointer"}else{D=_intl_images_root+"/placeholder_first_photo.gif";G.style.visibility="hidden";J.style.cursor=""}}else{if(N=="next"&&A&&A.next_id!=undefined){G.style.visibility="visible";J.style.cursor=(F.is_ie)?"hand":"pointer";if(A.next_id!=0){var B=this.cache["p"+A.next_id];E=B.url;D=B.src;I=B.id;M=B.is_video;J.style.visibility="visible";J.style.cursor=(F.is_ie)?"hand":"pointer"}else{D=_intl_images_root+"/placeholder_last_photo.gif";J.style.visibility="hidden";J.style.cursor="";hide_tooltip(_ge("nextprev_arrows_next_img_"+this.c_type+this.c_id))}}else{if(L){writeDebug("should have had it in cache");return }if(this.c_type=="set"){F.API.callMethod("flickr.photosets.getContext",{photoset_id:this.c_id,photo_id:H},this)}else{if(this.c_type=="pool"){F.API.callMethod("flickr.groups.pools.getContext",{group_id:this.c_id,photo_id:H},this)}else{if(this.c_type=="stream"){F.API.callMethod("flickr.photos.getContext",{user_id:this.c_id,photo_id:H},this)}}}return }}this.add_thumb(I,D,E,N,O,C,M);this.arrows_div.direction_to_move=0},generic_api_onLoad:function(J,I,H,D){if(J){var B="";var A="";var G="";var K=false;if(this.arrows_div.direction_to_move=="prev"){var C=I.documentElement.getElementsByTagName("prevphoto")[0];G=C.getAttribute("id")*1;if(C&&G!="0"){B=C.getAttribute("url");A=C.getAttribute("thumb");if(C.getAttribute("media")=="video"){K=true}}else{A=_intl_images_root+"/placeholder_first_photo.gif"}this.cache["p"+D.photo_id].prev_id=G;this.cache["p"+G]={next_id:D.photo_id,id:G,url:B,src:A,is_video:K}}else{if(this.arrows_div.direction_to_move=="next"){var E=I.documentElement.getElementsByTagName("nextphoto")[0];G=E.getAttribute("id")*1;if(E&&G!="0"){B=E.getAttribute("url");A=E.getAttribute("thumb");if(E.getAttribute("media")=="video"){K=true}}else{A=_intl_images_root+"/placeholder_last_photo.gif"}this.cache["p"+D.photo_id].next_id=G;this.cache["p"+G]={prev_id:D.photo_id,id:G,url:B,src:A,is_video:K}}}}else{this.arrows_div.direction_to_move=0;return }this.slide_it(D.photo_id,this.arrows_div.direction_to_move,1)}};var upload_uploading=0;function upload_is_safari(){if(navigator.userAgent.indexOf("Safari")!=-1){return 1}return 0}function upload_is_moz_one(){if(navigator.userAgent.indexOf("Mozilla/5.0")!=-1&&navigator.userAgent.indexOf("rv:1.0")!=-1){return 1}return 0}function upload_click_button(){if(upload_is_safari()){upload_hide_form();document.getElementById("upload_form").submit()}upload_uploading=1;return true}function upload_submit_form(){if(!upload_is_safari()&&!upload_is_moz_one()){upload_hide_form()}upload_uploading=1;return true}function upload_hide_form(){document.getElementById("upload_form_container").style.display="none";document.getElementById("upload_uploading_container").style.display="block"}function createYUIUploader(){writeDebug("Extending YUI flash/upload components..");
/*
	 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
	 *
	 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
	 * http://www.opensource.org/licenses/mit-license.php
	 */
if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;YAHOO.widget.FlashAdapter=function(swfURL,containerID,attributes,buttonSkin){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};attributes=attributes||{};this._id=attributes.id=attributes.id||YAHOO.util.Dom.generateId(null,"yuigen");attributes.version=attributes.version||"9.0.45";attributes.backgroundColor=attributes.backgroundColor||"#ffffff";this._attributes=attributes;this._swfURL=swfURL;this._containerID=containerID;this._embedSWF(this._swfURL,this._containerID,attributes.id,attributes.version,attributes.backgroundColor,attributes.expressInstall,attributes.wmode,buttonSkin);try{this.createEvent("contentReady")}catch(e){}};YAHOO.extend(YAHOO.widget.FlashAdapter,YAHOO.util.AttributeProvider,{_swfURL:null,_containerID:null,_swf:null,_id:null,_initialized:false,_attributes:null,toString:function(){return"FlashAdapter "+this._id},destroy:function(){if(this._swf){var container=YAHOO.util.Dom.get(this._containerID);container.removeChild(this._swf)}var instanceName=this._id;for(var prop in this){if(YAHOO.lang.hasOwnProperty(this,prop)){this[prop]=null}}},_embedSWF:function(swfURL,containerID,swfID,version,backgroundColor,expressInstall,wmode,buttonSkin){var swfObj=new deconcept.SWFObject(swfURL,swfID,"100%","100%",version,backgroundColor);if(expressInstall){swfObj.useExpressInstall(expressInstall)}swfObj.addParam("allowScriptAccess","always");if(wmode){swfObj.addParam("wmode",wmode)}swfObj.addParam("menu","false");swfObj.addVariable("allowedDomain",document.location.hostname);swfObj.addVariable("elementID",swfID);swfObj.addVariable("eventHandler","YAHOO.widget.FlashAdapter.eventHandler");if(buttonSkin){swfObj.addVariable("buttonSkin",buttonSkin)}var container=YAHOO.util.Dom.get(containerID);var result=swfObj.write(container);if(result){this._swf=YAHOO.util.Dom.get(swfID);window._swfOwner=this}else{}},_eventHandler:function(event){var type=event.type;switch(type){case"swfReady":this._loadHandler();return ;case"log":return }this.fireEvent(type,event)},_loadHandler:function(){this._initialized=false;this._initAttributes(this._attributes);this.setAttributes(this._attributes,true);this._initialized=true;this.fireEvent("contentReady")},set:function(name,value){this._attributes[name]=value;YAHOO.widget.FlashAdapter.superclass.set.call(this,name,value)},_initAttributes:function(attributes){this.getAttributeConfig("altText",{method:this._getAltText});this.setAttributeConfig("altText",{method:this._setAltText});this.getAttributeConfig("swfURL",{method:this._getSWFURL})},_getSWFURL:function(){return this._swfURL},_getAltText:function(){return this._swf.getAltText()},_setAltText:function(value){return this._swf.setAltText(value)}});YAHOO.widget.FlashAdapter.eventHandler=function(elementID,event){var loadedSWF=YAHOO.util.Dom.get(elementID);if(!window._swfOwner){setTimeout(function(){YAHOO.widget.FlashAdapter.eventHandler(elementID,event)},0)}else{window._swfOwner._eventHandler(event)}};YAHOO.widget.FlashAdapter.proxyFunctionCount=0;YAHOO.widget.FlashAdapter.createProxyFunction=function(func){var index=YAHOO.widget.FlashAdapter.proxyFunctionCount;YAHOO.widget.FlashAdapter["proxyFunction"+index]=function(){return func.apply(null,arguments)};YAHOO.widget.FlashAdapter.proxyFunctionCount++;return"YAHOO.widget.FlashAdapter.proxyFunction"+index.toString()};YAHOO.widget.FlashAdapter.removeProxyFunction=function(funcName){if(!funcName||funcName.indexOf("YAHOO.widget.FlashAdapter.proxyFunction")<0){return }funcName=funcName.substr(26);YAHOO.widget.FlashAdapter[funcName]=null};YAHOO.widget.Uploader=function(containerId,buttonSkin){var newWMode="window";if(!(buttonSkin)){newWMode="transparent"}YAHOO.widget.Uploader.superclass.constructor.call(this,YAHOO.widget.Uploader.SWFURL,containerId,{wmode:newWMode},buttonSkin);this.createEvent("mouseDown");this.createEvent("mouseUp");this.createEvent("rollOver");this.createEvent("rollOut");this.createEvent("click");this.createEvent("fileSelect");this.createEvent("uploadStart");this.createEvent("uploadProgress");this.createEvent("uploadCancel");this.createEvent("uploadComplete");this.createEvent("uploadCompleteData");this.createEvent("uploadError")};YAHOO.widget.Uploader.SWFURL="/images/upload/yuploadcomponent.v2.6.0";YAHOO.extend(YAHOO.widget.Uploader,YAHOO.widget.FlashAdapter,{upload:function(fileID,uploadScriptPath,method,vars,fieldName){this._swf.upload(fileID,uploadScriptPath,method,vars,fieldName)},uploadAll:function(uploadScriptPath,method,vars,fieldName){this._swf.uploadAll(uploadScriptPath,method,vars,fieldName)},cancel:function(fileID){this._swf.cancel(fileID)},clearFileList:function(){this._swf.clearFileList()},removeFile:function(fileID){this._swf.removeFile(fileID)},setAllowLogging:function(allowLogging){this._swf.setAllowLogging(allowLogging)},setSimUploadLimit:function(simUploadLimit){this._swf.setSimUploadLimit(simUploadLimit)},setAllowMultipleFiles:function(allowMultipleFiles){this._swf.setAllowMultipleFiles(allowMultipleFiles)},setFileFilters:function(fileFilters){this._swf.setFileFilters(fileFilters)},enable:function(){this._swf.enable()},disable:function(){this._swf.disable()}});YAHOO.register("uploader",YAHOO.widget.Uploader,{version:"2.6.0",build:"1321"})}function flashError(){}var escape_utf8_bytes=function(E){if(E===""||E===null||E===undefined){return""}E=E.toString();var A="";for(var D=0;D<E.length;D++){var G=E.charCodeAt(D);var C=new Array();if(G>65536){C[0]=240|((G&1835008)>>>18);C[1]=128|((G&258048)>>>12);C[2]=128|((G&4032)>>>6);C[3]=128|(G&63)}else{if(G>2048){C[0]=224|((G&61440)>>>12);C[1]=128|((G&4032)>>>6);C[2]=128|(G&63)}else{if(G>128){C[0]=192|((G&1984)>>>6);C[1]=128|(G&63)}else{C[0]=G}}}if(C.length>1){for(var B=0;B<C.length;B++){A+=(String.fromCharCode(C[B]))}}else{A+=(String.fromCharCode(C[0]))}}return A};var upPage=new function(){this.toggle=function(){row=_ge("moderation");if(Y.D.hasClass(row,"open")){Y.D.removeClass(row,"open")}else{Y.D.addClass(row,"open")}return false}};function goOldSkool(B){var C="?";var A=null;for(A in B){if(B.hasOwnProperty(A)&&A!="result"){C+=(A+"="+encodeURI(B[A])+"&")}}enableChoosePhotos();C=C.substr(0,C.length-1);window.location.replace(_ge("upload-add-files").href+C)}if(typeof YAHOO.util.BgPosAnim=="undefined"){(function(){YAHOO.util.BgPosAnim=function(E,D,G,H){YAHOO.util.BgPosAnim.superclass.constructor.apply(this,arguments)};YAHOO.extend(YAHOO.util.BgPosAnim,YAHOO.util.Anim);var B=YAHOO.util;var C=B.BgPosAnim.superclass;var A=B.BgPosAnim.prototype;A.toString=function(){var D=this.getEl();var E=D.id||D.tagName;return("BgPosAnim "+E)};A.patterns.bgPos=/^backgroundPosition|background-position$/i;A.setAttribute=function(D,G,E){if(this.patterns.bgPos.test(D)){G=G[0]+E[0]+" "+G[1]+E[1];YAHOO.util.Dom.setStyle(this.getEl(),D,G)}else{C.setAttribute.apply(this,arguments)}},A.doMethod=function(E,J,G){var I;if(this.patterns.bgPos.test(E)){I=[];for(var H=0,D=J.length;H<D;++H){I[H]=C.doMethod.call(this,E,J[H],G[H])}}else{I=C.doMethod.apply(this,arguments)}return I}})()}F.format_file_size=function(A,D,J){var J=(typeof J!="undefined"?J.toLowerCase():"bytes");var D=(typeof D!="undefined"?D.toLowerCase():null);var E={bytes:{string:F.output.format_strs.uploadr_filesize_bytes,scale:1,decimalPlaces:0},kb:{string:F.output.format_strs.uploadr_filesize_kb,scale:1024,decimalPlaces:1},mb:{string:F.output.format_strs.uploadr_filesize_mb,scale:1024*1024,decimalPlaces:2},gb:{string:F.output.format_strs.uploadr_filesize_gb,scale:1024*1024*1024,decimalPlaces:2},decimal:".",result_format:'<!! dev="chronic">%number %units</!!>'};var H=(E[J]?E[J]:E.bytes);if(!D){D="bytes";var K=A*H.scale;if(K>=E.gb.scale){D="gb"}else{if(K>=E.mb.scale){D="mb"}else{if(K>=E.kb.scale){D="kb"}}}}var I=(E[D]?E[D]:null);var C=H.scale/I.scale;var B=(A*C).toFixed(I.decimalPlaces);if(B.substr(B.length-3)==".00"){B=B.substr(0,B.length-3)}if(B.substr(B.length-2)==".0"){B=B.substr(0,B.length-2)}var G=E.result_format.replace("%number",(B.toString().replace(".",E.decimal)));G=G.replace("%units",I.string);return G};function toggleModeration(){var A=_ge("moderation_toggle");if(YAHOO.util.Dom.hasClass(A,"open")){YAHOO.util.Dom.removeClass(A,"open")}else{YAHOO.util.Dom.addClass(A,"open")}}function showBandwidthNotice(){var H=_ge("bandwidth");if(!H){return false}var C=_ge("bandwidth-used");var A=_bytes_used;var G=_bytes_left;var E=(A/G);var D=F.format_file_size(G,"mb");var B="low";if(E>0.5){B="moderate"}else{if(E>0.75){B="high"}}C.className=B}var flashVersion=null;F.uploadr=null;F.Uploadr=function(){writeDebug("UPLOADR()");var D=function(I){return document.getElementById(I)};var C=this;var B=C;this.url=(typeof window._upload_api_root!="undefined"?window._upload_api_root:_api_root)+(typeof window._upload_api_path!="undefined"?window._upload_api_path:"/services/upload/");this.data={bytesUploaded:0,bytesTotal:0,fileCount:0,videoCount:0};this.params={api_key:global_magisterLudi,async:true,auth_hash:global_auth_hash,auth_s:_get_cookie("cookie_session"),chronic:1};this.stats={photos:0,bytes:0,upload_time:0,errors:0,chronic:1};this.upload_disabled=false;this.didStatsSubmit=false;this.statsTimer=null;var E=0;this.async=this.params.async;var A={ANIM:0.6,EASE:YAHOO.util.Easing.easeBothStrong,FILE_TIMEOUT:1000*60,FOO:"BAR"};this.mb=1024*1024;this.oversizeFiles=0;this.excludedFiles=0;this.oversizeVideos=0;this.maxFileSize=(_upload_max_photo_size*this.mb);this.uploadActive=false;this.uploadStarted=false;this.uploadComplete=false;this.files=[];this.photoIDs=[];this.failedFiles=0;this.failedFilesBytes=0;this.currentFile=null;this.isEmpty=true;this.fileTypesPhotos=[{description:F.output.format_strs.uploadr_filetypes_photos,extensions:"*.jpg;*.JPG;*.jpeg;*.JPEG;*.bmp;*.BMP;*.gif;*.GIF;*.png;*.PNG;*.tif;*.TIF;*.tiff;*.TIFF"}];this.fileTypesPhotosAndVideos=[{description:F.output.format_strs.uploadr_filetypes_photos_and_videos,extensions:this.fileTypesPhotos[0].extensions+";*.mov;*.MOV;*.mpg;*.MPG;*.mpeg;*.MPEG;*.mp4;*.avi;*.AVI;*.wmv;*.WMV;*.3g2;*.3G2;*.3gp;*.3GP;*.m4v;*.M4V;*.asf;*.ASF"}];this.fileTypes=(_video_offline?this.fileTypesPhotos:this.fileTypesPhotosAndVideos);this.maxFileSize={fs_default:_upload_max_photo_size*this.mb,fs_video:(typeof _upload_max_video_size!="undefined"?_upload_max_video_size:0)*this.mb};this.getFileType=function(J){J=J.toLowerCase();var K=["mov","mpg","mpeg","mp4","avi","wmv","3g2","3gp","m4v","asf"];for(var I=K.length;I--;){if(J.indexOf("."+K[I])!=-1){return"video"}}return"image"};this.fileTypes[0].description+=" ("+this.fileTypes[0].extensions+")";this.o=D("upload-table");this.oWidth=0;this.barWidth=800;this.barOffset=60;this.oForm=D("upload_form");this.oControl=null;this.oAdd=D("upload-add-files");this.oAddMore=D("upload-add-more");this.oRemove=D("upload-remove-files");this.oList=D("uploadr-list");this.oStatus=D("upload-container");this.oUpOverSize=D("upload-oversize");this.oUpOverLimit=D("upload-overlimit");this.oUpNoVideo=D("upload-no-video");this.oUpFreeVideoLimit=D("upload-free-video-limit");this.oUpFreeVideoMonthLimit=D("upload-free-video-month-limit");this.oUpOneFailed=D("uploadr-one-failed");this.oUpSomeFailed=D("uploadr-some-failed");this.oUpAllFailed=D("uploadr-all-failed");this.oStatusProgress=D("uploadr-status").getElementsByTagName("div")[0];this.oOffline=document.createDocumentFragment();this.strings={messages:{overSize:this.oUpOverSize.innerHTML,overLimit:this.oUpOverLimit.innerHTML,upOneFailed:this.oUpOneFailed.innerHTML,upSomeFailed:this.oUpSomeFailed.innerHTML,upAllFailed:this.oUpAllFailed.innerHTML},fileCountSingle:YAHOO.util.Dom.getElementsByClassName("single","span",D("upload-total-files"))[0].innerHTML,fileCountPlural:YAHOO.util.Dom.getElementsByClassName("plural","span",D("upload-total-files"))[0].innerHTML,bytesCount:D("upload-total-bytes").innerHTML,pageTitleStatus:YAHOO.util.Dom.getElementsByClassName("title-status","li",D("upload-templates"))[0].innerHTML.replace("%pagetitle",document.title),pageTitleProcessing:YAHOO.util.Dom.getElementsByClassName("title-processing","li",D("upload-templates"))[0].innerHTML.replace("%pagetitle",document.title),pageTitleDefault:document.title};this.lastState=null;var H=(isIE&&navigator.appVersion.indexOf("MSIE 6")!=-1);var G=(navigator.userAgent.match(/firefox/i));if(G){YAHOO.util.Dom.addClass(C.oStatus,"firefox")}this.getControl=function(){if(C.oControl){writeDebug("uploadr.getControl: Already got control");return false}writeDebug("uploadr.getControl");C.oControl=uploader};this.getMaxFileSize=function(I){var J=(I=="video");var K=C.maxFileSize[(J?"fs_video":"fs_default")];return K};this.getModerationSettings=function(){var O=D("moderation_container");var J=O.getElementsByTagName("input");var N=null;var I=null;for(var K=J.length;K--;){if(J[K].name&&!J[K].disabled&&((J[K].type=="radio"&&J[K].checked)||(J[K].type=="checkbox"&&J[K].checked)||J[K].type=="hidden")){N=J[K].name.indexOf("_0")!=-1?J[K].name.substr(0,J[K].name.lastIndexOf("_0")):J[K].name;I=(J[K].name=="safety_level"||J[K].name=="content_type"?parseInt(J[K].value)+1:J[K].value);if(J[K].name=="hidden"){I=(J[K].checked?2:1)}C.params[N]=I}}var M=_ge("is_friend_0");var L=_ge("is_family_0");if(!M.disabled){C.params.is_friend=(M.checked?1:0)}if(!L.disabled){C.params.is_family=(L.checked?1:0)}};this.checkContentSettings=function(){return({is_restricted:D("restricted").checked,is_default:(_default_content_type_restricted==1)})};this.checkRestrictedRules=function(){var N=D("video_restricted");var L=YAHOO.util.Dom.hasClass(N,"open");function J(){N.style.position="absolute";N.style.top="-9999px";N.style.height="auto";N.className=K;var O=N.offsetHeight-4;N.style.overflow="hidden";N.style.height="1px";N.style.position="relative";N.style.top="0px";M=new YAHOO.util.Anim(N,{height:{from:1,to:O},opacity:{from:0,to:1}},0.33,YAHOO.util.Easing.easeBothStrong);M.onComplete.subscribe(function(){N.style.height="auto";N.style.overflow=""});M.animate()}function I(){N.style.overflow="hidden";M=new YAHOO.util.Anim(N,{height:{from:N.offsetHeight-4,to:1},opacity:{to:0}},0.33,YAHOO.util.Easing.easeBothStrong);M.onComplete.subscribe(function(){N.className=K;N.style.overflow=""});M.animate()}var M=null;if(C.data.videoCount>0&&D("restricted").checked){var K="open";if(C.data.videoCount==C.data.fileCount){K+=" video-only"}else{K+=" mixed-content"}if(_default_content_type_restricted==1){K+=" default"}else{K+=" non-default"}if(!D("moderation").className.match(/open/i)){toggleModeration();upPage.toggle()}if(!L&&K.indexOf("open")!=-1){J()}else{if(L&&K.indexOf("open")==-1){I()}else{N.className=K}}return false}else{I();return true}};this.checkNonProVideo=function(){writeDebug("checking non-pro video");if(global_ispro){return true}else{var K=0;var J=null;for(J in C.files){if(C.files[J].fileType=="video"&&!C.files[J].isOversize&&!C.files[J].isExcluded){K++}}var I=(C.getVideoListCount()-B.oversizeVideos);if(C.getVideoListCount()>0){if(_is_free_video){if(_video_count>=_video_limit){if(C.oUpFreeVideoMonthLimit){C.oUpFreeVideoMonthLimit.style.display="block"}else{writeDebug("** WARN: No free video limit message?")}}else{if(_video_count+I>_video_limit){if(C.oUpFreeVideoLimit){C.oUpFreeVideoLimit.style.display="block"}else{writeDebug("** WARN: No free video limit message?")}}else{if(C.oUpFreeVideoLimit){C.oUpFreeVideoLimit.style.display="none"}if(C.oUpFreeVideoMonthLimit){C.oUpFreeVideoMonthLimit.style.display="none"}}}}else{if(C.getVideoListCount()>0){C.oUpNoVideo.style.display="block"}else{C.oUpNoVideo.style.display="none"}}}else{if(!_is_free_video){if(C.getVideoListCount()>0){C.oUpNoVideo.style.display="block"}else{C.oUpNoVideo.style.display="none"}}if(C.oUpFreeVideoLimit){C.oUpFreeVideoLimit.style.display="none"}}}};this.setState=function(I){if((I=="canceled"||I=="failed")&&C.lastState=="ok"){return false}if(C.lastState){YAHOO.util.Dom.removeClass(C.oStatus,C.lastState)}C.lastState=I;YAHOO.util.Dom.addClass(C.oStatus,I)};this.setPageTitle=function(I,J,M){try{var L=(typeof I!="undefined"?C.strings[I].replace(J,M):C.strings.pageTitleDefault);if(document.title!=L){document.title=L}}catch(K){}};this.setPageIcon=function(I){if(!G){return false}if(!I){var I="/favicon.ico"}if(D("oldPageIcon")){D("oldPageIcon").parentNode.removeChild(D("oldPageIcon"))}link=document.createElement("link");link.id="oldPageIcon";link.href=I;link.type=(isIE?"image/vnd.microsoft.icon":"image/ico");link.rel=(isIE?"shortcut icon":"icon");document.getElementsByTagName("head")[0].appendChild(link)};this.File=function(J){var I=this;this.o=null;this.oWidth=0;this.oCheckbox=null;this.oRemove=null;this.complete=false;this.state="default";this.lastState=this.state;this.nextState=null;this.oData=J;this.oStub=document.createElement("div");this.bestDate=J.bestDate;this.bestDateStamp=null;this.data={id:J.id,url:J.url,bytesTotal:J.bytesTotal,mDate:J.mDate,cDate:J.cDate,debugInfo:[],bytesUploaded:0,lastBytesUploaded:0};this.isExcluded=false;this.fileType=B.getFileType(this.data.url);this.maxFileSize=B.getMaxFileSize(this.fileType);this.isOversize=(this.data.bytesTotal>this.maxFileSize);if(this.fileType=="video"&&!this.isOversize&&(_video_offline||(_is_free_video&&_video_count+(B.data.videoCount+1)>_video_limit))){this.isOversize=false;this.isExcluded=true;B.excludedFiles++}else{if(this.fileType=="video"&&(!global_ispro&&!_is_free_video)){this.isOversize=false;this.isExcluded=true;B.excludedFiles++}else{if(this.isOversize){this.isOversize=true;B.oversizeFiles++;B.oversizeVideos++;this.isExcluded=true;B.excludedFiles++}}}this.poll={retryCount:0,pendingResponse:0,pollCount:0,pollCountSegments:4,pollOffset:0};this.timeoutTimer=null;this.oAnimPoll=null;this.ticket=null;this.isOverLimit=false;this.allowUpload=(!this.isExcluded);this.reset=function(){if(I.state=="error"){I.setTooltip("");I.data.bytesUploaded=0;I.data.lastBytesUploaded=0;I.nextState=null;I.setState("default");I.animateColor("#000");if(I.oAnimPoll){I.oAnimPoll.stop()}I.o.style.backgroundPosition=(-B.barWidth+"px 0px")}};this.timeoutCheck=function(){if(F.is_safari&&F.is_mac){writeDebug("Safari/mac special case: Ignoring file timeout");return false}I.timeoutTimer=null;if(I.state=="uploading"){B.doFileError(I);I.setTooltip("file upload stall/timeout");B.oControl.cancel(I.data.id);B.refreshProgress();window.setTimeout(B.uploadNextFile,1000)}};this.setTimeoutEvent=function(){if(I.timeoutTimer){window.clearTimeout(I.timeoutTimer)}I.timeoutTimer=window.setTimeout(I.timeoutCheck,A.FILE_TIMEOUT)};this.animatePollingTween=function(){if(!I||I.nextState=="ok"||I.nextState=="error"){return false}var K=parseInt(this.getAttribute("marginLeft"));if(isNaN(K)||(this.currentFrame<this.totalFrames&&K==0)){return false}I.poll.pollOffset=K;I.o.style.backgroundPosition=(K+"px 0px")};this.animateColor=function(L){var K=new YAHOO.util.ColorAnim(I.o,{color:{to:L}},A.ANIM,YAHOO.util.Easing.easeBoth);K.animate()};this.resetBackground=function(){I.oSelect.style.backgroundPosition="50% 32px"};this.animateOut=function(){var K=new YAHOO.util.BgPosAnim(I.o,{backgroundPosition:{from:[-B.barWidth+I.oWidth,0],to:[-B.barWidth+I.oWidth,24],unit:["px","px"]}},A.ANIM,YAHOO.util.Easing.bounceOut);var L=new YAHOO.util.BgPosAnim(I.oSelect,{backgroundPosition:{from:[50,24],to:[50,5],unit:["%","px"]}},A.ANIM,YAHOO.util.Easing.bounceOut);I.resetBackground();I.setState(I.nextState);I.resetBackground();if(I.nextState=="ok"){K.onComplete.subscribe(function(){I.o.style.backgroundImage="none"})}K.animate();L.animate()};this.animateProcessingOut=function(){var L=-B.barWidth+parseInt(I.data.bytesUploaded/I.data.bytesTotal*I.oWidth);var K=new YAHOO.util.BgPosAnim(I.o,{backgroundPosition:{from:[I.poll.pollOffset,0],to:[L,0],unit:["px","px"]}},A.ANIM,A.EASE);K.onComplete.subscribe(function(){I.animateOut()});K.animate()};this.animatePoll=function(P){var M=-B.barWidth+I.oWidth;var O=M-B.barOffset;var N=O;var K=M;I.poll.pollOffset=N;var L=new YAHOO.util.Anim(I.oStub,{marginLeft:{from:O,to:M}},P,YAHOO.util.Easing.easeNone);L.onTween.subscribe(I.animatePollingTween);I.oAnimPoll=L;window.setTimeout(function(){L.animate()},A.ANIM*1000)};this.startPolling=function(){I.animatePoll(B.poll.delay*(Math.pow(2,B.poll.retryCountMax))/1000)};this.onUploadComplete=function(){};this.onComplete=function(){I.complete=true;I.animateColor("#999");I.nextState="ok";I.animateProcessingOut();B.removeFile(I.data.id);B.updateTicketRequests()};this.onError=function(){I.nextState="error";I.animateProcessingOut();I.data.bytesUploaded=0;I.poll.pollCount=0;I.animateColor("#cc3333")};this.setState=function(K){if((K=="canceled"||K=="failed")&&I.lastState=="ok"){return false}if((I.isExcluded||I.isOverLimit)&&K=="ok"){return false}if(I.lastState){YAHOO.util.Dom.removeClass(I.o,I.lastState)}I.state=K;I.lastState=K;YAHOO.util.Dom.addClass(I.o,K)};this.setSelected=function(K){if(K){return I.select()}else{return I.deselect()}};this.select=function(){if(!I.isSelected){YAHOO.util.Dom.addClass(I.o,"selected");I.isSelected=true;return true}return false};this.deselect=function(){if(I.isSelected){YAHOO.util.Dom.removeClass(I.o,"selected");I.isSelected=false;return true}return false};this.focus=function(){var O=D("uploadr-scroll");var L=parseInt(I.o.offsetHeight);var N=parseInt(I.o.offsetTop);var M=parseInt(O.offsetHeight);var Q=parseInt(O.scrollTop);var P=((N+L)>(Q+M));var K=(Q>N);if((P||K)&&!O._isScrolling){var R=new YAHOO.util.Scroll(O,{scroll:{to:[0,N-(P?L:0)]}},A.ANIM*2,A.EASE);O._isScrolling=true;R.onComplete.subscribe(function(){O._isScrolling=false});R.animate()}I.oWidth=parseInt(B.oList.offsetWidth)};this.setTooltip=function(L,K){if(typeof K=="undefined"){K=""}I.data.debugInfo[I.data.debugInfo.length]=L+K;if(_show_tooltips!="1"){return false}I.o.getElementsByTagName("div")[0].innerHTML=(I.data.url.indexOf("/")==-1?I.data.url:I.data.url.substr(I.data.url.lastIndexOf("/")))+(L?" <b>A/D: "+L+K+"</b>":"");I.o.title=L.unescape_from_xml()};this.init=function(){var K=0;I.o=D("tmpl-upload-item").cloneNode(true);I.oSelect=I.o.getElementsByTagName("div")[2];I.o.id="";I.o.title=I.data.url+" - "+new Date(I.bestDate).toLocaleString();I.o.getElementsByTagName("div")[0].innerHTML=(I.data.url.indexOf("/")==-1?I.data.url:I.data.url.substr(I.data.url.lastIndexOf("/")));I.oRemove=I.o.getElementsByTagName("a")[0];YAHOO.util.Event.addListener(I.oRemove,"click",I.removeAndDestruct,I);var L=I.o.getElementsByTagName("div")[1];L.innerHTML=L.innerHTML.replace("%filesize",F.format_file_size(I.data.bytesTotal));if(I.isExcluded){I.setState("oversize");K=1}B.oOffline.appendChild(I.o);I.oWidth=parseInt(B.oList.offsetWidth);if(!I.oWidth){I.oWidth=(global_ispro?736:400)}I.poll.pollOffset=-B.barWidth+I.oWidth-B.barOffset;return K};this.setData=function(L){var K=null;for(K in L){I.data[K]=L[K]}};this.refreshProgress=function(K){if(K){I.data.bytesUploaded=I.data.bytesTotal}var N=(I.data.bytesUploaded==I.data.bytesTotal);if(N&&!I.o._isAnimating&&I.lastState!="processing"&&I.lastState!="complete"){I.setState("processing");I.resetBackground();I.startPolling()}else{if(!I.complete&&I.lastState!="uploading"&&I.lastState!="processing"){I.setState("uploading")}}var M=-B.barWidth+parseInt(I.data.bytesUploaded/I.data.bytesTotal*(I.oWidth-B.barOffset));if(!I.o._isAnimating&&I.data.lastBytesUploaded==0&&I.data.bytesUploaded==I.data.bytesTotal){var O=-B.barWidth+parseInt(I.data.lastBytesUploaded/I.data.bytesTotal*(I.oWidth-B.barOffset));I.o._isAnimating=true;var L=new YAHOO.util.BgPosAnim(I.o,{backgroundPosition:{from:[O,0],to:[M,0],unit:["px","px"]}},A.ANIM,A.EASE);L.onComplete.subscribe(function(){I.o._isAnimating=false;I.setState("processing")});L.animate()}else{if(!I.o._isAnimating&&I.state!="failed"){I.o.style.backgroundPosition=(M+"px 0px")}}I.data.lastBytesUploaded=I.data.bytesUploaded};this.remove=function(){if(I.isOversize){B.oversizeFiles--;if(this.fileType=="video"){B.oversizeVideos--}}if(I.isExcluded){B.excludedFiles--}if(!B.uploadStarted){I.o.parentNode.removeChild(I.o)}};this.removeAndDestruct=function(K){B.removeFile(I.data.id);YAHOO.util.Event.preventDefault(K||event);return false};this.destruct=function(){I.o=null;I=null}};this.fileExists=function(L){var K=false;var I=null;var J=null;for(I in C.files){K=true;for(J in C.files[I].oData){if(J!="id"&&(C.files[I]).oData[J]!=L[J]){K=false}}if(K){return true}}return false};this.addFile=function(J){if(C.files[J.id]){return false}if(C.fileExists(J)){return false}C.files[J.id]=new C.File(J);var I=C.files[J.id].init();if(I==0){C.data.fileCount++;if(C.files[J.id].fileType=="video"){C.data.videoCount++}C.data.bytesTotal+=parseInt(J.bytesTotal)}if(C.isEmpty){C.isEmpty=false;C.setStep(2)}};this.selectFiles=function(){writeDebug("uploadr.selectFiles()");if(C.oControl.browseMultiple){try{C.oControl.browseMultiple(C.fileTypes)}catch(I){goOldSkool({reason:"jsError,selectFiles()"})}}else{writeDebug("WARN: self.oControl.browseMultiple null/undefined?");goOldSkool({reason:"selectFiles(),unsupported"})}writeDebug("uplaodr.selectFiles() complete");return false};this.stepFlashTargets=["upload-add-files","upload-add-more"];this.currentStep=0;this.setStep=function(I){C.currentStep=I;var J=D("uploadr");if(!YAHOO.util.Dom.hasClass(J,I)){J.className="step"+I+(global_ispro?" pro":"")}if(I==2){hideFlash()}else{overlayFlashOnElement(_ge(C.stepFlashTargets[C.currentStep-1]))}};this.removeFile=function(I,J){if(!C.files[I]||C.uploadStarted){return false}if(!C.files[I].isExcluded){C.data.fileCount--;C.data.bytesTotal-=parseInt(C.files[I].data.bytesTotal);if(C.files[I].fileType=="video"){C.data.videoCount--}}C.files[I].remove();C.oControl.removeFile(C.files[I].data.id);C.files[I].destruct();delete C.files[I];C.doEmptyCheck();if(!J){B.refreshTotals();B.refreshMessages()}};this.removeAllFiles=function(){for(var I in C.files){C.removeFile(C.files[I].data.id,true)}B.refreshTotals();B.refreshMessages()};this.removeVideos=function(){for(var I in C.files){if(C.files[I].fileType=="video"){C.removeFile(C.files[I].data.id,true)}}B.refreshTotals();B.refreshMessages()};this.getVideoBytes=function(){var J=null;var I=0;for(J in C.files){if(C.files[J].fileType=="video"&&!C.files[J].isExcluded&&!C.files[J].isOversize){I+=C.files[J].data.bytesTotal}}return I};this.refreshTotals=function(){var J=[C.strings.fileCountSingle.replace("%files",C.data.fileCount),C.strings.fileCountPlural.replace("%files",C.data.fileCount)];YAHOO.util.Dom.getElementsByClassName("single","span",D("upload-total-files"))[0].innerHTML=J[0];YAHOO.util.Dom.getElementsByClassName("plural","span",D("upload-total-files"))[0].innerHTML=J[1];var I=C.data.bytesTotal;D("upload-total-files").className=(C.data.fileCount!=1?"plural":"single");D("upload-total-bytes").innerHTML=C.strings.bytesCount.replace("%bytes",F.format_file_size(I))};this.refreshMessages=function(){var I=D("uploadr-messages");var L=null;var J=0;var R=0;var P=_ge("bandwidth-used");Q=(global_ispro?0:parseInt(P.innerHTML));var Q=(global_ispro?0:parseInt(P.innerHTML));var N=(global_ispro?8192*1024*1024:_bytes_left);var K=0;for(L in C.files){if(C.files[L].fileType=="video"){K++;if(C.files[L].isExcluded&&(C.files[L].data.bytesTotal<C.files[L].maxFileSize)&&(_video_count+K<=_video_limit)){writeDebug("Resetting previously-excluded video");C.files[L].isExcluded=false;C.excludedFiles--;C.data.bytesTotal+=parseInt(C.files[L].data.bytesTotal);C.data.fileCount++;C.data.videoCount++;C.files[L].setState()}}if(!C.files[L].isExcluded){if(!_is_free_video||(_is_free_video&&C.files[L].fileType!="video")){J+=C.files[L].data.bytesTotal}if(J>N){R++;C.files[L].isOverLimit=true;YAHOO.util.Dom.addClass(C.files[L].o,"overlimit")}else{if(C.files[L].isOverLimit){C.files[L].isOverLimit=false;C.files[L].deselect();YAHOO.util.Dom.removeClass(C.files[L].o,"overlimit")}}}}if(R>1){for(L in C.files){if(C.files[L].isOverLimit){C.files[L].select()}else{C.files[L].deselect()}}var M=(global_ispro?C.data.bytesTotal:C.data.bytesTotal-C.getVideoBytes());var O=C.strings.messages.overLimit.replace("%filecount",C.data.fileCount);O=O.replace("%filesize",F.format_file_size(M));O=O.replace("%extrabytes",F.format_file_size(Math.max(0,M-N)));C.oUpOverLimit.innerHTML=O;YAHOO.util.Dom.addClass(I,"overlimit");YAHOO.util.Dom.addClass(C.o,"overlimit")}else{YAHOO.util.Dom.removeClass(I,"overlimit");YAHOO.util.Dom.removeClass(C.o,"overlimit")}if(C.oversizeFiles>0){C.oUpOverSize.innerHTML=C.strings.messages.overSize.replace("%filecount",C.oversizeFiles);YAHOO.util.Dom.addClass(I,"oversize")}else{YAHOO.util.Dom.removeClass(I,"oversize")}C.canHasUpload();overlayFlashOnElement(_ge(C.stepFlashTargets[C.currentStep-1]));C._onMouseOut()};this.restrictedUpdate=function(){C.canHasUpload()};this.canHasUpload=function(){var I=(C.data.fileCount>0);var J=true;if(global_ispro||_is_free_video){J=C.checkRestrictedRules()}if(!global_ispro){C.checkNonProVideo()}if(I&&J){writeDebug("enabling upload");C.enableUpload()}else{writeDebug("disabling upload - "+(!I?"No stuff to upload ":"")+(!J?"Restricted rules not OK":""));C.disableUpload()}};this.getVideoListCount=function(){var J=null;var I=0;for(J in B.files){if(B.files[J].fileType=="video"){I++}}return I};this.doEmptyCheck=function(){if(C.oList.getElementsByTagName("li").length==1&&!C.isEmpty){C.isEmpty=true;C.setButtonState("");C.setStep(1)}else{if(C.isEmpty){C.isEmpty=false;YAHOO.util.Dom.addClass(C.o,"has-content")}}};this.setData=function(J){var I=null;for(I in J){C.data[I]=J[I]}};this.setFileState=function(J){var I=null;for(I in C.files){C.files[I].setState(J)}};this.setButtonState=function(I){D("upload-buttons").className=(typeof I!="undefined"?I:"default")};this.setCompleteState=function(I){D("uploadr-complete-messages").className=I};this.doAdJax=function(){var J=document.createElement("iframe");J.id="uploadr-ad";J.className="ad-iframe";J.style.margin="0px;";J.style.padding="0px";J.style.border="none";try{J.scrolling="no"}catch(I){}D("ad-element").appendChild(J);J.src="http://adjax.flickr.yahoo.com/ads/792600150/LREC"};this.enableUpload=function(){if(C.upload_disabled==false){return false}C.upload_disabled=false;YAHOO.util.Dom.removeClass(D("start-upload"),"not-allowed");window.setTimeout(function(){overlayFlashOnElement(_ge(C.stepFlashTargets[C.currentStep-1]))},20)};this.disableUpload=function(){if(C.upload_disabled==true){return false}C.upload_disabled=true;YAHOO.util.Dom.addClass(D("start-upload"),"not-allowed");overlayFlashOnElement(_ge(C.stepFlashTargets[C.currentStep-1]))};this.startUpload=function(I){if(C.uploadActive||C.upload_disabled){return false}E=new Date();C.uploadActive=true;C.uploadStarted=true;F.changes_were_made();C.oWidth=parseInt(C.oList.offsetWidth);C.getModerationSettings();YAHOO.util.Dom.addClass(C.o,"no-remove");C.setState("uploading");C.setPageIcon(_images_root+"/upload/balls-16x16-nopad-fortab2.gif");C.setButtonState("uploading");D("moderation_container").style.display="none";YAHOO.util.Dom.addClass(C.oStatus,"active");YAHOO.util.Dom.addClass(C.oStatus,"uploading");hideFlash();if(global_ispro){C.uploadNextFile()}else{C.doAdJax();setTimeout(C.uploadNextFile,1500)}if(typeof I!="undefined"||typeof event!="undefined"){YAHOO.util.Event.preventDefault(I||event)}return false};this.cancelUpload=function(){if(!C.uploadActive){return false}C.uploadActive=false;F.changes_were_saved();C.oControl.cancel();C.setFileState("canceled");C.setButtonState("finished");C.setState("canceled");C.setPageTitle()};this.retryUpload=function(){C.setCompleteState("");C.failedFiles=0;C.failedFilesBytes=0;C.resetBadFiles();C.uploadActive=false;F.changes_were_saved();C.setState("uploading");E=new Date();C.uploadNextFile()};this.scrollToTop=function(){var I=new YAHOO.util.Scroll(D("uploadr-scroll"),{scroll:{to:[0,0]}},A.ANIM*2,A.EASE);I.animate()};this.resetBadFiles=function(){var I=null;for(I in C.files){C.files[I].reset()}};this.uberSort=function(J,I){var L=J.toLowerCase();var K=I.toLowerCase();return(L>K)?1:((L<K)?-1:0)};this.uploadNextFile=function(){var I=null;var J=false;for(I in C.files){if(!J&&C.files[I].allowUpload&&C.files[I].state=="default"){J=true;if(C.currentFile&&C.async){C.data.bytesUploaded+=C.currentFile.data.bytesTotal}C.currentFile=C.files[I];C.files[I].focus();C.files[I].setState("uploading");C.files[I].setTimeoutEvent();C.uploadMostDefinitely(C.files[I].data)}}if(!J){if(C.async&&C.poll.tickets.length){C.setPageTitle("pageTitleProcessing");window.setTimeout(C.uploadNextFile,500)}else{if(C.async){C.onCompleteAnimation(C._onComplete)}else{C._onComplete()}}}};this.mergeObjects=function(J,I){var M={};for(var K in J){M[K]=J[K]}var L=(typeof I=="undefined"?_s.defaultOptions:I);for(var N in L){if(typeof M[N]=="undefined"){M[N]=L[N]}}return M};this.uploadMostDefinitely=function(J){var O=[];for(var M in B.params){O[O.length]=M+B.params[M]}O[O.length]="Filename"+J.url;O[O.length]="UploadSubmit Query";O.sort();var L=O.join("");C.api_sig=md5_calcMD5(escape_utf8_bytes(global_flickr_secret+L));var I=C.mergeObjects(C.params,{api_sig:C.api_sig});var N="";var K=null;for(K in I){N+=K+": "+I[K]+"\n"}writeDebug("uploading file with params: "+N);C.oControl.upload(J.id,C.url,"POST",I,"photo")};this.refreshProgress=function(){var J=C.data.bytesTotal;var K=C.data.bytesUploaded+C.currentFile.data.bytesUploaded+C.failedFilesBytes;C.oStatusProgress.style.width=((parseInt(K/J*(C.oWidth-C.barOffset)))+"px");var I=Math.floor(K/J*99);I=Math.max(0,Math.min(100,I));C.setPageTitle("pageTitleStatus","%percentuploaded",I)};this.onCompleteAnimation=function(I){var J=new YAHOO.util.Anim(C.oStatusProgress,{width:{to:C.oWidth+8}},A.ANIM,A.EASE);J.onComplete.subscribe(function(){I()});J.animate()};this.getFileByTicket=function(I){var J=null;for(J in B.files){if(B.files[J].ticket==I){return B.files[J]}}};this.getFilesByTickets=function(M){var L=[];var K=null;for(var J=0,I=M.length;J<I;J++){K=C.getFileByTicket(M[J]);if(K){L[L.length]=K}}return L};this.poll={active:0,tickets:[],ticketCount:0,delay:500,pollTimer:null,retryCount:0,retryCountMax:8};this.startPolling=function(){if(C.poll.active){return false}C.poll.active=true;C.pollRequest()};this.stopPolling=function(){if(!C.poll.active){return false}C.poll.active=false};this.pollRequest=function(){if(C.poll.pendingResponse){}else{C.poll.pendingResponse=true;var J=C.getFilesByTickets(C.poll.tickets);for(var I=J.length;I--;){if(J[I].poll.pollCount==0){J[I].poll.pollCount++}}F.API.callMethod("flickr.photos.upload.checkTickets",{tickets:C.poll.tickets.join(",")},C)}};this.flickr_photos_upload_checkTickets_onLoad=function(Q,P,O,J){C.poll.pendingResponse=false;if(P){var N=P.documentElement;var I=N.getElementsByTagName("ticket");for(var M=0,K=I.length;M<K;M++){C.checkTicket(I[M])}}if(C.poll.tickets.length>0){C.poll.retryCount++;var L=C.poll.delay*(Math.pow(2,C.poll.retryCount));C.poll.pollTimer=window.setTimeout(C.pollRequest,L)}else{C.stopPolling()}};this.checkTicket=function(K){var J=K.getAttribute("complete");var M=K.getAttribute("id");var L=B.getFileByTicket(M);if(!L){C.removeTicket(M);return false}if(J==0&&L.poll.retryCount<C.poll.retryCountMax){L.poll.retryCount++}else{if(J==1){C.removeTicket(M);var I=K.getAttribute("photoid");C.doFileComplete(L,I)}else{if(J==2){C.removeTicket(M);L.setTooltip("processing conversion failed");C.doFileError(L)}else{if(L.poll.retryCount>=L.poll.retryCountMax){C.removeTicket(M);L.setTooltip("polling (processing) retry timeout");C.doFileError(L)}}}}return J};this.ticketExists=function(I){for(var J=C.poll.tickets.length;J--;){if(C.poll.tickets[J]==I){return true}}return false};this.addTicket=function(I){if(!C.ticketExists(I)){C.poll.tickets[C.poll.tickets.length]=I;C.poll.ticketCount++}};this.removeTicket=function(I){for(var J=0;J<C.poll.tickets.length;J++){if(C.poll.tickets[J]==I){C.poll.tickets.splice(J,1);C.poll.ticketCount--;return true}}return false};this.updateTicketRequests=function(){if(C.async&&C.poll.tickets.length&&C.poll.pollTimer!=null){var I=500;window.clearTimeout(C.poll.pollTimer);C.poll.pollTimer=null;C.poll.pendingResponse=false;window.setTimeout(function(){C.poll.pollTimer=window.setTimeout(C.pollRequest,I)},250)}};this.describePhotos=function(){if(!C.photoIDs.length){window.location.reload()}D("uploadr-ids").value=C.photoIDs.join(",");D("photo-edit-form").submit()};this.sortFilesByName=function(J,I){var L=J.name.toLowerCase();var K=I.name.toLowerCase();return(L>K)?1:((L<K)?-1:0)};this.invalidDate=function(I){return(new Date(I).getYear()<70)};this.sortFilesByBestDateStamp=function(J,I){var L=J.bestDateStamp;var K=I.bestDateStamp;return(L>K)?1:((L<K)?-1:0)};this.debugReport=function(){var M="-- Web Uploadr: Debug info --\nuser "+global_nsid+", "+(new Date().toUTCString()+"\n");M+="-----------------------------\n";var L=[];var K=null;var J=false;var I=null;for(I in C.files){K=C.files[I];if(K.data&&K.data.debugInfo.length>0){L[L.length]=(K.data.url+" | "+K.data.bytesTotal+" | "+(K.ticket?K.ticket:"[none]")+" | "+K.data.debugInfo.join(", "));J=true}}if(J){M+="File name | size (bytes) | ticket | reason(s)\n";M=M+L.join("\n")}else{M+="No errors to report for this batch.\n";M+="-----------------------------\n"}alert(M)};this._onSelect=function(J){writeDebug("uploadr._onSelect()");var I=J.fileList;var N=[];for(M in I){I[M].bestDate=(C.invalidDate(I[M].cDate)?I[M].mDate:I[M].cDate);I[M].bestDateStamp=new Date(I[M].bestDate).getTime();N[N.length]=I[M]}N.sort(C.sortFilesByBestDateStamp);var M=null;writeDebug("adding "+N.length+" files");for(var L=0,K=N.length;L<K;L++){C.addFile({id:N[L].id,url:N[L].name,bytesTotal:N[L].size,cDate:N[L].cDate,mDate:N[L].mDate,bestDate:N[L].bestDate})}writeDebug("adding files complete");C.oList.appendChild(C.oOffline);C.oOffline=document.createDocumentFragment();C.refreshTotals();C.refreshMessages();C.setButtonState();writeDebug("uploadr._onSelect(): complete")};this._onProgress=function(I){var J=I.id;if(C.files[J]){C.files[J].data.lastBytesUploaded=C.files[J].data.bytesUploaded;C.files[J].setData({bytesUploaded:I.bytesLoaded,bytesTotal:I.bytesTotal});C.files[J].refreshProgress();C.files[J].setTimeoutEvent();C.refreshProgress()}};this._onComplete=function(){C.stats.upload_time+=(new Date()-E);C.setPageIcon();C.setButtonState("finished");C.setState("complete");F.changes_were_saved();C.oStatusProgress.style.width="0px";if(C.failedFiles>0){if(C.failedFiles==C.data.fileCount){C.setCompleteState("all-failed");C.submitStats()}else{if(C.failedFiles>1){C.oUpSomeFailed.innerHTML=C.strings.messages.upSomeFailed.replace("%filecount",C.failedFiles);C.setCompleteState("some-failed")}else{C.setCompleteState("one-failed")}}C.uploadStarted=false}else{C.setCompleteState("ok");C.submitStats()}C.setPageTitle("pageTitleStatus","%percentuploaded",100);C.uploadComplete=true};this._onFileComplete=function(I){};this._onFileCompleteData=function(I){window.setTimeout(function(){C._onFileCompleteDataDelayed(I)},20)};this._onFileCompleteDataDelayed=function(R){var O=R.id;var J=C.files[O];if(!J){return false}writeDebug("API response from Flash: \n"+R.data);J.refreshProgress(true);var K=F.str_to_XML(R.data);var P=(K.getElementsByTagName("rsp")[0]&&K.getElementsByTagName("rsp")[0].getAttribute("stat")=="ok");var L=K.getElementsByTagName("photoid")[0];if(C.async){var M=null;try{M=(K.getElementsByTagName("ticketid")[0].childNodes[0].nodeValue)}catch(N){M=null}if(!M){var Q=null;try{var I=R.data.escape_for_xml();Q='<span class="uploadr-debug">'+(I.substr(I.indexOf("&gt;")+4))+"</span>"}catch(N){}J.setTooltip("bad API response/no ticket",(Q?Q:""));C.doFileError(J);setTimeout(C.uploadNextFile,50);return false}J.ticket=M;B.addTicket(M);B.startPolling();setTimeout(C.uploadNextFile,50)}else{if(P&&L){L=parseInt(parseInt(K.getElementsByTagName("photoid")[0].childNodes[0].nodeValue));C.doFileComplete(J,L)}else{J.setTooltip("response indicates fail ("+parseInt(parseInt(K.getElementsByTagName("photoid")[0].childNodes[0].nodeValue))+")");C.doFileError(J)}setTimeout(C.uploadNextFile,50)}};this.doFileComplete=function(I,J){if(J){C.photoIDs[C.photoIDs.length]=J}if(!C.async){C.data.bytesUploaded+=I.data.bytesTotal}I.oSelect.style.backgroundPosition="50% 32px";C.poll.retryCount=Math.max(0,C.poll.retryCount-I.poll.retryCount);I.onComplete()};this.doFileError=function(I){C.stats.errors++;C.poll.retryCount=Math.max(0,C.poll.retryCount-I.poll.retryCount);I.onError();C.failedFiles++;C.failedFilesBytes+=I.data.bytesTotal;if(C.async){C.data.bytesUploaded-=I.data.bytesTotal}};this._onHTTPError=function(){C.files[C.currentFile].setTooltip("fatal HTTP error (called from Flash)");C.doFileError(C.files[C.currentFile]);setTimeout(C.uploadNextFile,100)};this._onError=function(I){C.files[C.currentFile].setTooltip("http/io/security error from Flash - "+I.type+", "+I.status);C.doFileError(C.files[C.currentFile]);setTimeout(C.uploadNextFile,100)};this._onMouseOver=function(I){Y.D.addClass(C.oAdd,"hover");Y.D.addClass(C.oAddMore,"hover")};this._onMouseOut=function(I){Y.D.removeClass(C.oAdd,"hover");Y.D.removeClass(C.oAddMore,"hover")};this.setBGCache=function(I){try{document.execCommand("BackgroundImageCache",false,I)}catch(J){}};this.getStats=function(){C.stats.photos=C.data.fileCount;C.stats.bytes=C.data.bytesTotal;C.stats.upload_time=C.stats.upload_time};this.submitStats=function(){if(C.didStatsSubmit){return false}C.didStatsSubmit=true;C.getStats();if(_use_stats=="1"){F.API.callMethod("flickr.utils.logUploadStats",C.stats,C)}};this.submitAndContinue=function(){if(_use_stats!="1"){F.uploadr.describePhotos()}C.flickr_utils_logUploadStats_onLoad=C.statsSubmitComplete;if(!C.didStatsSubmit){if(!C.statsTimer){C.statsTimer=window.setTimeout(F.uploadr.describePhotos,5000)}C.submitStats()}else{F.uploadr.describePhotos()}};this.flickr_utils_logUploadStats_onLoad=function(L,K,I,J){};this.statsSubmitComplete=function(L,K,I,J){if(C.statsTimer){window.clearTimeout(C.statsTimer);C.statsTimer=null}F.uploadr.describePhotos()};this.destruct=function(){B=null;C=null};YAHOO.util.Event.addListener(C.oAdd,"click",C.selectFiles,C);YAHOO.util.Event.addListener(D("start-upload"),"click",C.startUpload,C);this.initMovie=function(){writeDebug("uploadr.initMovie()");createUploadMovie()};this.assignHandlers=function(){writeDebug("uploadr.assignHandlers()");if(!C.oControl){C.getControl()}try{C.oControl.setAllowMultipleFiles(true);uploader.setFileFilters(C.fileTypes);C.oControl.addListener("fileSelect",F.uploadr._onSelect);C.oControl.addListener("uploadProgress",F.uploadr._onProgress);C.oControl.addListener("uploadComplete",F.uploadr._onFileComplete);C.oControl.addListener("uploadCompleteData",F.uploadr._onFileCompleteData);C.oControl.addListener("uploadError",F.uploadr._onError);C.oControl.addListener("rollOver",F.uploadr._onMouseOver);C.oControl.addListener("rollOut",F.uploadr._onMouseOut);YAHOO.util.Event.addListener("safe","click",C.restrictedUpdate,C);YAHOO.util.Event.addListener("moderate","click",C.restrictedUpdate,C);YAHOO.util.Event.addListener("restricted","click",C.restrictedUpdate,C)}catch(I){writeDebug("uploadr.assignHandlers(): JS/Flash error: "+I.message);goOldSkool({reason:"jsError,assignHandlers()"})}enableChoosePhotos();if(H){C.setBGCache(true);YAHOO.util.Event.addListener(window,"beforeunload",function(){C.setBGCache(false)})}writeDebug("uploadr.assignHandlers(): complete");window.setTimeout(function(){overlayFlashOnElement(_ge(F.uploadr.stepFlashTargets[0]))},20)};return this};function uploader_swf_ready(){writeDebug("uploader_swf_ready()");if(!F.uploadr.oControl){writeDebug("Getting movie..");F.uploadr.getControl()}try{writeDebug("assigning handlers..");F.uploadr.assignHandlers()}catch(A){writeDebug("ERROR: F.uploadr.assignHandlers() failed: "+A.message)}if(!F.uploadr){writeDebug("WARN: F.uploadr is null?")}writeDebug("uploadr_swf_ready(): complete");setLoadingState(false)}function initUploadr(){if(!document.getElementById("uploadr")){writeDebug("#uploadr not found - exiting");return false}flashVersion=deconcept.SWFObjectUtil.getPlayerVersion();createYUIUploader();F.uploadr=new F.Uploadr();writeDebug("F.uploadr: "+F.uploadr);F.uploadr.initMovie()}function disableChoosePhotos(){var A=_ge("step1");if(A){Y.D.removeClass(A,"enabled");Y.D.addClass(A,"disabled")}else{writeDebug("disableChoosePhotos(): Warn: Element not found")}}function enableChoosePhotos(){var A=_ge("step1");if(A){Y.D.removeClass(A,"disabled");Y.D.addClass(A,"enabled")}else{writeDebug("disableChoosePhotos(): Warn: Element not found")}}function createUploadMovie(){writeDebug("createUploadMovie()");initYUIUpload()}function checkFlash(){var A=deconcept.SWFObjectUtil.getPlayerVersion();alert(A.major+"."+A.minor+"r"+A.rev)}function uploadrSupported(){if(window.location.href.match(/nocheck/i)){return true}var A=deconcept.SWFObjectUtil.getPlayerVersion();if(navigator.platform.match(/linux/i)&&A.major==9&&A.minor==0){if(A.rev<60){return{result:false,reason:"needFlashUpgrade"}}else{return{result:true}}}if(document.getElementById&&A.major>0){if(A.major<9){return{result:false,reason:"needFlashUpgrade"}}else{if(A.major==9&&A.minor==0&&A.rev==28){return{result:false,reason:"needFlashUpgrade"}}if(A.major==9&&A.minor==0&&A.rev==16){return{result:false,reason:"badversion,needFlashUpgrade"}}if(A.major==9&&A.minor==0&&A.rev==0){return{result:true}}return{result:true}}}else{return{result:false,reason:"noflash"}}}function overlayFlashOnElement(A){if(!A){writeDebug("overlayFlashOnElement(): oTarget null?");return false}writeDebug("overlayFlashOnElement()");var E=_ge("upload-flash-box");var B=_ge("uploadr");var C=Y.D.getXY(B);var D=Y.D.getXY(A);E.style.width="1px";E.style.height="1px";E.style.left=(D[0]-C[0]-2)+"px";E.style.top=(D[1]-C[1]-2)+"px";E.style.width=(parseInt(A.offsetWidth)+4)+"px";E.style.height=(parseInt(A.offsetHeight)+4)+"px"}function hideFlash(){writeDebug("hideFlash()");var A=_ge("upload-flash-box");A.style.top="-999px";A.style.left="-999px"}function tryUploadInit(){if(!_ge("uploadr")){writeDebug("#uploadr not found - exiting");return false}var A=uploadrSupported();if(A.result==false){enableChoosePhotos();goOldSkool(A)}else{initUploadr()}}function makeKHTMLUpdateUI(){}if(navigator.userAgent.match(/khtml/i)){window.setInterval(makeKHTMLUpdateUI,250)}YAHOO.util.Event.onDOMReady(function(){window.setTimeout(tryUploadInit,20)});var uploader=null;function initYUIUpload(){writeDebug("initYUIUpload()");YAHOO.widget.Uploader.SWFURL="/images/upload/yuploadcomponent.swf.v2.6.0.1";try{uploader=new YAHOO.widget.Uploader("upload-flash-box")}catch(B){writeDebug("initYUIUpload(): something broke :"+B.message+" / "+B.toString());goOldSkool({reason:"jsError,initYUIUpload"})}writeDebug("uploader widget created");uploader.addListener("contentReady",uploader_swf_ready);function A(){if(typeof _upload_logging=="undefined"){uploader.setAllowLogging(false)}else{if(_upload_logging){uploader.setAllowLogging(true)}}uploader.setAllowMultipleFiles(true)}}function setLoadingState(A){writeDebug("setLoadingState: "+A);var C="loading";var B=_ge("uploadr");if(!B){writeDebug("setLoadingState(): Could not find element");return false}if(A){Y.D.addClass(B,C);disableChoosePhotos()}else{Y.D.removeClass(B,C);enableChoosePhotos()}}function preinitUpload(){setLoadingState(true)};var snagit=1;F.geotagger={closed:true,loaded_geobookmarks:false,already_loading_js:false,block_size:[],new_map_link:{},two_second_delay_time_started_for_dunstan_because_he_is_picky_like_that:0,saved_responseXML:"",geotagger_go_go_go:function(){this.bookmarks_select={onclick:function(){this.update_location_input();},onchange:function(){this.update_location_input();},onkeyup:function(M){this.update_location_input();},update_location_input:function(){if(this.options[this.options.selectedIndex].value!=""){_ge("freeform_geotagging").value=this.options[this.options.selectedIndex].text.split(" - (")[0];}else{var a=_ge("freeform_geotagging").value.toLowerCase();if(_ge("geo_bookmarks_slct")){for(var M=1;M<_ge("geo_bookmarks_slct").options.length;M++){if(a==_ge("geo_bookmarks_slct").options[M].text.split(" - (")[0].toLowerCase()){_ge("freeform_geotagging").value="";}}}}}};this.input_box={do_first_lat_long_auto_insert:true,onkeyup:function(n){if(!n){n=window.event;}var M=_get_event_keycode(n);if(M==71&&n.ctrlKey&&n.altKey){this.value="geo:long=";}if(M==13){_ge("geo_form_save").onclick();return ;}if(this.do_first_lat_long_auto_insert){var a=new RegExp("^(geo:(lat)=(\\+|\\-)?((\\d+\\.\\d+)|\\d+)([,; ]))$");var L=new RegExp("^(geo:(lon|long)=(\\+|\\-)?((\\d+\\.\\d+)|\\d+)([,; ]))$");if(this.value.toLowerCase().match(a)){this.value=this.value.toLowerCase()+" geo:long=";this.do_first_lat_long_auto_insert=false;}if(this.value.toLowerCase().match(L)){this.value=this.value.toLowerCase()+" geo:lat=";this.do_first_lat_long_auto_insert=false;}}if(_ge("geo_bookmarks_slct")){_ge("geo_bookmarks_slct").options.selectedIndex=0;}if(this.value==""){this.do_first_lat_long_auto_insert=true;}_ge("freeform_geotagging_4real").value="";}};this.submit_button={onclick:function(){_ge("a_geotag_toggle").two_second_delay_time_started_for_dunstan_because_he_is_picky_like_that=new Date();if(_ge("freeform_geotagging").value==""){return ;}if(_ge("freeform_geotagging_4real").value!=""){if(_ge("freeform_geotagging_4real").value.split("|").length==1){_ge("a_geotag_toggle").save_position(_pf(_ge("freeform_geotagging_4real").value.split(",")[0]),_pf(_ge("freeform_geotagging_4real").value.split(",")[1]),_pf(_ge("freeform_geotagging_4real").value.split(",")[2]),_ge("freeform_geotagging_4real").value.split(",")[0]+", "+_ge("freeform_geotagging_4real").value.split(",")[1]);}else{_ge("a_geotag_toggle").save_position(_pf(_ge("freeform_geotagging_4real").value.split(",")[0]),_pf(_ge("freeform_geotagging_4real").value.split(",")[1]),_pf(_ge("freeform_geotagging_4real").value.split(",")[2]),_ge("freeform_geotagging_4real").value.split("|")[1]);}return ;}var a=_ge("freeform_geotagging").value.toLowerCase();var d=null;if(_ge("freeform_geotagging").value.length>1&&_ge("freeform_geotagging").value.substr(0,1)=="@"){_ge("a_geotag_toggle").find_at(_ge("freeform_geotagging").value.substr(1,9999));return ;}var L=new RegExp("^(geo:lat=(\\+|\\-)?((\\d+\\.\\d+)|\\d+)([,; ]+))(geo:(long|lon)=(\\+|\\-)?((\\d+\\.\\d+)|\\d+))");var M=new RegExp("^(geo:(long|lon)=(\\+|\\-)?((\\d+\\.\\d+)|\\d+)([,; ]+))(geo:lat=(\\+|\\-)?((\\d+\\.\\d+)|\\d+))");var b=new RegExp("[a-z:=]","g");var C=new RegExp("[ ;]","g");var c=new RegExp(",+","g");if(a.match(L)){d=a.replace(b,"").replace(C,",").replace(c,",");var Z=_pf(d.split(",")[0]);var Q=_pf(d.split(",")[1]);}if(a.match(M)){d=a.replace(b,"").replace(C,",").replace(c,",");var Z=_pf(d.split(",")[1]);var Q=_pf(d.split(",")[0]);}if(typeof (Z)=="undefined"){var X=null;var B=null;var W=null;a=a.replace(String.fromCharCode(8220),"\"").replace(String.fromCharCode(8221),"\"").replace(String.fromCharCode(8216),"'").replace(String.fromCharCode(8217),"'").replace(String.fromCharCode(176),"*");var j=null;var P=null;if(a.indexOf("n")>0){X=true;j=a.indexOf("n");}if(a.indexOf("s")>0){X=false;j=a.indexOf("s");}if(a.indexOf("e")>0){B=true;P=a.indexOf("e");}if(a.indexOf("w")>0){B=false;P=a.indexOf("w");}if(j!=null&&P!=null&&P<j){this.lon_first=true;}if(a.indexOf("*")>0&&a.indexOf("'")>0&&a.indexOf("\"")>0){var a=a.replace(new RegExp("[nsew'\"*]"),",").replace(new RegExp(",+")," ").replace(new RegExp(" +")," ");var h=a.split(" ");if(h.length>=6){var Z=_pi(h[0]);if(Z>=0){Z+=(h[1]/60)+(h[2]/6000);}else{Z-=((h[1]/60)+(h[2]/6000));}var Q=_pi(h[3]);if(Q>=0){Q+=(h[4]/60)+(h[5]/6000);}else{Q-=((h[4]/60)+(h[5]/6000));}}}if(a.indexOf("*")>0&&a.indexOf("'")>0){var a=a.replace(new RegExp("[nsew'\"*]"),",").replace(new RegExp(",+")," ").replace(new RegExp(" +")," ");var h=a.split(" ");if(h.length>=4){var Z=_pi(h[0]);if(Z>=0){Z+=(h[1]/60);}else{Z-=(h[1]/60);}var Q=_pi(h[2]);if(Q>=0){Q+=(h[3]/60);}else{Q-=(h[3]/60);}}}if(typeof (h)=="undefined"){var a=a.replace(new RegExp("[nsew'\"*]"),",").replace(new RegExp(",+")," ").replace(new RegExp(" +")," ");var h=a.split(" ");if(h.length>=2){var Z=_pf(h[0]);var Q=_pf(h[1]);}}if(W==true){var n=Z;Z=Q;Q=n;}if(X==true){Z=Math.abs(Z);}if(X==false){Z=-1*Math.abs(Z);}if(B==true){Q=Math.abs(Q);}if(B==false){Q=-1*Math.abs(Q);}}if(this.validate(Z,Q)){_ge("a_geotag_toggle").save_position(Z,Q,16,Z+", "+Q);}else{var R=_ge("freeform_geotagging").value.toLowerCase().replace(new RegExp("[a-z]"),"").replace(new RegExp("[,;*'\" ]"),"");var E=_ge("freeform_geotagging").value.toLowerCase().replace(new RegExp("[0-9]"),"").replace(new RegExp("[,;*'\" ]"),"");if((R.length*0.7)>E.length){YAHOO.util.Dom.setStyle("block_page_geotag","display","none");YAHOO.util.Dom.setStyle("div_geo_feedback_mangled_format","display","block");}else{_ge("a_geotag_toggle").find_location(_ge("freeform_geotagging").value);}}},validate:function(M,a){if(typeof (M)=="undefined"||typeof (a)=="undefined"||typeof (M)!="number"||typeof (a)!="number"||isNaN(M)||isNaN(a)){return false;}if(Math.abs(M)>90||Math.abs(a)>180){return false;}return true;}};if(_ge("geo_bookmarks_slct")){F.decorate(_ge("geo_bookmarks_slct"),this.bookmarks_select);}F.decorate(_ge("freeform_geotagging"),this.input_box);F.decorate(_ge("geo_form_save"),this.submit_button);if(_ge("geo_bookmark_privacy_slct")){for(var r=0;r<_ge("geo_bookmark_privacy_slct").options.length;r++){if(use_viewgeo==_ge("geo_bookmark_privacy_slct").options[r].value){_ge("geo_bookmark_privacy_slct").options.selected=true;}}}if(_ge("a_place_on_map_nu")){_ge("a_place_on_map_nu").style.display="none";}if(_ge("a_place_on_map_old")){_ge("a_place_on_map_old").style.display="none";}if(_ge("a_geotag_toggle")&&!_ge("div_taken_in")){_ge("a_geotag_toggle").style.display="inline";}if(_ge("freeform_geotagging")){_ge("freeform_geotagging").value="";}if(_ge("freeform_geotagging_4real")){_ge("freeform_geotagging_4real").value="";}if(_ge("freeform_geotagging")&&use_location!=""){_ge("freeform_geotagging").value=use_location;}if(_ge("freeform_geotagging_4real")&&use_4real_location!=""){_ge("freeform_geotagging_4real").value=use_4real_location;}},toggle_geotagging:function(){if(this.closed){if(_ge("div_remove_only_if_we_have_geodata")){if(_ge("div_taken_in")){YAHOO.util.Dom.setStyle("div_remove_only_if_we_have_geodata","display","block");}else{YAHOO.util.Dom.setStyle("div_remove_only_if_we_have_geodata","display","none");}}YAHOO.util.Dom.setStyle("block_page_geotag","height","");YAHOO.util.Dom.setStyle("block_page_geotag","display","block");this.block_size_height=_ge("block_page_geotag").offsetHeight;this.block_size_width=_ge("block_page_geotag").offsetWidth;if(F.is_ie){var n=0;var a=0;}else{var n=10;var a=10;}var M=["div_geo_feedback_mangled_format","div_geo_feedback_error","div_geo_feedback_finding_locations","div_geo_feedback_saving","div_geo_feedback_success","div_geo_feedback_list_locations","div_geo_removing","div_geo_remove_success"];for(var r=0;r<M.length;r++){if(_ge(M[r])){YAHOO.util.Dom.setStyle(M[r],"height",this.block_size_height-a);YAHOO.util.Dom.setStyle(M[r],"width",this.block_size_width-n);}}this.closed=false;if(_ge("freeform_geotagging")){if(_ge("div_taken_in")){_ge("div_not_frm_geotagging_taken_in").innerHTML=_ge("div_taken_in").innerHTML.replace(/<[^>]+>/g,"");_ge("div_frm_geotagging").style.display="none";_ge("div_not_frm_geotagging").style.display="block";_ge("div_not_frm_geotagging_fix_this").style.display="block";}else{_ge("freeform_geotagging").focus();_ge("freeform_geotagging").do_first_lat_long_auto_insert=true;_ge("div_frm_geotagging").style.display="block";_ge("div_not_frm_geotagging").style.display="none";}}}else{Y.U.Dom.setStyle("block_page_geotag","display","none");Y.U.Dom.setStyle("div_geo_feedback_list_alternative_locations","display","none");this.closed=true;}return false;},load_geobookmarks:function(){var r={flickr_people_geoBookmarks_getList_onLoad:function(R,C,L,h){if(R){this.loaded_geobookmarks=true;var n=C.documentElement.getElementsByTagName("bookmark");var M=_ge("geo_bookmarks_slct").options;M.length=0;M[M.length]=new Option("-- "+F.output.get("global_plus_geo_select_bmk")+" --","");for(var a=0;a<n.length;a++){M[M.length]=new Option(n[a].getAttribute("label")+" - ("+n[a].getAttribute("pretty_name")+")",n[a].getAttribute("latitude")+", "+n[a].getAttribute("longitude")+", "+n[a].getAttribute("accuracy"));}_ge("div_geo_bookmark_form_loading").style.display="none";if(n.length>0){_ge("div_geo_bookmark_form").style.display="block";}else{_ge("div_geo_bookmark_none").style.display="block";}_ge("a_geotag_toggle").loaded_geobookmarks=true;}}};if(_ge("geo_bookmarks_slct")){F.API.callMethod("flickr.people.geoBookmarks.getList",{},r,null,null,0);}},find_location:function(r){var M={flickr_geocode_translate_onLoad:function(v,U,d,n){if(v){var x=U.documentElement.getElementsByTagName("ResultSet")[0];var c=U.documentElement.getElementsByTagName("Result");var u=x.getAttribute("fl:source_id");var P=n.location.trim().split(",")[0];var j=[];var o=false;var h=function(s){var I=1;if(s.precision=="GeocodedBuilding"){I=16;}if(s.precision=="POI"){I=16;}if(s.precision=="GeocodedStreet"){I=15;}if(s.precision=="Suburb"){I=11;}if(s.precision=="Town"){I=9;}if(s.precision=="State"){I=5;}if(s.precision=="Country"){I=2;}return I;};var N=function(s){var I="&bull; ";if(s.title!=""){I+="<strong>"+s.title+"</strong>, ";}I+="<a href=\"#\" onclick=\"_ge('a_geotag_toggle').set_position("+s.lat+", "+s.lon+", ";I+=h(s);I+=", '"+s.title+", "+s.sub_title+"'); return false\">";I+=s.sub_title;I+="</a><br />";return I;};var G=0;for(y=0;y<c.length;y++){try{var z=String(c[y].getAttribute("precision"));}catch(J){var z="";}try{var W=String(c[y].getElementsByTagName("woe_specificprobability")[0].firstChild.nodeValue);}catch(J){var W="";}try{var D=String(c[y].getElementsByTagName("woe_woeid")[0].firstChild.nodeValue);}catch(J){var D="";}var K=String(c[y].getElementsByTagName("Latitude")[0].firstChild.nodeValue);var b=String(c[y].getElementsByTagName("Longitude")[0].firstChild.nodeValue);try{var B=String(c[y].getElementsByTagName("woe_bbox")[0].firstChild.nodeValue);}catch(J){var B="";}try{var V=String(c[y].getElementsByTagName("Address")[0].firstChild.nodeValue);}catch(J){var V="";}try{var Q=String(c[y].getElementsByTagName("City")[0].firstChild.nodeValue);}catch(J){var Q="";}try{var A=String(c[y].getElementsByTagName("State")[0].firstChild.nodeValue);}catch(J){var A="";}try{var Z=String(c[y].getElementsByTagName("Zip")[0].firstChild.nodeValue);}catch(J){var Z="";}try{var l=String(c[y].getElementsByTagName("Country")[0].firstChild.nodeValue);}catch(J){var l="";}try{var O=String(c[y].getElementsByTagName("place_url")[0].firstChild.nodeValue);}catch(J){var O="";}l=(l=="United States")?"US":l;l=(l=="United Kingdom")?"UK":l;var e="";var a="";var L=P.toLowerCase();if(z=="GeocodedBuilding"||z=="POI"){if(V){a=a+", "+V;}}if(Q){a=a+", "+Q;}if(A){a=a+", "+A;}if(l){a=a+", "+l;}if(a.length>2){a=a.substring(2,a.length);}if(z=="County"){e=P.substring(0,1).toUpperCase()+P.substring(1,P.length)+" County";}else{if(z=="GeocodedBuilding"){a=P.split(" ")[0]+" "+a;}else{if(z=="POI"){e=P;}else{sub_titleA=a.split(", ");if(L==sub_titleA[0].toLowerCase()){if(sub_titleA[0]!=a){e=sub_titleA[0];a=a.replace(sub_titleA[0]+", ","");}}if(e==""){e=P;}}}}if(j.length==0||(j.length>0&&(e!=j[j.length-1].title||a!=j[j.length-1].sub_title))){var w=Math.abs(_pf(B.split(",")[0])-_pf(B.split(",")[2]));var R=Math.abs(_pf(B.split(",")[1])-_pf(B.split(",")[3]));var S=new woe_location_obj(D,e,a,W,B,z,K,b);o=true;var E=100.035;if((w+R<E||z=="GeocodedBuilding"||z=="POI"||z=="GeocodedStreet")){j.push(S);}else{if(z!="Country"){G++;}else{G+=5;}}}}if(G>=5){j=[];}if(j.length==0){if(o){new_html="<strong>"+F.output.get("global_plus_geo_kinda_found_stuff")+"</strong>";}else{new_html="<strong>"+F.output.get("global_plus_geo_no_matches_for",n.location)+"</strong>";}}else{if(j.length==1&&(j[0].precision=="GeocodedBuilding"||j[0].precision=="POI"||j[0].precision=="GeocodedStreet")){new_html="<strong>"+F.output.get("global_plus_geo_search_results")+"</strong><br />"+F.output.get("global_plus_geo_one_match")+"<br /><br />";new_html+=N(j[0]);_ge("a_geotag_toggle").set_position(j[0].lat,j[0].lon,h(j[0]),j[0].title+", "+j[0].sub_title);return ;}else{if(j.length>=8){new_html="<strong>"+F.output.get("global_plus_geo_search_results")+"</strong><br />"+F.output.get("global_plus_geo_found_x_matches",j.length)+"<br /><br />";for(var y=0;y<7;y++){new_html+=N(j[y]);}new_html+="<a href=\"#\" onclick=\"this.style.display='none'; _ge('div_geo_feedback_list_locations').style.height=''; _ge('div_more_geo_results').style.display='block'; return false\"><br /><strong>"+F.output.get("global_plus_geo_more_results")+"</strong></a>";new_html+="<div id=\"div_more_geo_results\" style=\"display: none\" class=\"p_smaller\">";for(var y=7;y<j.length;y++){new_html+=N(j[y]);}new_html+="</div>";}else{if(j.length==1){new_html=F.output.get("global_plus_geo_one_match")+"<br /><br />";}else{new_html=F.output.get("global_plus_geo_found_x_matches",j.length)+"<br /><br />";}for(var y=0;y<j.length;y++){new_html+=N(j[y]);}}}}_ge("a_geotag_toggle").set_failed_search(new_html);}else{try{var X=_pi(U.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var g=U.documentElement.getElementsByTagName("err")[0].getAttribute("msg");}catch(J){var C=F.output.get("unknown_err");}_ge("div_geo_feedback_error_msg").innerHTML=C;YAHOO.util.Dom.setStyle("div_geo_feedback_finding_locations","display","none");YAHOO.util.Dom.setStyle("div_geo_feedback_error","display","block");}}};YAHOO.util.Dom.setStyle("block_page_geotag","display","none");_ge("div_geo_feedback_finding_locations").style.display="block";F.API.callMethod("flickr.geocode.translate",{provider_name:(_qs_args.provider_name)?_qs_args.provider_name:"woe",location:r},M,null,null,0);},fetch_alternatives:function(b,a,L){b=parseFloat(b);a=parseFloat(a);L=parseInt(L);_ge("block_page_geotag").style.display="none";_ge("div_geo_feedback_list_alternative_locations").style.display="none";_ge("div_geo_feedback_finding_alternative_locations").style.display="block";if(L>0){if(L>=1&&L<=2){L=6;}if(L>=3&&L<=5){L=5;}if(L>=6&&L<=8){L=4;}if(L>=9&&L<=11){L=3;}if(L>=12&&L<=14){L=2;}if(L>=15&&L<=16){L=1;}}else{L=L*-1;}if(L==1){var C=22;var h=1.5;}if(L==2){var C=7;var h=7;}if(L==3){var C=9;var h=50;}if(L==4){var C=8;var h=200;}if(L==5){var C=12;var h=500;}if(L==6){var C=29;var h=1500;}var X=0.056;var P=b-(X*h/8);var R=b+(X*h/8);var M=a-(X*h/8);var d=a+(X*h/8);var n={flickr_photos_geo_placesForBoundingBox_onLoad:function(o,U,j,c){if(o){var W=U.documentElement.getElementsByTagName("place");var Z="<ul>";var E=U.documentElement.getElementsByTagName("places")[0].getAttribute("place_type");for(var B=0;B<W.length;B++){Z+="<li class=\"Stats\"><a href=\"#\" class=\"Plain\" onclick=\"_ge('a_geotag_toggle').correct_location('"+W[B].getAttribute("place_id")+"', "+E+");return false\">"+W[B].firstChild.nodeValue+"</a></li>";}Z+="</ul>";if(E==22){var Q=-2;}if(E==7){var Q=-3;}if(E==9){var Q=-4;}if(E==8){var Q=-5;}if(E==12){var Q=-6;}if(E==29){var Q=-7;}Z+="<br /><a href=\"#\" onclick=\"_ge('a_geotag_toggle').fetch_alternatives('"+c.pass_params.lat+"','"+c.pass_params.lon+"','"+Q+"'); return false\" class=\"Plain\">None of the above</a>";_ge("div_geo_feedback_list_alternative_locations_list").innerHTML=Z;_ge("div_geo_feedback_finding_alternative_locations").style.display="none";_ge("div_geo_feedback_list_alternative_locations").style.display="block";}else{var Z=F.output.get("geo_corrections_no_alternatives");_ge("div_geo_feedback_list_alternative_locations_list").innerHTML=Z;_ge("div_geo_feedback_finding_alternative_locations").style.display="none";_ge("div_geo_feedback_list_alternative_locations").style.display="block";}}};var r={lat:b,lon:a,step:(L*-1)};F.API.callMethod("flickr.photos.geo.placesForBoundingBox",{bbox:M+","+P+","+d+","+R,placetype:C,pass_params:r},n,null,null,0);},correct_location:function(r,a){var M={flickr_photos_geo_correctLocation_onLoad:function(R,C,L,h){if(R){if(h.place_type==22){var n=16;}if(h.place_type==7){var n=14;}if(h.place_type==9){var n=11;}if(h.place_type==8){var n=8;}if(h.place_type==12){var n=5;}if(h.place_type==29){var n=2;}_ge("a_geotag_toggle").load_position(n);}}};_ge("div_geo_feedback_list_alternative_locations").style.display="none";_ge("div_geo_feedback_saving").style.display="block";F.API.callMethod("flickr.photos.geo.correctLocation",{photo_id:page_photo_id,place_id:r,place_type:a},M,null,null,0);},find_at:function(M){var r={flickr_photos_search_onLoad:function(d,b,h,n){if(d){var R="";if(b.documentElement.getElementsByTagName("photo").length==1){photo_id=b.documentElement.getElementsByTagName("photo")[0].getAttribute("id");var X={flickr_photos_getInfo_onLoad:function(e,o,B,Q){if(e){if(o.documentElement.getElementsByTagName("location").length==0){var j=o.documentElement.getElementsByTagName("url");var Z="";for(var E=0;E<j.length;E++){if(j[E].getAttribute("type")=="photopage"){Z=j[E].childNodes[0].nodeValue;}}if(Z!=""){R="<strong>"+F.output.get("global_plus_geo_no_geo_bookmark_data_for_with_path",Z,"@"+Q.tags)+"</strong>";}else{R="<strong>"+F.output.get("global_plus_geo_no_geo_bookmark_data_for","@"+Q.tags)+"</strong>";}_ge("a_geotag_toggle").set_failed_search(R);}else{latitude=o.documentElement.getElementsByTagName("location")[0].getAttribute("latitude");longitude=o.documentElement.getElementsByTagName("location")[0].getAttribute("longitude");accuracy=o.documentElement.getElementsByTagName("location")[0].getAttribute("accuracy");try{query_string=o.documentElement.getElementsByTagName("query_string")[0].childNodes[0].nodeValue;}catch(G){query_string=latitude+", "+longitude;}geo_ispublic=o.documentElement.getElementsByTagName("geoperms")[0].getAttribute("ispublic");geo_iscontact=o.documentElement.getElementsByTagName("geoperms")[0].getAttribute("iscontact");geo_isfriend=o.documentElement.getElementsByTagName("geoperms")[0].getAttribute("isfriend");geo_isfamily=o.documentElement.getElementsByTagName("geoperms")[0].getAttribute("isfamily");use_location=query_string;use_4real_location=latitude+", "+longitude+", "+accuracy+"|"+query_string;_ge("freeform_geotagging").value=use_location;_ge("freeform_geotagging_4real").value=use_4real_location;var K=0;if(geo_ispublic==0&&geo_iscontact==0&&geo_isfriend==1&&geo_isfamily==1){K=1;}if(geo_ispublic==0&&geo_iscontact==0&&geo_isfriend==0&&geo_isfamily==1){K=2;}if(geo_ispublic==0&&geo_iscontact==0&&geo_isfriend==1&&geo_isfamily==0){K=3;}if(geo_iscontact==1){K=4;}if(geo_ispublic==1){K=5;}_ge("geo_bookmark_privacy_slct").options[K].selected=true;_ge("geo_form_save").onclick();}}else{try{var c=_pi(o.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var W=o.documentElement.getElementsByTagName("err")[0].getAttribute("msg");var U=F.output.get("api_err_generic")+W;}catch(G){var U=F.output.get("unknown_err");}_ge("div_geo_feedback_error_msg").innerHTML="<strong>"+U+"</strong>";_ge("div_geo_feedback_finding_locations").style.display="none";_ge("div_geo_feedback_error").style.display="block";}}};F.API.callMethod("flickr.photos.getInfo",{photo_id:photo_id,tags:n.tags},X,null,null,0);}else{R="<strong>"+F.output.get("global_plus_geo_no_matches_for","@"+n.tags)+"</strong>";_ge("a_geotag_toggle").set_failed_search(R);}}else{try{var L=_pi(b.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var a=b.documentElement.getElementsByTagName("err")[0].getAttribute("msg");}catch(P){var C=F.output.get("unknown_err");}_ge("div_geo_feedback_error_msg").innerHTML=C;YAHOO.util.Dom.setStyle("div_geo_feedback_finding_locations","display","none");YAHOO.util.Dom.setStyle("div_geo_feedback_error","display","block");}}};YAHOO.util.Dom.setStyle("block_page_geotag","display","none");_ge("div_geo_feedback_finding_locations").style.display="block";F.API.callMethod("flickr.photos.search",{user_id:global_nsid,tags:"geo:bookmark="+M,extras:"geo",per_page:1},r,null,null,0);},set_failed_search:function(L){YAHOO.util.Dom.setStyle("div_geo_feedback_list_locations","height","");_ge("div_geo_feedback_list_locations_list").innerHTML=L;YAHOO.util.Dom.setStyle("div_geo_feedback_finding_locations","display","none");YAHOO.util.Dom.setStyle("div_geo_feedback_list_locations","display","block");var r=YAHOO.util.Dom.getRegion("div_geo_feedback_list_locations");if(F.is_ie){var n=10;}else{var n=10;}if(r.bottom-r.top>_ge("a_geotag_toggle").block_size_height+n){var a=["div_geo_feedback_mangled_format","div_geo_feedback_error","div_geo_feedback_finding_locations","div_geo_feedback_saving","div_geo_feedback_success","div_geo_feedback_list_locations","div_geo_removing","div_geo_remove_success"];for(var M=0;M<a.length;M++){YAHOO.util.Dom.setStyle(a[M],"height",r.bottom-r.top-n);YAHOO.util.Dom.setStyle(a[M],"width",r.right-r.left-n);}}else{var a=["div_geo_feedback_list_locations"];for(var M=0;M<a.length;M++){YAHOO.util.Dom.setStyle(a[M],"height",_ge("a_geotag_toggle").block_size_height-n);YAHOO.util.Dom.setStyle(a[M],"width",_ge("a_geotag_toggle").block_size_width-n);}}},set_position:function(M,n,r,a){_ge("freeform_geotagging_4real").value=M+", "+n+", "+r+",|"+a;if(a.length>=2&&a.substring(0,2)==", "){a=a.substring(2,a.length);}_ge("freeform_geotagging").value=a;_ge("div_geo_feedback_list_locations").style.display="none";_ge("block_page_geotag").style.display="block";this.save_position(M,n,r,a);},save_position:function(n,L,a,M){var r={flickr_photos_geo_setLocation_onLoad:function(c,W,P,R){if(c){var Q=use_viewgeo;if(_ge("geo_bookmark_privacy_slct")){for(var X=0;X<_ge("geo_bookmark_privacy_slct").options.length;X++){if(_ge("geo_bookmark_privacy_slct").options[X].selected){Q=_ge("geo_bookmark_privacy_slct").options[X].value;break;}}}if(Q!=use_viewgeo){var h={flickr_photos_geo_setPerms_onLoad:function(U,Z,B,j){if(U){_ge("a_geotag_toggle").load_position(j.accuracy);}else{_ge("a_geotag_toggle").load_position(j.accuracy);}}};if(Q==0){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,accuracy:R.accuracy,is_public:1,is_friend:0,is_family:0,is_contact:0},h);}if(Q==1){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,accuracy:R.accuracy,is_public:0,is_friend:0,is_family:0,is_contact:1},h);}if(Q==2){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,accuracy:R.accuracy,is_public:0,is_friend:1,is_family:1,is_contact:0},h);}if(Q==3){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,accuracy:R.accuracy,is_public:0,is_friend:1,is_family:0,is_contact:0},h);}if(Q==4){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,accuracy:R.accuracy,is_public:0,is_friend:0,is_family:1,is_contact:0},h);}if(Q==5){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,accuracy:R.accuracy,is_public:0,is_friend:0,is_family:0,is_contact:0},h);}}else{_ge("a_geotag_toggle").load_position(R.accuracy);}}else{try{var b=_pi(W.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var C=W.documentElement.getElementsByTagName("err")[0].getAttribute("msg");var d=F.output.get("api_err_generic")+" "+C;}catch(E){var d=F.output.get("unknown_err");}_ge("div_geo_feedback_error_msg").innerHTML=d;_ge("div_geo_feedback_saving").style.display="none";_ge("div_geo_feedback_error").style.display="block";}}};if(M.length>=2&&M.substr(0,2)==", "){M=M.substr(2,9999);}_ge("block_page_geotag").style.display="none";_ge("div_geo_feedback_list_locations").style.display="none";_ge("div_geo_feedback_finding_locations").style.display="none";_ge("div_geo_feedback_saving").style.display="block";F.API.callMethod("flickr.photos.geo.setLocation",{photo_id:page_photo_id,lat:n,lon:L,accuracy:a,query:M,provider:"user"},r,null,null,0);},remove_location:function(){var r={flickr_photos_geo_removeLocation_onLoad:function(b,R,h,a){if(b){if(_ge("div_pre_geo_block")){_ge("div_pre_geo_block").innerHTML="";}use_location="";use_4real_location;if(_ge("freeform_geotagging")){_ge("freeform_geotagging").value=use_location;}if(_ge("freeform_geotagging_4real")){_ge("freeform_geotagging_4real").value=use_4real_location;}if(_ge("geo_bookmark_privacy_slct")){for(var n=0;n<_ge("geo_bookmark_privacy_slct").options.length;n++){if(default_viewgeo==_ge("geo_bookmark_privacy_slct").options[n].value){_ge("geo_bookmark_privacy_slct").options.selected=true;}}}YAHOO.util.Dom.setStyle("div_geo_remove_location_confirm","display","none");YAHOO.util.Dom.setStyle("div_geo_remove_location_question","display","block");YAHOO.util.Dom.setStyle("div_remove_only_if_we_have_geodata","display","none");if(_ge("div_mini_map_frame")&&_ge("div_mini_map_frame").visible==true){_ge("div_mini_map_frame").visible=false;}YAHOO.util.Dom.setStyle("div_geo_removing","display","none");YAHOO.util.Dom.setStyle("div_geo_remove_success","display","block");if(_ge("a_geotag_toggle")&&!_ge("div_taken_in")){_ge("a_geotag_toggle").style.display="inline";}if(_ge("a_geotag_toggle_ad")&&!_ge("div_taken_in")){_ge("a_geotag_toggle_ad").style.display="inline";}setTimeout("_ge('a_geotag_toggle').fade_yay('div_geo_remove_success')",500);}else{try{var L=_pi(R.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var M=R.documentElement.getElementsByTagName("err")[0].getAttribute("msg");var C=F.output.get("api_err_generic")+" "+M;}catch(X){var C=F.output.get("unknown_err");}_ge("div_geo_feedback_error_msg").innerHTML=C;YAHOO.util.Dom.setStyle("div_geo_feedback_removing","display","none");YAHOO.util.Dom.setStyle("div_geo_remove_location_confirm","display","none");YAHOO.util.Dom.setStyle("div_geo_remove_location_question","display","block");YAHOO.util.Dom.setStyle("div_geo_feedback_error","display","block");}}};YAHOO.util.Dom.setStyle("block_page_geotag","display","none");YAHOO.util.Dom.setStyle("div_geo_removing","display","block");F.API.callMethod("flickr.photos.geo.removeLocation",{photo_id:page_photo_id},r,null,null,0);},load_position:function(M){var r={flickr_photos_geo_getLocation_onLoad:function(d,b,R,L){if(d){if(typeof (photo_acc)!="undefined"){photo_acc=_pi(b.documentElement.getElementsByTagName("location")[0].getAttribute("accuracy"));}var a=new Date();var h=a-_ge("a_geotag_toggle").two_second_delay_time_started_for_dunstan_because_he_is_picky_like_that;if(h<2000){_ge("a_geotag_toggle").saving_delayer(b,L.accuracy);}else{_ge("a_geotag_toggle").saved_responseXML=b;_ge("a_geotag_toggle").saved_accuracy=L.accuracy;setTimeout("_ge('a_geotag_toggle').saving_delayer(_ge('a_geotag_toggle').saved_responseXML, _ge('a_geotag_toggle').saved_accuracy)",2000-h);}}else{try{var C=_pi(b.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var n=b.documentElement.getElementsByTagName("err")[0].getAttribute("msg");var X=F.output.get("api_err_generic")+n;}catch(P){var X=F.output.get("unknown_err");}_ge("div_geo_feedback_error_msg").innerHTML="<strong>"+X+"</strong>";_ge("div_geo_feedback_saving").style.display="none";_ge("div_geo_feedback_error").style.display="block";}}};F.API.callMethod("flickr.photos.geo.getLocation",{photo_id:page_photo_id,accuracy:M},r,null,null,0);},saving_delayer:function(a,M){_ge("a_geotag_toggle").saved_responseXML=a;if(M<15){_ge("a_geotag_toggle").redraw_taken_in(a);var r=_ge("div_geo_feedback_success").innerHTML;r+="<small style=\"color:black\">"+F.output.get("global_plus_geo_yeah_ok_found_stuff","/photos/organize/?start_tab=map&from_geo_ids="+page_photo_id)+"</small>";r+="<input type=\"button\" class=\"Butt\" value=\"CONTINUE\" onclick=\"_ge('a_geotag_toggle').saving_delayer(_ge('a_geotag_toggle').saved_responseXML, 99)\" />";r+="<br /><br /><small>"+F.output.get("global_plus_geo_yeah_ok_hint_found_stuff")+"</small>";_ge("div_geo_feedback_saving").innerHTML=r;}else{_ge("div_geo_feedback_saving").innerHTML=_ge("div_geo_feedback_saving_stored").innerHTML;_ge("div_geo_feedback_saving").style.display="none";_ge("div_geo_feedback_success").style.display="block";if(_ge("a_geotag_toggle")&&!_ge("div_taken_in")){_ge("a_geotag_toggle").style.display="inline";}if(_ge("a_geotag_toggle_ad")&&!_ge("div_taken_in")){_ge("a_geotag_toggle_ad").style.display="inline";}setTimeout("_ge('a_geotag_toggle').fade_yay('div_geo_feedback_success')",500);_ge("a_geotag_toggle").redraw_taken_in(a);}},redraw_taken_in:function(r){this.responseXML=r;if(_ge("div_pre_geo_block")){_ge("div_pre_geo_block").innerHTML="<span id='div_taken_in'>"+r.documentElement.getElementsByTagName("location")[0].getAttribute("taken_in").replace("&lt;","<").replace("&gt;",">").replace("&#38;lt;","<").replace("&#38;gt;",">")+"</span>";}if(typeof (YMap)=="function"){_ge("a_geotag_toggle").new_geo_point=new YGeoPoint(r.documentElement.getElementsByTagName("location")[0].getAttribute("latitude"),r.documentElement.getElementsByTagName("location")[0].getAttribute("longitude"));_ge("a_geotag_toggle").new_geo_accuracy=r.documentElement.getElementsByTagName("location")[0].getAttribute("accuracy");_ge("a_geotag_toggle").new_geo_taken_in=r.documentElement.getElementsByTagName("location")[0].getAttribute("taken_in").replace("&lt;","<").replace("&gt;",">").replace("&#38;lt;","<").replace("&#38;gt;",">");_ge("div_pre_geo_block").innerHTML+=" (<a href=\"#\" onclick=\"_ge('a_geotag_toggle').toggle_geotagging(); return false\" class=\"Plain\">edit</a>&nbsp;|&nbsp;<a id=\"a_link_to_map\" href=\""+geo_map_url+"?view=everyones\" class=\"Plain\" onclick=\"try{F.mini_map_open(_ge('a_link_to_map'), "+page_photo_id+", '"+geo_map_url+"', '"+escape(geo_possessed_username)+"', '"+geo_thmb+"', _ge('a_geotag_toggle').new_geo_point.Lat + '', _ge('a_geotag_toggle').new_geo_point.Lon + '', _ge('a_geotag_toggle').new_geo_accuracy, escape(_ge('a_geotag_toggle').new_geo_taken_in)); return false} catch(er) {}\">map</a>)";_ge("a_geotag_toggle").style.display="none";if(_ge("a_geotag_toggle_ad")){_ge("a_geotag_toggle_ad").style.display="none";}if(_ge("div_mini_map_frame")&&_ge("div_mini_map_frame").visible==true){_ge("div_mini_map_frame").visible=false;_ge("a_link_to_map").onclick();}}else{_ge("a_geotag_toggle").new_geo_point_lat=r.documentElement.getElementsByTagName("location")[0].getAttribute("latitude");_ge("a_geotag_toggle").new_geo_point_lon=r.documentElement.getElementsByTagName("location")[0].getAttribute("longitude");_ge("a_geotag_toggle").new_geo_accuracy=r.documentElement.getElementsByTagName("location")[0].getAttribute("accuracy");_ge("a_geotag_toggle").new_geo_taken_in=r.documentElement.getElementsByTagName("location")[0].getAttribute("taken_in").replace("&lt;","<").replace("&gt;",">").replace("&#38;lt;","<").replace("&#38;gt;",">");F._map_script_loader.load_scripts(_ge("a_geotag_toggle").map_scripts_loaded,null);}},map_scripts_loaded:function(){_ge("div_pre_geo_block").innerHTML+=" (<a href=\"#\" onclick=\"_ge('a_geotag_toggle').toggle_geotagging(); return false\" class=\"Plain\">edit</a>&nbsp;|&nbsp;<a id=\"a_link_to_map\" href=\""+geo_map_url+"?view=everyones\" class=\"Plain\" onclick=\"try{F.mini_map_open(_ge('a_link_to_map'), "+page_photo_id+", '"+geo_map_url+"', '"+escape(geo_possessed_username)+"', '"+geo_thmb+"', _ge('a_geotag_toggle').new_geo_point_lat + '', _ge('a_geotag_toggle').new_geo_point_lon + '', _ge('a_geotag_toggle').new_geo_accuracy, escape(_ge('a_geotag_toggle').new_geo_taken_in)); return false} catch(er) {}\">map</a>)";_ge("a_geotag_toggle").style.display="none";if(_ge("a_geotag_toggle_ad")){_ge("a_geotag_toggle_ad").style.display="none";}},check_for_map_existing:function(){if(typeof (YMap)=="function"){_ge("a_geotag_toggle").new_geo_point=new YGeoPoint(this.responseXML.documentElement.getElementsByTagName("location")[0].getAttribute("latitude"),this.responseXML.documentElement.getElementsByTagName("location")[0].getAttribute("longitude"));_ge("a_geotag_toggle").new_geo_accuracy=this.responseXML.documentElement.getElementsByTagName("location")[0].getAttribute("accuracy");_ge("a_geotag_toggle").new_geo_taken_in=this.responseXML.documentElement.getElementsByTagName("location")[0].getAttribute("taken_in").replace("&lt;","<").replace("&gt;",">").replace("&#38;lt;","<").replace("&#38;gt;",">");_ge("a_link_to_map").onclick=function(){F.mini_map_open(_ge("a_link_to_map"),page_photo_id,geo_map_url,escape(geo_possessed_username),geo_thmb,_ge("a_geotag_toggle").new_geo_point.Lat,_ge("a_geotag_toggle").new_geo_point.Lon,_ge("a_geotag_toggle").new_geo_accuracy,escape(_ge("a_geotag_toggle").new_geo_taken_in));};_ge("div_hide_map_link").style.display="inline";}else{setTimeout("_ge('a_geotag_toggle').check_for_map_existing()",1000);}},fade_yay:function(M){var n=_ge(M);var r=function(){var L=function(){n.style.display="none";var C=new YAHOO.util.Anim(M,{opacity:{to:1}},0.1,YAHOO.util.Easing.easeOut);C.animate();_ge("a_geotag_toggle").closed=true;};var h=new YAHOO.util.Anim(M,{height:{to:1}},0.333,YAHOO.util.Easing.easeOut);h.onComplete.subscribe(L);h.animate();};if(_ge("a_geotag_toggle")&&!_ge("div_taken_in")){_ge("a_geotag_toggle").style.display="inline";}if(_ge("a_geotag_toggle_ad")&&!_ge("div_taken_in")){_ge("a_geotag_toggle_ad").style.display="inline";}var a=new YAHOO.util.Anim(M,{opacity:{to:0}},0.333,YAHOO.util.Easing.easeOut);a.onComplete.subscribe(r);a.animate();},last_empty_function:function(){}};F._map_script_loader={callback_func:"",load_scripts:function(M,r){this.callback_func=M;this.callback_args=r;if(typeof (YMap)=="function"){this.do_callback();return ;}var a=document.createElement("script");a.src="http://us.js2.yimg.com/us.js.yimg.com/lib/map/js/api/ymapapi_3_0_4_9.js";a.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(a);setTimeout("F._map_script_loader.check_for_map_existing()",100);},check_for_map_existing:function(){if(typeof (YMap)=="function"){F._map_script_loader.do_callback();return ;}setTimeout("F._map_script_loader.check_for_map_existing()",100);},do_callback:function(){if(this.callback_func){if(this.callback_args){this.callback_func.apply(null,this.callback_args);}else{this.callback_func.apply();}}}};F.mini_map_open=function(a,M,h,b,n,r,X,R,L){if(!window.ymap){window.ymap=new YMap(_ge("map"));}if(!window.ymap){return ;}geo_point=new YGeoPoint(_pf(r.replace(",",".")),_pf(X.replace(",",".")));window.ymap.setMapType(YAHOO_MAP_HYB);var C=_ge("div_mini_map_frame");if(!C.mini_map_frame_go_go_go){F.decorate(C,F._mini_map_frame).mini_map_frame_go_go_go();}C.show(a,M,h,b,n,geo_point,R,L);};F._mini_map_anchor={mini_map_anchor_go_go_go:function(r,M){this.style.color="#4a90e6";this.style.cursor=(F.is_ie)?"hand":"pointer";this.geo_point=r;this.zl=17-M+5;if(this.zl>16){this.zl=16;}},onclick:function(r){_ge("div_mini_map_frame").show(this,this.geo_point,this.zl);}};F._mini_map_frame={mini_map_frame_go_go_go:function(M){var h=1;this.visible=false;this.map_loaded=false;this.current_photo_id=null;this.ov=null;this.mo=null;this.parent_el=M;this.left_offset=null;this.style.position="absolute";this.style.width="510px";this.style.height="307px";this.style.zIndex="2000";this.style.background="#f0f0f0";var n=_ge("div_mini_map_frame2");n.style.position="absolute";n.style.top="2px";n.style.left="2px";n.style.width="506px";n.style.height="303px";n.style.background="#ffffff";var a=_ge("div_mini_map_frame3");a.style.position="absolute";a.style.top="27px";a.style.left="3px";a.style.width="500px";a.style.height="250px";a.style.overflow="hidden";F.decorate(_ge("close_button"),F._map_close_button).button_go_go_go();_ge("map").style.position="absolute";_ge("map").style.top="0px";_ge("map").style.left="0px";var L=new YSize(500,372);try{ymap.resizeTo(L);}catch(X){}this.pop_shadow_id=F.make_shadow(this.id,994).id;var C=YUtility.createNode("div","div_zoom_background");var R={position:"absolute",top:"4px",right:"4px",width:"24px",height:"165px"};YUtility.setStyle(C,R);var r=YUtility.createNode("img","map_zoom_background");var R={position:"absolute",top:"0px",left:"0px",width:"24px",height:"165px"};YUtility.setStyle(r,R);r.src=_images_root+"/map_zoom_background.png";r.className="trans_png";YUtility.appendNode(C,r);var r=YUtility.createNode("img","candy_map_zoom_out");var R={position:"absolute",top:"4px",left:"4px",width:"16px",height:"16px"};YUtility.setStyle(r,R);r.style.cursor=(F.is_ie)?"hand":"pointer";r.src=_images_root+"/candy_map_zoom_out_default.png";YUtility.appendNode(C,r);var r=YUtility.createNode("img","candy_map_zoom_in");var R={position:"absolute",top:"145px",left:"4px",width:"16px",height:"16px"};YUtility.setStyle(r,R);r.style.cursor=(F.is_ie)?"hand":"pointer";r.src=_images_root+"/candy_map_zoom_in_default.png";YUtility.appendNode(C,r);var r=YUtility.createNode("img","candy_map_dragger");var R={position:"absolute",top:"20px",left:"3px",width:"18px",height:"13px"};YUtility.setStyle(r,R);r.style.cursor=(F.is_ie)?"hand":"pointer";r.src=_images_root+"/candy_map_zoom_drag.png";r.className="trans_png";YUtility.appendNode(C,r);YUtility.appendNode(_ge("map"),C);F.decorate(_ge("candy_map_zoom_in"),F._map_zoom_button).button_go_go_go("in");F.decorate(_ge("candy_map_zoom_out"),F._map_zoom_button).button_go_go_go("out");Y.U.Event.addListener(_ge("candy_map_dragger"),"mousedown",this.map_dragger_mouseDown,this,true);YEvent.Capture(ymap,EventsList.changeZoom,function(){_ge("div_mini_map_frame").change_zoom();});F.eb_add(this);},window_onresize:function(){if(this.visible){var r=Y.U.Dom.getX(_ge("Main"))+this.left_offset;this.style.left=r+"px";this.pop_place();}},show:function(n,a,b,Q,L,X,W,C){F.eb_broadcast("stewart_pause");this.parent_el=n;if(this.current_photo_id!=a){if(this.mo!=null){ymap.removeOverlay(this.mo);}var M=this.pop_shadow_id;var d=function(){_ge(M).shadow_show();};if(F.is_ie){_ge(this.pop_shadow_id).shadow_show();}else{anim_do_opacity_to(this,1,1,100,"easeInQuad",d);}this.current_photo_id=a;var h=Y.U.Dom.getX(n)-289+11;if(h<Y.U.Dom.getX(_ge("Main"))){h=Y.U.Dom.getX(_ge("Main"))+11;}if(h+_pi(this.style.width)>Y.U.Dom.getX(_ge("Main"))+_ge("Main").offsetWidth-28){h-=(h+_pi(this.style.width))-(Y.U.Dom.getX(_ge("Main"))+_ge("Main").offsetWidth-28);}this.left_offset=h-Y.U.Dom.getX(_ge("Main"));this.style.top=Y.U.Dom.getY(n)-315+"px";this.style.left=h+"px";W=17-W+4;if(W>16){W=16;}ymap.drawZoomAndCenter(X,W);this.toggle_zoom();this.init_zoom_level=W;var r=YUtility.createNode("div","single_marker");var R=YUtility.createNode("img","img_single_marker");R.style.position="absolute";R.style.left="-27px";R.style.top="-136px";R.style.width="159px";R.style.height="146px";R.src=_images_root+"/pop_up_pinwin.png";R.className="trans_png";YUtility.appendNode(r,R);var R=YUtility.createNode("img","img_single_marker_thumb");R.style.position="absolute";R.style.left="-16px";R.style.top="-126px";R.src=L;YUtility.appendNode(r,R);this.mo=new YCustomOverlay(X,r);this.ov=ymap.addOverlay(this.mo);ymap.getMarkerObject("single_marker").setYGeoPoint(X);if(_ge("map_links1")){_ge("map_links1").innerHTML="<a href=\""+b+"?view=users\"><strong>"+F.output.get("photo_mini_map_view_on_map",Q)+"</strong></a>";}if(C){var P=unescape(C).replace("<a>","").replace("</a>","");P=P.replace("&lt;","<").replace("&gt;",">");P+=" (See <a href=\""+b+"?view=everyones\">"+F.output.get("photo_mini_map_more_photos")+"</a>)";}if(_ge("map_links2")){if(P){_ge("map_links2").innerHTML=P;}setTimeout("_ge('div_mini_map_frame').set_width('map_links2')",100);}if(_ge("map_links")){if(P){_ge("map_links").innerHTML=P;}setTimeout("_ge('div_mini_map_frame').set_width('map_links')",100);}if(_ge("pretty_lat_long")){_ge("pretty_lat_long").innerHTML=this.make_pretty(X.Lat,X.Lon);_ge("pretty_lat_long").innerHTML+="<span class=\"geo\" style=\"display:none\"><span class=\"latitude\">"+X.Lat+"</span><span class=\"longitude\">"+X.Lon+"</span></span>";}this.visible=true;this.style.display="block";this.window_onresize();}else{if(this.current_photo_id==a&&this.visible==true){this.hide();}else{if(this.current_photo_id==a&&this.visible==false){var M=this.pop_shadow_id;var d=function(){_ge(M).shadow_show();};if(F.is_ie){_ge(this.pop_shadow_id).shadow_show();}else{anim_do_opacity_to(this,1,1,100,"easeInQuad",d);}if(_ge("map_links1")){_ge("map_links1").innerHTML="<a href=\""+b+"?view=users\"><strong>"+F.output.get("photo_mini_map_view_on_map",Q)+"</strong></a>";}W=17-W+4;if(W>16){W=16;}ymap.drawZoomAndCenter(X,W);ymap.getMarkerObject("single_marker").setYGeoPoint(X);ymap.getMarkerObject("single_marker").unhide();this.toggle_zoom();if(C){var P=unescape(C).replace("<a>","").replace("</a>","");P=P.replace("&lt;","<").replace("&gt;",">");P+=" (See <a href=\""+b+"?view=everyones\">"+F.output.get("photo_mini_map_more_photos")+"</a>)";}if(_ge("map_links2")){_ge("map_links2").innerHTML=P;setTimeout("_ge('div_mini_map_frame').set_width('map_links2')",100);}if(_ge("map_links")){_ge("map_links").innerHTML=P;setTimeout("_ge('div_mini_map_frame').set_width('map_links')",100);}if(_ge("pretty_lat_long")){_ge("pretty_lat_long").innerHTML=this.make_pretty(X.Lat,X.Lon);_ge("pretty_lat_long").innerHTML+="<span class=\"geo\" style=\"display:none\"><span class=\"latitude\">"+X.Lat+"</span><span class=\"longitude\">"+X.Lon+"</span></span>";}this.visible=true;this.style.display="block";this.window_onresize();}}}},set_width:function(r){if(_ge(r).offsetHeight>20){_ge("div_mini_map_frame").style.height="319px";_ge("div_mini_map_frame2").style.height="315px";this.style.top=Y.U.Dom.getY(this.parent_el)-327+"px";}else{_ge("div_mini_map_frame").style.height="307px";_ge("div_mini_map_frame2").style.height="303px";this.style.top=Y.U.Dom.getY(this.parent_el)-315+"px";}_ge(this.pop_shadow_id).shadow_size_and_place();},make_pretty:function(a,n){var M=this.dec_to_dms(a);if(a>0){M.push("N");}else{M.push("S");}var r=this.dec_to_dms(n);if(n>0){r.push("E");}else{r.push("W");}return M[0]+"&#176;"+M[1]+"' "+M[2]+"\" "+M[3]+", "+r[0]+"&#176;"+r[1]+"' "+r[2]+"\" "+r[3];},dec_to_dms:function(L){L=Math.abs(L);while(L>360){L-=360;}var n=Math.floor(L);var h=3600*(L-n);var M=Math.floor(h/60);var r=(h/60)-M;var a=Math.round(60*r);if(a<10){a="0"+a;}return new Array(n,M,a);},change_zoom:function(){if(_ge("div_mini_map_frame").init_zoom_level>ymap.getZoomLevel()+4){YAHOO.util.Dom.setStyle("single_marker","display","none");}else{YAHOO.util.Dom.setStyle("single_marker","display","block");}},hide:function(){F.eb_broadcast("stewart_play_if_was_playing");_ge(this.pop_shadow_id).shadow_hide();var M=this.id;var r=function(){_ge(M).done_hiding();};if(F.is_ie){this.done_hiding();}else{anim_do_opacity_to(this,5,35,0,"easeInQuad",r);}},done_hiding:function(){this.visible=false;this.style.display="none";},pop_place:function(r,M){_ge(this.pop_shadow_id).shadow_size_and_place();},toggle_zoom:function(){if(ymap.getZoomLevel()&&_ge("candy_map_dragger")){_ge("candy_map_dragger").style.top=20+((17-ymap.getZoomLevel())*7)+"px";}},map_dragger_mouseDown:function(r){Y.U.Event.stopEvent(r);this._new_zoom_level=ymap.getZoomLevel();this._startDragY=Y.U.Event.getPageY(r)-_pi(_ge("candy_map_dragger").style.top);Y.U.Event.addListener(document,"mouseup",this.map_dragger_mouseUp,this,true);Y.U.Event.addListener(document,"mousemove",this.map_dragger_mouseMove,this,true);},map_dragger_mouseUp:function(r){Y.U.Event.stopEvent(r);Y.U.Event.removeListener(document,"mouseup",this.map_dragger_mouseUp);Y.U.Event.removeListener(document,"mousemove",this.map_dragger_mouseMove);ymap.setZoomLevel(this._new_zoom_level);_ge("div_mini_map_frame").toggle_zoom();},map_dragger_mouseMove:function(r){var M=(Y.U.Event.getPageY(r)-this._startDragY);this._new_zoom_level=17-(_pi(M/7)-3);if(this._new_zoom_level<1){this._new_zoom_level=1;}if(this._new_zoom_level>17){this._new_zoom_level=17;}_ge("candy_map_dragger").style.top=((17-this._new_zoom_level)*7)+20+"px";}};F._map_close_button={_decotype:F._simple_button,className:"simple_butt",kittens:"fluffy",button_go_go_go:function(){this.style.position="absolute";this.style.right="8px";this.style.top="8px";this.style.cursor=(F.is_ie)?"hand":"pointer";this.innerHTML="<span style=\"color: #999\">"+F.output.get("close")+"</span><img src=\""+_images_root+"/simple_close_default.gif\" width=\"15\" height=\"15\" style=\"overflow:visible\">";F._map_close_button._decotype.button_go_go_go.apply(this);},onclick:function(r){F.stop_event_propagation(r);_ge("div_mini_map_frame").hide();},ondblclick:function(r){F.stop_event_propagation(r);_ge("div_mini_map_frame").hide();}};F._map_zoom_button={_decotype:F._simple_button,button_go_go_go:function(r){this.direction=r;F._map_zoom_button._decotype.button_go_go_go.apply(this);},onclick:function(M){var r=ymap.getZoomLevel();if(this.direction=="in"){r--;}if(this.direction=="out"){r++;}if(r<1){r=1;}if(r>17){r=17;}ymap.setZoomLevel(r);_ge("div_mini_map_frame").toggle_zoom();F.stop_event_propagation(M);},ondblclick:function(r){F.stop_event_propagation(r);}};F.picnik_2={go_go_go:function(){if(picnik_token){this.show()}else{F.fragment_getter.get("/photo_picnik_auth_fragment.gne",{},this,"fragment_onLoad")}},loadSwfObjJs:function(){if(!this.swfJsWritten){this.loadJs(page_p.swfObjSrc);this.swfJsWritten=true}return(window.SWFObject)?true:false},loadUrlkitJs:function(){if(!this.urlkiJsWritten){this.loadJs(picnik_urlkit_path);this.urlJsWritten=true}},loadJs:function(B){var A=document.createElement("script");A.src=B;A.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(A);writeDebug("picnik js source: "+A.src)},initSwf:function(){if(!this.p_div){this.header_height=35;this.p_div=document.createElement("div");this.p_div.id="picnik-div";var H=document.createElement("div");H.id="picnik-div-header";H.style.height=this.header_height+"px";var C=document.createElement("div");C.id="picnik-div-header-inner";H.appendChild(C);var E=_ge("FlickrLogo").parentNode.cloneNode(true);try{E.firstChild.id="FlickrLogo2";E.style.background="none"}catch(G){}C.appendChild(E);var B=document.createElement("span");var D=document.createTextNode(F.output.get("picnik_mode"));B.appendChild(D);if(page_p.id){B.innerHTML+=" "+F.output.get("picnik_return_to_photo",page_p.id);F.set_spaceid("792600342")}else{B.innerHTML+=" "+F.output.get("picnik_return_to_stream")}C.appendChild(B);this.p_swf_cont=document.createElement("div");this.p_swf_cont.id="picnik-cont";this.p_swf_cont.style.height=(Y.U.Dom.getViewportHeight()-(this.header_height+10))+"px";this.p_div.appendChild(H);this.p_div.appendChild(this.p_swf_cont);this.p_div.style.height=Y.U.Dom.getViewportHeight()+"px";this.p_div.style.width="100%";this.p_div.style.position="absolute";this.p_div.style.top="0px";this.p_div.style.left="0px";document.getElementsByTagName("body")[0].appendChild(this.p_div);var A=deconcept.SWFObjectUtil.getPlayerVersion();if(A.major<9){Y.U.Dom.addClass(this.p_swf_cont,"picnik_no_flash");this.p_swf_cont.innerHTML=F.output.get("picnik_no_flash")}else{this.writeSwf()}}else{this.writeSwf();this.p_div.style.top="0px";this.p_div.style.left="0px"}Y.U.Event.addListener(window,"resize",this.resize,this);window.onbeforeunload=F.picnik_2.saveChangesDialog;_ge("Main").style.display="none";_ge("MainFooterClear").style.display="none";_ge("FooterWrapper").style.display="none"},writeSwf:function(){var C=new SWFObject(picnik_swf_path,"picnik","100%","100%","9.0.28","#ffffff",true);C.addParam("allowFullScreen","true");C.addParam("allowScriptAccess","always");C.addVariable("serverurl","http://www.picnik.com");C.addVariable("loglevel","30");C.addVariable("lite","true");C.addVariable("host","Flickr lite");C.addVariable("authservice","Flickr");C.addVariable("userid",global_nsid);C.addVariable("token",picnik_token);if(typeof (_is_picnik_basket)!="undefined"&&_is_picnik_basket==true){var B="<_multi>";for(var A=0;A<page_photo_id.split(",").length;A++){B+="<item id='"+page_photo_id.split(",")[A]+"' ss='flickr'/>"}B+="</_multi>";C.addVariable("_multi",B);C.addVariable("_ss_cmd","multi")}else{C.addVariable("_ss_itemid",page_photo_id)}C.addVariable("_ss_setid",picnik_set_id);if(C.write(this.p_swf_cont)){var D=new SWFMacMouseWheel(C)}F.changes_count=true},fragment_onLoad:function(E,B,D){this.lightBoxBg=_ge("contactChangerBackground");this.lightBox=document.createElement("div");this.lightBox.style.position="absolute";var A=500;var C=290;this.lightBox.style.width=A+"px";this.lightBox.style.height=C+"px";this.lightBox.style.top=((Y.U.Dom.getViewportHeight()/2)-(C/2))-30;this.lightBox.style.left=(Y.U.Dom.getViewportWidth()/2)-(A/2);this.lightBox.style.zIndex=20001;this.lightBoxBg.style.display="block";document.getElementsByTagName("body")[0].appendChild(this.lightBox);this.lightBox.innerHTML=B},resize:function(B,A){A.p_div.style.height=Y.U.Dom.getViewportHeight()+"px";A.p_swf_cont.style.height=(Y.U.Dom.getViewportHeight()-Y.U.Dom.getRegion("picnik-div-header").bottom)+"px"},show:function(){if(this.loadSwfObjJs()){this.initSwf();this.loadUrlkitJs()}else{setTimeout(function(){F.picnik_2.show()},300)}},doAuth:function(){window.page_always_post_fragment_requests=true;F.fragment_getter.get("/services/auth/picnik.gne",{magic_cookie:global_auth_hash},this,"digestAuthResponse")},digestAuthResponse:function(success,responseText,params){var rsp=eval("("+responseText+")");this.lightBox.style.display="none";this.lightBoxBg.style.display="none";if(rsp.picnik_auth.stat){picnik_token=rsp.picnik_auth.token;this.go_go_go()}else{F.photo_confirm_msg.add(1,F.output.get("picnik_auth_fail"))}},cancelAuth:function(){this.lightBoxBg.style.display="none";this.lightBox.style.display="none"},its_raining:function(A){writeDebug("3) its_raining response: "+A);F.changes_count=false;if(A){if(A==page_photo_id){window.location.replace(page_p.url+"?editreplace=1")}else{window.location.href=page_p.ownersUrl+A+"/?eOrig="+page_photo_id}}else{if(_ge("Main")){_ge("Main").style.display=""}if(_ge("MainFooterClear")){_ge("MainFooterClear").style.display=""}if(_ge("FooterWrapper")){_ge("FooterWrapper").style.display=""}this.p_div.style.top="-9999px";this.p_div.style.left="-9999px";F.photo_confirm_msg.add(1,F.output.get("picnik_cancel_edit"))}},saveChangesDialog:function(B){var C=true;var A=document.getElementById("picnik");if(A&&typeof (A.IsNavigateOk)!="undefined"){C=A.IsNavigateOk()}if(!C){return F.output.get("global_unsaved")}}};F.picnik={its_raining:function(A){writeDebug("2) its_raining response: "+A);if(page_p.id){var C=true;var B=document.getElementById("picnik");if(B&&typeof (B.IsNavigateOk)!="undefined"){C=B.IsNavigateOk()}if(C){if(A!=null){if(A==page_p.id){window.location.replace(page_p.url+"?editreplace=1")}else{window.location.href=page_p.ownersUrl+A+"/?eOrig="+page_photo_id}}else{if(_ge("Main")){_ge("Main").style.display=""}if(_ge("MainFooterClear")){_ge("MainFooterClear").style.display=""}if(_ge("FooterWrapper")){_ge("FooterWrapper").style.display=""}F.picnik_2.p_div.style.top="-9999px";F.picnik_2.p_div.style.left="-9999px";F.photo_confirm_msg.add(1,F.output.get("picnik_cancel_edit"));window.onbeforeunload=null}}else{if(_ge("Main")){_ge("Main").style.display=""}if(_ge("MainFooterClear")){_ge("MainFooterClear").style.display=""}if(_ge("FooterWrapper")){_ge("FooterWrapper").style.display=""}F.picnik_2.p_div.style.top="-9999px";F.picnik_2.p_div.style.left="-9999px";F.photo_confirm_msg.add(1,F.output.get("picnik_cancel_edit"));window.onbeforeunload=null}}else{window.location.href="/photos/me/?editreplace=1"}}};F._corrections_box={created:false,snag:2,show_right_side:true,has_the_map_moved_or_what:false,corrections_box_go_go_go:function(){F.eb_add(this);this.created=true;F.decorate(_ge("one_corrections_close_img"),F._simple_button).button_go_go_go();this.pop_shadow_id=F.make_shadow(this.id,10008).id},show:function(D){if(!_ge("f_div_corrections_box_holder_border").created){F.decorate(_ge("f_div_corrections_box_holder_border"),F._corrections_box).corrections_box_go_go_go();_ge("f_div_corrections_box_holder_border").show(D);return }scrollTo(0,0);F.eb_broadcast("stewart_pause");var E=_find_screen_width();var B=0;var C=724;var A=B+_pi((E-C)/2);A=Math.max(A,1);Y.U.Dom.setStyle(_ge("f_div_corrections_box_holder_border"),"left",A+"px");Y.U.Dom.setStyle(_ge("f_div_corrections_box_holder_border"),"display","block");_ge(_ge("f_div_corrections_box_holder_border").pop_shadow_id).shadow_size_and_place();_ge(_ge("f_div_corrections_box_holder_border").pop_shadow_id).shadow_show();F.decorate(_ge("f_div_corrections_right_side"),F._corrections_box.right_side_holder).right_side_holder_go_go_go(D);if(!F.is_ie){Y.U.Dom.setStyle("div_geo_feedback_list_alternative_locations_list_ul","margin-left","-25px")}else{Y.U.Dom.setStyle("div_geo_feedback_list_alternative_locations_list_ul","margin-left","15px")}if(F.is_safari){Y.U.Dom.setStyle("f_div_corrections_psst_holder","width","200px")}setTimeout("_ge('f_div_corrections_box_holder_border').map_box.show("+D+")",50);F.modal_blocker.show()},hide:function(){_ge(this.pop_shadow_id).shadow_hide();Y.U.Dom.setStyle("div_geo_feedback_finding_locations","display","none");Y.U.Dom.setStyle("div_geo_remove_location_confirm","display","none");Y.U.Dom.setStyle("div_geo_perms","display","none");Y.U.Dom.setStyle("div_geo_feedback_list_locations","display","none");Y.U.Dom.setStyle("div_geo_feedback_saving","display","none");Y.U.Dom.setStyle("div_geo_feedback_finding_alternative_locations","display","none");Y.U.Dom.setStyle("div_geo_feedback_list_alternative_locations","display","none");Y.U.Dom.setStyle("div_geo_removing","display","none");Y.U.Dom.setStyle("div_geo_other_photos","display","none");Y.U.Dom.setStyle("div_geo_saved_success","display","none");Y.U.Dom.setStyle("div_geo_removed_success","display","none");Y.U.Dom.setStyle("div_corrections_search_results_clicked","display","none");Y.U.Dom.setStyle("div_corrections_search_no_results","display","none");Y.U.Dom.setStyle("div_corrections_search_results_clicked","display","none");Y.U.Dom.setStyle("div_corrections_main_form","display","none");Y.U.Dom.setStyle("pp_geo","display","none");Y.U.Dom.setStyle("f_div_corrections_map_holder","display","block");if(Y.U.Dom.getStyle("div_corrections_inside","display")=="block"){Y.U.Dom.setStyle("div_corrections_inside","display","none");Y.U.Dom.setStyle("div_corrections_save_bottom","display","block");Y.U.Dom.setStyle("f_div_extra_options_2","display","block")}Y.U.Dom.setStyle("div_corrections_main_form","display","block");Y.U.Dom.setStyle(this,"display","none");F.modal_blocker.hide();F.eb_broadcast("stewart_play_if_was_playing");return false},window_onresize:function(){var D=window.innerWidth;var B=window.pageXOffset;var C=724;var A=B+_pi((D-C)/2);A=Math.max(A,1);Y.U.Dom.setStyle(_ge("f_div_corrections_box_holder_border"),"left",A+"px");_ge(_ge("f_div_corrections_box_holder_border").pop_shadow_id).shadow_size_and_place()},right_side_holder:{closed:true,loaded_geobookmarks:false,already_loading_js:false,block_size:[],new_map_link:{},two_second_delay_time_started_for_dunstan_because_he_is_picky_like_that:0,saved_responseXML:"",show_box:true,right_side_holder_go_go_go:function(A){if(page_p.video_thumb_src){}else{}_ge("f_div_corrections_psst").innerHTML=F.output.get("corrections_psst",_taken_in);_ge("div_geo_feedback_after_list").innerHTML=F.output.get("corrections_never_mind_2",_taken_in);this.show_box=A;if(A){this.style.display="block";_ge("f_div_corrections_topbar_left").innerHTML=F.output.get("corrections_add_location_2")}else{this.style.display="none";_ge("f_div_corrections_topbar_left").innerHTML=F.output.get("map")+": "+_taken_in}F.decorate(_ge("freeform_geotagging"),this.input_box);F.decorate(_ge("freeform_geotagging_2"),this.input_box);F.decorate(_ge("freeform_geotagging_3"),this.input_box);F.decorate(_ge("freeform_geotagging_4"),this.input_box);F.decorate(_ge("geo_form_save"),this.submit_button);F.decorate(_ge("geo_form_save_2"),this.submit_button);F.decorate(_ge("geo_form_save_3"),this.submit_button);F.decorate(_ge("geo_form_save_geotagged"),this.submit_button_geotagged)},input_box:{do_first_lat_long_auto_insert:true,onkeyup:function(C){if(!C){C=window.event}var A=_get_event_keycode(C);if(A==71&&C.ctrlKey&&C.altKey){this.value="geo:long="}if(A==13){if(this.id=="freeform_geotagging"){_ge("inp_freeform_geotagging_go").onclick()}else{if(this.id=="freeform_geotagging_2"){_ge("inp_freeform_geotagging_go_2").onclick()}else{if(this.id=="freeform_geotagging_3"){_ge("inp_freeform_geotagging_go_3").onclick()}else{_ge("inp_freeform_geotagging_go_4").onclick()}}}return }if(this.do_first_lat_long_auto_insert){var B=new RegExp("^(geo:(lat)=(\\+|\\-)?((\\d+\\.\\d+)|\\d+)([,; ]))$");var D=new RegExp("^(geo:(lon|long)=(\\+|\\-)?((\\d+\\.\\d+)|\\d+)([,; ]))$");if(this.value.toLowerCase().match(B)){this.value=this.value.toLowerCase()+" geo:long=";this.do_first_lat_long_auto_insert=false}if(this.value.toLowerCase().match(D)){this.value=this.value.toLowerCase()+" geo:lat=";this.do_first_lat_long_auto_insert=false}}},onfocus:function(){this.select()}},submit_button:{onclick:function(){if(_ge("freeform_geotagging").value.length>1&&_ge("freeform_geotagging").value.substr(0,1)=="@"){_ge("f_div_corrections_right_side").find_at(_ge("freeform_geotagging").value.substr(1,9999));return }_ge("f_div_corrections_right_side").save_at_center()},validate:function(A,B){if(typeof (A)=="undefined"||typeof (B)=="undefined"||typeof (A)!="number"||typeof (B)!="number"||isNaN(A)||isNaN(B)){return false}if(Math.abs(A)>90||Math.abs(B)>180){return false}return true}},submit_button_geotagged:{onclick:function(){var C=_use_viewgeo;for(var B=0;B<_ge("geo_bookmark_privacy_slct_geotagged").options.length;B++){if(_ge("geo_bookmark_privacy_slct_geotagged").options[B].selected){C=_ge("geo_bookmark_privacy_slct_geotagged").options[B].value;break}}var A={flickr_photos_geo_setPerms_onLoad:function(I,H,E,G){if(I){_use_viewgeo=G.new_viewgeo;if(_use_viewgeo==5){_ge("f_div_corrections_who_can_see").innerHTML='<img width="15" height="15" class="absmiddle" src="/images/icon_private.gif"/> '}else{if(_use_viewgeo==0){_ge("f_div_corrections_who_can_see").innerHTML='<img width="15" height="15" class="absmiddle" src="/images/icon_public.gif"/> '}else{_ge("f_div_corrections_who_can_see").innerHTML='<img width="15" height="15" class="absmiddle" src="/images/icon_a_bit_private.gif"/> '}}_ge("f_div_corrections_who_can_see").innerHTML+=F.output.get("geotag_from_page_who_can_see_2_"+_use_viewgeo)+" ";for(var D=0;D<_ge("geo_bookmark_privacy_slct").options.length;D++){if(_pi(_ge("geo_bookmark_privacy_slct").options[D].value)==_use_viewgeo){_ge("geo_bookmark_privacy_slct").options[D].selected=true}else{_ge("geo_bookmark_privacy_slct").options[D].selected=false}}for(var D=0;D<_ge("geo_bookmark_privacy_slct_geotagged").options.length;D++){if(_pi(_ge("geo_bookmark_privacy_slct_geotagged").options[D].value)==_use_viewgeo){_ge("geo_bookmark_privacy_slct_geotagged").options[D].selected=true}else{_ge("geo_bookmark_privacy_slct_geotagged").options[D].selected=false}}}Y.U.Dom.setStyle("div_geo_saved_success","display","block");Y.U.Dom.setStyle("div_corrections_main_form","display","block");Y.U.Dom.setStyle("div_geo_feedback_saving","display","none");setTimeout("_ge('f_div_corrections_right_side').fade_save_success()",800)}};Y.U.Dom.setStyle("div_corrections_main_form","display","none");Y.U.Dom.setStyle("div_geo_feedback_saving","display","block");if(C==0){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:1,is_friend:0,is_family:0,is_contact:0,new_viewgeo:C},A)}if(C==1){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:0,is_friend:0,is_family:0,is_contact:1,new_viewgeo:C},A)}if(C==2){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:0,is_friend:1,is_family:1,is_contact:0,new_viewgeo:C},A)}if(C==3){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:0,is_friend:1,is_family:0,is_contact:0,new_viewgeo:C},A)}if(C==4){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:0,is_friend:0,is_family:1,is_contact:0,new_viewgeo:C},A)}if(C==5){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:0,is_friend:0,is_family:0,is_contact:0,new_viewgeo:C},A)}}},find_at:function(A){var B={flickr_photos_search_onLoad:function(H,G,D,E){if(H){if(G.documentElement.getElementsByTagName("photo").length==1){photo_id=G.documentElement.getElementsByTagName("photo")[0].getAttribute("id");var C={flickr_photos_getInfo_onLoad:function(O,N,K,M){if(O){if(N.documentElement.getElementsByTagName("location").length==0){var L=N.documentElement.getElementsByTagName("url");var I="";for(var J=0;J<L.length;J++){if(L[J].getAttribute("type")=="photopage"){I=L[J].childNodes[0].nodeValue}}if(I!=""){new_html="<strong>"+F.output.get("global_plus_geo_no_geo_bookmark_data_for_with_path",I,"@"+M.tags)+"</strong>"}else{new_html="<strong>"+F.output.get("global_plus_geo_no_geo_bookmark_data_for","@"+M.tags)+"</strong>"}_ge("a_geotag_toggle").set_failed_search(new_html)}else{latitude=N.documentElement.getElementsByTagName("location")[0].getAttribute("latitude");longitude=N.documentElement.getElementsByTagName("location")[0].getAttribute("longitude");accuracy=N.documentElement.getElementsByTagName("location")[0].getAttribute("accuracy");_geo_perms={geo_ispublic:N.documentElement.getElementsByTagName("geoperms")[0].getAttribute("ispublic"),geo_iscontact:N.documentElement.getElementsByTagName("geoperms")[0].getAttribute("iscontact"),geo_isfriend:N.documentElement.getElementsByTagName("geoperms")[0].getAttribute("isfriend"),geo_isfamily:N.documentElement.getElementsByTagName("geoperms")[0].getAttribute("isfamily")};_ge("f_div_corrections_box_holder_border").map_box.ymap.drawZoomAndCenter(new YGeoPoint(latitude,longitude),Math.min(16,Math.max(0,17-accuracy)));_ge("geo_form_save").click()}}else{}}};F.API.callMethod("flickr.photos.getInfo",{photo_id:photo_id,tags:E.tags},C,null,null,0)}else{}}else{}}};Y.U.Dom.setStyle("div_corrections_main_form","display","none");Y.U.Dom.setStyle("div_geo_feedback_finding_locations","display","block");F.API.callMethod("flickr.photos.search",{user_id:global_nsid,tags:"geo:bookmark="+A,extras:"geo",per_page:1},B,null,null,0)},find_location:function(A){var B={flickr_geocode_translate_onLoad:function(f,U,M,D){if(f){var e=U.documentElement.getElementsByTagName("ResultSet")[0];var Q=U.documentElement.getElementsByTagName("Result");var o=e.getAttribute("fl:source_id");var L=D.location.trim().split(",")[0];var S=[];var V=false;var G=function(i){var r=1;if(i.precision=="GeocodedBuilding"){r=16}if(i.precision=="POI"){r=16}if(i.precision=="GeocodedStreet"){r=15}if(i.precision=="Suburb"){r=11}if(i.precision=="Town"){r=9}if(i.precision=="State"){r=5}if(i.precision=="Country"){r=2}return r};var n=function(s,r){if(r==6){var t='<li id="location_li_more"><a href="#" class="Plain" onclick="_ge(\'f_div_corrections_right_side\').show_other_locations()">More...</a></li><div id="f_div_more_locations" style="display:none"><li>'}else{var t="<li>"}t+='<a href="#" class="Plain" onclick="_ge(\'f_div_corrections_right_side\').jump_to_position(_ge(\'f_div_corrections_right_side\').locations['+r+']); return false">';t+=s.sub_title;t+="</a></li>";return t};var W=0;for(l=0;l<Q.length;l++){try{var m=String(Q[l].getAttribute("precision"))}catch(h){var m=""}try{var N=String(Q[l].getElementsByTagName("woe_specificprobability")[0].firstChild.nodeValue)}catch(h){var N=""}try{var p=String(Q[l].getElementsByTagName("woe_woeid")[0].firstChild.nodeValue)}catch(h){var p=""}var Z=String(Q[l].getElementsByTagName("Latitude")[0].firstChild.nodeValue);var K=String(Q[l].getElementsByTagName("Longitude")[0].firstChild.nodeValue);try{var R=String(Q[l].getElementsByTagName("woe_bbox")[0].firstChild.nodeValue)}catch(h){var R=""}try{var j=String(Q[l].getElementsByTagName("Address")[0].firstChild.nodeValue)}catch(h){var j=""}try{var O=String(Q[l].getElementsByTagName("City")[0].firstChild.nodeValue)}catch(h){var O=""}try{var q=String(Q[l].getElementsByTagName("State")[0].firstChild.nodeValue)}catch(h){var q=""}try{var T=String(Q[l].getElementsByTagName("Zip")[0].firstChild.nodeValue)}catch(h){var T=""}try{var c=String(Q[l].getElementsByTagName("Country")[0].firstChild.nodeValue)}catch(h){var c=""}try{var d=String(Q[l].getElementsByTagName("place_url")[0].firstChild.nodeValue)}catch(h){var d=""}c=(c=="United States")?"US":c;c=(c=="United Kingdom")?"UK":c;var X="";var C="";var E=L.toLowerCase();if(m=="GeocodedBuilding"||m=="POI"){if(j){C=C+", "+j}}if(O){C=C+", "+O}if(q){C=C+", "+q}if(c){C=C+", "+c}if(C.length>2){C=C.substring(2,C.length)}if(m=="County"){X=L.substring(0,1).toUpperCase()+L.substring(1,L.length)+" County"}else{if(m=="GeocodedBuilding"){C=L.split(" ")[0]+" "+C}else{if(m=="POI"){X=L}else{sub_titleA=C.split(", ");if(E==sub_titleA[0].toLowerCase()){if(sub_titleA[0]!=C){X=sub_titleA[0];C=C.replace(sub_titleA[0]+", ","")}}if(X==""){X=L}}}}if(S.length==0||(S.length>0&&(X!=S[S.length-1].title||C!=S[S.length-1].sub_title))){var b=Math.abs(_pf(R.split(",")[0])-_pf(R.split(",")[2]));var I=Math.abs(_pf(R.split(",")[1])-_pf(R.split(",")[3]));var k=new woe_location_obj(p,X,C,N,R,m,Z,K);k.query_string=D.location;V=true;var P=100.035;if((b+I<P||m=="GeocodedBuilding"||m=="POI"||m=="GeocodedStreet")){S.push(k)}else{if(m!="Country"){W++}else{W+=5}}}}if(W>=5){S=[]}if(S.length==0){_ge("div_corrections_search_no_results_display").innerHTML=F.output.get("corrections_no_matches_for_2",D.location)+" "+F.output.get("corrections_search_again");Y.U.Dom.setStyle("div_geo_feedback_finding_locations","display","none");Y.U.Dom.setStyle("div_corrections_search_no_results","display","block");return }else{if(S.length==1&&(S[0].precision=="GeocodedBuilding"||S[0].precision=="POI"||S[0].precision=="GeocodedStreet")){var g=F.output.get("global_plus_geo_one_match")+"<br /><ul class='corrections_list'>";for(var l=0;l<S.length;l++){g+=n(S[l],l)}if(S.length>=6){g+="</div>"}g+="</ul>";Y.U.Dom.setStyle("div_geo_feedback_finding_locations","display","none");_ge("f_div_corrections_right_side").jump_to_position(S[0]);return }else{if(S.length==1){var g=F.output.get("global_plus_geo_one_match")+"<br /><br />";Y.U.Dom.setStyle("div_geo_feedback_finding_locations","display","none");_ge("f_div_corrections_right_side").jump_to_position(S[0]);return }else{if(!F.is_ie){var g=F.output.get("corrections_found_x_matches_2",S.length,D.location)+"<br /><ul style='margin-left:-25px; font-size:11px'>"}else{var g=F.output.get("corrections_found_x_matches_2",S.length,D.location)+"<br /><ul style='margin-left:15px; font-size:11px'>"}}for(var l=0;l<S.length;l++){g+=n(S[l],l)}g+="</ul>"}}_ge("f_div_corrections_right_side").locations=S;_ge("div_geo_feedback_list_locations_list").innerHTML=g;_ge("div_geo_feedback_list_locations").scrollTop=0;Y.U.Dom.setStyle("div_geo_feedback_finding_locations","display","none");Y.U.Dom.setStyle("div_geo_feedback_list_locations","display","block")}else{try{var J=_pi(U.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var a=U.documentElement.getElementsByTagName("err")[0].getAttribute("msg")}catch(h){var H=F.output.get("unknown_err")}_ge("div_geo_feedback_error_msg").innerHTML=H;Y.U.Dom.setStyle("div_geo_feedback_finding_locations","display","none");Y.U.Dom.setStyle("div_geo_feedback_error","display","block")}}};Y.U.Dom.setStyle("div_corrections_main_form","display","none");Y.U.Dom.setStyle("div_corrections_search_results_clicked","display","none");Y.U.Dom.setStyle("div_corrections_search_no_results","display","none");Y.U.Dom.setStyle("div_geo_feedback_list_locations","display","none");Y.U.Dom.setStyle("div_geo_feedback_list_alternative_locations","display","none");_ge("div_geo_feedback_finding_locations").style.display="block";F.API.callMethod("flickr.geocode.translate",{provider_name:(_qs_args.provider_name)?_qs_args.provider_name:"woe",location:A},B,null,null,0)},show_other_locations:function(){Y.U.Dom.setStyle("f_div_more_locations","display","block");Y.U.Dom.setStyle("location_li_more","display","none")},go:function(A){if(A){_ge("freeform_geotagging").value=_ge("freeform_geotagging"+A).value}var C=_ge("freeform_geotagging").value.toLowerCase();var B=this.parse_input(C);if(B.error){if(B.error=="find location"){this.find_location(C)}}else{Y.U.Dom.setStyle("f_img_ch_white","display","none");Y.U.Dom.setStyle("f_img_ch_pink","display","block");_is_editing_geo=true;_ge("f_div_corrections_box_holder_border").map_box.jump_to_lat_lon(B.lat,B.lon);_ge("f_div_corrections_right_side").display_lat_lon(_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon());_ge("geo_form_save").disabled=false}},parse_input:function(G){if(G.length>1&&G.substr(0,1)=="@"){this.find_at(G.substr(1,9999));return{error:"doing bookmark"}}var L=new RegExp("^(geo:lat=(\\+|\\-)?((\\d+\\.\\d+)|\\d+)([,; ]+))(geo:(long|lon)=(\\+|\\-)?((\\d+\\.\\d+)|\\d+))");var H=new RegExp("^(geo:(long|lon)=(\\+|\\-)?((\\d+\\.\\d+)|\\d+)([,; ]+))(geo:lat=(\\+|\\-)?((\\d+\\.\\d+)|\\d+))");var I=new RegExp("[a-z:=]","g");var Q=new RegExp("[ ;]","g");var K=new RegExp(",+","g");if(G.match(L)){found_value=G.replace(I,"").replace(Q,",").replace(K,",");var O=_pf(found_value.split(",")[0]);var R=_pf(found_value.split(",")[1])}if(G.match(H)){found_value=G.replace(I,"").replace(Q,",").replace(K,",");var O=_pf(found_value.split(",")[1]);var R=_pf(found_value.split(",")[0])}if(typeof (O)=="undefined"){var E=null;var N=null;var P=null;G=G.replace(String.fromCharCode(8220),'"').replace(String.fromCharCode(8221),'"').replace(String.fromCharCode(8216),"'").replace(String.fromCharCode(8217),"'").replace(String.fromCharCode(176),"*");var B=null;var D=null;if(G.indexOf("n")>0){E=true;B=G.indexOf("n")}if(G.indexOf("s")>0){E=false;B=G.indexOf("s")}if(G.indexOf("e")>0){N=true;D=G.indexOf("e")}if(G.indexOf("w")>0){N=false;D=G.indexOf("w")}if(B!=null&&D!=null&&D<B){this.lon_first=true}if(G.indexOf("*")>0&&G.indexOf("'")>0&&G.indexOf('"')>0){var G=G.replace(new RegExp("[nsew'\"*]"),",").replace(new RegExp(",+")," ").replace(new RegExp(" +")," ");var M=G.split(" ");if(M.length>=6){var O=_pi(M[0]);if(O>=0){O+=(M[1]/60)+(M[2]/6000)}else{O-=((M[1]/60)+(M[2]/6000))}var R=_pi(M[3]);if(R>=0){R+=(M[4]/60)+(M[5]/6000)}else{R-=((M[4]/60)+(M[5]/6000))}}}if(G.indexOf("*")>0&&G.indexOf("'")>0){var G=G.replace(new RegExp("[nsew'\"*]"),",").replace(new RegExp(",+")," ").replace(new RegExp(" +")," ");var M=G.split(" ");if(M.length>=4){var O=_pi(M[0]);if(O>=0){O+=(M[1]/60)}else{O-=(M[1]/60)}var R=_pi(M[2]);if(R>=0){R+=(M[3]/60)}else{R-=(M[3]/60)}}}if(typeof (M)=="undefined"){var G=G.replace(new RegExp("[nsew'\"*]"),",").replace(new RegExp(",+")," ").replace(new RegExp(" +")," ");var M=G.split(" ");if(M.length>=2){var O=_pf(M[0]);var R=_pf(M[1])}}if(P==true){var A=O;O=R;R=A}if(E==true){O=Math.abs(O)}if(E==false){O=-1*Math.abs(O)}if(N==true){R=Math.abs(R)}if(N==false){R=-1*Math.abs(R)}}if(this.validate(O,R)){return{lat:O,lon:R}}else{var J=_ge("freeform_geotagging").value.toLowerCase().replace(new RegExp("[a-z]"),"").replace(new RegExp("[,;*'\" ]"),"");var C=_ge("freeform_geotagging").value.toLowerCase().replace(new RegExp("[0-9]"),"").replace(new RegExp("[,;*'\" ]"),"");if((J.length*0.7)>C.length){return{error:"mangled format"}}else{return{error:"find location"}}}},validate:function(A,B){if(typeof (A)=="undefined"||typeof (B)=="undefined"||typeof (A)!="number"||typeof (B)!="number"||isNaN(A)||isNaN(B)){return false}if(Math.abs(A)>90||Math.abs(B)>180){return false}return true},start_editing:function(){_is_editing_geo=true;Y.U.Dom.setStyle("div_single_marker_holder","display","none");Y.U.Dom.setStyle("f_img_ch_white","display","none");Y.U.Dom.setStyle("f_img_ch_pink","display","block");Y.U.Dom.setStyle("f_div_extra_options","display","none");Y.U.Dom.setStyle("div_corrections_inside","display","none");Y.U.Dom.setStyle("f_div_edit_form","display","block");Y.U.Dom.setStyle("div_corrections_save_bottom","display","block");if(!_is_suggestion){Y.U.Dom.setStyle("f_div_corrections_psst_holder","display","block")}_ge("f_div_corrections_box_holder_border").map_box.get_center_point_label();_ge("f_div_corrections_right_side").display_lat_lon(_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon());Y.U.Dom.setStyle("div_corrections_main_form","display","block")},reset_stuff:function(){Y.U.Dom.setStyle("f_img_ch_white","display","none");Y.U.Dom.setStyle("f_img_ch_pink","display","none");_ge("f_div_corrections_box_holder_border").map_box.jump_to_last_saved_position();Y.U.Dom.setStyle("div_single_marker_holder","display","block");_is_editing_geo=false;_ge("f_div_corrections_right_side").display_lat_lon(_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon())},stop_editing:function(){Y.U.Dom.setStyle("div_geo_feedback_list_locations","display","none");Y.U.Dom.setStyle("div_corrections_main_form","display","block")},set_perms:function(){var C=-1;for(var B=0;B<document.forms.frm_geo_perms.length;B++){if(document.forms.frm_geo_perms[B].checked){C=document.forms.frm_geo_perms[B].value}}if(C>-1&&C!=_use_viewgeo){var A={flickr_photos_geo_setPerms_onLoad:function(H,G,D,E){if(H){_use_viewgeo=E.new_viewgeo}if(_use_viewgeo==5){_ge("f_div_corrections_who_can_see").innerHTML='<img width="15" height="15" class="absmiddle" src="/images/icon_private.gif"/> '}else{if(_use_viewgeo==0){_ge("f_div_corrections_who_can_see").innerHTML='<img width="15" height="15" class="absmiddle" src="/images/icon_public.gif"/> '}else{_ge("f_div_corrections_who_can_see").innerHTML='<img width="15" height="15" class="absmiddle" src="/images/icon_a_bit_private.gif"/> '}}_ge("f_div_corrections_who_can_see").innerHTML+=F.output.get("geotag_from_page_who_can_see_2_"+_use_viewgeo);Y.U.Dom.setStyle("div_geo_saved_success","display","block");Y.U.Dom.setStyle("div_corrections_main_form","display","block");Y.U.Dom.setStyle("div_geo_feedback_saving","display","none");setTimeout("_ge('f_div_corrections_right_side').fade_save_success()",800)}};Y.U.Dom.setStyle("div_geo_perms","display","none");Y.U.Dom.setStyle("div_geo_feedback_saving","display","block");if(C==0){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:1,is_friend:0,is_family:0,is_contact:0,new_viewgeo:C},A)}if(C==1){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:0,is_friend:0,is_family:0,is_contact:1,new_viewgeo:C},A)}if(C==2){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:0,is_friend:1,is_family:1,is_contact:0,new_viewgeo:C},A)}if(C==3){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:0,is_friend:1,is_family:0,is_contact:0,new_viewgeo:C},A)}if(C==4){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:0,is_friend:0,is_family:1,is_contact:0,new_viewgeo:C},A)}if(C==5){F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:0,is_friend:0,is_family:0,is_contact:0,new_viewgeo:C},A)}}},jump_to_position:function(A){this.current_location_obj=A;_ge("f_div_corrections_box_holder_border").map_box.jump_to_position(this.current_location_obj);_ge("f_div_corrections_right_side").display_lat_lon(_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon());if(this.current_location_obj.title!=""&&this.current_location_obj.sub_title!=""){if(this.current_location_obj.title.toLowerCase()==this.current_location_obj.sub_title.split(",")[0].toLowerCase()){var B=this.current_location_obj.sub_title.split(",")[0]}else{var B=this.current_location_obj.title+", "+this.current_location_obj.sub_title.split(",")[0]}}else{if(this.current_location_obj.title!=""){if(this.current_location_obj.title.split(",").length==1){var B=this.current_location_obj.title}else{if(this.current_location_obj.title.split(",")[0].toLowerCase()==this.current_location_obj.title.split(",")[1].toLowerCase()){var B=this.current_location_obj.title.split(",")[1]}else{var B=this.current_location_obj.title.split(",")[0]+", "+this.current_location_obj.title.split(",")[1]}}}else{if(this.current_location_obj.sub_title!=""){if(this.current_location_obj.sub_title.split(",").length==1){var B=this.current_location_obj.sub_title}else{if(this.current_location_obj.sub_title.split(",")[0].toLowerCase()==this.current_location_obj.sub_title.split(",")[1]){var B=this.current_location_obj.sub_title.split(",")[1]}else{var B=this.current_location_obj.sub_title.split(",")[0]+", "+this.current_location_obj.sub_title.split(",")[1]}}}else{var B=F.output.get("a_place_with_no_name")}}}_ge("f_div_corrections_search_results_clicked").innerHTML=F.output.get("corrections_heres_a_place",B);_ge("div_corrections_search_no_results_display").innerHTML=F.output.get("corrections_drag_around",B);_ge("f_div_corrections_box_holder_border").map_box.map_moved=0;Y.U.Dom.setStyle("div_geo_feedback_list_locations","display","none");Y.U.Dom.setStyle("div_corrections_search_results_clicked","display","block")},save_at_marker:function(){this.current_location_obj={};this.current_location_obj.query_string="";this.current_location_obj.lat=_ge("f_div_corrections_box_holder_border").map_box.mo.YGeoPoint.Lat;this.current_location_obj.lon=_ge("f_div_corrections_box_holder_border").map_box.mo.YGeoPoint.Lon;this.current_location_obj.acc=Math.min(16,Math.max(0,17-_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel()));this.save_location()},save_at_center:function(){this.current_location_obj={};this.current_location_obj.query_string="";this.current_location_obj.lat=_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon().Lat;this.current_location_obj.lon=_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon().Lon;this.current_location_obj.acc=Math.min(16,Math.max(0,17-_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel()));this.save_location()},flickr_photos_geo_setLocation_onLoad:function(G,E,C,D){if(G){_has_geo=true;_ge("f_div_corrections_right_side").load_new_position(D.accuracy,false)}else{try{var A=_pi(E.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var I=E.documentElement.getElementsByTagName("err")[0].getAttribute("msg");var B=F.output.get("api_err_generic")+" "+I}catch(H){var B=F.output.get("unknown_err")}_ge("div_geo_feedback_error_msg").innerHTML=B;_ge("div_geo_feedback_saving").style.display="none";_ge("div_geo_feedback_error").style.display="block"}},flickr_photos_suggestions_removeSuggestion_onLoad:function(G,E,C,D){if(G){F.API.callMethod("flickr.photos.suggestions.suggestLocation",D.carry_over_obj,_ge("f_div_corrections_right_side"),null,null,0)}else{try{var A=_pi(E.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var I=E.documentElement.getElementsByTagName("err")[0].getAttribute("msg");var B=F.output.get("api_err_generic")+" "+I}catch(H){var B=F.output.get("unknown_err")}}},flickr_photos_suggestions_suggestLocation_onLoad:function(L,J,G,C){if(L){YAHOO.util.Dom.setStyle("li_edit_suggestion","display","block");YAHOO.util.Dom.setStyle("li_add_suggestion","display","none");_has_geo=true;var H=_pf(C.lat);var A=_pf(C.lon);var D=_pf(C.accuracy);_use_4real_location=H+", "+A+", "+D;_suggestion_obj={latitude:H,longitude:A,key:J.documentElement.getElementsByTagName("suggestion")[0].getAttribute("id")};Y.U.Dom.setStyle("f_img_ch_pink","display","none");_ge("f_div_corrections_box_holder_border").map_box.set_splat();_ge("f_div_corrections_right_side").close_saving();Y.U.Dom.setStyle("div_corrections_inside","display","block")}else{try{var E=_pi(J.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var B=J.documentElement.getElementsByTagName("err")[0].getAttribute("msg");var I=F.output.get("api_err_generic")+" "+B}catch(K){var I=F.output.get("unknown_err")}}},save_location:function(){var A=this.current_location_obj.query_string;if(A.length>=2&&A.substr(0,2)==", "){A=A.substr(2,9999)}Y.U.Dom.setStyle("div_corrections_main_form","display","none");Y.U.Dom.setStyle("div_geo_feedback_finding_locations","display","none");Y.U.Dom.setStyle("div_corrections_search_results_clicked","display","none");Y.U.Dom.setStyle("div_corrections_search_no_results","display","none");Y.U.Dom.setStyle("div_geo_feedback_saving","display","block");if(this.current_location_obj.acc==undefined){this.current_location_obj.acc=Math.min(16,Math.max(0,17-_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel()))}if(_is_suggestion){if(typeof (_suggestion_obj)=="object"&&_suggestion_obj!=null){var B={photo_id:page_photo_id,lat:this.current_location_obj.lat,lon:this.current_location_obj.lon,accuracy:this.current_location_obj.acc};F.API.callMethod("flickr.photos.suggestions.removeSuggestion",{carry_over_obj:B,suggestion_id:_suggestion_obj.key},_ge("f_div_corrections_right_side"),null,null,0)}else{F.API.callMethod("flickr.photos.suggestions.suggestLocation",{photo_id:page_photo_id,lat:this.current_location_obj.lat,lon:this.current_location_obj.lon,accuracy:this.current_location_obj.acc},_ge("f_div_corrections_right_side"),null,null,0)}}else{F.API.callMethod("flickr.photos.geo.setLocation",{photo_id:page_photo_id,lat:this.current_location_obj.lat,lon:this.current_location_obj.lon,accuracy:this.current_location_obj.acc,query:A,provider:"user"},_ge("f_div_corrections_right_side"),null,null,0)}},load_new_position:function(B,C){var A={flickr_photos_geo_getLocation_onLoad:function(M,D,N,U){if(M){if(typeof (_photo_acc)!="undefined"){_photo_acc=_pi(D.documentElement.getElementsByTagName("location")[0].getAttribute("accuracy"))}_has_geo=true;var L=_pf(D.documentElement.getElementsByTagName("location")[0].getAttribute("latitude"));var G=_pf(D.documentElement.getElementsByTagName("location")[0].getAttribute("longitude"));var K=_pf(D.documentElement.getElementsByTagName("location")[0].getAttribute("accuracy"));_use_4real_location=L+", "+G+", "+K;Y.U.Dom.setStyle("div_geo_block","display","block");_ge("div_taken_in").innerHTML=D.documentElement.getElementsByTagName("location")[0].getAttribute("taken_in").replace("&lt;","<").replace("&gt;",">").replace("&#38;lt;","<").replace("&#38;gt;",">");_ge("div_taken_in_links").innerHTML=' (<a class="Plain" onclick="F._corrections_box.show(true); return false" href="#">'+F.output.get("corrections_edit")+'</a> | <a class="Plain" onclick="F._corrections_box.show(false); return false" href="#">'+F.output.get("corrections_map")+"</a>)";var Q=/<a[^>]*>|<\/a>|<b>|<\/b>/ig;var P=D.documentElement.getElementsByTagName("location")[0].getAttribute("taken_in").replace("&lt;","<").replace("&gt;",">").replace("&#38;lt;","<").replace("&#38;gt;",">").replace('""','"').replace("Taken","taken");var E="";for(var T=0;T<D.documentElement.getElementsByTagName("location")[0].childNodes.length;T++){if(D.documentElement.getElementsByTagName("location")[0].childNodes[T].nodeType==1&&D.documentElement.getElementsByTagName("location")[0].childNodes[T].getAttribute("place_id")!=null){var J=D.documentElement.getElementsByTagName("location")[0].childNodes[T].firstChild.nodeValue;if(E==""){E=J}else{if(E.toLowerCase()!=J.toLowerCase()){E+=", "+J;break}}}}_taken_in=E;if(U.check_for_other_photos){_ge("f_div_corrections_drag_around").innerHTML=F.output.get("corrections_now_were_saying_2",_taken_in);_ge("f_div_corrections_drag_around").innerHTML+=' (<a href="#" class="Plain" onclick="_ge(\'f_div_corrections_right_side\').start_editing()">'+F.output.get("corrections_edit")+"</a>)"}else{if(page_p.video_thumb_src){_ge("f_div_corrections_drag_around").innerHTML=F.output.get("corrections_weve_placed_video_2",_taken_in)}else{_ge("f_div_corrections_drag_around").innerHTML=F.output.get("corrections_weve_placed_photo_2",_taken_in)}_ge("f_div_corrections_drag_around").innerHTML+=' (<a href="#" class="Plain" onclick="_ge(\'f_div_corrections_right_side\').start_editing()">'+F.output.get("corrections_edit")+"</a>)"}_ge("f_div_corrections_psst").innerHTML=F.output.get("corrections_psst",_taken_in);_ge("div_geo_feedback_after_list").innerHTML=F.output.get("corrections_never_mind_2",_taken_in);var R=D.documentElement.getElementsByTagName("location")[0].getAttribute("woeid");if(U.check_for_other_photos&&1==1){var I={flickr_photos_geo_photosForLocation_onLoad:function(a,Z,W,X){if(a){if(_pi(Z.documentElement.getElementsByTagName("photos")[0].getAttribute("total"))>1){if(_pi(Z.documentElement.getElementsByTagName("photos")[0].getAttribute("total"))==2){_ge("div_geo_other_photos_number").innerHTML=F.output.get("corrections_other_photo_2","<strong>"+_taken_in+"</strong>")+"<br /><br />"+F.output.get("corrections_other_photo_pt_single_2",1)}else{_ge("div_geo_other_photos_number").innerHTML=F.output.get("corrections_other_photo_2","<strong>"+_taken_in+"</strong>")+"<br /><br />"+F.output.get("corrections_other_photo_pt_plural_2",(_pi(Z.documentElement.getElementsByTagName("photos")[0].getAttribute("total"))-1).pretty_num())}Y.U.Dom.setStyle("div_geo_feedback_saving","display","none");Y.U.Dom.setStyle("div_geo_other_photos","display","block");_ge("pp-source_geo").innerHTML='<ul class="pp-list_geo"></ul><div class="clear"></div><span id="pp-loading_geo"></span>';Y.U.Dom.setStyle("pp_geo","display","block");Y.U.Dom.setStyle("f_div_corrections_map_holder","display","none");_pp_geo.apiData.lastCallParams.lat=X.lat;_pp_geo.apiData.lastCallParams.lon=X.lon;_pp_geo.apiData.lastCallParams.acc=X.accuracy;_pp_geo.apiData.lastCallParams.woe_id=X.woe_id;_pp_geo.apiData.lastCallParams.per_page=X.per_page;_pp_geo.makePhotosList(_pp_geo.parseCollection(Z))}else{if(_geo_perms.geo_ispublic){_ge("f_div_corrections_right_side").save_pre_perms()}else{_ge("f_div_corrections_right_side").close_saving()}}}}};F.API.callMethod("flickr.photos.geo.photosForLocation",{lat:L,lon:G,accuracy:K,per_page:50,woe_id:R},I,null,null,0)}else{if(_geo_perms.geo_ispublic){_ge("f_div_corrections_right_side").save_pre_perms()}else{_ge("f_div_corrections_right_side").close_saving()}}}else{try{var S=_pi(D.documentElement.getElementsByTagName("err")[0].getAttribute("code"));var H=D.documentElement.getElementsByTagName("err")[0].getAttribute("msg");var O=F.output.get("api_err_generic")+H}catch(V){var O=F.output.get("unknown_err")}_ge("div_geo_feedback_error_msg").innerHTML="<strong>"+O+"</strong>";_ge("div_geo_feedback_saving").style.display="none";_ge("div_geo_feedback_error").style.display="block"}}};F.API.callMethod("flickr.photos.geo.getLocation",{photo_id:page_photo_id,accuracy:B,breadcrumb:1,check_for_other_photos:C},A,null,null,0)},load_new_suggestion:function(){},save_pre_perms:function(){var A={flickr_photos_geo_setPerms_onLoad:function(H,G,D,E){if(H){_use_viewgeo=E.new_viewgeo;if(_use_viewgeo==5){_ge("f_div_corrections_who_can_see").innerHTML='<img width="15" height="15" class="absmiddle" src="/images/icon_private.gif"/> '}else{if(_use_viewgeo==0){_ge("f_div_corrections_who_can_see").innerHTML='<img width="15" height="15" class="absmiddle" src="/images/icon_public.gif"/> '}else{_ge("f_div_corrections_who_can_see").innerHTML='<img width="15" height="15" class="absmiddle" src="/images/icon_a_bit_private.gif"/> '}}_ge("f_div_corrections_who_can_see").innerHTML+=F.output.get("geotag_from_page_who_can_see_2_"+_use_viewgeo);for(var C=0;C<document.forms.frm_geo_perms.length;C++){if(_use_viewgeo==document.forms.frm_geo_perms[C].value){document.forms.frm_geo_perms.selected=true}else{document.forms.frm_geo_perms.selected=false}}}_ge("f_div_corrections_right_side").close_saving()}};if(_geo_perms.is_public&&!_geo_perms.is_friend&&!_geo_perms.is_family&&!_geo_perms.is_contact){var B=0}if(!_geo_perms.is_public&&!_geo_perms.is_friend&&!_geo_perms.is_family&&_geo_perms.is_contact){var B=1}if(!_geo_perms.is_public&&_geo_perms.is_friend&&_geo_perms.is_family&&!_geo_perms.is_contact){var B=2}if(!_geo_perms.is_public&&_geo_perms.is_friend&&!_geo_perms.is_family&&!_geo_perms.is_contact){var B=3}if(!_geo_perms.is_public&&!_geo_perms.is_friend&&_geo_perms.is_family&&!_geo_perms.is_contact){var B=4}if(!_geo_perms.is_public&&!_geo_perms.is_friend&&!_geo_perms.is_family&&!_geo_perms.is_contact){var B=5}_geo_perms={};F.API.callMethod("flickr.photos.geo.setPerms",{photo_id:page_photo_id,is_public:_geo_perms.is_public,is_friend:_geo_perms.is_public,is_family:_geo_perms.is_public,is_contact:_geo_perms.is_public,new_viewgeo:B},A)},update_other_locations:function(){var A={flickr_photos_geo_batchCorrectLocation_onLoad:function(E,D,B,C){if(E){}else{}}};F.API.callMethod("flickr.photos.geo.batchCorrectLocation",{lat:_pp_geo.apiData.lastCallParams.lat,lon:_pp_geo.apiData.lastCallParams.lon,accuracy:_pp_geo.apiData.lastCallParams.acc,place_id:_pp_geo.apiData.lastCallParams.woe_id},A,null,null,0);this.close_saving()},close_saving:function(){if(!_is_suggestion){this.reset_stuff()}Y.U.Dom.setStyle("div_geo_feedback_saving","display","none");Y.U.Dom.setStyle("div_geo_other_photos","display","none");Y.U.Dom.setStyle("div_geo_saved_success","display","block");Y.U.Dom.setStyle("f_div_edit_form","display","none");Y.U.Dom.setStyle("div_corrections_save_bottom","display","none");if(!_is_suggestion){Y.U.Dom.setStyle("f_div_extra_options","display","block");Y.U.Dom.setStyle("div_corrections_inside","display","block");Y.U.Dom.setStyle("f_div_corrections_psst_holder","display","block")}Y.U.Dom.setStyle("div_corrections_main_form","display","block");setTimeout("_ge('f_div_corrections_right_side').fade_save_success()",800);if(_ge("pp-source_geo")&&!_is_suggestion){try{_ge("pp-source_geo").scrollTop=0}catch(A){}}_ge("f_div_corrections_map_holder").style.display="block"},pre_fetch_alternatives:function(){_ge("div_geo_feedback_list_alternative_locations_list_ul").innerHTML="";_ge("div_corrections_main_form").style.display="none";_ge("div_geo_feedback_list_alternative_locations").style.display="none";_ge("div_geo_feedback_finding_alternative_locations").style.display="block";this.fetch_alternatives(_use_4real_location.split("|")[0].split(",")[0],_use_4real_location.split("|")[0].split(",")[1],_use_4real_location.split("|")[0].split(",")[2])},alt_fetch_alternatives:function(B,C,A){_ge("li_find_mode").innerHTML=_ge("div_geo_feedback_finding_alternative_locations").innerHTML;this.fetch_alternatives(B,C,A)},fetch_alternatives:function(K,C,E){K=parseFloat(K);C=parseFloat(C);E=parseInt(E);if(E>0){if(E>=1&&E<=2){E=5}if(E>=3&&E<=5){E=4}if(E>=6&&E<=8){E=3}if(E>=9&&E<=11){E=2}if(E>=12&&E<=14){E=1}if(E>=15&&E<=16){E=1}}else{E=E*-1}if(_place_map[E]){var H=_place_map[E].type;var G=_place_map[E].distance}else{if(_place_map[6]){var H=_place_map[6].type;var G=_place_map[6].distance}else{var H=29;var G=1500}}var J=0.056;var L=K-(J*G/8);var I=K+(J*G/8);var B=C-(J*G/8);var M=C+(J*G/8);var D={flickr_photos_geo_placesForBoundingBox_onLoad:function(W,V,S,Q){if(W){var N=V.documentElement.getElementsByTagName("place");var U="";var P=V.documentElement.getElementsByTagName("places")[0].getAttribute("place_type");for(var R=0;R<N.length;R++){var T=N[R].firstChild.nodeValue;if(T.split(",").length>1){T=T.split(",")[0]+", "+T.split(",")[1]}U+='<li><a href="#" class="Plain" onclick="_ge(\'f_div_corrections_right_side\').correct_location(\''+N[R].getAttribute("place_id")+"', "+P+');return false">'+T+"</a></li>"}if(P==22){var O=-2}if(P==7){var O=-3}if(P==9){var O=-4}if(P==8){var O=-5}if(P==12){var O=-6}if(P==29){var O=-7}if(_ge("li_find_mode")){_ge("li_find_mode").parentNode.removeChild(_ge("li_find_mode"))}U+='<li id="li_find_mode"><a href="#" onclick="_ge(\'f_div_corrections_right_side\').alt_fetch_alternatives(\''+Q.pass_params.lat+"','"+Q.pass_params.lon+"','"+O+'\'); return false" class="Plain">'+F.output.get("corrections_more")+"</a></li>";_ge("div_geo_feedback_list_alternative_locations_list_ul").innerHTML+=U;_ge("div_geo_feedback_finding_alternative_locations").style.display="none";_ge("div_geo_feedback_list_alternative_locations").style.display="block"}else{if(_ge("li_find_mode")){_ge("li_find_mode").parentNode.removeChild(_ge("li_find_mode"))}_ge("div_geo_feedback_list_alternative_locations_list_ul").innerHTML+="<li>"+F.output.get("corrections_no_more")+"</li>";_ge("div_geo_feedback_finding_alternative_locations").style.display="none";_ge("div_geo_feedback_list_alternative_locations").style.display="block"}}};var A={lat:K,lon:C,step:(E*-1)};F.API.callMethod("flickr.photos.geo.placesForBoundingBox",{bbox:B+","+L+","+M+","+I,placetype:H,pass_params:A},D,null,null,0)},cancel_alternatives:function(){Y.U.Dom.setStyle("div_corrections_main_form","display","block");Y.U.Dom.setStyle("div_geo_feedback_list_alternative_locations","display","none")},correct_location:function(A,C){var B={flickr_photos_geo_correctLocation_onLoad:function(I,H,E,G){if(I){if(G.place_type==22){var D=16}if(G.place_type==7){var D=14}if(G.place_type==9){var D=11}if(G.place_type==8){var D=8}if(G.place_type==12){var D=5}if(G.place_type==29){var D=2}_ge("f_div_corrections_right_side").load_new_position(D,true)}}};_ge("div_geo_feedback_list_alternative_locations").style.display="none";_ge("div_geo_feedback_saving").style.display="block";F.API.callMethod("flickr.photos.geo.correctLocation",{photo_id:page_photo_id,place_id:A,place_type:C},B,null,null,0)},remove_location:function(){var A={flickr_photos_geo_removeLocation_onLoad:function(G,E,C,D){if(G){Y.U.Dom.setStyle("div_single_marker_holder","display","none");Y.U.Dom.setStyle("f_img_ch_pink","display","block");_is_editing_geo=true;_has_geo=false;_taken_in="";_ge("freeform_geotagging").value="";_ge("freeform_geotagging_2").value="";_ge("freeform_geotagging_3").value="";_ge("freeform_geotagging_4").value="";_ge("geo_form_save").disabled=false;for(var B=0;B<document.forms.frm_geo_perms.length;B++){if(_default_viewgeo==document.forms.frm_geo_perms[B].value){document.forms.frm_geo_perms.selected=true}}Y.U.Dom.setStyle("div_corrections_inside","display","none");Y.U.Dom.setStyle("f_div_corrections_psst_holder","display","none");YAHOO.util.Dom.setStyle("div_geo_removing","display","none");YAHOO.util.Dom.setStyle("div_geo_remove_success","display","block");YAHOO.util.Dom.setStyle("f_div_edit_form","display","block");YAHOO.util.Dom.setStyle("div_corrections_save_bottom","display","block");YAHOO.util.Dom.setStyle("div_corrections_main_form","display","block");_ge("f_div_corrections_box_holder_border").map_box.drag_around_timer_id=setTimeout("_ge('f_div_corrections_box_holder_border').map_box.get_center_point_label()",333);setTimeout("_ge('f_div_corrections_right_side').fade_remove_success()",800);_ge("f_div_corrections_right_side").display_lat_lon(_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon());_ge("div_taken_in").innerHTML="";_ge("div_taken_in_links").innerHTML='<a class="Plain" onclick="F._corrections_box.show(true); return false" href="#">'+F.output.get("corrections_add_location_2")+"</a>";YAHOO.util.Dom.setStyle("f_div_extra_options","display","none");YAHOO.util.Dom.setStyle("f_div_extra_options_2","display","none")}else{}},flickr_photos_suggestions_removeSuggestion_onLoad:function(E,D,B,C){if(E){_ge("f_div_corrections_box_holder_border").map_box.hide_splat();Y.U.Dom.setStyle("f_img_ch_pink","display","block");_is_editing_geo=true;_has_geo=false;_ge("freeform_geotagging").value="";_ge("freeform_geotagging_2").value="";_ge("freeform_geotagging_3").value="";_ge("freeform_geotagging_4").value="";_ge("geo_form_save").disabled=false;Y.U.Dom.setStyle("div_corrections_inside","display","none");Y.U.Dom.setStyle("f_div_corrections_psst_holder","display","none");YAHOO.util.Dom.setStyle("div_geo_removing","display","none");YAHOO.util.Dom.setStyle("div_geo_remove_success","display","block");YAHOO.util.Dom.setStyle("f_div_edit_form","display","block");YAHOO.util.Dom.setStyle("div_corrections_save_bottom","display","block");YAHOO.util.Dom.setStyle("div_corrections_main_form","display","block");_ge("f_div_corrections_box_holder_border").map_box.drag_around_timer_id=setTimeout("_ge('f_div_corrections_box_holder_border').map_box.get_center_point_label()",333);setTimeout("_ge('f_div_corrections_right_side').fade_remove_success()",800);_ge("f_div_corrections_right_side").display_lat_lon(_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon());YAHOO.util.Dom.setStyle("li_edit_suggestion","display","none");YAHOO.util.Dom.setStyle("li_add_suggestion","display","block");YAHOO.util.Dom.setStyle("f_div_extra_options","display","none");YAHOO.util.Dom.setStyle("f_div_extra_options_2","display","none");_suggestion_obj=null}else{}}};YAHOO.util.Dom.setStyle("div_geo_remove_location_confirm","display","none");YAHOO.util.Dom.setStyle("div_geo_removing","display","block");if(_is_suggestion){F.API.callMethod("flickr.photos.suggestions.removeSuggestion",{suggestion_id:_suggestion_obj.key},A,null,null,0)}else{F.API.callMethod("flickr.photos.geo.removeLocation",{photo_id:page_photo_id},A,null,null,0)}},display_lat_lon:function(A){_ge("f_div_corrections_bottombar_right").innerHTML=this.make_pretty(A.Lat,A.Lon)+"<br />";_ge("f_div_corrections_bottombar_right").innerHTML+="("+(_pi(A.Lat*10000)/10000)+", "+(_pi(A.Lon*10000)/10000)+")";_ge("f_div_corrections_bottombar_right").innerHTML+='<span class="geo" style="display:none"><span class="latitude">'+A.Lat+'</span><span class="longitude">'+A.Lon+"</span></span>"},display_drag_around:function(A){},make_pretty:function(C,D){var B=this.dec_to_dms(C);if(C>0){B.push("N")}else{B.push("S")}var A=this.dec_to_dms(D);if(D>0){A.push("E")}else{A.push("W")}return B[0]+"&#176;"+B[1]+"'"+B[2]+'"'+B[3]+", "+A[0]+"&#176;"+A[1]+"'"+A[2]+'"'+A[3]},fade_remove_success:function(){var A=function(){var C=function(){Y.U.Dom.setStyle("div_geo_remove_success","display","none");Y.U.Dom.setStyle("div_geo_remove_success","height","");Y.U.Dom.setStyle("div_geo_remove_success","opacity","1");var E=new YAHOO.util.Anim(_ge("div_geo_remove_success"),{opacity:{to:1}},0.1,YAHOO.util.Easing.easeOut);E.animate()};var D=new YAHOO.util.Anim(_ge("div_geo_remove_success"),{height:{to:1}},0.333,YAHOO.util.Easing.easeOut);D.onComplete.subscribe(C);D.animate()};var B=new YAHOO.util.Anim(_ge("div_geo_remove_success"),{opacity:{to:0}},0.333,YAHOO.util.Easing.easeOut);B.onComplete.subscribe(A);B.animate()},fade_save_success:function(){var A=function(){var C=function(){Y.U.Dom.setStyle("div_geo_saved_success","display","none");Y.U.Dom.setStyle("div_geo_saved_success","height","");Y.U.Dom.setStyle("div_geo_saved_success","opacity","1");var E=new YAHOO.util.Anim(_ge("div_geo_saved_success"),{opacity:{to:1}},0.1,YAHOO.util.Easing.easeOut);E.animate()};var D=new YAHOO.util.Anim(_ge("div_geo_saved_success"),{height:{to:1}},0.333,YAHOO.util.Easing.easeOut);D.onComplete.subscribe(C);D.animate()};var B=new YAHOO.util.Anim(_ge("div_geo_saved_success"),{opacity:{to:0}},0.333,YAHOO.util.Easing.easeOut);B.onComplete.subscribe(A);B.animate()},dec_to_dms:function(E){E=Math.abs(E);while(E>360){E-=360}var D=Math.floor(E);var G=3600*(E-D);var B=Math.floor(G/60);var A=(G/60)-B;var C=Math.round(60*A);if(C<10){C="0"+C}return new Array(D,B,C)}},map_box:{ymap:null,marker_offset:{x:-27,y:-130},const_map_map:0,const_map_sat:1,const_map_hyb:2,map_mode:0,counter_id:null,drag_around_timer_id:null,label_counter:0,map_moved:0,osming:false,show:function(A){if(typeof (YMap)=="function"){if(!_ge("div_zoom_background")){if(A){Y.U.Dom.setStyle("f_div_corrections_map_holder","width","480px");Y.U.Dom.setStyle("f_div_corrections_map","width","480px")}else{Y.U.Dom.setStyle("f_div_corrections_map_holder","width","704px");Y.U.Dom.setStyle("f_div_corrections_map","width","704px")}this.ymap=new YMap(_ge("f_div_corrections_map"));this.ymap.disableKeyControls();this.ymap.setMapType(YAHOO_MAP_REG);var J=YUtility.createNode("div","div_zoom_background");var L={position:"absolute",top:"4px",right:"4px",width:"24px",height:"165px"};YUtility.setStyle(J,L);var B=YUtility.createNode("img","map_zoom_background");var L={position:"absolute",top:"0px",left:"0px",width:"24px",height:"165px"};YUtility.setStyle(B,L);B.src=_images_root+"/map_zoom_background.png";B.className="trans_png";YUtility.appendNode(J,B);var B=YUtility.createNode("img","candy_map_zoom_out");var L={position:"absolute",top:"4px",left:"4px",width:"16px",height:"16px"};YUtility.setStyle(B,L);B.style.cursor=(F.is_ie)?"hand":"pointer";B.src=_images_root+"/candy_map_zoom_out_default.png";YUtility.appendNode(J,B);var B=YUtility.createNode("img","candy_map_zoom_in");var L={position:"absolute",top:"145px",left:"4px",width:"16px",height:"16px"};YUtility.setStyle(B,L);B.style.cursor=(F.is_ie)?"hand":"pointer";B.src=_images_root+"/candy_map_zoom_in_default.png";YUtility.appendNode(J,B);var B=YUtility.createNode("img","candy_map_dragger");var L={position:"absolute",top:"20px",left:"3px",width:"18px",height:"13px"};YUtility.setStyle(B,L);B.style.cursor=(F.is_ie)?"hand":"pointer";B.src=_images_root+"/candy_map_zoom_drag.png";B.className="trans_png";YUtility.appendNode(J,B);YUtility.appendNode(_ge("f_div_corrections_map"),J);F.decorate(_ge("candy_map_zoom_in"),F._map_zoom_button).button_go_go_go("in");F.decorate(_ge("candy_map_zoom_out"),F._map_zoom_button).button_go_go_go("out");var J=YUtility.createNode("div","f_div_crosshairs");var L={position:"absolute",top:"161px",left:"222px"};YUtility.setStyle(J,L);var B=YUtility.createNode("img","f_img_ch_white");var L={display:"none"};YUtility.setStyle(B,L);B.style.cursor=(F.is_ie)?"hand":"pointer";B.src=_images_root+"/map_crosshair_white.png";YUtility.appendNode(J,B);var B=YUtility.createNode("img","f_img_ch_pink");var L={display:"block"};YUtility.setStyle(B,L);B.style.cursor=(F.is_ie)?"hand":"pointer";B.src=_images_root+"/map_crosshair_pink.png";YUtility.appendNode(J,B);YUtility.appendNode(_ge("f_div_corrections_map"),J);F.decorate(_ge("f_img_ch_white"),F._map_crosshairs_button).button_go_go_go();F.decorate(_ge("f_img_ch_pink"),F._map_crosshairs_button).button_go_go_go();YEvent.Capture(this.ymap,EventsList.changeZoom,function(){_ge("f_div_corrections_box_holder_border").map_box.toggle_zoom();F.osming.check_map(this,"f_div_corrections_map")});if(A){YEvent.Capture(this.ymap,EventsList.startPan,function(){if(_ge("f_div_corrections_box_holder_border").map_box.counter_id!=null){clearTimeout(_ge("f_div_corrections_box_holder_border").map_box.counter_id)}});YEvent.Capture(this.ymap,EventsList.endPan,function(){_ge("f_div_corrections_box_holder_border").has_the_map_moved_or_what=true;_ge("f_div_corrections_box_holder_border").map_box.map_moved++;if(_ge("f_div_corrections_box_holder_border").map_box.counter_id!=null){clearTimeout(_ge("f_div_corrections_box_holder_border").map_box.counter_id)}if(_is_editing_geo||(!_has_geo&&!_is_editing_geo)){_is_editing_geo=true;Y.U.Dom.setStyle("f_img_ch_white","display","none");Y.U.Dom.setStyle("f_img_ch_pink","display","block");_ge("geo_form_save").disabled=false;_ge("f_div_corrections_right_side").display_lat_lon(this.getCenterLatLon())}clearTimeout(_ge("f_div_corrections_box_holder_border").map_box.drag_around_timer_id);_ge("f_div_corrections_box_holder_border").map_box.drag_around_timer_id=setTimeout("_ge('f_div_corrections_box_holder_border').map_box.get_center_point_label()",333);if(_save_position){_ge("f_div_corrections_box_holder_border").map_box.counter_id=setTimeout("_ge('f_div_corrections_box_holder_border').map_box.end_pan_delay()",1000)}F.osming.check_map(this,"f_div_corrections_map")})}else{}Y.U.Event.addListener(_ge("candy_map_dragger"),"mousedown",this.map_dragger_mouseDown,this,true);var J=YUtility.createNode("img","candy_map_type_map");var L={position:"absolute",top:"4px",right:"31px",width:"62px",height:"20px"};YUtility.setStyle(J,L);J.src=_intl_images_root+"/candy_map_type_map_default.png";YUtility.appendNode(_ge("f_div_corrections_map"),J);var J=YUtility.createNode("img","candy_map_type_hybrid");var L={position:"absolute",top:"25px",right:"31px",width:"62px",height:"20px"};YUtility.setStyle(J,L);J.src=_intl_images_root+"/candy_map_type_hybrid_default.png";YUtility.appendNode(_ge("f_div_corrections_map"),J);var J=YUtility.createNode("img","candy_map_type_sat");var L={position:"absolute",top:"46px",right:"31px",width:"62px",height:"20px"};YUtility.setStyle(J,L);J.src=_intl_images_root+"/candy_map_type_sat_default.png";YUtility.appendNode(_ge("f_div_corrections_map"),J);F.decorate(_ge("candy_map_type_map"),F._map_type_button).button_go_go_go("map");F.decorate(_ge("candy_map_type_hybrid"),F._map_type_button).button_go_go_go("hybrid");F.decorate(_ge("candy_map_type_sat"),F._map_type_button).button_go_go_go("sat");if(F.geoloc&&F.geoloc.can_locate()){var J=YUtility.createNode("img","candy_map_find_me");if(A){var L={position:"absolute",top:"4px",right:"95px",width:"127px",height:"20px",display:"block"}}else{var L={position:"absolute",top:"4px",right:"95px",width:"127px",height:"20px",display:"none"}}YUtility.setStyle(J,L);J.src=_intl_images_root+"/candy_find_me_default.png";YUtility.appendNode(_ge("f_div_corrections_map"),J);var J=YUtility.createNode("img","img_find_me_pulse");var L={position:"absolute",top:"11px",right:"152px",width:"12px",height:"6px",display:"none"};YUtility.setStyle(J,L);J.src=_images_root+"/progress/balls-12x6-trans.gif";YUtility.appendNode(_ge("f_div_corrections_map"),J);F.decorate(_ge("candy_map_find_me"),F._find_me_button).button_go_go_go(1)}this.map_position();F.osming.check_map(_ge("f_div_corrections_box_holder_border").map_box.ymap,"f_div_corrections_map");var K=YUtility.createNode("div","div_single_marker_holder");K.style.position="absolute";if(_has_geo&&!A){K.style.display="block";Y.U.Dom.setStyle("f_img_ch_white","display","none");Y.U.Dom.setStyle("f_img_ch_pink","display","none")}else{K.style.display="none"}var C=YUtility.createNode("div","div_single_marker");C.style.position="absolute";C.style.left=this.marker_offset.x+"px";C.style.top=this.marker_offset.y+"px";C.style.width="102px";C.style.height="140px";C.style.cursor="pointer";YUtility.appendNode(K,C);var H=YUtility.createNode("img","img_single_marker");H.style.position="absolute";H.style.left="0px";H.style.top="0px";H.style.width="102px";H.style.height="140px";H.src=_images_root+"/pop_up_pinwin_thinner.png";H.style.cursor="pointer";H.className="trans_png";YUtility.appendNode(C,H);var H=YUtility.createNode("img","img_single_marker_thumb");H.style.position="absolute";H.style.left="7px";H.style.top="7px";H.style.width="75px";H.style.height="75px";H.style.cursor="pointer";H.src=geo_thmb;YUtility.appendNode(C,H);if(_use_4real_location==""){var I=new YGeoPoint(this.ymap.getCenterLatLon().Lat,this.ymap.getCenterLatLon().Lon)}else{var I=new YGeoPoint(_use_4real_location.split("|")[0].split(",")[0],_use_4real_location.split("|")[0].split(",")[1])}if(I.Lat==0&&I.Lon==0){I.Lat=0.0001;I.Lon=-0}this.mo=new YCustomOverlay(I,K);this.ov=this.ymap.addOverlay(this.mo);if(_is_suggestion){var G=YUtility.createNode("div","f_div_splat_dot");var L={position:"relative",opacity:"0.85"};YUtility.setStyle(G,L);var B=YUtility.createNode("img","f_img_splat_dot");if(typeof (_suggestion_obj)=="object"&&_suggestion_obj!=null){var L={position:"absolute",top:"-16px",left:"-16px",width:"32px",height:"34px",display:"block"}}else{var L={position:"absolute",top:"-16px",left:"-16px",width:"32px",height:"34px",display:"none"}}YUtility.setStyle(B,L);B.src=_images_root+"/dot_splat.png";B.className="trans_png";YUtility.appendNode(G,B);if(typeof (_suggestion_obj)=="object"&&_suggestion_obj!=null){var E=new YCustomOverlay(new YGeoPoint(_suggestion_obj.latitude,_suggestion_obj.longitude),G)}else{var E=new YCustomOverlay(new YGeoPoint(0.0001,0),G)}var D=this.ymap.addOverlay(E);this.splat_dot=E}_ge("f_div_corrections_right_side").display_lat_lon(this.mo.YGeoPoint);_ge("f_div_corrections_box_holder_border").map_box.toggle_type();return }else{_ge("f_div_corrections_map").innerHTML="";this.show(A);return }}var M=document.createElement("script");M.src="http://l.yimg.com/a/lib/map/js/api/ymapapi_3_8_2_1.js";M.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(M);setTimeout("_ge('f_div_corrections_box_holder_border').map_box.check_for_map_existing("+A+")",100)},end_pan_delay:function(){if(_ge("f_div_corrections_box_holder_border").map_box.counter_id!=null){clearTimeout(_ge("f_div_corrections_box_holder_border").map_box.counter_id)}var A={flickr_people_geo_setLocation_onLoad:function(G,E,C,D){}};var B=new Object();B.lat=_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon().Lat;B.lon=_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon().Lon;B.accuracy=Math.min(16,Math.max(0,17-_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel()));B.context="last";F.API.callMethod("flickr.people.geo.setLocation",B,A,null,null,0)},get_center_point_label:function(){_ge("f_div_corrections_box_holder_border").map_box.label_counter++;var B=new Object();B.lat=_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon().Lat;B.lon=_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon().Lon;B.accuracy=Math.min(16,Math.max(0,17-_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel()));B.label_counter=_ge("f_div_corrections_box_holder_border").map_box.label_counter;var A={flickr_geocode_reverseGeocodePoint_onLoad:function(K,J,H,I){if(K){if(I.label_counter==_ge("f_div_corrections_box_holder_border").map_box.label_counter){var E=[];var G=J.documentElement.getElementsByTagName("location")[0].childNodes;for(var D=0;D<G.length;D++){if(G[D].nodeName!="#text"&&G[D].nodeName!="taken_in"){if(E.length==0||(E[0]!=G[D].firstChild.nodeValue)){E.push(G[D].firstChild.nodeValue)}if(E.length>=2){break}}}var C=E.join(", ");_taken_in_for_suggestion=C;_ge("f_div_corrections_drag_around").innerHTML=F.output.get("corrections_drag_around",C);if(_is_suggestion&&typeof (_suggestion_obj)=="object"&&_suggestion_obj!=null&&_populate_suggestion==true){_ge("f_div_corrections_psst").innerHTML=F.output.get("corrections_psst",C);Y.U.Dom.setStyle("f_div_corrections_psst","display","block");_populate_suggestion=false}if(_ge("f_div_corrections_box_holder_border").map_box.map_moved>=1){_ge("f_div_corrections_search_results_clicked").innerHTML=F.output.get("corrections_heres_a_place",C);_ge("div_corrections_search_no_results_display").innerHTML=F.output.get("corrections_drag_around",C)}}}else{_ge("f_div_corrections_drag_around").innerHTML=F.output.get("corrections_drag_around",F.output.get("a_place_with_no_name"))}}};if(Y.U.Dom.getStyle("f_div_crosshairs","display")=="block"){F.API.callMethod("flickr.geocode.reverseGeocodePoint",B,A,null,null,0)}},check_for_map_existing:function(A){if(typeof (YMap)=="function"){_ge("f_div_corrections_box_holder_border").map_box.show(A)}else{setTimeout("_ge('f_div_corrections_box_holder_border').map_box.check_for_map_existing("+A+")",100)}},jump_to_map:function(){window.location="/map?fLat="+this.ymap.getCenterLatLon().Lat+"&fLon="+this.ymap.getCenterLatLon().Lon+"&zl="+_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel()},correct_marker:function(){var A={};A.x=Y.U.Dom.getRegion("div_single_marker").left-Y.U.Dom.getRegion("f_div_corrections_map").left;A.y=Y.U.Dom.getRegion("div_single_marker").top-Y.U.Dom.getRegion("f_div_corrections_map").top;A.x-=this.marker_offset.x;A.y-=this.marker_offset.y;this.mo.setYGeoPoint(this.ymap.convertXYLatLon(new YCoordPoint(A.x,A.y)));_ge("f_div_corrections_right_side").display_lat_lon(this.mo.YGeoPoint);Y.U.Dom.setStyle("div_single_marker","left",this.marker_offset.x+"px");Y.U.Dom.setStyle("div_single_marker","top",this.marker_offset.y+"px")},center_marker:function(){var A={};A.x=_pi((Y.U.Dom.getRegion("f_div_corrections_map").right-Y.U.Dom.getRegion("f_div_corrections_map").left)/2);A.y=_pi((Y.U.Dom.getRegion("f_div_corrections_map").bottom-Y.U.Dom.getRegion("f_div_corrections_map").top)/2);this.mo.setYGeoPoint(this.ymap.convertXYLatLon(new YCoordPoint(A.x,A.y)));_ge("f_div_corrections_right_side").display_lat_lon(this.mo.YGeoPoint);Y.U.Dom.setStyle("div_single_marker","left",this.marker_offset.x+"px");Y.U.Dom.setStyle("div_single_marker","top",this.marker_offset.y+"px")},center_map_on_marker:function(){this.ymap.drawZoomAndCenter(this.mo.YGeoPoint,this.ymap.getZoomLevel())},center_marker_on_map:function(){this.center_marker()},hide_splat:function(){Y.U.Dom.setStyle("f_img_splat_dot","display","none")},set_splat:function(){this.splat_dot.setYGeoPoint(new YGeoPoint(_suggestion_obj.latitude,_suggestion_obj.longitude));Y.U.Dom.setStyle("f_img_splat_dot","display","block")},jump_to_last_saved_position:function(){if(_use_4real_location==""){var A=new YGeoPoint(0.0001,0);this.ymap.drawZoomAndCenter(A,16);this.mo.setYGeoPoint(A)}else{var A=new YGeoPoint(_use_4real_location.split("|")[0].split(",")[0],_use_4real_location.split("|")[0].split(",")[1]);this.ymap.drawZoomAndCenter(A,17-_use_4real_location.split("|")[0].split(",")[2]);this.mo.setYGeoPoint(A)}Y.U.Dom.setStyle("div_single_marker","left",this.marker_offset.x+"px");Y.U.Dom.setStyle("div_single_marker","top",this.marker_offset.y+"px");_ge("f_div_corrections_right_side").display_lat_lon(this.mo.YGeoPoint)},map_position:function(){if(_use_4real_location==""){var A=new YGeoPoint(0,0);this.ymap.drawZoomAndCenter(A,16)}else{var A=new YGeoPoint(_use_4real_location.split("|")[0].split(",")[0],_use_4real_location.split("|")[0].split(",")[1]);this.ymap.drawZoomAndCenter(A,17-_use_4real_location.split("|")[0].split(",")[2])}this.toggle_zoom()},jump_to_position:function(B){var C=[new YGeoPoint(B.bbox.split(",")[1],B.bbox.split(",")[0]),new YGeoPoint(B.bbox.split(",")[3],B.bbox.split(",")[2])];var A=this.ymap.getBestZoomAndCenter(C);this.ymap.drawZoomAndCenter(new YGeoPoint(B.lat,B.lon),A.zoomLevel)},jump_to_lat_lon:function(A,B){this.ymap.drawZoomAndCenter(new YGeoPoint(A,B),3)},jump_to_found_location:function(A){_ge("f_div_corrections_box_holder_border").map_box.ymap.drawZoomAndCenter(new YGeoPoint(A.latitude,A.longitude),A.accuracy);_ge("f_div_corrections_box_holder_border").map_box.ymap.Events.endPan.trigger();Y.U.Dom.setStyle("img_find_me_pulse","display","none");_ge("candy_map_find_me").button_enable()},jump_to_found_location_fail:function(A){alert(A);Y.U.Dom.setStyle("img_find_me_pulse","display","none");_ge("candy_map_find_me").button_enable()},set_map_type:function(B){if(B!=this.map_mode){this.map_mode=B;if(this.map_mode==this.const_map_map){this.ymap.setMapType(YAHOO_MAP_REG)}if(this.map_mode==this.const_map_hyb){this.ymap.setMapType(YAHOO_MAP_HYB)}if(this.map_mode==this.const_map_sat){this.ymap.setMapType(YAHOO_MAP_SAT)}var A={lat:_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon().Lat,lon:_ge("f_div_corrections_box_holder_border").map_box.ymap.getCenterLatLon().Lon};if(typeof (_use_osm)!="undefined"&&_use_osm==true&&_ge("f_div_corrections_box_holder_border").map_box.ymap.getCurrentMapType()=="YAHOO_MAP"&&_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel()<8&&A.lat>=39.8558502197&&A.lat<=40.0156097412&&A.lon>=116.2662734985&&A.lon<=116.4829177856){if(!_ge("f_div_corrections_box_holder_border").map_box.osming){_ge("f_div_corrections_box_holder_border").map_box.oldTileReg=YMapConfig.tileReg;YMapConfig.tileReg=["/map_openstreetmap_tile_broker.gne?t=m&","/map_openstreetmap_tile_broker.gne?t=m&"];_ge("f_div_corrections_box_holder_border").map_box.osming=true;if(_ge("f_div_osm_cc")){_ge("f_div_osm_cc").style.display="block"}setTimeout("_ge('f_div_corrections_box_holder_border').map_box.hide_copy()","100");_ge("f_div_corrections_box_holder_border").map_box.ymap._cleanTileCache();_ge("f_div_corrections_box_holder_border").map_box.ymap._callTiles()}setTimeout("_ge('f_div_corrections_box_holder_border').map_box.hide_copy()","100");setTimeout("_ge('f_div_corrections_box_holder_border').map_box.hide_copy()","800")}else{if(_ge("f_div_corrections_box_holder_border").map_box.osming==true){YMapConfig.tileReg=_ge("f_div_corrections_box_holder_border").map_box.oldTileReg;_ge("f_div_corrections_box_holder_border").map_box.osming=false;if(_ge("f_div_osm_cc")){_ge("f_div_osm_cc").style.display="none"}setTimeout("_ge('f_div_corrections_box_holder_border').map_box.show_copy()","100");setTimeout("_ge('f_div_corrections_box_holder_border').map_box.show_copy()","800");_ge("f_div_corrections_box_holder_border").map_box.ymap._cleanTileCache();_ge("f_div_corrections_box_holder_border").map_box.ymap._callTiles()}}}},toggle_type:function(){if(this.map_mode==this.const_map_map){_ge("candy_map_type_map").button_disable()}else{_ge("candy_map_type_map").button_enable()}if(this.map_mode==this.const_map_hyb){_ge("candy_map_type_hybrid").button_disable()}else{_ge("candy_map_type_hybrid").button_enable()}if(this.map_mode==this.const_map_sat){_ge("candy_map_type_sat").button_disable()}else{_ge("candy_map_type_sat").button_enable()}},toggle_zoom:function(){if(this.ymap.getZoomLevel()&&_ge("candy_map_dragger")){_ge("candy_map_dragger").style.top=20+((17-this.ymap.getZoomLevel())*7)+"px"}if(_has_geo&&!_is_editing_geo){var B=_pi(_use_4real_location.split(",")[2]);var A=Math.min(16,Math.max(0,17-_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel()));if(B+2<A){Y.U.Dom.setStyle("div_single_marker_holder","display","none")}else{Y.U.Dom.setStyle("div_single_marker_holder","display","block")}}_ge("f_div_corrections_box_holder_border").map_box.drag_around_timer_id=setTimeout("_ge('f_div_corrections_box_holder_border').map_box.get_center_point_label()",333);if(_save_position){_ge("f_div_corrections_box_holder_border").map_box.counter_id=setTimeout("_ge('f_div_corrections_box_holder_border').map_box.end_pan_delay()",1000)}},map_dragger_mouseDown:function(A){Y.U.Event.stopEvent(A);this._new_zoom_level=_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel();this._startDragY=Y.U.Event.getPageY(A)-_pi(_ge("candy_map_dragger").style.top);Y.U.Event.addListener(document,"mouseup",this.map_dragger_mouseUp,this,true);Y.U.Event.addListener(document,"mousemove",this.map_dragger_mouseMove,this,true)},map_dragger_mouseUp:function(A){Y.U.Event.stopEvent(A);Y.U.Event.removeListener(document,"mouseup",this.map_dragger_mouseUp);Y.U.Event.removeListener(document,"mousemove",this.map_dragger_mouseMove);_ge("f_div_corrections_box_holder_border").map_box.ymap.setZoomLevel(this._new_zoom_level)},map_dragger_mouseMove:function(A){var B=(Y.U.Event.getPageY(A)-this._startDragY);this._new_zoom_level=17-(_pi(B/7)-3);if(this._new_zoom_level<1){this._new_zoom_level=1}if(this._new_zoom_level>17){this._new_zoom_level=17}_ge("candy_map_dragger").style.top=((17-this._new_zoom_level)*7)+20+"px"}}};F._map_zoom_button={_decotype:F._simple_button,button_go_go_go:function(A){this.direction=A;F._map_zoom_button._decotype.button_go_go_go.apply(this)},onclick:function(B){var A=_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel();if(this.direction=="in"){A--}if(this.direction=="out"){A++}if(A<1){A=1}if(A>17){A=17}_ge("f_div_corrections_box_holder_border").map_box.ymap.setZoomLevel(A);F.stop_event_propagation(B)},ondblclick:function(A){F.stop_event_propagation(A)}};F._map_type_button={_decotype:F._simple_button,button_go_go_go:function(A){this.type=A;F._map_type_button._decotype.button_go_go_go.apply(this,[1])},onclick:function(A){F.stop_event_propagation(A);if(this.type=="map"){_ge("f_div_corrections_box_holder_border").map_box.set_map_type(_ge("f_div_corrections_box_holder_border").map_box.const_map_map)}if(this.type=="hybrid"){_ge("f_div_corrections_box_holder_border").map_box.set_map_type(_ge("f_div_corrections_box_holder_border").map_box.const_map_hyb)}if(this.type=="sat"){_ge("f_div_corrections_box_holder_border").map_box.set_map_type(_ge("f_div_corrections_box_holder_border").map_box.const_map_sat)}_ge("f_div_corrections_box_holder_border").map_box.toggle_type()},ondblclick:function(A){F.stop_event_propagation(A)}};F._map_crosshairs_button={_decotype:F._simple_button,button_go_go_go:function(){F._map_type_button._decotype.button_go_go_go.apply(this,[0])},onclick:function(A){F.stop_event_propagation(A)},ondblclick:function(B){F.stop_event_propagation(B);var A=_ge("f_div_corrections_box_holder_border").map_box.ymap.getZoomLevel()-1;if(A<1){A=1}_ge("f_div_corrections_box_holder_border").map_box.ymap.setZoomLevel(A);_ge("f_div_corrections_box_holder_border").map_box.toggle_zoom()}};F._find_me_button={_decotype:F._simple_button,button_go_go_go:function(A){F._find_me_button._decotype.button_go_go_go.apply(this,[A])},onclick:function(A){F.stop_event_propagation(A);this.button_disable();Y.U.Dom.setStyle("img_find_me_pulse","display","block");F.geoloc.get_location(_ge("f_div_corrections_box_holder_border").map_box.jump_to_found_location,_ge("f_div_corrections_box_holder_border").map_box.jump_to_found_location_fail)},ondblclick:function(A){F.stop_event_propagation(A)}};F.PhotoPicker=function(){var B=this;var A=null;this.selectedPhotos=[];this.selectedPhotosHash=[];this.addedAPIResponses=[];this.oPhotosFound=null;this.pendingRequest=false;this.apiData={currentPage:1,pages:0,lastCallParams:{page:0}};this.parseCollection=function(G){var N=G.documentElement.getElementsByTagName("photo");if(N.length==0){return }else{var H=G.documentElement.getElementsByTagName("photos")[0];if(!H){H=G.documentElement.getElementsByTagName("photoset")[0]}B.apiData.currentPage=parseInt(H.getAttribute("page"));B.apiData.pages=parseInt(H.getAttribute("pages"));var C=[];var I,K,L,D,E,J,O;for(var M=0;M<N.length;M++){I=N[M].getAttribute("id");K=N[M].getAttribute("secret");L=N[M].getAttribute("server");E=N[M].getAttribute("farm");J=N[M].getAttribute("media");O=N[M].getAttribute("ispublic");D=_photo_root.replace("farm","farm"+E)+L+"/"+I+"_"+K+"_s.jpg";C.push({id:I,src:D,media:J,ispublic:O});global_photos[I]=N[M]}}return C};this.photoItem=document.createElement("li");this.photoItem.appendChild(document.createElement("img"));this.photoItem.getElementsByTagName("img")[0].src=_images_root+"/spaceball.gif";this.photoItem.getElementsByTagName("img")[0].className="pp_thumb_geo";this.photoItem.appendChild(document.createElement("span"));this.photoItem.getElementsByTagName("span")[0].className="pp_close_geo";this.photoItem.appendChild(document.createElement("span"));this.photoItem.getElementsByTagName("span")[1].className="pp_status_geo";this.photoItem.appendChild(document.createElement("img"));this.photoItem.getElementsByTagName("img")[1].src=_images_root+"/video_play_icon_small.png.v1";this.photoItem.getElementsByTagName("img")[1].className="pp_video_geo trans_png";this.cloneItem=function(){return B.photoItem.cloneNode(true)};this.call_API=function(E,C){var D={flickr_photos_geo_photosForLocation_onLoad:function(K,J,H,I){if(K){_pp_geo.setLoading(false);_pp_geo.pendingRequest=false;if(!K){alert("there was an error: "+H);return }var G=_pp_geo.parseCollection(J);_pp_geo.makePhotosList(G)}}};_pp_geo.pendingRequest=true;F.API.callMethod("flickr.photos.geo.photosForLocation",{lat:E.lat,lon:E.lon,accuracy:E.acc,page:E.page,per_page:E.per_page},D,null,null,0)};this.makePhotosList=function(E){var H=_ge("pp-source_geo");if(E&&E.length){var D=document.createElement("ul");D.className="pp-list_geo";var K=null;var I=null;var C=null;for(var G=0;G<E.length;G++){K=B.cloneItem();K.style.width="60px";K.style.height="60px";I=K.getElementsByTagName("img")[0];I.id="source_"+E[G].id;I.src=E[G].src;I.style.width="60px";I.style.height="60px";if(E[G].id!=page_photo_id){D.appendChild(K)}}H.appendChild(D);var J=H.scrollHeight-H.offsetHeight;if(H.scrollHeight&&H.scrollTop>=J){H.scrollTop=J-1}}};this.setLoading=function(C,E){var D=_ge("pp-source_geo");var G=_ge("pp-loading_geo");if(E){D.innerHTML=""}if(C){Y.D.addClass(_ge("pp_geo"),"pp-cursor-loading_geo")}else{Y.D.removeClass(_ge("pp_geo"),"pp-cursor-loading_geo")}document.body.style.cursor=(C?"wait":"auto");G.className=(C?"active":"")};this.getNextPage=function(){this.setLoading(true);this.pendingRequest=true;this.apiData.lastCallParams.page=this.apiData.currentPage;this.call_API(this.apiData.lastCallParams)};this.didScroll=function(){if(this.scrollHeight&&this.scrollTop>=this.scrollHeight-this.offsetHeight-2){B.scrolledToBottom()}};this.scrolledToBottom=function(){if(!this.pendingRequest&&this.apiData.currentPage<this.apiData.pages){this.apiData.currentPage++;this.getNextPage()}};this.isSelected=function(C){return(typeof B.selectedPhotosHash[C]!="undefined")};this.sourceClick=function(H){var I=(H?H.target||H.srcElement:event.srcElement);if(I.nodeName.toLowerCase()!=""){var C=F.find_parent_node_by_name(I,"li")}if(!Y.D.hasClass(C,"pp_type_photo_geo")&&!Y.D.hasClass(C,"pp_type_video_geo")){return false}var D=(I.nodeName.toLowerCase()=="li"?I:F.find_parent_node_by_name(I,"li"));I=Y.D.getElementsByClassName("pp_thumb_geo","img",D)[0];var E=null;var J=I.nodeName.toLowerCase();if(J=="img"&&Y.D.hasClass(I,"pp_thumb_geo")){E=I.id}else{return true}if(B.resetMode){B.removeSelectedItems()}var G=E.replace("source","target");var D=_ge(G);if(D){B.removeItem(E,G)}else{B.addItem(F.find_parent_node(_ge(E)))}B.setResetMode(false)};this.resetMode=false;this.attachEvents=function(){Y.E.addListener(_ge("pp-source_geo"),"scroll",_pp_geo.didScroll)};this.init=function(){B.attachEvents()}};F.geoloc={location_method:"",loki:null,gears:null,callback_func_win:null,callback_func_fail:null,gears_override:false,kittens:true,snag:2,can_locate:function(){if(typeof (google)=="object"&&google.gears&&google.gears.factory&&google.gears.factory.create){this.gears=google.gears.factory.create("beta.geolocation");}if(typeof (navigator)=="object"&&navigator.geolocation){this.location_method="geode";return true;}if(typeof (LokiAPI)=="function"&&LokiAPI.isInstalled()){this.location_method="loki";this.loki=new LokiAPI();this.loki.setKey("flickr.com");this.loki.onSuccess=F.geoloc.got_location;this.loki.onFailure=F.geoloc.fail_location;return true;}if(typeof (google)=="object"&&google.gears&&google.gears.factory&&google.gears.factory.create){this.location_method="gears";return true;}},get_location:function(B,A){this.callback_func_win=B;this.callback_func_fail=A;if(this.location_method=="loki"){this.loki.requestLocation(true,this.loki.NO_STREET_ADDRESS_LOOKUP);}if(this.location_method=="geode"){navigator.geolocation.getCurrentPosition(F.geoloc.got_location,F.geoloc.fail_location);}if(this.location_method=="gears"){this.gears.getCurrentPosition(F.geoloc.got_location,F.geoloc.fail_location);}},get_location_delay:function(){F.geoloc.gears_override=true;F.geoloc.gears.getCurrentPosition(F.geoloc.got_location,F.geoloc.fail_location);},got_location:function(A){var C={};if(F.geoloc.location_method=="geode"&&!F.geoloc.gears_override){if(A.coords&&A.coords.latitude&&A.coords.longitude){C.latitude=A.coords.latitude;C.longitude=A.coords.longitude;if(A.coords.accuracy){C.accuracy=A.coords.accuracy;}}else{C.latitude=A.latitude;C.longitude=A.longitude;}if(!C.accuracy){C.accuracy=1;}if(A.accuracy>6&&A.accuracy<=200){C.accuracy=3;}if(A.accuracy>200){C.accuracy=6;}}if(F.geoloc.location_method=="loki"&&!F.geoloc.gears_override){C.latitude=A.latitude;C.longitude=A.longitude;var B=A.accuracy-20;if(B<0){B=0;}B=Math.floor(B/20);if(B>16){B=16;}C.accuracy=B;}if(F.geoloc.location_method=="gears"||F.geoloc.gears_override){F.geoloc.gears_override=false;C.latitude=A.latitude;C.longitude=A.longitude;C.accuracy=1;}F.geoloc.callback_func_win(C);},fail_location:function(B){var A="unknown error";if(F.geoloc.location_method=="geode"){if(F.geoloc.gears!=null){setTimeout("F.geoloc.get_location_delay()",100);return ;}if(B.code==1){A="Scanner not found";}if(B.code==2){A="Wi-Fi not available";}if(B.code==3){A="No Wi-Fi in range";}if(B.code==5){A="Location server unavailable";}if(B.code==6){A="Location cannot be determined";}}if(F.geoloc.location_method=="loki"){if(F.geoloc.gears!=null){setTimeout("F.geoloc.get_location_delay()",100);return ;}if(B==1){A="Scanner not found";}if(B==2){A="Wi-Fi not available";}if(B==3){A="No Wi-Fi in range";}if(B==5){A="Location server unavailable";}if(B==6){A="Location cannot be determined";}}if(F.geoloc.location_method=="gears"){A=B.message;}F.geoloc.callback_func_fail(A);}};LokiPlugin.availableVersion="2.7.2.18";LokiPlugin.scriptRevision="2";function LokiAPI(){return Try.these(function(){return new LokiPlugin();},function(){return new LokiNull();})||false;}LokiAPI.isInstalled=function(){return LokiPlugin.isInstalled(true);};function LokiPlugin(){if(LokiPlugin.timer){clearTimeout(LokiPlugin.timer);}LokiPlugin.attemptedInstall=false;LokiPlugin.installFailed=false;LokiPlugin.upgradeStarted=false;LokiPlugin.activex=null;if(LokiPlugin.isInstalled(false)){LokiPlugin.initPlugin();}else{this.tryToInstallPlugin();}}LokiPlugin.isInstalled=function(A){switch(BrowserDetect.browser){case"Explorer":return LokiPlugin.isInstalled_IE(A);case"Firefox":try{var B=new Loki();if(B){LokiPlugin.xpcom=B;return true;}}catch(C){}case"Opera":case"Safari":return LokiPlugin.isInstalled_NPAPI(A);default:return false;}};LokiPlugin.initPlugin=function(){if(LokiPlugin.xpcom!=null){return ;}switch(BrowserDetect.browser){case"Explorer":LokiPlugin.init_IE();break;case"Firefox":case"Opera":case"Safari":LokiPlugin.init_NPAPI();break;}};LokiPlugin.checkDeprecatedVersion=function(A){if(LokiPlugin.upgradeCompletedSuccessfull){return false;}if(!LokiPlugin.upgradeCancelled&&(this.checkVersionOnServer(A)>0)){if(LokiPlugin.upgradeStarted){return true;}LokiPlugin.upgradeStarted=true;if(confirm("Newer version of Loki Plugin available. Do you wish to install it?")){return true;}else{LokiPlugin.upgradeCancelled=true;}}return false;};LokiPlugin.checkVersionOnServer=function(A){if(A==undefined||A.indexOf("v.")==-1){return true;}actualVersion=A.substring(A.indexOf("v.")+2);if(compareVersions(LokiPlugin.availableVersion,actualVersion)>0){return true;}return false;};LokiPlugin.prototype.browserSupported=function(){if((BrowserDetect.OS!="Windows"&&BrowserDetect.OS!="Mac"&&BrowserDetect.OS!="Linux")||(BrowserDetect.browser!="Explorer"&&BrowserDetect.browser!="Firefox"&&BrowserDetect.browser!="Safari"&&BrowserDetect.browser!="Opera")){return false;}return true;};LokiPlugin.prototype.requestLocation=function(C,B,A){this.requestLocationBy(false,C,B,A);};LokiPlugin.prototype.requestIPLocation=function(C,B,A){this.requestLocationBy(true,C,B,A);};LokiPlugin.prototype.requestLocationBy=function(E,D,C,A){if(!this.browserSupported()){if(this.onFailure){this.onFailureProxy(LokiPlugin.returnCodes.WPS_ERROR_PLUGIN_BROWSER_NOT_SUPPORTED);}return ;}if(A==undefined){A=0;}if(D==undefined){D=false;}if(C==undefined){C=this.NO_STREET_ADDRESS_LOOKUP;}if(A>=600||this.installFailed){return ;}if(LokiPlugin.activex==null&&(LokiPlugin.plugin==undefined||LokiPlugin.plugin.asynchronousRequestLocation==undefined)&&LokiPlugin.xpcom==null){if(LokiPlugin.isInstalled(false)){LokiPlugin.initPlugin();A++;}else{if(this.attemptedInstall){A++;}}var B=this;if(LokiPlugin.timer){clearTimeout(LokiPlugin.timer);}LokiPlugin.timer=setTimeout(function(){B.requestLocationBy(E,D,C,A);},300);return ;}if(true==LokiPlugin.waitingRet){return ;}LokiPlugin.waitingRet=true;if(LokiPlugin.xpcom!=null){this.runRequestLocation_XPCOM(E,D,C);}else{if(BrowserDetect.browser=="Explorer"){this.runRequestLocation_IE(E,D,C);}else{this.runRequestLocation_NPAPI(E,D,C);}}};LokiPlugin.prototype.onFailureProxy=function(A){LokiPlugin.waitingRet=false;if(this.onFailure!=undefined){this.onFailure(A,LokiPlugin.returnMessages[A]);}else{if(LokiPlugin.lastOnFailure!=undefined){LokiPlugin.lastOnFailure(A,LokiPlugin.returnMessages[A]);}}};LokiPlugin.prototype.onSuccessProxy=function(A){LokiPlugin.waitingRet=false;if(this.onSuccess!=undefined){this.onSuccess(A);}else{if(LokiPlugin.lastOnSuccess!=undefined){LokiPlugin.lastOnSuccess(A);}}};LokiPlugin.isInstalled_IE=function(B){if(LokiPlugin.toolbarDetected){return true;}var A;if(LokiPlugin.activex!=null){A=LokiPlugin.activex;}else{try{A=new ActiveXObject("Loki.LocationFinder.1");}catch(C){return false;}if(!A){return false;}}if(!B&&this.checkDeprecatedVersion(A.description)){return false;}LokiAPI.pluginDescription=A.description;return true;};LokiPlugin.init_IE=function(){LokiPlugin.activex=new ActiveXObject("Loki.LocationFinder.1");};LokiPlugin.prototype.runRequestLocation_XPCOM=function(D,B,A){if(D){this.onFailureProxy(LokiPlugin.returnCodes.WPS_ERROR_FEATURE_NOT_SUPPORTED);return ;}LokiPlugin.xpcom.onSuccess=this.onSuccessProxy;LokiPlugin.xpcom.onFailure=this.onFailureProxy;LokiPlugin.lastOnFailure=this.onFailure;LokiPlugin.lastOnSuccess=this.onSuccess;LokiPlugin.xpcom.setKey(this.key);try{LokiPlugin.xpcom.requestLocation(B,A);}catch(C){this.onFailureProxy(LokiPlugin.returnCodes.WPS_ERROR_FEATURE_NOT_SUPPORTED);}};LokiPlugin.prototype.runRequestLocation_IE=function(D,B,A){LokiPlugin.activex.onSuccess=this.onSuccessProxy;LokiPlugin.activex.onFailure=this.onFailureProxy;LokiPlugin.lastOnFailure=this.onFailure;LokiPlugin.lastOnSuccess=this.onSuccess;LokiPlugin.activex.setKey(this.key);try{if(D){LokiPlugin.activex.requestIPLocation(B,A);}else{LokiPlugin.activex.requestLocation(B,A);}}catch(C){this.onFailureProxy(LokiPlugin.returnCodes.WPS_ERROR_FEATURE_NOT_SUPPORTED);}};LokiPlugin.isInstalled_NPAPI=function(A){var C=-1;navigator.plugins.refresh(false);for(var B=0;B<navigator.plugins.length;++B){if(navigator.plugins[B]==undefined){continue;}if(navigator.plugins[B].name=="Loki Plugin"){if(!A&&this.checkDeprecatedVersion(navigator.plugins[B].description)){return false;}LokiAPI.pluginDescription=navigator.plugins[B].description;return true;}if(navigator.plugins[B].name=="FindMe Plugin"||navigator.plugins[B].name=="Find Me Plugin"){C=B;}}if(-1!=C){if(!A&&this.checkDeprecatedVersion(navigator.plugins[C].description)){return false;}LokiAPI.pluginDescription=navigator.plugins[B].description;return true;}return false;};LokiPlugin.init_NPAPI=function(){if(!LokiPlugin.isRunning){var C={id:"__lokiPlugin",width:"1",height:"1",type:"application/x-loki"};var B=document.createElement("object");for(var A in C){B.setAttribute(A,C[A]);}document.getElementsByTagName("body").item(0).appendChild(B);LokiPlugin.plugin=B;LokiPlugin.isRunning=true;}};LokiPlugin.prototype.runRequestLocation_NPAPI=function(D,C,B){var A=this;setTimeout(function(){A.runRequestLocation_NPAPI_async(D,C,B);},100);};LokiPlugin.prototype.runRequestLocation_NPAPI_async=function(D,C,B){var A=this;if(D){LokiPlugin.plugin.asynchronousRequestIPLocation(this.key,C,B);}else{LokiPlugin.plugin.asynchronousRequestLocation(this.key,C,B);}setTimeout(function(){A.tickNpapiXHR();},100);};LokiPlugin.prototype.tickNpapiXHR=function(){var A=LokiPlugin.plugin.tickRunHttpRequest();if(!A||A.returnCode==undefined){var B=this;setTimeout(function(){B.tickNpapiXHR();},50);return ;}if(A.returnCode!=LokiPlugin.returnCodes.WPS_OK){this.onFailureProxy(A.returnCode);return ;}this.onSuccessProxy(A);};LokiPlugin.prototype.setKey=function(A){if(A==undefined||A==null){this.key="";}else{this.key=A;}};LokiPlugin.prototype.tryToInstallPlugin=function(){if(this.attemptedInstall){return ;}this.attemptedInstall=true;if(BrowserDetect.javaAvail){if(LokiAPI_PreloadNullapplet&&!LokiPlugin.isInstalled(true)){if(BrowserDetect.javaWaitingConfirmation&&(BrowserDetect.browser=="Explorer"||(BrowserDetect.browser=="Safari"&&BrowserDetect.OS=="Windows")||(BrowserDetect.browser=="Firefox"&&LokiPlugin.javaPluginDescription.indexOf("1.4.")!=-1))){var A=(new Date()).getTime()-BrowserDetect.javaWaitingConfirmationSince;if(A<LokiPlugin.fallbackToNativeTimeout){LokiPlugin.nullappletShouldRunInstaller=true;setTimeout(fallbackToNativeInstaller,LokiPlugin.fallbackToNativeTimeout-A);}else{fallbackToNativeInstaller();}}else{LokiPlugin.startInstallApplet();}}else{if(BrowserDetect.browser=="Explorer"||(BrowserDetect.browser=="Safari"&&BrowserDetect.OS=="Windows")||(BrowserDetect.browser=="Firefox"&&LokiPlugin.javaPluginDescription.indexOf("1.4.")!=-1)){LokiPlugin.nullappletShouldRunInstaller=true;LokiPlugin.runNullapplet();setTimeout(fallbackToNativeInstaller,LokiPlugin.fallbackToNativeTimeout);}else{LokiPlugin.startInstallApplet();}}}else{LokiPlugin.downloadNativeInstaller();}};LokiPlugin.downloadNativeInstaller=function(){switch(BrowserDetect.OS){case"Windows":if(BrowserDetect.browser=="Explorer"){if(window.XMLHttpRequest){document.location.href=LokiPlugin.globalURLPrefix+"loki_activex.exe";}else{window.open(LokiPlugin.globalURLPrefix+"loki_activex.exe","download");}}else{document.location.href=LokiPlugin.globalURLPrefix+"loki_setup.exe";}break;case"Mac":document.location.href=LokiPlugin.globalURLPrefix+"LokiPlugin.zip";break;case"Linux":document.location.href=LokiPlugin.globalURLPrefix+"LokiPlugin_Installer.sh";break;}};function appletInstallationSuccessfull(){LokiPlugin.upgradeCompletedSuccessfull=true;}function fallbackToNativeInstaller(){if(BrowserDetect.javaWaitingConfirmation){BrowserDetect.javaAvail=false;LokiPlugin.nullappletShouldRunInstaller=false;LokiPlugin.downloadNativeInstaller();}}function appletInstallationFailed(){LokiPlugin.downloadNativeInstaller();}LokiPlugin.startInstallApplet=function(){var B=document.createElement("div");var C=LokiPlugin.useGlobalURLs?'<PARAM NAME="archive" VALUE="'+LokiPlugin.globalURLPrefix+'LokiApplet.jar"/>':"";document.getElementsByTagName("body").item(0).appendChild(B);var A=LokiPlugin.useGlobalURLs?'<PARAM NAME="globalUrlPrexif" VALUE="'+LokiPlugin.globalURLPrefix+'">':"";if(BrowserDetect.browser=="Explorer"){B.innerHTML='<OBJECT id="LokiApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="0" HEIGHT="0">'+C+'<PARAM NAME="CODE" VALUE="LokiApplet.class"/>'+A+'<PARAM NAME="scriptable" VALUE="true"/></OBJECT>';}else{B.innerHTML='<object classid="java:LokiApplet.class" type="application/x-java-applet" code="LokiApplet.class" archive="'+LokiPlugin.globalURLPrefix+'LokiApplet.jar" width=0 height=0><PARAM NAME="MAYSCRIPT" VALUE="true">'+A+"</object>";}};LokiPlugin.prototype.tryToInstallExtension=function(){var A=this;var B=function(E,D){A.attemptedInstall=true;if(D==0){A.init();}else{A.installFailed=true;}};var C=function(D){var E=InstallTrigger.install({"Loki Plugin":{URL:LokiPlugin.globalURLPrefix+"loki_plugin.xpi",IconURL:"Loki_B.png"}},B);if(!E){throw"LokiPlugin: failed to prompt user to install plugin.";}};C();return ;};function IsLokiToolbarInstalled(){try{if(Try.these(function(){return new ActiveXObject("Loki.LokiButton.1");})||false){return true;}return false;}catch(A){return false;}}function LokiNull(){}LokiNull.prototype.setKey=function(){};LokiNull.prototype.isInstalled=function(){return false;};LokiNull.prototype.requestLocation=function(){if(this.onFailure!=undefined){this.onFailureProxy(LokiPlugin.returnCodes.WPS_ERROR_PLUGIN_COULD_NOT_BE_INSTALLED);}};LokiNull.prototype.requestIPLocation=function(){if(this.onFailure!=undefined){this.onFailureProxy(LokiPlugin.returnCodes.WPS_ERROR_PLUGIN_COULD_NOT_BE_INSTALLED);}};var Try={these:function(){var C;for(var B=0;B<arguments.length;B++){var A=arguments[B];try{C=A();break;}catch(D){}}return C;}};function compareVersions(A,B){versions1=A.split(".");versions2=B.split(".");for(i=0;i<versions1.length&&i<versions2.length;i++){if(parseInt(versions1[i])>parseInt(versions2[i])){return i+1;}if(parseInt(versions1[i])<parseInt(versions2[i])){return -(i+1);}}return 0;}var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"Unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"Unknown version";this.OS=this.searchString(this.dataOS)||"Unknown OS";if(this.browser=="Explorer"){this.javaAvail=true;}else{if(this.browser=="Firefox"&&this.version==3){this.javaAvail=this.findJava();}else{if(this.browser=="Opera"){this.javaAvail=navigator.javaEnabled();}else{this.javaAvail=this.findJava()&&navigator.javaEnabled();}}}this.javaWaitingConfirmation=true;this.javaWaitingConfirmationSince=(new Date()).getTime();},findJava:function(){if(!navigator||!navigator.plugins){return true;}navigator.plugins.refresh(false);for(var A=0;A<navigator.plugins.length;++A){if(navigator.plugins[A]==undefined){continue;}if(navigator.plugins[A].name.indexOf("Java")!=-1){LokiPlugin.javaPluginDescription=navigator.plugins[A].description;return true;}}return false;},searchString:function(D){for(var A=0;A<D.length;A++){var B=D[A].string;var C=D[A].prop;this.versionSearchString=D[A].versionSearch||D[A].identity;if(B){if(B.indexOf(D[A].subString)!=-1){return D[A].identity;}}else{if(C){return D[A].identity;}}}},searchVersion:function(B){var A=B.indexOf(this.versionSearchString);if(A==-1){return ;}return parseFloat(B.substring(A+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};LokiPlugin.javaPluginDescription="";BrowserDetect.init();LokiPlugin.prototype.key="beta";LokiPlugin.prototype.NO_STREET_ADDRESS_LOOKUP=0;LokiPlugin.prototype.LIMITED_STREET_ADDRESS_LOOKUP=1;LokiPlugin.prototype.FULL_STREET_ADDRESS_LOOKUP=2;LokiPlugin.returnCodes=new Object();LokiPlugin.returnCodes.WPS_OK=0;LokiPlugin.returnCodes.WPS_ERROR_SCANNER_NOT_FOUND=1;LokiPlugin.returnCodes.WPS_ERROR_WIFI_NOT_AVAILABLE=2;LokiPlugin.returnCodes.WPS_ERROR_NO_WIFI_IN_RANGE=3;LokiPlugin.returnCodes.WPS_ERROR_UNAUTHORIZED=4;LokiPlugin.returnCodes.WPS_ERROR_SERVER_UNAVAILABLE=5;LokiPlugin.returnCodes.WPS_ERROR_LOCATION_CANNOT_BE_DETERMINED=6;LokiPlugin.returnCodes.WPS_ERROR_PROXY_UNAUTHORIZED=7;LokiPlugin.returnCodes.WPS_ERROR_FILE_IO=8;LokiPlugin.returnCodes.WPS_ERROR_INVALID_FILE_FORMAT=9;LokiPlugin.returnCodes.WPS_ERROR_PLUGIN_COULD_NOT_BE_INSTALLED=1000;LokiPlugin.returnCodes.WPS_ERROR_PERMISSION_DENIED=1001;LokiPlugin.returnCodes.WPS_ERROR_PLUGIN_BROWSER_NOT_SUPPORTED=1002;LokiPlugin.returnCodes.WPS_ERROR_FEATURE_NOT_SUPPORTED=1003;LokiPlugin.returnMessages=new Object();LokiPlugin.returnMessages[0]="Successfull";LokiPlugin.returnMessages[1]="Wi-Fi Scanner was not found";LokiPlugin.returnMessages[2]="Wi-Fi is not available";LokiPlugin.returnMessages[3]="No Wi-Fi access points are in range";LokiPlugin.returnMessages[4]="Invalid application key, please contact the site owner";LokiPlugin.returnMessages[5]="Location server unavailable";LokiPlugin.returnMessages[6]="No Wi-Fi access points were recognized";LokiPlugin.returnMessages[7]="Proxy error";LokiPlugin.returnMessages[8]="A file I/O error was encountered";LokiPlugin.returnMessages[9]="Invalid file format";LokiPlugin.returnMessages[1000]="Plugin could not be installed";LokiPlugin.returnMessages[1001]="Permission denied";LokiPlugin.returnMessages[1002]="Browser is not supported";LokiPlugin.returnMessages[1003]="Feature is not supported by installed version of plugin";LokiPlugin.fallbackToNativeTimeout=10000;LokiPlugin.xpcom=null;LokiPlugin.activex=null;LokiPlugin.isRunning=false;LokiPlugin.timer=0;LokiPlugin.attemptedInstall=false;LokiPlugin.installFailed=false;LokiPlugin.upgradeCancelled=false;LokiPlugin.upgradeStarted=false;LokiPlugin.upgradeCompletedSuccessfull=false;LokiPlugin.nullappletShouldRunInstaller=false;LokiPlugin.waitingRet=false;var LokiAPI_PreloadNullapplet;var LokiAPI_FilesLocation;if(LokiAPI_FilesLocation==undefined){LokiAPI_FilesLocation="http://loki.com/plugin/files/";}if(LokiAPI_PreloadNullapplet==undefined){LokiAPI_PreloadNullapplet=false;}LokiPlugin.toolbarDetected=IsLokiToolbarInstalled();LokiPlugin.useGlobalURLs=(LokiAPI_FilesLocation!=undefined&&LokiAPI_FilesLocation!="");LokiPlugin.globalURLPrefix=LokiPlugin.useGlobalURLs?LokiAPI_FilesLocation:"";if(BrowserDetect.javaAvail&&!LokiPlugin.isInstalled(true)){if(LokiAPI_PreloadNullapplet){setTimeout(function(){LokiPlugin.runNullapplet();},200);}}LokiPlugin.runNullapplet=function(){var C=LokiPlugin.useGlobalURLs?'codebase="'+LokiPlugin.globalURLPrefix+'"':"";var B=LokiPlugin.useGlobalURLs?'<PARAM NAME="CODEBASE" VALUE="'+LokiPlugin.globalURLPrefix+'"/>':"";var A=document.createElement("div");document.getElementsByTagName("body").item(0).appendChild(A);if(!LokiAPI_PreloadNullapplet){LokiPlugin.nullappletShouldRunInstaller=true;}BrowserDetect.javaWaitingConfirmationSince=(new Date()).getTime();if(BrowserDetect.browser=="Safari"){A.innerHTML='<object type="application/x-java-applet" code="nullapplet.class" '+C+' width=0 height=0><PARAM NAME="MAYSCRIPT" VALUE="true"><param name="JAVA_CODEBASE" value="'+LokiPlugin.globalURLPrefix+'"></object>';}else{if(BrowserDetect.browser=="Explorer"){A.innerHTML='<OBJECT id="nullapplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="0" HEIGHT="0">'+B+'<PARAM NAME="CODE" VALUE="nullapplet.class"/><PARAM NAME="scriptable" VALUE="true"/></OBJECT>';}else{A.innerHTML='<applet name="nullapplet" id="nullapplet" '+C+' code="nullapplet.class" width="0" height="0" mayscript=true><param name="mayscript" value="true"></applet>';}}};function confirmJavaOK(){BrowserDetect.javaWaitingConfirmation=false;if(LokiPlugin.nullappletShouldRunInstaller){LokiPlugin.nullappletShouldRunInstaller=false;LokiPlugin.startInstallApplet();}}(function(){if(window.google&&google.gears){return ;}var A=null;if(typeof GearsFactory!="undefined"){A=new GearsFactory();}else{try{A=new ActiveXObject("Gears.Factory");if(A.getBuildInfo().indexOf("ie_mobile")!=-1){A.privateSetGlobalObject(this);}}catch(B){if((typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes["application/x-googlegears"]){A=document.createElement("object");A.style.display="none";A.width=0;A.height=0;A.type="application/x-googlegears";document.documentElement.appendChild(A);}}}if(!A){return ;}if(!window.google){google={};}if(!google.gears){google.gears={factory:A};}})();