var Y=YAHOO;Y.U=Y.util;Y.D=Y.util.Dom;Y.E=Y.util.Event;var snag=1;F._eb={eb_go_go_go:function(){this._eb_listeners=[];F._ebA.push(this)},eb_broadcast:function(){var e=false;if(e){var f=arguments.shift()}else{var d=[];for(var b=0;b<arguments.length;b++){d[b]=arguments[b]}var f=d.shift()}var c=F.array_copy(this._eb_listeners);var a=c.length;for(var b=0;b<a;++b){if(c[b][f]){c[b][f].apply(c[b],d)}else{}}},eb_add:function(a){this.eb_remove(a);this._eb_listeners.push(a);return(true)},eb_remove:function(c){var b=this._eb_listeners;var a=b.length;while(a--){if(b[a]==c){b.splice(a,1);return(true)}}return(false)},eb_remove_all:function(){this._eb_listeners=[]}};F.decorate(F,F._eb).eb_go_go_go();F.toggleClass=function(c,b){var a=_ge(c);if(Y.U.Dom.hasClass(a,b)){Y.U.Dom.removeClass(a,b)}else{Y.U.Dom.addClass(a,b)}return false};F.prepare_for_insertion=function(a){if(!a.parentNode){return a}if(F.is_ie){return a}return a.parentNode.removeChild(a)};F.get_local_X=function(a){if(a.style.left){return _pi(a.style.left)}return a.offsetLeft};F.get_local_Y=function(a){if(a.style.top){return _pi(a.style.top)}return a.offsetTop};F._paginator={paginator_go_go_go:function(){F.decorate(this,F._eb).eb_go_go_go();this.paginator_hide();this.pages=0;this.page=0;this.side_slots=2;this.middle_slots=7;this.pagesA=[];this.total_slots=(this.side_slots*2)+this.middle_slots;var a='<nobr><a id="paginator_link_prev" href="" class="Prev" onclick="_ge(\''+this.id+'\').paginator_go_prev(); this.blur(); return false;">&lt; Prev</a><a id="paginator_link_1" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_2" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><span id="paginator_break_1" class="break">...</span><a id="paginator_link_3" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_4" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_5" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_6" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_7" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_8" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_9" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><span id="paginator_break_2" class="break">...</span><a id="paginator_link_10" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_11" href="" onclick="_ge(\''+this.id+'\').paginator_go_page(this.page); this.blur(); return false;"></a><a id="paginator_link_next" href="" class="Next" onclick="_ge(\''+this.id+"').paginator_go_next(); this.blur(); return false;\">Next &gt;</a></nobr>";this.innerHTML=a;this.paginator_get_going()},paginator_place:function(){},paginator_get_going:function(f,g){if(f==undefined||g==undefined){return}if(g<2){this.paginator_hide();return}this.pages=g;this.page=f;writeDebug("paginator_get_going pages:"+this.pages+" page:"+this.page);this.pagesA=[];var d=(this.total_slots-1)/2;var e=this.page-(d);e=Math.max(1,e);var c=e+this.total_slots-1;if(c>this.pages){e=e-(c-this.pages)}c=Math.min(this.pages,c);writeDebug("first_page:"+e+" page:"+this.page+" last_page:"+c);for(var b=e;b<=c;b++){this.pagesA.push(b)}for(var b=1;b<=this.side_slots;b++){if(this.pagesA[b-1]>0){this.pagesA[b-1]=b}}for(var b=1;b<=this.side_slots;b++){var a=this.pagesA.length-b;this.pagesA[a]=this.pages-b+1}writeDebug(this.pagesA.join(","));this.paginator_draw()},paginator_draw:function(){this.paginator_hide_break(1);this.paginator_hide_break(2);for(var b=1;b<=this.total_slots;b++){this.paginator_hide_link(b)}var a=0;for(var b=0;b<this.pagesA.length;b++){var c=this.pagesA[b];if(c<1){continue}a++;this.paginator_show_link(a,c);if(a==2){if(this.pagesA[b+1]&&this.pagesA[b+1]>c+1){this.paginator_show_break(1)}}if(a==this.total_slots-2){if(this.pagesA[b+1]&&this.pagesA[b+1]>c+1){this.paginator_show_break(2)}}}if(this.page==1){_ge("paginator_link_prev").className="AtStart"}else{_ge("paginator_link_prev").className="Prev"}if(this.page==this.pages){_ge("paginator_link_next").className="AtEnd"}else{_ge("paginator_link_next").className="Next"}this.paginator_show()},paginator_go_prev:function(){var a=this.page-1;this.paginator_go_page(a)},paginator_go_next:function(){var a=this.page+1;this.paginator_go_page(a)},paginator_go_page:function(a){a=Math.min(this.pages,Math.max(1,a));if(a!=this.page){this.page=a;this.paginator_draw();this.eb_broadcast("on_paginator_go_page",this.page)}},paginator_hide:function(){this.style.display="none"},paginator_show:function(){if(this.style.display!="block"){this.style.visibility="hidden"}this.style.display="block";this.paginator_place();this.style.visibility="visible"},paginator_hide_link:function(a){_ge("paginator_link_"+a).style.display="none"},paginator_show_link:function(a,c){var b=_ge("paginator_link_"+a);if(c!=undefined){b.page=c}b.innerHTML=b.page;b.className=(b.page==this.page)?"this-page":"";b.style.display="inline"},paginator_hide_break:function(a){_ge("paginator_break_"+a).style.display="none"},paginator_show_break:function(a){_ge("paginator_break_"+a).style.display="inline"}};F._carrot=new Object();F._carrot.carrot_go_go_go=function(f,e,b,g){if(this.childNodes&&this.childNodes[0]){var c=this.childNodes[0].src}else{var c=this.src}var a=c.split("/");var h=a[a.length-1];var a=h.split(".");var d=a[0].substr().replace_global("_closed","").replace_global("_open_down","").replace_global("_open_up","");this.carrot_open_img={};if(f=="up"){this.carrot_open_img.src=_images_root+"/"+d+"_open_up.gif"}else{this.carrot_open_img.src=_images_root+"/"+d+"_open_down.gif"}this.carrot_closed_img={};this.carrot_closed_img.src=_images_root+"/"+d+"_closed.gif";F.preload_images(this.carrot_open_img.src,this.carrot_closed_img.src);this.carrot_is_open=(e)?1:0;if(this.childNodes&&this.childNodes[1]){if(this.carrot_is_open){this.carrot_open_text=(b)?b:this.childNodes[1].innerHTML;this.carrot_closed_text=(g)?g:this.carrot_open_text}else{this.carrot_closed_text=(g)?g:this.childNodes[1].innerHTML;this.carrot_open_text=(b)?b:this.carrot_closed_text}}this.style.cursor=(F.is_ie)?"hand":"pointer";this.onclick_default=(this.onclick)?this.onclick:function(){};this.onclick=this.carrot_onclick;if(this.carrot_is_open){if(this.childNodes&&this.childNodes[0]){this.childNodes[0].src=this.carrot_open_img.src;if(this.childNodes[1]){this.childNodes[1].innerHTML=this.carrot_open_text}}else{this.src=this.carrot_open_img.src}}else{if(this.childNodes&&this.childNodes[0]){this.childNodes[0].src=this.carrot_closed_img.src;if(this.childNodes[1]){this.childNodes[1].innerHTML=this.carrot_closed_text}}else{this.src=this.carrot_closed_img.src}}};F._carrot.carrot_onclick=function(a){if(this.carrot_is_open){this.carrot_close()}else{this.carrot_open()}};F._carrot.carrot_open=function(){this.onclick_default();this.carrot_is_open=1;if(this.childNodes&&this.childNodes[0]){this.childNodes[0].src=this.carrot_open_img.src;if(this.childNodes[1]){this.childNodes[1].innerHTML=this.carrot_open_text}}else{this.src=this.carrot_open_img.src}};F._carrot.carrot_close=function(){this.onclick_default();this.carrot_is_open=0;if(this.childNodes&&this.childNodes[0]){this.childNodes[0].src=this.carrot_closed_img.src;if(this.childNodes[1]){this.childNodes[1].innerHTML=this.carrot_closed_text}}else{this.src=this.carrot_closed_img.src}};F._shadow=new Object();F._shadow.shadow_go_go_go=function(c,d,b){this.shadow_use_local_coords=(b!=document.body);this.shadow_for_id=c;this.style.zIndex=d;this.style.display="none";this.style.position="absolute";this.shadow_height_plus=-14;this.shadow_width_plus=-14;this.shadow_x_plus=-0;this.shadow_y_plus=-0;if(navigator.userAgent.match(/msie 5/i)||navigator.userAgent.match(/msie 6/i)){var a='<table class="shadow_table" cellpadding="0" cellspacing="0" border="0" style="padding:0px;"><tr><td width="11"><img class="trans_png" width="11" height="11" src="'+_images_root+'/tc_white_shadow_tl.png"></td><td id="'+this.id+'_width_controller"><img class="trans_png" width="100%" height="11" src="'+_images_root+'/tc_white_shadow_t.png"></td><td width="11"><img class="trans_png" width="11" height="11" src="'+_images_root+'/tc_white_shadow_tr.png"></td></tr><tr><td height="30" id="'+this.id+'_height_controller"><img class="trans_png" width="11" height="100%" src="'+_images_root+'/tc_white_shadow_l.png"></td><td></td><td><img class="trans_png" width="11" height="100%" src="'+_images_root+'/tc_white_shadow_r.png"></td></tr><tr><td><img class="trans_png" width="11" height="11" src="'+_images_root+'/tc_white_shadow_bl.png"></td><td><img class="trans_png" width="100%" height="11" src="'+_images_root+'/tc_white_shadow_b.png"></td><td><img class="trans_png" width="11" height="11" src="'+_images_root+'/tc_white_shadow_br.png"></td></tr></table>'}else{var a='<table class="shadow_table" cellpadding="0" cellspacing="0" border="0" style="padding:0px;"><tr><td width="11"><img width="11" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_tl"></td><td id="'+this.id+'_width_controller"><img width="100%" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_t"></td><td width="11"><img width="11" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_tr"></td></tr><tr><td height="30" id="'+this.id+'_height_controller"><img width="11" height="100%" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_l"></td><td></td><td><img width="11" height="100%" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_r"></td></tr><tr><td><img width="11" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_bl"></td><td><img width="100%" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_b"></td><td><img width="11" height="11" src="'+_images_root+'/spaceout.gif" class="shadow_sprite shadow_br"></td></tr></table>'}this.innerHTML=a};F._shadow.shadow_size_and_place=function(){var d=_ge(this.shadow_for_id);if(this.shadow_use_local_coords){var a=F.get_local_X(d);var e=F.get_local_Y(d)}else{var a=Y.U.Dom.getX(d);var e=Y.U.Dom.getY(d)}if(a==undefined){return}a+=this.shadow_x_plus;e+=this.shadow_y_plus;this.style.left=a+"px";this.style.top=e+"px";var b=((d.offsetWidth)+this.shadow_width_plus);if(b<0){b=0}var c=((d.offsetHeight)+this.shadow_height_plus);if(c<0){c=0}_ge(this.id+"_width_controller").style.width=b+"px";_ge(this.id+"_height_controller").style.height=c+"px"};F._shadow.shadow_show=function(){this.style.display="block"};F._shadow.shadow_hide=function(){this.style.display="none"};F.eb_add({window_onload_dom:function(){var d=3450;var g=1111;var f=_ge("e_"+(d+g+2));var c=_ge("e_"+(d+g+3));var b=_ge("e_"+(d+g+4));var a=_ge("e_"+(d+g+5));var e=_ge("e_"+(d+g+6));if(f||c||b||a||e){F.API.callMethod("flickr.people.getMagicEmail",{user_id:global_nsid},{flickr_people_getMagicEmail_onLoad:function(k,j){if(k){var h=j.documentElement.getElementsByTagName("user")[0].getAttribute("magic_email");if(f){f.href="mailto:"+h+"@photos.flickr.com";f.innerHTML=h+"@photos.flickr.com"}if(c){c.href="mailto:"+h+"2blog@photos.flickr.com";c.innerHTML=h+"2blog@photos.flickr.com"}if(b){b.href="mailto:"+h+"@photos.flickr.com";b.innerHTML=h+"@photos.flickr.com"}if(a){a.href="mailto:"+h+"2blog@photos.flickr.com";a.innerHTML=h+"2blog@photos.flickr.com"}if(e){e.href="mailto:"+h+"2twitter@photos.flickr.com";e.innerHTML=h+"2twitter@photos.flickr.com"}}}})}}});F.set_png_bg=function(b,d,f,a){var j=(navigator.userAgent.match(/msie 6/i));if(!j){if(typeof b.setStyle!="undefined"){b.setStyle(d,f)}else{YAHOO.util.Dom.setStyle(b,d,f)}}else{var c=null;var h=(typeof a=="undefined"?"scale":a);if(f.indexOf("url(")!=-1){c=f.substr(f.indexOf("(")+1);c=c.substr(0,c.lastIndexOf(")"))}else{c=f}if(typeof b.setStyle!="undefined"){b.setStyle("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c+"',sizingMethod='"+h+"')")}else{try{b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c+"',sizingMethod='"+h+"')"}catch(g){YAHOO.util.Dom.setStyle(b,d,f);return false}}}};F.find_parent_node=function(a){if(!a||!a.parentNode){return false}a=a.parentNode;while(a.parentNode&&a.parentNode.nodeType!=1){a=a.parentNode}return(a.nodeType==1?a:null)};F.find_parent_node_by_name=function(a,b){if(!a||!a.parentNode||!b){return false}b=b.toLowerCase();a=a.parentNode;while(a.nodeName.toLowerCase()!=b&&a.parentNode){a=a.parentNode}return(a.nodeName.toLowerCase()==b?a:null)};F.find_parent_node_by_class_name=function(b,a){if(!b||!b.parentNode||!a){return false}b=b.parentNode;while(!Y.D.hasClass(b,a)&&b.parentNode){b=b.parentNode}return(Y.D.hasClass(b,a)?b:null)};F.is_child_of=function(a,b){if(!a||!b){return false}while(a.parentNode&&a!=b){a=a.parentNode}return(a==b)};function woe_location_obj(e,j,g,b,k,d,f,a,c,h){this.id=e;this.title=j;this.sub_title=g;this.relevance=b;this.bbox=k;this.precision=d;this.lat=f;this.lon=a;this.place_url=c;this.place_disambiguate=h}F.do_explore_location_search=function(){if(!_ge("explore_loc_search_div")){var c=document.createElement("div");c.id="explore_loc_search_div";document.body.appendChild(c);var a="explore";F.decorate(c,F._loc_search_div).div_go_go_go(a)}try{_ge("explore_loc_search_div").div_do_loc_search()}catch(b){writeDebug(b)}return false};F.do_places_world_location_search=function(){var e=_ge("txt_search_for");var d=_ge("txt_taken_in");var c=false;if(e.value==""){c=true;e.focus();e.value=places.defaults.search_for;e.select()}if(d.value==""||d.value==places.defaults.taken_in){c=true;d.focus();d.value=places.defaults.taken_in;d.select()}if(c){return false}if(!_ge("explore_loc_search_div")){var f=document.createElement("div");f.id="explore_loc_search_div";document.body.appendChild(f);var a="places_world";F.decorate(f,F._loc_search_div).div_go_go_go(a)}try{_ge("explore_loc_search_div").div_do_loc_search()}catch(b){writeDebug(b)}return false};F._loc_search_div={provider_name:(_qs_args.provider_name)?_qs_args.provider_name:"woe"};F._loc_search_div.div_go_go_go=function(d){this.page_type=d;this.input_id=(this.page_type=="org")?"loc_search_input":(this.page_type=="explore")?"exploreMapSearch":(this.page_type=="places_world")?"txt_taken_in":(this.page_type=="places_home")?"location-search-field":"header_search_q";this.logged_last=0;this.last_source_id=null;this.last_search_term=null;this.setLocation_geo_point=null;this.setLocation_source_id=null;this.setLocation_search_term=null;var c=_ge(this.input_id);this.style.display="none";F.eb_add(this);this.locations=[];this.div_show_all=0;this.current_location_index=-1;var a=document.createElement("div");a.id="loc_search_inner_div";a.style.width="300px";a.style.border="0px solid black";this.appendChild(a);var f=document.createElement("div");f.id="loc_search_header_div";f.className="Pulser";f.style.position="absolute";f.style.top="10px";f.style.left="10px";f.style.height="20px";f.style.width="30px";a.appendChild(f);var f=document.createElement("div");f.id="loc_search_header_msg_div";f.style.margin="12px 15px 10px 38px";f.style.fontWeight="normal";f.style.fontFamily="arial";f.style.fontSize="12px";f.style.color="#434343";a.appendChild(f);var f=document.createElement("div");f.id="loc_search_results_div";f.style.margin="0 0 15px 38px";a.appendChild(f);var f=document.createElement("div");f.id="loc_search_msg_div";f.style.margin="0px 0 10px 30px";f.style.display="none";a.appendChild(f);var b=document.createElement("img");b.id="loc_search_close";b.style.border="0px";b.style.position="absolute";b.style.left="281px";b.style.top="4px";b.src=_images_root+"/simple_close_default.gif";b.width=b.height="15";var e=this.id;b.onclick=function(){_ge(e).div_fade()};this.appendChild(b);F.decorate(_ge("loc_search_close"),F._simple_button).button_go_go_go()};F._loc_search_div.window_onresize=function(){if(this.style.display!="none"){this.div_show()}};F._loc_search_div.div_show=function(){if(this.style.display=="none"){this.style.visibility="hidden"}this.style.display="block";var f=_ge("loc_search_results_div");var e=Y.U.Dom.getY(_ge(this.input_id));if(this.page_type=="org"){var a=(_find_screen_width()-this.offsetWidth-3);e+=25}else{if(this.page_type=="else"||this.page_type=="world_map"){var a=(_find_screen_width()-this.offsetWidth-60);if(a>Y.U.Dom.getX(_ge(this.input_id))){a=Y.U.Dom.getX(_ge(this.input_id))}e+=23}else{if(this.page_type=="explore"){var a=Y.U.Dom.getX(_ge(this.input_id));e+=23}else{if(this.page_type=="places_world"){var a=Y.U.Dom.getX(_ge(this.input_id));e+=31}else{var b=_ge("Main");var a=(b?(Y.U.Dom.getX(b)+b.offsetWidth-this.offsetWidth):Y.U.Dom.getX(_ge("header_search_q"))-56);e+=24}}}}f.style.height="";f.style.overflow="";if(this.div_show_all){if(this.page_type=="explore"){var d=88;if(this.offsetHeight+d>_find_screen_height()){f.style.height=(_find_screen_height()-d)+"px";f.style.overflow="auto"}}else{var d=58;if(this.offsetHeight+e>_find_screen_height()+document.body.scrollTop){f.style.height=(_find_screen_height()-e-d+document.body.scrollTop)+"px";f.style.overflow="auto"}}if(this.reset_scrollTop){this.reset_scrollTop=0;f.scrollTop=0}}var c=100;this.style.opacity=c/100;this.style.filter="alpha(opacity="+c+")";this.style.left=a+"px";this.style.top=e+"px";this.style.visibility="visible";if(this.page_type=="explore"){F.scroll_this_el_into_view(this.id)}if(_ge("geo_bookmarks_div")&&typeof(_ge("geo_bookmarks_div").hide=="function")){_ge("geo_bookmarks_div").hide()}};F._loc_search_div.div_hide=function(){this.style.display="none"};F._loc_search_div.div_loading=function(){_ge("loc_search_results_div").style.display="none";_ge("loc_search_close").style.display="none";_ge("loc_search_header_div").className="Pulser_gray";_ge("loc_search_header_msg_div").innerHTML="&nbsp;&nbsp;&nbsp;"+F.output.get("searching");this.reset_scrollTop=1;this.div_show_all=0;this.div_show()};F._loc_search_div.div_fade_if_open=function(){if(this.style.display=="block"){this.div_fade()}this.div_log(0)};F._loc_search_div.div_fade=function(){var b=this;var a=function(){b.div_hide()};anim_do_opacity_to(b,7,35,0,"easeInQuad",a)};F._loc_search_div.div_update_results=function(e){if(_ge("f_div_photo_ribbon_holder")){this.page_type="world_map"}if(e){this.div_show_all=1}var g=this.locations.length;_ge("loc_search_close").style.display="block";if(this.locations.length==0){_ge("loc_search_header_div").className="Problem_small";_ge("loc_search_header_msg_div").innerHTML=F.output.get("loc_results_no_matches");_ge("loc_search_results_div").style.display="none"}else{if(this.locations.length==1){if((this.page_type=="site"||this.page_type=="explore"||this.page_type=="places_home")&&!_ge("div_force_header_location_search")){}else{if(this.page_type=="places_world"){}else{setTimeout("_ge('"+this.id+"').div_fade()",2000)}}}_ge("loc_search_header_div").className="Confirm_small";if(g==1){var d=F.output.get("loc_results_one_match")}else{var d=F.output.get("loc_results_matches",g,this.last_search_term.escape_for_display())}_ge("loc_search_header_msg_div").innerHTML=d;_ge("loc_search_results_div").style.display="block";var j=[];max_abs=20;max_to_show=8;max_to_show_if_more_than_that=5;var c=(this.current_location_index>max_to_show_if_more_than_that||this.div_show_all)?this.locations.length:(this.locations.length>max_to_show)?max_to_show_if_more_than_that:this.locations.length;for(i=0;i<c;i++){var a="margin-top:3px;";if((this.page_type=="site"||this.page_type=="explore"||this.page_type=="places_home")&&!_ge("div_force_header_location_search")){if(_ge("world_map")||_ge("f_div_photo_ribbon_holder")){if(_ge("user_places_is_go")){var b="/photos/"+_ge("user_places_is_go").innerHTML+"/places"+this.locations[i].place_url}else{var b="/places"+this.locations[i].place_url}}else{if(this.locations[i].precision=="GeocodedBuilding"||this.locations[i].precision=="POI"){var b="/map?fLat="+this.locations[i].lat+"&fLon="+this.locations[i].lon+"&zl=2&place_id="+this.locations[i].id+"&woe_sub_title="+escape(this.locations[i].sub_title)}else{var b="/map?place_id="+this.locations[i].id}}var h="_ge('"+this.id+"').div_hide(); _ge('"+this.id+"').div_log('"+this.locations[i].id+"', this.href); return false"}else{a+=(i==this.current_location_index)?"font-weight:bold; text-decoration:none":"";var h="_ge('"+this.id+"').div_on_result_click("+i+"); return false;";if(this.page_type=="else"||this.page_type=="world_map"||_ge("div_force_header_location_search")){if(this.locations[i].precision=="GeocodedBuilding"||this.locations[i].precision=="POI"){var b="/map?fLat="+this.locations[i].lat+"&fLon="+this.locations[i].lon+"&zl=2&place_id="+this.locations[i].id+"&woe_sub_title="+escape(this.locations[i].sub_title)}else{var b="/map?place_id="+this.locations[i].id}}else{if(this.locations[i].precision=="GeocodedBuilding"||this.locations[i].precision=="POI"){var b="/photos/organize/?start_tab=map&fLat="+this.locations[i].lat+"&fLon="+this.locations[i].lon+"&zl=2&place_id="+this.locations[i].id+"&woe_sub_title="+escape(this.locations[i].sub_title)}else{var b="/photos/organize/?start_tab=map&place_id="+this.locations[i].id}}}var f='<div style="margin-bottom:7px; font-size:12px; font-family:arial">';if(F.is_ie){b=encodeURI(b)}if(_ge("world_map")||_ge("f_div_photo_ribbon_holder")){f+='<a href="'+b+'" style="'+a+'" onclick="'+h+'">';if(this.locations[i].title){f+='<span class="loc_search_found_term">'+this.locations[i].title+"</span>, "}}else{if(this.locations[i].title){f+='<span class="loc_search_found_term">'+this.locations[i].title+"</span>, "}f+='<a href="'+b+'" style="'+a+'" onclick="'+h+'">'}f+=" "+this.locations[i].sub_title+"</a>";if(this.locations[i].place_disambiguate!=""){f+=" ("+this.locations[i].place_disambiguate+")"}f+="</div>";j.push(f)}if(this.locations.length>c){j.push('<br><b><a href="#" onclick="_ge(\''+this.id+"').div_update_results(1); return false;\">"+F.output.get("loc_results_more")+"</a></b>")}_ge("loc_search_results_div").innerHTML=j.join("")}this.div_show()};F._loc_search_div.div_go_to_map=function(d,c){if(!c||c<1){var b=this.locations[d].id;if(this.locations[d].precision=="GeocodedBuilding"||this.locations[d].precision=="POI"){var a="/map?fLat="+this.locations[d].lat+"&fLon="+this.locations[d].lon+"&zl=2&place_id="+b+"&woe_sub_title="+escape(this.locations[d].sub_title)}else{var a="/map?place_id="+b}document.location=a;var e=F.output.get("loc_results_take_you_there")}else{setTimeout("_ge('"+this.id+"').div_go_to_map("+d+", "+(c-1000)+")",c);if(c==0){var e=F.output.get("loc_results_zero_second")}else{if(_pi(c/1000)==1){var e=F.output.get("loc_results_one_second")}else{var e=F.output.get("loc_results_x_second",_pi(c/1000))}}}writeDebug(e);if(_ge("loc_search_msg_div")){_ge("loc_search_msg_div").style.display="block";_ge("loc_search_msg_div").innerHTML=e}};F._loc_search_div.div_go_to_place=function(d,c){if(!c||c<1){var b=this.locations[d].id;if(_ge("world_map")){if(_ge("user_places_is_go")){var a="/photos/"+_ge("user_places_is_go").innerHTML+"/places"+this.locations[d].place_url}else{var a="/places"+this.locations[d].place_url}}else{if(this.locations[d].precision=="GeocodedBuilding"||this.locations[d].precision=="POI"){var a="/map?fLat="+this.locations[d].lat+"&fLon="+this.locations[d].lon+"&zl=2&place_id="+b+"&woe_sub_title="+escape(this.locations[d].sub_title)}else{var a="/map?place_id="+b}}document.location=a;var e=F.output.get("loc_results_take_you_there")}else{setTimeout("_ge('"+this.id+"').div_go_to_place("+d+", "+(c-1000)+")",c);if(c==0){var e=F.output.get("loc_results_zero_second")}else{if(_pi(c/1000)==1){var e=F.output.get("loc_results_one_second")}else{var e=F.output.get("loc_results_x_second",_pi(c/1000))}}}writeDebug(e);if(_ge("loc_search_msg_div")){_ge("loc_search_msg_div").style.display="block";_ge("loc_search_msg_div").innerHTML=e}};F._loc_search_div.div_on_result_click=function(a){if((this.page_type=="site"||this.page_type=="explore"||this.page_type=="places_home")&&!_ge("div_force_header_location_search")){}else{this.current_location_index=a;this.focus_on_location();this.div_update_results();this.div_fade()}};F._loc_search_div.div_do_loc_search=function(){var a=window.page_map_type;var c=_ge(this.input_id).value.trim();var b=/^([-\.\d]+),\s*([-\.\d]+)$/i;var d;if(c){if(this.last_search_term!=c){if(this.last_search_term){this.div_log(0);if(this.logged_last){this.logged_last=0}}this.last_search_term=c;d=b.exec(c);if(a=="org"&&d&&d.length){this.locations=[new woe_location_obj(null,null,null,null,[d[2],d[1],d[2],d[1]].join(","),null,d[1],d[2],null,null)];this.current_location_index=0;_ge(this.id).focus_on_location();F.API.callMethod("flickr.people.geo.setLocation",{lat:d[1],lon:d[2],accuracy:16,context:"last"},this,null,null,0)}else{this.div_loading();F.API.callMethod("flickr.geocode.translate",{location:this.last_search_term,provider_name:this.provider_name},this,null,null,null,0)}}}};F._loc_search_div.div_add_source_params=function(a){if(this.setLocation_geo_point!=null&&_ge("map_controller").is_this_point_on_the_map(this.setLocation_geo_point)){writeDebug("adding source!");a.source=this.setLocation_source_id;a.query=this.setLocation_search_term}return a};F._loc_search_div.flickr_geocode_translate_onLoad=function(k,b,m,y){if(k){var n=b.documentElement.getElementsByTagName("ResultSet")[0];var q=b.documentElement.getElementsByTagName("Result");this.last_source_id=n.getAttribute("fl:source_id");this.locations=[];if(q.length==0){this.div_update_results();return}for(i=0;i<q.length;i++){try{var v=String(q[i].getAttribute("precision"))}catch(A){var v=""}try{var h=String(q[i].getElementsByTagName("woe_specificprobability")[0].firstChild.nodeValue)}catch(A){var h=""}try{var l=String(q[i].getElementsByTagName("woe_woeid")[0].firstChild.nodeValue)}catch(A){var l=""}var j=String(q[i].getElementsByTagName("Latitude")[0].firstChild.nodeValue);var e=String(q[i].getElementsByTagName("Longitude")[0].firstChild.nodeValue);try{var c=String(q[i].getElementsByTagName("woe_bbox")[0].firstChild.nodeValue)}catch(A){var c=""}try{var f=String(q[i].getElementsByTagName("Address")[0].firstChild.nodeValue)}catch(A){var f=""}try{var t=String(q[i].getElementsByTagName("City")[0].firstChild.nodeValue)}catch(A){var t=""}try{var g=String(q[i].getElementsByTagName("State")[0].firstChild.nodeValue)}catch(A){var g=""}try{var x=String(q[i].getElementsByTagName("Zip")[0].firstChild.nodeValue)}catch(A){var x=""}try{var r=String(q[i].getElementsByTagName("Country")[0].firstChild.nodeValue)}catch(A){var r=""}try{var w=String(q[i].getElementsByTagName("place_url")[0].firstChild.nodeValue)}catch(A){var w=""}try{var s=String(q[i].getElementsByTagName("place_disambiguate")[0].firstChild.nodeValue)}catch(A){var s=""}r=(r=="United States")?"US":r;r=(r=="United Kingdom")?"UK":r;var B="";var a="";var d=this.last_search_term.trim().split(" ")[0].split(",")[0];var u=d.toLowerCase();if(v=="GeocodedBuilding"||v=="POI"){if(f){a=a+", "+f}}if(t){a=a+", "+t}if(g){a=a+", "+g}if(r){a=a+", "+r}if(a.length>2){a=a.substring(2,a.length)}if(v=="County"){B=d.substring(0,1).toUpperCase()+d.substring(1,d.length)+" County"}else{if(v=="GeocodedBuilding"){a=d+" "+a}else{if(v=="POI"){a=this.last_search_term+", "+a}else{sub_titleA=a.split(", ");if(u==sub_titleA[0].toLowerCase()){if(sub_titleA[0]!=a){B=sub_titleA[0];a=a.replace_global(sub_titleA[0]+", ","")}}}}}var z=new woe_location_obj(l,B,a,h,c,v,j,e,w,s);if(z.place_url!="/"){this.locations.push(z)}}this.current_location_index=-1;this.div_update_results();if(this.locations.length==1){this.current_location_index=0;if((this.page_type=="site"||this.page_type=="explore"||this.place_type=="places_home")&&!_ge("div_force_header_location_search")){if(_ge("world_map")){this.div_go_to_place(0,0)}else{this.div_go_to_map(0,0)}}else{var o=this.id;setTimeout(function(){_ge(o).focus_on_location()},50)}}else{if(this.locations.length>0&&_pf(this.locations[0].relevance)>0.85&&this.page_type=="places_world"){this.current_location_index=0;var o=this.id;setTimeout(function(){_ge(o).focus_on_location()},50)}}}else{writeDebug("Something sucked");return}};F._loc_search_div.focus_on_location=function(){var f;if(window.YGeoPoint){f={point:YGeoPoint,bbox:null,panAndZoom:"drawZoomAndCenter",getCenter:"getCenterLatLon",getZoom:"getZoomLevel",zoomToBounds:null,poiZoom:2}}else{if(window.L&&window.L.Map){f={point:L.LatLng,bbox:L.LatLngBounds,panAndZoom:"setView",getCenter:"getCenter",getZoom:"getZoom",zoomToBounds:"fitBounds",poiZoom:17}}}if((f==undefined||this.page_type=="site"||this.page_type=="places_home")&&!_ge("div_force_header_location_search")){return}var d=this.locations[this.current_location_index];if(this.page_type=="places_world"){if(_ge("txt_search_for").value!=""&&_ge("txt_search_for").value!=places.defaults.search_for){if(_ge("user_places_is_go")){window.location="photos/"+_ge("user_places_is_go").innerHTML+"/places"+d.place_url+"/?q="+_ge("txt_search_for").value}else{window.location="/places"+d.place_url+"/?q="+_ge("txt_search_for").value}}else{alert("here")}return}if(this.locations.length==1&&(d.precision=="GeocodedBuilding"||d.precision=="POI")){var h=f.poiZoom;if(_ge("f_div_photo_ribbon_holder")){map_controller.ymap[f.panAndZoom](new f.point(d.lat,d.lon),h);_ge("f_inpt_search_what").value=F.output.get("numap_amazing_photos");_ge("f_inpt_search_where").value=F.output.get("numap_this_map");if(_ge("f_div_search_mode_tab")){_ge("f_div_search_mode_tab").firstest_time_ever=false}if(typeof(map_controller)=="object"){map_controller.from_top_search=true}_ge("f_div_search_mode_tab").do_search()}else{if(_ge("div_force_header_location_search")){var g=drag_map.ymap[f.getCenter]();if(g.Lon!=d.lon||g.Lat!=d.lat||drag_map.ymap[f.getZoom]()!=h){drag_map.ymap[f.panAndZoom](new f.point(d.lat,d.lon),h);drag_map.end_pan()}}else{var g=ymap[f.getCenter]();_ge("you_are_here_holder").setYGeoPoint(new f.point(d.lat,d.lon),h);_ge("you_are_here_holder").show(true,d.sub_title);if(g.Lon!=d.lon||g.Lat!=d.lat||ymap[f.getZoom]()!=h){ymap[f.panAndZoom](new f.point(d.lat,d.lon),h);_ge("map_controller").end_pan()}}}}else{this.best_fit_points=[];this.best_fit_points.push(new f.point(d.bbox.split(",")[1],d.bbox.split(",")[0]));this.best_fit_points.push(new f.point(d.bbox.split(",")[3],d.bbox.split(",")[2]));var j=[];for(i=0;i<this.best_fit_points.length;i++){j.push(this.best_fit_points[i])}if(_ge("f_div_photo_ribbon_holder")){if(f.zoomToBounds){ymap[f.zoomToBounds](new f.bbox(j))}else{var h=map_controller.ymap[f.getZoom](j);if(d.precision!="GeocodedStreet"){h=Math.max(5,h);var b=map_controller.ymap.getGeoBox(j);var c=map_controller.ymap.getBoxGeoCenter(b.min,b.max)}else{var c=new f.point(d.lat,d.lon);var h=3}map_controller.ymap[f.panAndZoom](c,h);_ge("f_inpt_search_what").value=F.output.get("numap_amazing_photos");_ge("f_inpt_search_where").value=F.output.get("numap_this_map");if(_ge("f_div_search_mode_tab")){_ge("f_div_search_mode_tab").firstest_time_ever=false}if(typeof(map_controller)=="object"){map_controller.from_top_search=true}_ge("f_div_search_mode_tab").do_search()}}else{if(_ge("div_force_header_location_search")){if(f.zoomToBounds){ymap[f.zoomToBounds](new f.bbox(j))}else{var g=drag_map.ymap[f.getCenter]();var h=drag_map.ymap[f.getZoom](j);if(d.precision!="GeocodedStreet"){h=Math.max(5,h);var b=drag_map.ymap.getGeoBox(j);var c=drag_map.ymap.getBoxGeoCenter(b.min,b.max)}else{var c=new f.point(d.lat,d.lon);var h=3}if(g.Lon!=c.Lon||g.Lat!=c.Lat||drag_map.ymap[f.getZoom]()!=h){drag_map.ymap[f.panAndZoom](c,h);drag_map.end_pan()}}}else{if(f.zoomToBounds){var e=_ge("map_controller").dots;if(e){for(var a in e){if(a.indexOf("dot_holder")>-1&&e.hasOwnProperty(a)){e[a].show(false)}}}ymap[f.zoomToBounds](new f.bbox(j))}else{var g=ymap[f.getCenter]();var h=ymap[f.getZoom](j);_ge("you_are_here_holder").show(false,"");if(d.precision!="GeocodedStreet"){h=Math.max(5,h);var b=ymap.getGeoBox(j);var c=ymap.getBoxGeoCenter(b.min,b.max)}else{var c=new f.point(d.lat,d.lon);var h=3}if(g.Lon!=c.Lon||g.Lat!=c.Lat||ymap[f.getZoom]()!=h){ymap[f.panAndZoom](c,h);_ge("map_controller").end_pan()}}}}}this.setLocation_geo_point=new f.point(d.lat,d.lon);this.setLocation_source_id=this.last_source_id;this.setLocation_search_term=this.last_search_term;this.div_log(d.id)};F._loc_search_div.div_log=function(a,b){if(this.provider_name&&this.provider_name.toLowerCase()=="yahoo"){return}if(this.locations.length<2&&this.page_type!="places_home"){return}if(!a&&this.logged_last){return}this.logged_last=1;F.API.callMethod("flickr.geocode.log",{query:this.last_search_term,result_id:a,provider_name:this.provider_name},{flickr_geocode_log_onLoad:function(){if(b){document.location=b}}})};F._canvas={canvas_go_go_go:function(a,b){if(a!=undefined){this.width=a;this.style.width=a+"px"}if(b!=undefined){this.height=b;this.style.height=b+"px"}if(F.is_ie&&!this.getContext){G_vmlCanvasManager_.initElement(this)}},rounded_rect:function(a,f,c,d,e){var b=this.getContext("2d");b.beginPath();b.moveTo(a,f+e);b.lineTo(a,f+d-e);b.quadraticCurveTo(a,f+d,a+e,f+d);b.lineTo(a+c-e,f+d);b.quadraticCurveTo(a+c,f+d,a+c,f+d-e);b.lineTo(a+c,f+e);b.quadraticCurveTo(a+c,f,a+c-e,f);b.lineTo(a+e,f);b.quadraticCurveTo(a,f,a,f+e);b.stroke()}};F._simple_button={button_disabled:0,button_go_go_go:function(e){this.EXT=this;this.style.cursor=(F.is_ie)?"hand":"pointer";if(this.tagName=="IMG"){this.img_id=this.id}else{for(var c=0;c<this.childNodes.length;c++){var a=this.childNodes[c];if(a.tagName=="IMG"){if(!a.id){a.id=this.id+"IMG"}this.img_id=a.id}else{if(a.tagName=="SPAN"){if(!a.id){a.id=this.id+"SPAN"}this.span_id=a.id}}}}if(!this.img_id){return}this.button_has_disabled_src=(e)?1:0;var d=this.button_get_img();this.img_format=d.src.split(".")[d.src.split(".").length-1];if(/v[0-9]+/.test(this.img_format)){this.img_format=d.src.split(".")[d.src.split(".").length-2]}var g=d.src.split("/");var h=g[g.length-1];this.img_path_root=d.src.replace_global("/"+h,"");var j=h.split("_default."+this.img_format)[0];this.button_set_img_srcs(j);if(this.img_format=="png"){d.className="trans_png"}this.button_is_down=0;this.button_is_over=0;if(this.onclick){var f=this.onclick;var b=this.button_default_onclick;this.onclick=function(k){f.apply(this,[k]);b.apply(this,[k])}}else{this.onclick=this.button_default_onclick}return this},button_get_img:function(){return _ge(this.img_id)},button_get_span:function(){return _ge(this.span_id)},button_set_img_srcs_and_change:function(a){this.button_set_img_srcs(a);this.button_change_src()},button_set_text:function(a){var b=this.button_get_span();if(!b){return}b.innerHTML=a},button_set_img_srcs:function(a){this.button_default_img={};this.button_default_img.src=this.img_path_root+"/"+a+"_default."+this.img_format;this.button_hover_img={};this.button_hover_img.src=this.img_path_root+"/"+a+"_hover."+this.img_format;this.button_selected_img={};this.button_selected_img.src=this.img_path_root+"/"+a+"_selected."+this.img_format;F.preload_images(this.button_default_img.src,this.button_hover_img.src,this.button_selected_img.src);if(this.button_has_disabled_src){this.button_disabled_img={};this.button_disabled_img.src=this.img_path_root+"/"+a+"_disabled."+this.img_format;F.preload_images(this.button_disabled_img.src)}else{this.button_disabled_img=this.button_default_img}},button_change_src:function(){var a=this.button_default_img.src;if(this.button_disabled){a=this.button_disabled_img.src}else{if(this.button_is_down){a=this.button_selected_img.src}else{if(this.button_is_over){a=this.button_hover_img.src}}}var b=this.button_get_img();if(b){b.src=a}},button_enable:function(){this.button_disabled=0;this.button_change_src();if(this.tagName=="A"){this.className=this.className.replace_global("_disabled","")}},button_disable:function(){if(this.button_disabled){return}this.button_disabled=1;this.button_is_over=0;this.button_is_down=0;this.button_change_src();if(this.tagName=="A"){this.className=this.className+"_disabled"}},onmouseover:function(){if(this.button_disabled){return}this.button_is_over=1;this.button_change_src()},onmouseout:function(){if(this.button_disabled){return}this.button_is_over=0;this.button_is_down=0;this.button_change_src()},onmousedown:function(){if(this.button_disabled){return}this.button_is_over=1;this.button_is_down=1;this.button_change_src()},onmouseup:function(){if(this.button_disabled){return}this.button_is_over=1;this.button_is_down=0;this.button_change_src()},button_default_onclick:function(a){this.blur();return false}};F._link_button={_decotype:F._simple_button,button_go_go_go:function(){F._link_button._decotype.button_go_go_go.apply(this)},button_default_onclick:function(a){this.blur();return true}};F._button_bar={bar_go_go_go:function(){if(!this.bar_button){return}var b=Y.U.Dom.getElementsByClassName("menu_li","li",this);for(var a=0;a<b.length;a++){F.decorate(b[a],this.bar_button).button_go_go_go()}}};F._l10n_button={button_go_go_go:function(){this.button_menu_id=this.id.replace_global("button","menu");this.button_form_id=this.id.replace_global("button","form");var d=_ge(this.button_form_id);if(d){var c=this;d.onsubmit=function(){c.button_close();return false}}this.button_is_open=0;this.button_is_split=(this.button_get_img().src.indexOf("_split")>-1)?1:0;this.onclick_default=(this.onclick)?this.onclick:function(){};this.onclick=this.onclick_handler;var b=this.button_get_a();if(!b){return}b.onclick_default=(b.onclick)?b.onclick:null;b.onclick=null},button_get_img:function(){if(this.tagName=="IMG"){return this}return this.getElementsByTagName("img")[0]},button_get_src:function(b){if(!b){b="default"}var a=(this.button_is_split)?"split_":"";return _images_root+"/"+this.button_img_root+a+b+"."+this.button_img_ext},button_close:function(b){var a=this.button_get_img();Y.U.Dom.removeClass(this,"selected");if(b){a.src=this.button_get_src("hover")}else{Y.U.Dom.removeClass(this,"hover");a.src=this.button_get_src()}_ge(this.button_menu_id).style.display="none";this.button_is_open=0;document.onmousedown=null;F.eb_broadcast("stewart_play_if_was_playing")},button_disable:function(){this.onmouseout();this.button_is_disabled=1},button_undisable:function(){this.button_is_disabled=0},button_go_down:function(b){b=b||"both";if(b=="both"||b=="left"){Y.U.Dom.addClass(this,"selected")}if(b=="both"||b=="right"){var a=this.button_get_img();a.src=this.button_get_src("selected")}},button_open:function(){if(this.button_is_split){this.button_go_down("right")}else{this.button_go_down()}var a=_ge(this.button_menu_id);if(!a){return}a.style.display="block";this.button_is_open=1;F.eb_broadcast("stewart_pause");var b=this;document.onmousedown=function c(g){var f=_get_event_src(g);var d=0;if(f.parentNode){while(f.parentNode){if(f.parentNode==b){d=1;break}f=f.parentNode}}if(!d){b.button_close()}}},button_swap_image_if_needed:function(c,d){var b=this.button_get_img();if(b){var a=_get_event_src(c);if(a==b||this.button_always_swap_img){b.src=this.button_get_src(d);return 1}}return 0},onmouseover:function(a){if(this.button_is_disabled){return}if(this.button_is_open){return}Y.U.Dom.addClass(this,"hover");if(!this.button_swap_image_if_needed(a,"hover")){Y.U.Dom.addClass(this,"hover_left")}else{Y.U.Dom.removeClass(this,"hover_left")}},onmouseout:function(a){if(this.button_is_disabled){return}if(this.button_is_open){return}this.button_swap_image_if_needed(a,"default");Y.U.Dom.removeClass(this,"hover");Y.U.Dom.removeClass(this,"hover_left");Y.U.Dom.removeClass(this,"selected")},onmouseup:function(a){_enable_select();if(this.button_is_disabled){return}if(this.button_is_open){return}this.button_swap_image_if_needed(a,"hover");Y.U.Dom.removeClass(this,"selected")},onmousedown:function(f){if(this.button_is_disabled){return}if(this.button_is_split){var b=_get_event_src(f);var d=this.button_get_img();if(b==d){this.button_go_down("right")}else{this.button_go_down("left")}}else{this.button_go_down()}var b=_get_event_src(f);if(this.button_click_is_in_menu(b)){return}var c=this.button_get_a();if(!c||!c.href){_disable_select();return false}},onclick_handler:function(j){if(this.button_is_disabled){return false}var c=_get_event_src(j);var f=this.button_get_img();if(c==f||!this.button_is_split){if(this.button_is_open){var k=1;var h=_ge(this.button_form_id);if(h){if(this.button_click_is_in_menu(c)){k=0}}if(k){this.button_close(1)}}else{var b=_ge(this.button_menu_id);if(b){this.button_open()}}}if((c!=f||c==this)&&!this.button_click_is_in_menu(c)){var d=this.button_get_a();if(d){if(d.onclick_default){return d.onclick_default()}if(d.href&&c!=d){document.location=d.href;return}}else{this.onclick_default()}if(this.button_is_split){var b=_ge(this.button_menu_id);var g=b.getElementsByTagName("A");if(g&&g[0]){if(g[0].onclick){return g[0].onclick()}if(g[0].href){if(!d){document.location=g[0].href;return}else{if(!d.href){d.href=g[0].href}return 1}}}}}},button_get_a:function(){var a=this.getElementsByTagName("A");if(!a){return null}return a[0]},button_click_is_in_menu:function(a){var b=a;while(b){if(Y.U.Dom.hasClass(b,"candy_menu")){return 1}b=b.parentNode;if(b==this){return 0}}return 0}};F._nav_button={_decotype:F._l10n_button,button_always_swap_img:0,button_img_root:"site_nav_caret_",button_img_ext:"png",button_go_go_go:function(){F.preload_images(_images_root+"/site_nav_caret_split_default.png",_images_root+"/site_nav_caret_split_hover.png",_images_root+"/site_nav_caret_split_selected.png");F._nav_button._decotype.button_go_go_go.apply(this)}};F._gray_menu_button={_decotype:F._l10n_button,button_always_swap_img:1,button_img_root:"gray_button_caret_",button_img_ext:"gif",button_go_go_go:function(){F.preload_images(_images_root+"/gray_button_caret_default.gif",_images_root+"/gray_button_caret_hover.gif",_images_root+"/gray_button_caret_selected.gif",_images_root+"/gray_button_caret_split_default.gif",_images_root+"/gray_button_caret_split_hover.gif",_images_root+"/gray_button_caret_split_selected.gif",_images_root+"/gray_button_bg_hover.gif",_images_root+"/gray_button_bg_selected.gif");F._gray_menu_button._decotype.button_go_go_go.apply(this)}};F._gray_button={_decotype:F._l10n_button,button_always_swap_img:1,button_img_root:"gray_button_no_caret_",button_img_ext:"gif",button_go_go_go:function(){F.preload_images(_images_root+"/gray_button_no_caret_default.gif",_images_root+"/gray_button_no_caret_hover.gif",_images_root+"/gray_button_no_caret_selected.gif",_images_root+"/gray_button_bg_hover.gif",_images_root+"/gray_button_bg_selected.gif");F._gray_button._decotype.button_go_go_go.apply(this)}};F._gray_button_bar={_decotype:F._button_bar,bar_button:F._gray_menu_button,bar_go_go_go:function(){var b=Y.U.Dom.getElementsByClassName("no_menu_li","li",this);for(var a=0;a<b.length;a++){F.decorate(b[a],F._gray_button).button_go_go_go()}F._gray_button_bar._decotype.bar_go_go_go.apply(this)}};F._nav_button_bar={_decotype:F._button_bar,bar_button:F._nav_button};F.str_to_XML=function(b){var a;if(window.DOMParser){var c=new DOMParser();a=c.parseFromString(b,"text/xml")}else{if(window.ActiveXObject){a=new ActiveXObject("Microsoft.XMLDOM");a.async=false;a.loadXML(b)}else{}}if(a.normalize){a.normalize()}return a};F.make_hoverable=function(a,b){a.hover_class=b;Y.U.Event.addListener(a,"mouseover",F.handle_hoverable_mouseover);Y.U.Event.addListener(a,"mouseout",F.handle_hoverable_mouseout)};F.handle_hoverable_mouseover=function(a){Y.U.Dom.addClass(this,this.hover_class)};F.handle_hoverable_mouseout=function(a){Y.U.Dom.removeClass(this,this.hover_class)};F.html_info={show:function(a){if(!a){return}if(!a.tip_div){var b=document.createElement("div");b.style.padding="10 0";b.style.display="none";b.innerHTML='<img src="'+_images_root+'/pulser2.gif" width="32" height="15" border="0">';a.tip_div=b;a.parentNode.appendChild(b);a.fragment_onLoad=function(e,c,d){a.fragment_loaded=1;a.tip_div.innerHTML=c;F.scroll_this_el_into_view(a.tip_div)}}if(a.tip_div.style.display=="none"){if(_ge("html_info_caret")){_ge("html_info_caret").src=_images_root+"/caret_open_down.gif"}a.tip_div.style.display="block";if(_ge("div_invite_loader")){_ge("div_invite_loader").style.display="none"}if(!a.fragment_loaded){F.fragment_getter.get(a.href+"&only_fragment=1",{},a,"fragment_onLoad")}else{F.scroll_this_el_into_view(a.tip_div)}}else{if(_ge("html_info_caret")){_ge("html_info_caret").src=_images_root+"/caret_closed.gif"}a.tip_div.style.display="none";if(_ge("div_invite_loader")){_ge("div_invite_loader").style.display="block"}}},showZeus:function(a){if(!a){return}if(!a.tip_div){var b=document.createElement("div");b.style.padding="10 0";b.style.display="none";b.innerHTML='<img src="'+_images_root+'/pulser2.gif" width="32" height="15" border="0">';a.tip_div=b;a.parentNode.appendChild(b);a.fragment_onLoad=function(e,c,d){a.fragment_loaded=1;a.tip_div.innerHTML=c;F.scroll_this_el_into_view(a.tip_div)}}if(a.tip_div.style.display=="none"){if(_ge("html-info-caret")){_ge("html-info-caret").innerHTML="&#9662;"}a.tip_div.style.display="block";if(_ge("div_invite_loader")){_ge("div_invite_loader").style.display="none"}if(!a.fragment_loaded){F.fragment_getter.get(a.href+"&only_fragment=1",{},a,"fragment_onLoad")}else{F.scroll_this_el_into_view(a.tip_div)}}else{if(_ge("html-info-caret")){_ge("html-info-caret").innerHTML="&#9656;"}a.tip_div.style.display="none";if(_ge("div_invite_loader")){_ge("div_invite_loader").style.display="block"}}}};F.osming={osming:false,check_map:function(j,o){var e=j.getCenterLatLon();var k=j.getZoomLevel();var m=j.getCurrentMapType();if(typeof(_use_osm)!="undefined"&&_use_osm==true){var h=false;var d="";var a=0;var l;var c=[2008,2009];if(typeof photo_taken_year!="undefined"){for(var b=0,f=c.length;b<f;b++){if(c[b]==photo_taken_year){l=_pi(photo_taken_year);break}}}if(m=="YAHOO_MAP"){if(k<10){if(e.Lat>=-4.3634901047&&e.Lat<=-4.3009300232&&e.Lon>=15.2374696732&&e.Lon<=15.3460502625){h=true}if(e.Lat>=2.0093801022&&e.Lat<=2.0614199638&&e.Lon>=45.313911438&&e.Lon<=45.3669013977){h=true}if(e.Lat>=-17.8511505127&&e.Lat<=-17.7955493927&&e.Lon>=31.021030426&&e.Lon<=31.0794296265){h=true}if(e.Lat>=-1.3546253687&&e.Lat<=-1.1987955811&&e.Lon>=36.7169952392&&e.Lon<=36.9593811035){h=true;d="kibera"}if(e.Lat>=5.5237197876&&e.Lat<=5.5998301506&&e.Lon>=-0.253580004&&e.Lon<=-0.1586299986){h=true}if(e.Lat>=30.0068798065&&e.Lat<=30.1119003296&&e.Lon>=31.2149791718&&e.Lon<=31.311170578){h=true}if(e.Lat>=36.699760437&&e.Lat<=36.8181610107&&e.Lon>=2.9909501076&&e.Lon<=3.1476099491){h=true}if(e.Lat>=50.3168792725&&e.Lon>=30.3380508423&&e.Lat<=50.5327110291&&e.Lon<=30.713060379){h=true}if(e.Lat>=16.4462890625&&e.Lon>=107.5323104858&&e.Lat<=16.4913291931&&e.Lon<=107.6173629761){h=true}if(e.Lat>=4.5628199577&&e.Lon>=-74.1714935303&&e.Lat<=4.7098898888&&e.Lon<=-74.0556335449){h=true}if(e.Lat>=3.403539896&&e.Lon>=-76.5521697998&&e.Lat<=3.4737200737&&e.Lon<=-76.4818496704){h=true}if(e.Lat>=6.2083601952&&e.Lon>=-75.618598938&&e.Lat<=6.2879300117&&e.Lon<=-75.5447769165){h=true}if(k<9){if(e.Lat>=35.46290704974905&&e.Lat<=36.02799998329552&&e.Lon>=139.21875&&e.Lon<=140.27069091796875){h=true}if(e.Lat>=17.811454&&e.Lat<=20.179721&&e.Lon>=-74.641111&&e.Lon<=-68.225095){h=true}if(k<8){if(e.Lat>=39.8558502197&&e.Lat<=40.0156097412&&e.Lon>=116.2662734985&&e.Lon<=116.4829177856){h=true}if(e.Lat>=-34.6944313049&&e.Lat<=-34.4146499634&&e.Lon>=-58.6389389038&&e.Lon<=-58.2992210388){h=true}if(e.Lat>=35.6444816589&&e.Lat<=35.7650184631&&e.Lon>=51.3495407104&&e.Lon<=51.4786109924){h=true}if(e.Lat>=20.9743099213&&e.Lat<=21.0687198639&&e.Lon>=105.7889633179&&e.Lon<=105.878868103){h=true}if(e.Lat>=10.7326498032&&e.Lat<=10.8422002792&&e.Lon>=106.6206512451&&e.Lon<=106.7253265381){h=true}if(e.Lat>=23.0498790741&&e.Lat<=23.1469707489&&e.Lon>=-82.4551391602&&e.Lon<=-82.3025131226){h=true}if(e.Lat>=-33.5340118408&&e.Lat<=-33.3920707703&&e.Lon>=-70.7330093384&&e.Lon<=-70.5628662109){h=true}if(e.Lat>=14.4964799881&&e.Lat<=14.6804504395&&e.Lon>=120.9344711304&&e.Lon<=121.0866470337){h=true}if(e.Lat>=7.0708699226&&e.Lat<=7.0890498161&&e.Lon>=125.6036834717&&e.Lon<=125.6218566895){h=true}if(e.Lat>=10.2898797989&&e.Lat<=10.3323202133&&e.Lon>=123.8772964478&&e.Lon<=123.9136810303){h=true}if(e.Lat>=-35.2210502625&&e.Lat<=-34.6507987976&&e.Lon>=138.4653778076&&e.Lon<=138.7634735107){h=true}if(e.Lat>=-34.1896095276&&e.Lat<=-33.5781402588&&e.Lon>=150.5171661377&&e.Lon<=151.3425750732){h=true}if(e.Lat>=-27.8130893707&&e.Lat<=-27.0251598358&&e.Lon>=152.6393127441&&e.Lon<=153.3230438232){h=true}if(e.Lat>=-35.4803314209&&e.Lat<=-35.1245193481&&e.Lon>=148.9959259033&&e.Lon<=149.2332458496){h=true}if(e.Lat>=-38.4112510681&&e.Lat<=-37.5401115417&&e.Lon>=144.5532073975&&e.Lon<=145.5077362061){h=true}if(e.Lat>=33.2156982422&&e.Lat<=33.4300994873&&e.Lon>=44.2592010498&&e.Lon<=44.5364112854){h=true}if(e.Lat>=34.461101532&&e.Lat<=34.5925598145&&e.Lon>=69.0997009277&&e.Lon<=69.2699813843){h=true}if(k<7){if(e.Lat>=40.735551&&e.Lat<=40.807533&&e.Lon>=-119.272041&&e.Lon<=-119.163379&&l==2008){h=true;a=1}if(e.Lat>=40.7472569628&&e.Lat<=40.7971774152&&e.Lon>=-119.267578125&&e.Lon<=-119.201660156){h=true;a=1}}}}}}if(h){if(!this.osming){this.osming=true;this.oldTileReg=YMapConfig.tileReg;var g="/map_openstreetmap_tile_broker.gne?t=m&";if(d!=""){g+="v="+d+"&"}if(a){g+="bm="+a+"&";if(l){g+="yr="+l+"&"}}YMapConfig.tileReg=[g,g];if(_ge("f_div_osm_cc")){_ge("f_div_osm_cc").style.display="block"}j._cleanTileCache();j._callTiles()}setTimeout("F.osming.hide_y_copy('"+o+"')",100);setTimeout("F.osming.hide_y_copy('"+o+"')",800)}else{if(this.osming==true){this.osming=false;YMapConfig.tileReg=this.oldTileReg;if(_ge("f_div_osm_cc")){_ge("f_div_osm_cc").style.display="none"}j._cleanTileCache();j._callTiles();setTimeout("F.osming.show_y_copy('"+o+"')",100);setTimeout("F.osming.show_y_copy('"+o+"')",800)}}}},hide_y_copy:function(b){var a=Y.U.Dom.getElementsBy(function(c){if((c.style.left=="1px"&&c.style.bottom=="0px")||c.src.indexOf("/copy")>=0){return true}return false},"img",_ge(b));if(a.length==1){a[0].style.display="none"}var a=Y.U.Dom.getElementsBy(function(c){if(c.src.indexOf("/yahoo.png")>=0){return true}return false},"img",_ge(b));if(a.length==1){a[0].style.display="none"}var a=Y.U.Dom.getElementsBy(function(c){if(c.innerHTML.indexOf("Yahoo!")>=0){return true}return false},"div",_ge(b));if(a.length==1){a[0].style.display="none"}},show_y_copy:function(b){var a=Y.U.Dom.getElementsBy(function(c){if((c.style.left=="1px"&&c.style.bottom=="0px")||c.src.indexOf("/copy")>=0){return true}return false},"img",_ge(b));if(a.length==1){a[0].style.display="block"}var a=Y.U.Dom.getElementsBy(function(c){if(c.src.indexOf("/yahoo.png")>=0){return true}return false},"img",_ge(b));if(a.length==1){a[0].style.display="block"}var a=Y.U.Dom.getElementsBy(function(c){if(c.innerHTML.indexOf("Yahoo!")>=0){return true}return false},"div",_ge(b));if(a.length==1){a[0].style.display="block"}}};F.set_spaceid=function(g){var h="//geo.yahoo.com/f?";var a=_ge("beacon");if(!a||!a.getElementsByTagName("img")[0]){return false}var d=a.getElementsByTagName("img")[0];var b=d.src;b=b.substr(b.indexOf("?")+1);var c=b.split("&");var j={s:"792600122",t:(new Date()).getTime(),r:encodeURIComponent(window.location.href)};if(g){j.s=g}var k=null;for(var e=0,f=c.length;e<f;e++){k=c[e].split("=")[0];if(j[k]){c[e]=k+"="+j[k]}}d.src=h+c.join("&");writeDebug("beaconImg.src: "+d.src)};F.getty_intl_warn=function(f){var b={"en-us":"english","fr-fr":false,"de-de":false,"es-us":false,"it-it":false,"pt-br":false,"zh-hk":false,"ko-kr":false};var d="";if(!global_intl_lang||typeof b[global_intl_lang]=="undefined"){F.getty_log_omniture();return true}if(b[global_intl_lang]){F.getty_log_omniture();window.location.href=f}else{if(global_comm_div){var h=_ge("comm_div");var g=_ge("shadow_div");var a=null;if(h){a=F.find_parent_node(h).removeChild(h);if(g){g=F.find_parent_node(g).removeChild(g);g.style.left="0px";g.style.top="0px";document.body.appendChild(g)}global_comm_div=null}}if(!global_comm_div){_make_comm_div("10001")}function c(){F.getty_log_omniture();window.location.href=f}function e(){_ge("shadow_div").style.display="none";_ge("shadow_div").style.left="-9999px";_ge("shadow_div").style.top="-9999px"}global_comm_div.start_comming(F.output.get("getty_intl_warning"),undefined,undefined,true,true,F.output.get("go_ahead"),c,true,F.output.get("remain_here"),e,undefined,true,false);return false}};F.getty_log_omniture=function(){if(window.s_gi){var a=s_gi(s_account);a.linkTrackVars="eVar9,events";a.linkTrackEvents="event21";a.eVar9=page_photo_id;a.events="event21";a.tl("","o","Link Name")}};Y.E.addListener(window,"load",function(){window.setTimeout(F._preload_images_ready,1000)});F.keyboardShortcuts={enabled:false,handlers:{jumpToSearchField:function(b,a,d){var c=_ge("header_search_q");if(c&&c.tagName.toLowerCase()==="input"&&c.focus){Y.E.stopEvent(a[1]);F.scroll_this_el_into_view(c,null,function(){c.focus()},null,10,true)}},jumpToCommentField:function(b,a,d){var c=_ge("message");if(c&&c.tagName.toLowerCase()==="textarea"&&c.focus){Y.E.stopEvent(a[1]);F.scroll_this_el_into_view(c,null,function(){c.focus()},null,60,true)}},addTag:function(b,a,c){if(tagrs_showForm&&typeof tagrs_showForm==="function"){Y.E.stopEvent(a[1]);F.scroll_this_el_into_view("tagadderlink",null,function(){tagrs_showForm()},null,0,true)}},addPerson:function(b,a,d){var c=_ge("add-person-link");if(c&&typeof c.onclick==="function"){Y.E.stopEvent(a[1]);F.scroll_this_el_into_view(c,null,function(){c.onclick()},null,0,true)}},favoritePhoto:function(b,a,c){var d=_ge("photo_gne_button_add_to_faves");if(d&&typeof d.handle_click==="function"){Y.E.stopEvent(a[1]);F.scroll_this_el_into_view("photo_gne_button_add_to_faves",null,function(){d.handle_click()},null,0,true)}},nextPhotoInContext:function(b,a,c){if(nextprev_currentContextID){var d=_ge("nextprev_div_"+nextprev_currentContextID);if(d&&d.next_url){Y.E.stopEvent(a[1]);window.location=d.next_url}}},prevPhotoInContext:function(b,a,c){if(nextprev_currentContextID){var d=_ge("nextprev_div_"+nextprev_currentContextID);if(d&&d.prev_url){Y.E.stopEvent(a[1]);window.location=d.prev_url}}},nextContext:function(b,a,c){},previousContext:function(b,a,c){},navigateToUpload:function(){window.location="/photos/upload/"},navigateToYourPhotostream:function(){window.location=photos_url},navigateToOrganizr:function(){window.location="/photos/organize/"},navigateToRecentActivity:function(){window.location="/activity/"},navigateToContactsUploads:function(){window.location="/photos/friends/"},navigateToGroups:function(){window.location="/groups/"},navigateToHelp:function(){window.location="/help/"}},enableAll:function(){if(F.keyboardShortcuts.enabled){return}F.keyboardShortcuts.jumpToSearchField.enable();F.keyboardShortcuts.jumpToCommentField.enable();F.keyboardShortcuts.addPerson.enable();F.keyboardShortcuts.favoritePhoto.enable();F.keyboardShortcuts.nextPhotoInContext.enable();F.keyboardShortcuts.prevPhotoInContext.enable();F.keyboardShortcuts.navigateToUpload.enable();F.keyboardShortcuts.navigateToYourPhotostream.enable();F.keyboardShortcuts.navigateToOrganizr.enable();F.keyboardShortcuts.navigateToRecentActivity.enable();F.keyboardShortcuts.navigateToContactsUploads.enable();F.keyboardShortcuts.navigateToGroups.enable();F.keyboardShortcuts.enabled=true},disableAll:function(){if(!F.keyboardShortcuts.enabled){return}F.keyboardShortcuts.jumpToSearchField.disable();F.keyboardShortcuts.jumpToCommentField.disable();F.keyboardShortcuts.addPerson.disable();F.keyboardShortcuts.favoritePhoto.disable();F.keyboardShortcuts.nextPhotoInContext.disable();F.keyboardShortcuts.prevPhotoInContext.disable();F.keyboardShortcuts.navigateToUpload.disable();F.keyboardShortcuts.navigateToYourPhotostream.disable();F.keyboardShortcuts.navigateToOrganizr.disable();F.keyboardShortcuts.navigateToRecentActivity.disable();F.keyboardShortcuts.navigateToContactsUploads.disable();F.keyboardShortcuts.navigateToGroups.disable();F.keyboardShortcuts.enabled=false}};F.keyboardShortcuts.jumpToSearchField=new Y.U.KeyListener(document,{keys:83,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.jumpToSearchField,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.jumpToCommentField=new Y.U.KeyListener(document,{keys:67,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.jumpToCommentField,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.addTag=new Y.U.KeyListener(document,{keys:84,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.addTag,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.addPerson=new Y.U.KeyListener(document,{keys:80,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.addPerson,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.favoritePhoto=new Y.U.KeyListener(document,{keys:70,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.favoritePhoto,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.nextPhotoInContext=new Y.U.KeyListener(document,{keys:75,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.nextPhotoInContext,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.prevPhotoInContext=new Y.U.KeyListener(document,{keys:74,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.prevPhotoInContext,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.nextContext=new Y.U.KeyListener(document,{keys:73,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.nextContext,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.previousContext=new Y.U.KeyListener(document,{keys:77,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.previousContext,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.navigateToUpload=new Y.U.KeyListener(document,{keys:85,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.navigateToUpload,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.navigateToYourPhotostream=new Y.U.KeyListener(document,{keys:89,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.navigateToYourPhotostream,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.navigateToOrganizr=new Y.U.KeyListener(document,{keys:79,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.navigateToOrganizr,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.navigateToRecentActivity=new Y.U.KeyListener(document,{keys:82,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.navigateToRecentActivity,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.navigateToContactsUploads=new Y.U.KeyListener(document,{keys:78,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.navigateToContactsUploads,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.navigateToGroups=new Y.U.KeyListener(document,{keys:71,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.navigateToGroups,scope:F.keyboardShortcuts,correctScope:true});F.keyboardShortcuts.navigateToHelp=new Y.U.KeyListener(document,{keys:191,ctrl:true,shift:true},{fn:F.keyboardShortcuts.handlers.navigateToHelp,scope:F.keyboardShortcuts,correctScope:true});F.wordwrap=function(n,t,d,q){var e=t||75,o=d||"\n",k=q||false,h,g,f,u,a;for(h=-1,f=(a=n.split(/\r\n|\n|\r/)).length;++h<f;a[h]+=u){for(u=a[h],a[h]="";u.length>e;a[h]+=u.slice(0,g)+((u=u.slice(g)).length?o:"")){g=k==2||(g=u.slice(0,e+1).match(/\S*(\s)?$/))[1]?e:g.input.length-g[0].length||k==1&&e||g.input.length+(g=u.slice(e).match(/^\S*/)).input.length}}return a.join("\n")};F.get_elm_size=function(d){var b=_ge("OffScreenElm");if(!b){b=document.createElement("div");b.id="OffScreenElm";b.style.position="absolute";b.style.top="-9999px";b.style.left="-9999px";document.getElementsByTagName("body")[0].appendChild(b)}b.innerHTML=d.innerHTML;var a=b.offsetWidth;var c=b.offsetHeight;b.innerHTML="";return[a,c]};F.GlobalDialog=function(){writeDebug("F.GlobalDialog()");var a=this;var c=(navigator.userAgent.match(/msie/i));var e=Y.D.getElementsByClassName;var b="global_dialog";var d=(navigator.userAgent.match(/msie 6/i));this.spinner=null;this.is_modal=false;this.events_on=false;this.o_shadows=null;this.is_showing=false;this.style="default";this.last_style=null;this.on_escape_handler=null;this.o=null;this.o_container=null;this.o_cover=null;this.get_elements=function(){if(!a.o_cover){a.o_cover=_ge("global-dialog-background")}if(!a.o||!a.o_container){a.o=document.getElementById(b);if(!a.o){writeDebug("F.GlobalDialog(): Warn: o_dialog is null/undefined");return false}else{writeDebug("F.GlobalDialog().get_elements");a.o_container=e("global_dialog_container","div",a.o)[0];if(a.o){a.o_shadows={left:e("shadow_l","div",a.o)[0],right:e("shadow_r","div",a.o)[0]};return true}}}else{return true}};this.reposition=function(){if(!a.get_elements()){writeDebug("GlobalDialog.reposition: o is null?");return false}var g=parseInt(a.o_container.offsetHeight);if(a.o_shadows&&a.o_shadows.left&&a.o_shadows.right){a.o_shadows.left.style.height=a.o_shadows.right.style.height=(g+"px")}a.o.style.marginLeft=-(parseInt(a.o.offsetWidth)/2)+"px";a.o.style.marginTop=-(parseInt(a.o.offsetHeight)/2)+"px";a.o.style.left="50%";a.o.style.top="50%";if(c){if(window.innerWidth){var f=window.pageXOffset;var h=window.pageYOffset}else{var f=document.body.scrollLeft;var h=document.body.scrollTop}a.o.style.top=(h+parseInt(document.body.clientHeight/2)+"px")}};this.show=function(f){writeDebug("F.global_dialog.show()");if(typeof f!="undefined"&&typeof f.loading!="undefined"){a.set_loading(f.loading?true:false)}if(!a.get_elements()){return false}if(typeof f!="undefined"){if((typeof f.modal=="undefined")||(typeof f.modal!="undefined"&&f.modal!=false)){a.set_modal(true)}else{a.set_modal(false)}if(typeof f.style!="undefined"){a.set_style(f.style)}if(typeof f.width!="undefined"){a.set_width(f.width)}}else{a.set_modal(true)}if(!a.is_showing){if(f&&typeof f.left!="undefined"){a.o.style.left=f.left;a.o.style.top=f.top;a.o.style.display="block";a.is_showing=true}else{a.o.style.left="-9999px";a.o.style.top="-9999px";a.o.style.display="block";a.reposition();a.is_showing=true}}};this.hide=function(f){writeDebug("F.global_dialog.hide()");a.set_modal();if(c){a.detach_events()}a.detach_key_events();if(f&&f.loading){a.set_loading(true)}else{a.set_loading(false)}if(!a.get_elements()){return false}if(a.is_showing){a.o.style.display="none";a.is_showing=false}a.on_escape_handler=null};this.set_width=function(f){if(!a.get_elements()){writeDebug("F.GlobalDialog.set_width: no element");return false}if(f){writeDebug("setting container width: "+f);a.o.style.width="auto";a.o_container.style.width=f+"px"}else{writeDebug("setting default width");a.o.style.width="auto";a.o_container.style.width=(d?"334px":"320px")}a.reposition()};this.set_style=function(f){if(!a.get_elements()){writeDebug("F.GlobalDialog.set_style: no element");return false}writeDebug("F.globalDialog.set_style()");if(a.last_style){Y.D.removeClass(a.o,a.last_style)}if(f){Y.D.addClass(a.o,f)}a.last_style=f;a.reposition()};this.set_spinner=function(f){if(f){if(!a.spinner){a.spinner=document.createElement("div");a.spinner.className="global_dialog_spinner";document.body.appendChild(a.spinner);if(c){a.position_cover(a.spinner)}}a.spinner.style.display="block"}else{if(a.spinner){a.spinner.style.display="none"}}};this.set_modal=function(f){a.is_modal=f;if(!a.o_cover){return false}if(f){if(c){a.o_cover.style.position="absolute";a.position_cover();a.attach_events()}else{a.o_cover.style.position="fixed"}a.attach_key_events();var g=35;a.o_cover.style.backgroundColor="#000";a.o_cover.style.opacity=g/100;a.o_cover.style.MozOpacity=g/100;a.o_cover.style.filter="alpha(opacity="+g+")";a.o_cover.style.display="block"}else{a.o_cover.style.position="absolute";a.o_cover.style.display="none";a.detach_events();a.detach_key_events()}};this.set_loading=function(f){if(!a.o_cover){writeDebug("setLoading: no cover");return false}writeDebug("F.global_dialog.set_loading(): "+f);if(f){a.set_spinner(f);Y.D.removeClass(a.o_cover,"loaded");Y.D.addClass(a.o_cover,"loading");if(!a.is_modal){a.set_modal(true)}}else{a.set_spinner(f);Y.D.removeClass(a.o_cover,"loading");Y.D.addClass(a.o_cover,"loaded");if(a.is_modal){a.set_modal(false)}}};this.remove_existing_dialog=function(){if(a.o){writeDebug("remove_existing_dialog: removing node");try{a.o.parentNode.removeChild(a.o);a.o=null;writeDebug("remove OK");return true}catch(f){writeDebug("WARN: could not remove node");return false}}};this.create_dialog=function(h,f){if(a.o){a.remove_existing_dialog();a.o=null}a.last_style=null;a.is_showing=false;var g=document.createElement("div");g.id="global_dialog";g.className="global_dialog";document.body.appendChild(g);a.o=g;a.o.innerHTML='<div id="global-dialog-container" class="global_dialog_container"><div class="wrapper">'+h+"</div></div>";a.o_container=null;a.get_elements();if(f&&f.style){a.set_style(f.style)}if(f&&f.width){a.set_width(f.width)}else{a.set_width()}return a};this.position_cover=function(g){if(!g){var g=a.o_cover}if(!a.get_elements()){return false}if(window.innerWidth){var f=window.pageXOffset;var h=window.pageYOffset}else{var f=document.body.scrollLeft;var h=document.body.scrollTop}g.style.top=h+"px";g.style.left=f+"px"};this.legacy_resize_handler=function(){writeDebug("GlobalDialog.legacy_resize_handler()");a.reposition();a.position_cover()};this.legacy_scroll_handler=function(){writeDebug("GlobalDialog.legacy_scroll_handler()");a.reposition();a.position_cover()};this.key_handler=function(g){writeDebug("key_handler()");var f=g.which||g.keyCode;if(f==27){a.hide()}};this.attach_events=function(){if(a.events_on){return false}a.events_on=true;Y.U.Event.addListener(window,"resize",a.legacy_resize_handler,a,true);Y.U.Event.addListener(window,"scroll",a.legacy_scroll_handler,a,true)};this.attach_key_events=function(){Y.U.Event.addListener(window,"keyup",a.key_handler,a,true)};this.detach_events=function(){if(!a.events_on){return false}a.events_on=false;Y.U.Event.removeListener(window,"resize",a.legacy_resize_handler);Y.U.Event.removeListener(window,"scroll",a.legacy_scroll_handler)};this.detach_key_events=function(){Y.U.Event.removeListener(window,"keyup",a.key_handler)};F.preload_images(_images_root+"/progress/balls-24x12-white.gif");this.get_elements()};F.global_dialog=null;Y.E.onDOMReady(function(){F.global_dialog=new F.GlobalDialog()});if(typeof page_printing_use_printcart!="undefined"){F.Printing=function(){var self=this;var enable_printcart=(typeof page_printing_use_printcart!="undefined");var snapfish_unavailable=(typeof page_printing_snapfish_unavailable!="undefined"?page_printing_snapfish_unavailable:null);this.cart_urls={};this.addtocart_cart_url=page_printing_snapfish_cart_url;this.authed_partners={snapfish:null};this.user_data={user_country:(typeof page_printing_country_user!="undefined"?page_printing_country_user:null)};this.size_units=null;this.options={print_partner:"snapfish",photo_ids:null,product_name:"print",product:null,show_other_products:false,user_currency:null,style:null};this.composites_allowing_single_photo={prod6:true,prod7:true,prod8:true,prod9:true};var special_country_exceptions={snapfish:{cn:"exception-china",dk:"exception-generic",hk:"exception-china",no:"exception-generic",se:"exception-generic",va:"exception-italy"}};this.printcart_config={queue:[],max_ids_per_api_call:20,api_responses:0,api_responses_expected:0};this.global_photos_data={queue:[],api_queue:[],max_ids_per_api_call:16,max_items_to_check:256,api_responses:0,api_responses_expected:0};this.reset_exclusions=function(){self.excluded_videos={ids:[]};self.excluded_photos={ids:[],non_jpeg:[]}};this.reset_exclusions();this.check_global_photo_exceptions=function(){writeDebug("check_global_photo_exceptions()");var id=null;var do_remove=null;var ok_photo_ids=[];for(var i=self.options.photo_ids.length;i--;){do_exclude=0;if(window.global_photos[self.options.photo_ids[i]]){if(window.global_photos[self.options.photo_ids[i]].media=="video"){self.excluded_videos.ids.push(self.options.photo_ids[i]);do_exclude=1}if(window.global_photos[self.options.photo_ids[i]].media=="photo"){if(window.global_photos[self.options.photo_ids[i]].originalformat){if(window.global_photos[self.options.photo_ids[i]].originalformat.match(/gif|bmp|tif|tiff|png/i)){do_exclude=1;self.excluded_photos.ids.push(self.options.photo_ids[i]);self.excluded_photos.non_jpeg.push(self.options.photo_ids[i])}else{}}else{}}}if(!do_exclude){ok_photo_ids.push(self.options.photo_ids[i])}}return ok_photo_ids};this.is_showing_products=false;var photo_id=null;var is_multiple_photoids=null;var print_item_count=0;var use_simple_confirm_dialog=null;var supported_countries=null;var last_location_class=null;var which="print";var ref_str_base="PrintDialog";var ref_str=ref_str_base+"Div";var what_key="print";this.fetched_product_list=false;this.check_is_authed=function(partner_id,f_onload){writeDebug("F.printing.check_is_authed()");if(!partner_id){writeDebug("check_is_authed: need partner id");return false}if(!f_onload){writeDebug("check_is_authed: need onload handler")}if(typeof self.authed_partners[partner_id]!="undefined"&&self.authed_partners[partner_id]!=null){f_onload(self.authed_partners[partner_id])}else{var auth_params={partner:partner_id,user_id:global_nsid};var handler={flickr_auth_userHasPartnerToken_onLoad:function(success,responseXML,responseText,params){var token_element=responseXML.documentElement.getElementsByTagName("auth")[0];if(token_element){self.authed_partners[partner_id]=(token_element.getAttribute("has_token")=="1")}else{self.authed_partners[partner_id]=false}f_onload(self.authed_partners[partner_id])}};F.API.callMethod("flickr.auth.userHasPartnerToken",auth_params,handler)}};this.reset=function(){writeDebug("reset(): starting over - will re-fetch fragment, products");self.fetched_product_list=false;self.productsO=undefined;self.is_showing_products=false};this.auth_prompt=function(o_params){if(!o_params){writeDebug("auth_prompt: {partner:} param missing?");return false}var params={partner:o_params.partner,magic_cookie:global_auth_hash};self.do_auth_ok_handler=(o_params.onsuccess?o_params.onsuccess:null);self.do_auth_fail_handler=(o_params.onfail?o_params.onfail:null);F.global_dialog.hide();F.global_dialog.set_loading(true);window.page_always_post_fragment_requests=true;F.fragment_getter.get("/photo_auth_inline_fragment.gne",params,this,"auth_prompt_onload")};this.print_location_update=function(){var snapfish_location=_ge("print_country_snapfish").value;if(!supported_countries){var o=_ge("print-supported-countries").getElementsByTagName("option");supported_countries=[];for(var i=o.length;i--;){supported_countries[o[i].value]=true}}if(typeof special_country_exceptions.snapfish[this.value]!="undefined"){Y.D.removeClass("print-location-container",last_location_class);last_location_class=special_country_exceptions.snapfish[this.value];Y.D.addClass("print-location-container",last_location_class)}else{if(!supported_countries[this.value]){Y.D.removeClass("print-location-container",last_location_class);Y.D.addClass("print-location-container","exception");last_location_class="exception"}else{Y.D.removeClass("print-location-container",last_location_class)}}};this.auth_prompt_onload=function(success,responseText,params){writeDebug("auth_account_onload()");F.global_dialog.remove_existing_dialog();var content=document.createElement("div");content.innerHTML=responseText;document.body.appendChild(content);F.global_dialog.set_width(525);F.global_dialog.show({loading:false});if(self.options.print_partner=="snapfish"&&_ge("print-location")){_ge("print-location").onchange=_ge("print-location").onkeypress=self.print_location_update;_ge("print-location").onchange.apply(_ge("print-location"))}if(!success&&o_params&&o_params.onfail){o_params.onfail()}};this.set_print_prefs_and_auth=function(o_print_prefs,o_auth_params){writeDebug("set_print_prefs_and_auth()");if(!o_print_prefs){writeDebug("need print_prefs object");return false}var print_country=o_print_prefs.print_country||null;var print_privacy=o_print_prefs.print_privacy||null;var api_responses_expected=0;var api_responses_done_handler=null;function generic_api_handler(){writeDebug("set_print_prefs_generic_api_onload()");api_responses_expected--;writeDebug("responses remaining: "+api_responses_expected);if(api_responses_expected==0){writeDebug("calling done handler");api_responses_done_handler()}}if(print_country){api_responses_expected++;if(print_privacy!=null){F.API.callMethod("flickr.printing.setPrefs",{country_code:print_country,print_privacy:print_privacy},{generic_api_onLoad:generic_api_handler})}else{F.API.callMethod("flickr.printing.setPrefs",{country_code:print_country},{generic_api_onLoad:generic_api_handler})}}if(api_responses_expected>0){api_responses_done_handler=function(){self.do_auth(o_auth_params)}}else{self.do_auth(o_auth_params)}};this.do_auth_ok_handler=function(){writeDebug("do_auth_ok_handler()")};this.do_auth_fail_handler=function(){writeDebug("do_auth_fail_handler()")};this.do_auth=function(o_params){if(!o_params){writeDebug("do_auth: {partner:} param missing?");return false}var params={magic_cookie:global_auth_hash,partner:o_params.partner};window.page_always_post_fragment_requests=true;F.fragment_getter.get("/services/auth/inline.gne",params,this,"do_auth_onload")};this.do_auth_onload=function(success,responseText,params){writeDebug("do_auth_onload: checking response: "+responseText);var rsp=eval("("+responseText+")");if(rsp.stat){var token=rsp.token;writeDebug("response: OK");if(self.do_auth_ok_handler){writeDebug("calling do_auth_ok_handler()");self.do_auth_ok_handler(success,responseText,params)}else{writeDebug("no do_auth_ok_handler()?")}}else{writeDebug("Response: Fail");if(self.do_auth_fail_handler){writeDebug("calling do_auth_fail_handler");self.do_auth_fail_handler(success,responseText,params)}else{writeDebug("no do_auth_fail_handler?")}}};this.set_photo_ids=function(a_photo_ids){writeDebug("set_photo_ids");self.options.photo_ids=a_photo_ids;print_item_count=self.options.photo_ids.length;is_multiple_photoids=(print_item_count>1)};this.need_to_get_photo_info=function(){writeDebug("need_to_get_photo_info()");var need=false;var queue=[];var item=null;for(var i=0,j=self.options.photo_ids.length;i<j;i++){item=window.global_photos[self.options.photo_ids[i]];if(!item||!item.originalformat){queue.push(self.options.photo_ids[i])}}if(queue.length){writeDebug("need_to_get_photo_info: "+queue.length+" items")}else{writeDebug("need_to_get_photo_info: photo info present")}if(!queue.length){writeDebug("need_to_get_photo_info(): nothing in queue")}return queue};this.check_global_photos=function(f_api_onload_handler){writeDebug("check_global_photos()");var queue=self.need_to_get_photo_info();writeDebug("queue: "+queue.length+" items");var new_items=0;for(var i=queue.length;i--;){new_items++;self.global_photos_data.queue.push(queue[i])}writeDebug("number of items in queue: "+self.global_photos_data.queue.length);if(self.global_photos_data.queue.length){return self.get_global_photos_info(f_api_onload_handler)}else{return 0}};this.get_global_photos_info=function(f_api_onload_handler){var api_calls=0;if(self.global_photos_data.queue.length){var max_items=Math.min(self.global_photos_data.max_items_to_check,self.global_photos_data.queue.length);api_calls=Math.max(1,Math.ceil(max_items/self.global_photos_data.max_ids_per_api_call));writeDebug("api_calls: "+api_calls);self.global_photos_data.api_responses_expected=api_calls;var get_info_photo_ids=[];var index=0;var photo_limit=Math.min(self.global_photos_data.max_items_to_check,self.global_photos_data.queue.length);for(var i=0,j=photo_limit;i<j;i++){index=Math.floor(i/self.global_photos_data.max_ids_per_api_call);if(!get_info_photo_ids[index]){get_info_photo_ids[index]=[]}get_info_photo_ids[index].push(self.global_photos_data.queue[i])}var params=null;var limit=Math.min(api_calls,get_info_photo_ids.length);for(i=0;i<limit;i++){writeDebug("checking photo "+i);params={photo_ids:get_info_photo_ids[i].join(",")};F.API.callMethod("flickr.photos.getInfo",params,{flickr_photos_getInfo_onLoad:function(success,responseXML,responseText,params){var photos=responseXML.documentElement.getElementsByTagName("photo");for(var i=0,j=photos.length;i<j;i++){_upsert_photo(photos[i])}self.global_photos_data.api_responses++;if(self.global_photos_data.api_responses>=self.global_photos_data.api_responses_expected&&f_api_onload_handler){f_api_onload_handler()}}})}self.global_photos_data.queue=[]}else{return 0}};this.order_products=function(o_options){if(typeof window.use_yui3_printing!="undefined"){writeDebug("F.printing.order_products(): YUI 3 printing active, exiting");return false}if(!o_options){writeDebug("order_products: WARN: No partner/photo ID params - using defaults")}else{if(o_options.print_partner){self.options.print_partner=o_options.print_partner}if(o_options.photo_ids){if(o_options.photo_ids instanceof Array){writeDebug("photo_ids is an array, "+o_options.photo_ids.length+" items")}else{o_options.photo_ids=o_options.photo_ids.toString().replace(/\s/g,"").split(",")}writeDebug("setting photo id(s): "+o_options.photo_ids.join(","));self.options.photo_ids=(!(o_options.photo_ids instanceof Array))?[o_options.photo_ids]:o_options.photo_ids}else{if(typeof page_photo_id!="undefined"&&page_photo_id){writeDebug("order_products: using page_photo_id");self.options.photo_ids=[page_photo_id]}}if(o_options.show_other_products){writeDebug("setting show_other_products");self.options.show_other_products=o_options.show_other_products}if(o_options.product){writeDebug("setting product filter - results will be limited to matching API endpoint");self.reset();self.options.product_name=o_options.product;self.options.product=o_options.product}if(o_options.style){self.options.style=o_options.style}}if(!self.options.print_partner){writeDebug("order_products: Need print_partner");return false}if(!self.options.photo_ids){if(typeof page_photo_id!="undefined"&&page_photo_id){writeDebug("using page_photo_id");self.options.photo_ids=[page_photo_id]}else{writeDebug("order_products: Need photo_ids");return false}}print_item_count=self.options.photo_ids.length;is_multiple_photoids=(print_item_count>1);writeDebug("order_products: using "+self.options.print_partner+" / "+self.options.photo_ids.join(","));self.check_global_photos(self.show_printing_products);if(!self.fetched_product_list){writeDebug("Fetching product list, etc...")}else{F.global_dialog.show();return false}F.global_dialog.set_loading({modal:true});var params=null;if(is_multiple_photoids){params={photo_id:self.options.photo_ids.join(",")}}else{params={photo_id:self.options.photo_ids[0]}}if(typeof window.is_organizr!=="undefined"){params.use_yui2_printing=1}use_simple_confirm_dialog=(self.options.checkout||self.options.is_organizr||(self.options.product&&!self.composites_allowing_single_photo["prod"+params.product_id])&&self.options.product!="print");F.fragment_getter.get("/photo_print_fragment.gne",params,F.printing,"photo_print_fragment_onload")};this.print_set=function(o_options){if(!o_options){writeDebug("print_set: need options");return false}var photo_ids=(o_options.photo_ids||null);var set_id=(o_options.set_id||null);if(!photo_ids||!photo_ids.length){writeDebug("print_set: no photo ids?");if(set_id==null){writeDebug("print_set: set_id is null");return false}var params={photoset_id:set_id};var handler={flickr_photosets_getPhotos_onLoad:function(success,responseXML,responseText,params){var photos=responseXML.documentElement.getElementsByTagName("photo");var photo_ids=[];for(var i=0,j=photos.length;i<j;i++){photo_ids.push(photos[i].getAttribute("id"))}if(photo_ids.length){self.order_products({photo_ids:photo_ids})}else{F.global_dialog.set_loading(false);return false}}};F.global_dialog.set_loading(true);F.API.callMethod("flickr.photosets.getPhotos",params,handler)}else{self.order_products({photo_ids:photo_ids});return false}};this.photo_print_fragment_onload=function(success,responseText,params){writeDebug("photo print fragment onload: "+responseText);F.global_dialog.remove_existing_dialog();if(is_multiple_photoids||use_simple_confirm_dialog){F.global_dialog.create_dialog('<div class="bd" style="padding:12px">'+self.get_print_options_html()+'</div><div class="ft">'+self.get_footer_checkout_note()+"</div>",{style:self.options.style})}else{F.global_dialog.create_dialog('<div class="bd" style="padding:12px">'+self.get_print_options_html()+"</div>",{style:self.options.style})}writeDebug("printDialogListDiv: "+_ge("PrintDialogListDiv"));_ge("PrintDialogListDiv").innerHTML=responseText;writeDebug("print_form: "+_ge("print_form"));_ge("PrintDialogHeaderDiv").style.display="none";_ge("PrintDialogListWrapperDiv").style.display="block";_ge("print_form").style.display="block";self.assign_other_product_links();self.show_printing_products()};this.get_product_name=function(partner_id,product_id,product_endpoint,size_label,size_units){var name=partner_id+"_product"+product_id;writeDebug("get_product_name()");if(size_label&&size_units){writeDebug("dimensions && type");if(product_endpoint=="print"){name=partner_id+"_prints";writeDebug("F.printing.get_product_name: "+name);return F.output.get(name,size_label.replace_global("x","&times;"))}else{if(product_endpoint=="poster"){name=partner_id+"_poster";writeDebug("F.printing.get_product_name: "+name);return F.output.get(name,size_label.replace_global("x","&times;"))}}}writeDebug("F.printing.get_product_name: "+name);return F.output.get(name)};this.get_print_options_html=function(){writeDebug("get_print_options_html");var ref_str_base="PrintDialog";var what_key="print";var what=F.output.get("photo_what_print");var what_plural=F.output.get("photo_what_print_plural");var button_w=58;var list_method="";var none_msg="";var start_html='<div id="'+ref_str_base+'"'+(is_multiple_photoids?' class="print_cart is_multiple_photos"':' class="print_cart"')+">";start_html+='<div id="'+ref_str_base+'HeaderDiv">'+F.output.get("photo_loading_print_options")+"</div>";start_html+='<div id="'+ref_str_base+'ListWrapperDiv">';start_html+='<div id="'+ref_str_base+'ListDiv" style="padding-right:2px; max-height:450px; overflow:auto;overflow-x:hidden"></div>';start_html+="</div>";start_html+="</div>";start_html+='<div id="'+ref_str_base+'BottomDiv" style="margin:3px; display:none; text-align:center;">';start_html+='<a href="" onclick="hide_'+ref_str_base+'(); return false;">'+F.output.get("cancel")+"</a>";start_html+="</div>";writeDebug("get_print_options_html: OK");return start_html};this.get_click_a_text=function(){writeDebug("get_click_a_text");var txt="";if(which=="sendToSet"){if(user_can_create_sets){txt+=F.output.get("photo_choose_a_set_or","_ge('"+ref_str+"').show_new_set_form();return false;")}else{txt+=F.output.get("photo_choose_a_set")}}else{if(which=="addToGallery"){txt+=F.output.get("photo_choose_a_gallery_or","_ge('"+ref_str+"').show_new_gallery_form(); return false;")}else{if(which=="print"){if(!is_multiple_photoids){txt=F.output.get("photo_snapfish_choose_a_size")}else{txt="<b>"+F.output.get("print_x_photos_with_snapfish",print_item_count)+"</b>"}}else{if(what_key=="set"){txt=F.output.get("photo_choose_a_what_set")}if(what_key=="group"){txt=F.output.get("photo_choose_a_what_group")}if(what_key=="blog"){txt=F.output.get("photo_choose_a_what_blog")}if(what_key=="print"){txt=F.output.get("photo_choose_a_what_print")}if(what_key=="gallery"){txt=F.output.get("photo_choose_a_what_gallery")}}}}return txt};this.flickr_printcart_getProductList_onLoad=function(success,responseXML,responseText,params){writeDebug("flickr_printcart_getProductList_onLoad");if(!success){alert(F.output.get("api_err_generic")+" "+responseText)}self.fetched_product_list=true;writeDebug("checking photo IDs");if(!(self.options.photo_ids instanceof Array)&&self.options.photo_ids.length&&self.options.photo_ids.indexOf(",")==-1){writeDebug("making array");self.options.photo_ids=self.options.photo_ids.join(",")}for(var i=0;i<print_item_count;i++){self.calculate_photo_props(self.options.photo_ids[i])}if(typeof window.global_photos=="undefined"){writeDebug("global_photos[] undefined - creating");window.global_photos=[]}if(typeof window.page_p=="undefined"){writeDebug("page_p undefined - creating");window.page_p=null}var p=global_photos[self.options.photo_ids[0]]||null;if(!is_multiple_photoids&&p&&!p.o_h&&page_p&&page_p.o_w){writeDebug("using page photo o_w/o_h");p.o_w=parseInt(page_p.o_w);p.o_h=parseInt(page_p.o_h)}var collection=responseXML.documentElement.getElementsByTagName("product");if(collection.length==0){writeDebug("nothing to show?");hide_printDialog();return false}else{writeDebug("checking printcart, productsO");window.page_print_prices={};self.productsO={};if(enable_printcart){var provider_host=responseXML.documentElement.getElementsByTagName("products")[0].getAttribute("provider_host")}var user_currency=responseXML.documentElement.getElementsByTagName("products")[0].getAttribute("currency");self.options.user_currency=user_currency;writeDebug("parsing collection");var hidden_count=0;for(var g=0;g<collection.length;g++){var item=collection[g];var product_id=item.getAttribute("id");var product_price=item.getAttribute("price");var product_name=item.getAttribute("name");var product_description=item.getAttribute("description");var product_minresx=parseInt(item.getAttribute("minresx"));var product_minresy=parseInt(item.getAttribute("minresy"));if(isNaN(product_minresx)){product_minresx=null}if(isNaN(product_minresy)){product_minresy=null}var product_aspect=item.getAttribute("aspect")*1;var product_panorama=item.getAttribute("panorama")*1;var product_type=null;var product_endpoint=item.getAttribute("product_endpoint");var size_label=null;var size_units=null;if(enable_printcart){product_type=item.getAttribute("product_type");F.printing.cart_urls["product"+product_id]=provider_host+product_endpoint}if(enable_printcart){if(!product_name){product_name=""}if(!product_description){product_description=F.output.get(F.printing.options.print_partner+"_product"+product_id+"_desc")}size_label=item.getAttribute("size_label");size_units=item.getAttribute("size_units");if(size_units){self.size_units=size_units}writeDebug("label/units: "+size_label+"/"+size_units);if(product_price==null){var prices_node=item.getElementsByTagName("prices")[0];if(prices_node.getAttribute("has_range")==1){product_price=prices_node.getElementsByTagName("price")[0].childNodes[0].nodeValue}else{if(prices_node.getElementsByTagName("price")[0].childNodes[0]){product_price=prices_node.getElementsByTagName("price")[0].childNodes[0].nodeValue}else{writeDebug("WARN: bad product (undefined price)");product_type="bad";product_price=999999}}}}var do_show=0;var do_exclude=0;if(!enable_printcart){if(p.huge){if(F.array_index_of(global_huge_photo_print_ids,product_id)>-1){do_show=1}}else{if(F.array_index_of(global_wallet_photo_print_ids,product_id)>-1){do_show=1}}if(p.square){if(F.array_index_of(global_square_photo_print_ids,product_id)>-1){do_show=1}}if(p.dig_dims){if(F.array_index_of(global_dig_photo_print_ids,product_id)>-1){do_show=1}}else{if(F.array_index_of(global_reg_photo_print_ids,product_id)>-1){do_show=1}}}else{do_show=1;if(self.options.product){if(self.options.product!=product_endpoint){do_show=0;if(product_type=="composite"&&!self.composites_allowing_single_photo["prod"+product_id]){do_exclude=1}}else{do_show=1;do_exclude=0}}else{if(product_type=="composite"){do_show=0;if(self.composites_allowing_single_photo["prod"+product_id]){do_exclude=0;do_show=0}else{if(is_multiple_photoids){do_exclude=1}else{do_exclude=1}}}}}if(product_type=="bad"){writeDebug("WARN: Excluding bad product "+product_id+" ("+product_name+")");do_exclude=1;do_show=0}if(!is_multiple_photoids){if(product_minresx&&product_minresy&&p&&p.o_w&&p.o_h){writeDebug("min rec size: "+product_minresx+"x"+product_minresy+", photo size:"+p.o_w+"x"+p.o_h);var product_rec=((p.o_w>=product_minresx&&p.o_h>=product_minresy)||(p.o_h>=product_minresx&&p.o_w>=product_minresy))}else{var product_rec=1}}else{var product_rec=1}if(!do_show&&!do_exclude){hidden_count++}self.productsO["prod"+product_id+"_printcart"]={id:product_id,api_product_name:product_name,name:self.get_product_name(self.options.print_partner,product_id,product_endpoint,size_label,size_units),description:product_description,price:product_price,recommended:product_rec,minresx:product_minresx,minresy:product_minresy,product_type:product_type,exclude:do_exclude,show:do_show,provider_host:provider_host,product_endpoint:product_endpoint,size_label:size_label,size_units:size_units};page_print_prices["prod"+product_id+"_printcart"]=product_price}if(hidden_count&&_ge("more_print_options")){writeDebug(hidden_count+" items hidden, showing more print options");_ge("more_print_options").style.display="inline"}var was_multiple_photoids=(self.options.photo_ids.length>1);self.reset_exclusions();var allowed_photo_ids=self.check_global_photo_exceptions();if(!was_multiple_photoids&&allowed_photo_ids.length==0){}else{self.set_photo_ids(allowed_photo_ids);if(self.options.photo_ids.length==0){F.global_dialog.hide();F.global_dialog.create_dialog('<div class="bd"><p>'+F.output.get("nothing_to_print")+'</p><p><a href="#" onclick="F.global_dialog.hide();return false" class="Butt">'+F.output.get("ok")+"</a></p></div>");F.global_dialog.show();return false}}if(self.excluded_videos.ids.length){writeDebug(self.excluded_videos.ids.length+" videos were excluded")}if(self.excluded_photos.ids.length){writeDebug(self.excluded_photos.ids.length+" photos were excluded");if(is_multiple_photoids&&_ge("multiple_unsupported_message")){_ge("multiple_unsupported_message").innerHTML=F.output.get("snapfish_unsupported").replace_global("{$js_count}",self.excluded_photos.ids.length).replace_global("{$js_photocount}",self.options.photo_ids.length+self.excluded_photos.ids.length)}_ge(is_multiple_photoids?"print_multiple_unsupported_tr":"print_single_unsupported_tr").style.display=(F.is_ie)?"block":"table-row"}else{_ge(is_multiple_photoids?"print_multiple_unsupported_tr":"print_single_unsupported_tr").style.display="none"}}};this.assign_other_product_links=function(){writeDebug("assign_other_product_links()");var links=_ge("sf-product-links");if(links){links=links.getElementsByTagName("a")}else{return false}var product_ids=(self.options.photo_ids instanceof Array?self.options.photo_ids.join(","):self.options.photo_ids);var link_types={product_photobook:{product_name:"book"},product_calendar:{product_name:"calendar"},product_card:{product_name:"card"},product_collage:{product_name:"collage"},product_canvas:{product_name:"canvas"}};for(var i=0;i<links.length;i++){links[i].href="/photos/organize/?start_tab=print&ids="+product_ids+"&product="+link_types[links[i].className].product_name}};this.show_all_printing_products=function(){F.global_dialog.hide();for(p in self.productsO){var prod=self.productsO[p];if(prod.show||prod.exclude){continue}_ge("prod"+prod.id+"_printcart").style.display=(F.is_ie)?"block":"table-row";if(!prod.recommended){_ge("print_not_rec_tr").style.display=(F.is_ie)?"block":"table-row"}}F.global_dialog.show()};this.update_print_prices=function(){var print_form=_ge("print_form");var ppt_td=_ge("price_print_total_td");var t=0;writeDebug("update_print_prices");for(var i=0;i<print_form.elements.length;i++){if(print_form.elements[i].type=="select-one"){if(print_form.elements[i].value*1>0){var p=page_print_prices[print_form.elements[i].name];t=t+(p*print_form.elements[i].value)}}}var this_price=0;if(!(self.options.photo_ids instanceof Array)){self.options.photo_ids=self.options.photo_ids.split(",")}var product_type=null;for(var i=0;i<print_form.elements.length;i++){if(print_form.elements[i].type=="radio"&&print_form.elements[i].checked){writeDebug("value: "+print_form.elements[i].value);var p=page_print_prices[print_form.elements[i].name];this_price=page_print_prices[print_form.elements[i].value];if(!isNaN(this_price)){product_type=self.productsO[print_form.elements[i].value].product_type;t=t+(page_print_prices[print_form.elements[i].value]*(product_type=="composite"&&self.composites_allowing_single_photo[print_form.elements[i].value]?1:print_item_count))}}}var ft=F.currency.format_currency(t,{currency_type:self.options.user_currency,country:self.user_data.user_country});if(t>0){ft="<nobr><b>"+ft+"</b></nobr>";if(print_form.last_total!=t){anim_do_blink_pink(ppt_td)}}else{ppt_td.style.color="rgb(0, 0, 0)"}writeDebug("update_print_prices: done");ppt_td.innerHTML=ft;print_form.last_total=t;if(_ge("print_add")){_ge("print_add").className=(t==0?"DisabledButt":"Butt")}};this.increment_print_dropdown=function(e){var target_el=Y.E.getTarget(e);var el=null;if(target_el){el=F.find_parent_node_by_name(target_el,"tr").getElementsByTagName(is_multiple_photoids?"input":"select")[0]}if(!el){return true}else{if(is_multiple_photoids){try{el.checked="checked";F.printing.update_print_prices()}catch(e){}}else{try{if(el.selectedIndex<el.getElementsByTagName("option").length-1){el.selectedIndex++;F.printing.update_print_prices()}}catch(e){}}}};this.show_printing_products=function(){writeDebug("show_printing_products");if(self.productsO==undefined){if(enable_printcart){writeDebug("show_printing_products: new cart");if(self.global_photos_data.api_responses<self.global_photos_data.api_responses_expected){writeDebug("global_photos: "+self.global_photos_data.api_responses_expected+", waiting for "+self.global_photos_data.api_responses+" responses");return false}var params={provider_id:self.options.print_partner};writeDebug("printcart.getProductList");F.API.callMethod("flickr.printcart.getProductList",params,{flickr_printcart_getProductList_onLoad:function(success,responseXML,responseText,params){F.API.callMethod("flickr.printing.getPrefs",null,{flickr_printing_getPrefs_onLoad:function(success2,responseXML2,responseText2,params2){self.user_data.user_country=responseXML2.documentElement.getElementsByTagName("country").length?responseXML2.documentElement.getElementsByTagName("country")[0].code:null;writeDebug("got print country: "+self.user_data.user_country);self.flickr_printcart_getProductList_onLoad(success,responseXML,responseText,params);try{self.show_printing_products()}catch(e){writeDebug("Oh snap! show_printing_products error: "+e.toString())}}})}})}else{writeDebug("printing.getProducts");F.API.callMethod("flickr.printing.getProducts",{provider_id:page_printing_provider},self)}return}if(self.is_showing_products){writeDebug("have already written products out - exiting");return false}writeDebug("writing innerHTML for product list");if(self.options.show_other_products){writeDebug("showing other products");if(_ge("other_printers_tr")){_ge("other_printers_tr").style.display=(F.is_ie)?"block":"table-row"}}writeDebug(ref_str_base+"HeaderDiv: "+_ge(ref_str_base+"HeaderDiv"));if(_ge(ref_str_base+"HeaderDiv")){_ge(ref_str_base+"HeaderDiv").innerHTML=self.get_click_a_text();_ge(ref_str_base+"HeaderDiv").style.display="block"}var pricing_header=F.output.get("snapfish_cost_heading",self.options.print_country);if(is_multiple_photoids){var template_tr=_ge("print_multiple_photo_tr");var header_tr=_ge("print_multiple_header_tr");_ge("print_single_header_tr").style.display="none";Y.D.getElementsByClassName("print_header_td","td",header_tr)[0].innerHTML+=" ("+self.size_units+")";var cost_header=Y.D.getElementsByClassName("print_cost_header","td",header_tr)[0];cost_header.innerHTML=F.output.get("cost_currency",self.options.user_currency);header_tr.style.display=(F.is_ie)?"block":"table-row"}else{var template_tr=_ge("print_product_tr");var header_tr=_ge("print_single_header_tr");Y.D.getElementsByClassName("print_header_td","td",header_tr)[1].innerHTML+=" ("+self.size_units+")";var cost_header=Y.D.getElementsByClassName("print_cost_header","td",header_tr)[0];cost_header.innerHTML=F.output.get("cost_currency",self.options.user_currency)}if(_ge("more-from-snapfish")){writeDebug("checking more-from-snapfish");var is_photo_owner=(window.page_p&&window.page_p.isOwner);var is_set_owner=(typeof page_set_owner_nsid!="undefined"&&global_nsid&&page_set_owner_nsid==global_nsid);_ge("more-from-snapfish").style.display=(is_photo_owner||is_set_owner)?"block":"none";writeDebug("checking OK")}var tbody=template_tr.parentNode;var rep=function(txt,prod){var tip_txt=prod.description+" "+F.output.get("photo_we_recommend",prod.minresx,prod.minresy);global_js_tip_count++;var tip_html=F.get_tip_html(tip_txt,"js_tooltip_"+global_js_tip_count,"tip_print_menu");txt=txt.replace_global("REP_TIP",tip_html);txt=txt.replace_global("REP_NAME",prod.name);txt=txt.replace_global("REP_PRODUCT","prod"+prod.id+"_printcart");var price=F.currency.format_currency(prod.price,{currency_type:self.options.user_currency,country:self.user_data.user_country,show_prefix:false});txt=txt.replace_global("REP_PRICE",(is_multiple_photoids?F.output.get("print_price_ea",price):price));return txt};for(p in self.productsO){var prod=self.productsO[p];var tr=document.createElement("tr");tr.id="prod"+prod.id+"_printcart";if(is_multiple_photoids){tr.className="print_radio_row"}tr.onclick=F.printing.update_print_prices;tr.onkeypress=F.printing.update_print_prices;tr.onchange=F.printing.update_print_prices;if(!prod.show){tr.style.display="none"}var td1=document.createElement("td");td1.className="print_dropdown_td";td1.innerHTML=rep(template_tr.childNodes[0].innerHTML,prod);tr.appendChild(td1);var td2=document.createElement("td");td2.className=(prod.recommended)?"print_item_td":"print_item_notrec_td";td2.innerHTML=rep(template_tr.childNodes[1].innerHTML,prod);tr.appendChild(td2);var td3=document.createElement("td");td3.className=(prod.recommended)?"print_price_td":"print_price_notrec_td";td3.innerHTML=rep(template_tr.childNodes[2].innerHTML,prod);tr.appendChild(td3);if(prod.recommended){tbody.insertBefore(tr,_ge("print_not_rec_tr"))}else{if(prod.show){_ge("print_not_rec_tr").style.display=(F.is_ie)?"block":"table-row"}tbody.appendChild(tr)}}var print_cancel=_ge("print_cancel");var print_add=_ge("print_add");var print_form=_ge("print_form");print_form.clear=function(){for(var i=0;i<print_form.elements.length;i++){if(print_form.elements[i].type=="select-one"){print_form.elements[i].selectedIndex=0}}self.update_print_prices()};page_print_orderA=[];print_cancel.onclick=self.hide_printDialog;print_add.onclick=function(){writeDebug("print add onclick");page_print_orderA=[];if(!is_multiple_photoids){for(var i=0;i<print_form.elements.length;i++){if(print_form.elements[i].type=="select-one"){if(print_form.elements[i].value*1>0){writeDebug("adding item, print_form.elements[i].value: "+print_form.elements[i].value);page_print_orderA.push(print_form.elements[i].name+":"+print_form.elements[i].value+":")}else{writeDebug("ignoring item "+print_form.elements[i])}}}}else{var product_type=null;for(var i=0;i<print_form.elements.length;i++){if(print_form.elements[i].type=="radio"&&print_form.elements[i].checked){writeDebug("value: "+print_form.elements[i].value);var p=page_print_prices[print_form.elements[i].name];this_price=page_print_prices[print_form.elements[i].value];if(!isNaN(this_price)){writeDebug("this price: "+this_price);product_type=self.productsO[print_form.elements[i].value].product_type;writeDebug("photo ids length: "+print_item_count);writeDebug("print_form.elements[i].value "+print_form.elements[i].value);page_print_orderA.push(print_form.elements[i].value+":"+1*(product_type=="composite"&&self.composites_allowing_single_photo[print_form.elements[i].value]?1:print_item_count)+":")}}}}writeDebug("page_print_orderA.length: "+page_print_orderA.length);if(page_print_orderA.length>0){self.send_to_action()}else{writeDebug("Nothing to order.")}return false};if(_ge("change_country_link2")){_ge("change_country_link2").onclick=function(){self.show_country_form();return false}}if(_ge("more_print_options")){_ge("more_print_options").onclick=function(){this.style.display="none";self.show_all_printing_products();return false}}_ge("print_form").style.display="block";_ge(ref_str_base+"ListDiv").parentNode.style.display="block";if(self.options.product){writeDebug("Filter case");var products=self.find_products_by_name(self.options.product);if(products.length==1){var product=products[0];var product_type=product.product_type;writeDebug("adding filtered product: "+product.product_endpoint);page_print_orderA.push("prod"+product.id+"_printcart:"+1*(product_type=="composite"&&self.composites_allowing_single_photo["prod"+product.id]?1:print_item_count)+":");var confirm_html='<div class="bd">';confirm_html+='<h3 style="margin:0px;padding:0px;color:#ff0084;font-size:14px;font-weight:bold">'+F.output.get("snapfish_off_you_go")+"</h3>";confirm_html+="<p>"+F.output.get("snapfish_handing_off")+"</p>";confirm_html+='<p id="prints-in-shopping-cart" style="display:none">'+F.output.get("prints_in_shopping_cart")+"</p>";confirm_html+="<p>"+F.output.get("have_fun")+"</p>";confirm_html+='<form id="print_cart_form" onsubmit="return false"><input type="button" id="print_ok_button" class="Butt" value="'+F.output.get("continuoo")+'" style="margin:5px 0px 0px 0px;text-transform:uppercase">&nbsp;&nbsp;<input type="button" id="print_cancel_button" class="CancelButt" value="'+F.output.get("cancel")+'" style="margin:5px 0px 0px 0px;text-transform:uppercase"></form></div>';confirm_html+="</div>";F.global_dialog.create_dialog(confirm_html,{style:self.options.style});function cart_onLoad(success,responseXML,responseText,params){var items=responseXML.getElementsByTagName("photo");if(items.length&&_ge("prints-in-shopping-cart")){_ge("prints-in-shopping-cart").style.display="block";F.global_dialog.show()}else{F.global_dialog.show()}}_ge("print_ok_button").onclick=function(){self.send_to_action()};_ge("print_cancel_button").onclick=function(){F.global_dialog.hide();F.global_dialog.set_loading(false)};if(_ge("prints-in-shopping-cart")){F.API.callMethod("flickr.printcart.getAllQueued",null,{flickr_printcart_getAllQueued_onLoad:cart_onLoad})}else{F.global_dialog.show()}}else{F.global_dialog.show({loading:false});F.global_dialog.reposition();self.update_print_prices()}}else{F.global_dialog.show({loading:false});F.global_dialog.reposition();self.update_print_prices()}self.is_showing_products=true};this.get_footer_checkout_note=function(){return['<div id="print_cart_prompt" style="border-top:none;padding-top:0px"><img src="'+_images_root+'/icon_cart.gif" width="16" height="16" border="0" style="margin:0 6px 0px 0px; border:none; float:left; display:inline">',"<div>"+F.output.get("prints_during_checkout")+"</div>",'<div style="clear:both;font-size:1px;line-height:1px;overflow:hidden;height:1px;display:inline">&nbsp;</div>',"</div>"].join("")};this.find_products_by_name=function(product_name){var results=[];if(!self.productsO){return results}var item=null;for(item in self.productsO){if(self.productsO[item].product_endpoint==product_name){results.push(self.productsO[item])}}return results};this.send_to_action=function(){var action_str=F.output.get("photo_adding_prints_to_cart");F.global_dialog.hide();F.global_dialog.set_loading(true);writeDebug("send_to_action: print case");self.addToCart_responses_expected=page_print_orderA.length;self.addToCart_responses=0;self.addToCart_error_count=0;self.addToCart_problem_product_ids=[];self.addToCart_last_error="";self.send_another_printing_product()};this.send_another_printing_product=function(){writeDebug("send_another_printing_product()");if(!page_print_orderA[self.addToCart_responses]){writeDebug("send_another_printing_product: page_print_orderA["+self.addToCart_responses+"] null/undefined");return false}var A=page_print_orderA[self.addToCart_responses].split(":");writeDebug("A split: "+A.join("/"));writeDebug("A[0]: "+A[0]);writeDebug("A[1]: "+A[1]);var params=null;if(enable_printcart){if(self.productsO[A[0]].product_type!="composite"&&self.options.product_name!="other"){F.printing.options.product_name=self.productsO[A[0]].product_endpoint;params={provider_id:self.options.print_partner,photo_ids:self.options.photo_ids,product_id:A[0].match(/[0-9]+/),quantity:(is_multiple_photoids?1:A[1])};self.add_product("flickr.printcart.addPrint",params,self)}else{F.printing.options.product_name=self.productsO[A[0]].product_endpoint;params={provider_id:self.options.print_partner,photo_ids:self.options.photo_ids,product_id:A[0].match(/[0-9]+/),quantity:(is_multiple_photoids?1:A[1])};self.add_product("flickr.printcart.addComposite",params,self)}}else{var params={provider_id:page_printing_provider,photo_ids:photo_id,product_id:A[0].replace_global("prod",""),quantity:A[1]};F.API.callMethod("flickr.printing.addToCart",params,self)}};this.add_product=function(api_method_name,params,scope){var photo_ids=params.photo_ids;if(!photo_ids.length){writeDebug("add_product: queue is empty.");return false}var handler=scope;var max_ids=self.printcart_config.max_ids_per_api_call;if(params.photo_ids.length<=max_ids){writeDebug("adding "+params.photo_ids.length+" items at once");F.API.callMethod(api_method_name,params,scope)}else{var this_ids=[];var queued_ids=[];for(var i=0;i<photo_ids.length;i++){if(i<max_ids){this_ids.push(photo_ids[i])}else{queued_ids.push(photo_ids[i])}}params.photo_ids=this_ids.join(",");writeDebug("adding "+photo_ids.length+" items, max of "+max_ids+" per API call");if(queued_ids.length){writeDebug("queued IDs after max call: "+queued_ids.length);self.addToCart_responses_expected++;handler={};handler.generic_api_onLoad=function(onload_success,onload_responseXML,onload_responseText,onload_params){writeDebug("printcart: addPrint/addComposite onload(): Going back for more");self.addToCart_responses++;params.photo_ids=queued_ids;self.add_product(api_method_name,params,scope);writeDebug("OK")}}else{writeDebug("no queued IDs")}F.API.callMethod(api_method_name,params,handler)}};this.calculate_photo_props=function(photo_id){var p=global_photos[photo_id];if(!p){return}var longer_side=Math.max(p.o_w,p.o_h);var shorter_side=Math.min(p.o_w,p.o_h);p.aspect=longer_side/shorter_side;p.panorama=(p.aspect>=2)?1:0;p.dig_dims=(p.aspect<1.36)?1:0;p.square=(p.aspect>0.96&&p.aspect<1.04)?1:0;p.small=(longer_side<=1024)?1:0;p.huge=(shorter_side>=3000&&longer_side>=4500)?1:0};this.hide_printDialog=function(){F.global_dialog.hide();var print_form=_ge("print_form");if(print_form&&print_form.clear){print_form.clear()}};this.snapfish_auth_ok=function(success,responseText,params){F.global_dialog.hide();writeDebug("self.options.print_partner: "+self.options.print_partner);if(self.options.print_partner=="snapfish"){writeDebug("success: "+success);writeDebug("responseText: "+responseText);writeDebug("params: "+params);writeDebug("evaling response..");var result=eval("("+responseText+")");writeDebug("eval OK");writeDebug("checking result.stat");var url_params={product_name:self.options.product_name};if(result.stat=="ok"&&result.token&&result.token.is_new){writeDebug("result stat OK, is new");if(_ge("share-email")&&_ge("share-email").checked&&result.user){writeDebug("going to post details");url_params={product_name:self.options.product_name,email:encodeURI(result.user.email),first_name:encodeURI(result.user.first_name),last_name:encodeURI(result.user.last_name)};writeDebug("got user params");self.post_to_url(self.addtocart_cart_url,url_params)}else{writeDebug("no result.user, no token or no email");self.post_to_url(self.addtocart_cart_url,url_params)}}else{writeDebug("result != OK or not new");self.post_to_url(self.addtocart_cart_url,url_params)}if(!success){self.post_to_url(self.addtocart_cart_url,url_params)}}else{writeDebug("Warn: missing/unknown partner?");self.post_to_url(self.addtocart_cart_url,url_params)}};this.show_snapfish_unavailable=function(){F.global_dialog.create_dialog('<div class="bd"><p>'+F.output.get("snapfish_unavailable")+'</p><p><a href="#" onclick="F.global_dialog.hide();return false" class="Butt">'+F.output.get("ok")+"</a></p></div>");F.global_dialog.show();return false};this.post_to_url=function(url,o_params){writeDebug("post_to_url()");if(snapfish_unavailable){return self.show_snapfish_unavailable()}var f=document.createElement("form");f.id="print-form";f.action=url;f.method="post";f.style.position="absolute";f.style.left="-999px";f.style.top="-999px";var formHTML="";var item=null;writeDebug("going into item loop");for(item in o_params){formHTML+='<input name="'+item+'" id="'+item+'" value="'+o_params[item]+'" />\n'}writeDebug("item loop OK");f.innerHTML=formHTML;writeDebug("innerHTML OK");document.body.appendChild(f);writeDebug("appendChild OK");f.submit()};this.check_and_go_to_cart=function(){writeDebug("check_and_go_to_cart()");F.global_dialog.hide({loading:true});function cart_onLoad(success,responseXML,responseText,params){var items=responseXML.getElementsByTagName("photo");function is_authed_onload(is_authed){if(items.length||is_authed){writeDebug(items.length+" items in cart");self.go_to_cart()}else{F.global_dialog.create_dialog('<div class="bd"><p>'+F.output.get("print_cart_empty")+'</p><p><a href="#" onclick="F.global_dialog.hide();F.printing.reset();return false" class="Butt">'+F.output.get("ok")+"</a></p></div>");F.global_dialog.show({modal:true});return false}}self.check_is_authed(self.options.print_partner,is_authed_onload)}F.API.callMethod("flickr.printcart.getAllQueued",null,{flickr_printcart_getAllQueued_onLoad:cart_onLoad})};this.go_to_cart=function(product_name,function_ok){writeDebug("go_to_cart()");F.global_dialog.hide({loading:true});var product=product_name?product_name:self.options.product_name;function is_authed_onload(is_authed){if(!is_authed){function fail(){writeDebug("User canceled, or auth failed");F.global_dialog.hide()}if(!function_ok){var function_ok=self.snapfish_auth_ok}var ok=function_ok;writeDebug("doing auth prompt");self.auth_prompt({partner:self.options.print_partner,onsuccess:ok,onfail:fail})}else{writeDebug("auth OK");self.post_to_url(self.addtocart_cart_url,{product_name:product})}}self.check_is_authed(self.options.print_partner,is_authed_onload)};this.flickr_printing_addToCart_onLoad=this.flickr_printcart_addPrint_onLoad=this.flickr_printcart_addComposite_onLoad=function(success,responseXML,responseText,params){writeDebug("flickr_printing_addToCart_onLoad()");self.addToCart_responses++;try{writeDebug("addToCart_onLoad()");if(success){var cart_url=F.printing.cart_urls["product"+params.product_id];writeDebug("cart URL: "+cart_url);self.addtocart_cart_url=cart_url}else{self.addToCart_error_count++;self.addToCart_problem_product_ids.push(params.product_id);if(responseText){self.addToCart_last_error=responseText}else{self.addToCart_last_error=F.output.get("unknown_err")}}writeDebug("addToCart_responses / self.addToCart_responses_expected: "+self.addToCart_responses+" "+self.addToCart_responses_expected);if(self.addToCart_responses<self.addToCart_responses_expected){self.send_another_printing_product();return}var photo_notes=_ge("photo_notes");writeDebug("self.addToCart_responses: "+self.addToCart_responses+", self.addToCart_error_count: "+self.addToCart_error_count);if(self.addToCart_responses>self.addToCart_error_count){var confirm_html="";if(use_simple_confirm_dialog){self.go_to_cart();return false}else{if(!enable_printcart){confirm_html='<div id="contactChangerContainer" class="global_dialog_container">'}else{confirm_html+='<div class="bd">'}if(self.addToCart_error_count>0){confirm_html+=F.output.get("photo_adding_some_errors",global_photos[photo_id].title,self.addToCart_error_count,self.addToCart_last_error.truncate_with_ellipses(400).replace_global("&","[wbr]&").replace_global("/","/[wbr]").replace_global("=","=[wbr]").escape_for_display_and_wrap().replace_global("[wbr]","<wbr>"))}else{if(use_simple_confirm_dialog){confirm_html+='<h3 style="margin:0px 0px 4px 0px;padding:0px;color:#ff0084;font-size:14px;font-weight:bold">'+F.output.get("photo_added_prints_to_order")+"</h3>"}else{confirm_html+='<div style="margin-bottom:4px"><b>'+F.output.get("photo_added_prints_to_order")+"</b></div>"}}confirm_html+='<ul style="list-style-type:none;margin:0px;padding:0px">';for(var i=0;i<page_print_orderA.length;i++){var A=page_print_orderA[i].split(":");writeDebug("looking for self.productsO["+A[0]+"]");if(F.array_index_of(self.addToCart_problem_product_ids,self.productsO[A[0]].id)>-1){confirm_html+='<li style="color:red;"><b>(0)</b> '+self.productsO[A[0]].id+" "+self.productsO[A[0]].name+"</li>"}else{if(typeof page_printing_use_printcart!="undefined"){confirm_html+="<li>("+A[1]+") "+self.productsO[A[0]].name+" <nobr> &mdash; "+F.currency.format_currency(A[1]*(self.productsO[A[0]].price),{currency_type:self.options.user_currency,country:self.user_data.user_country})+"*</nobr></li>"}else{confirm_html+="<li>("+A[1]+") "+self.productsO[A[0]].name+" <nobr>("+self.format_price(A[1]*(self.productsO[A[0]].price.replace_global(".","")))+") total*</nobr></li>"}}}confirm_html+="</ul>";if(typeof page_printing_use_printcart!="undefined"){if(self.options.user_currency!="USD"){confirm_html+='<p style="font-size:10px;color:#666">'+F.output.get("snapfish_estimated_price")+"</p>"}else{confirm_html+='<p style="font-size:10px;color:#666">'+F.output.get("snapfish_estimated_price_usd")+"</p>"}}}confirm_html+='<form id="print_cart_form" onsubmit="return false"><input type="button" id="print_cart_button" class="Butt" value="'+F.output.get("photo_proceed_to_checkout")+'" style="margin:5px 0px 0px 0px">&nbsp;&nbsp;<input type="button" id="print_ok_button" class="CancelButt" value="'+F.output.get("close")+'" style="margin:5px 0px 0px 0px;text-transform:uppercase"></form></div>';confirm_html+='<div class="ft"><div id="print_cart_prompt" style="border-top:none;padding-top:0px"><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>";confirm_html+="</div></div>";if(!enable_printcart){if(photo_notes){photo_notes.start_comming(confirm_html,1,0,F.output.get("photo_go_to_cart"),1,null,null)}}else{if(photo_notes){photo_notes.stop_comming()}F.global_dialog.hide();F.global_dialog.set_loading(true);F.global_dialog.create_dialog(confirm_html,{style:self.options.style});F.global_dialog.show()}var print_ok_button=_ge("print_ok_button");if(navigator.userAgent.indexOf("KHTML")==-1){print_ok_button.focus()}print_ok_button.onclick=function(){if(!enable_printcart){photo_notes.stop_comming();this.blur()}else{F.global_dialog.hide();F.global_dialog.set_loading(false)}};var print_cart_button=_ge("print_cart_button");print_cart_button.onclick=function(){self.go_to_cart()};F.global_dialog.set_loading(false);F.global_dialog.show()}else{alert(F.output.get("photo_errors_adding_prints")+" "+self.addToCart_last_error);if(photo_notes&&photo_notes.stop_comming){photo_notes.stop_comming(1)}}}catch(e){writeDebug("ERROR: "+e.toString()+e.line||e.lineNumber)}}};F.printing=new F.Printing()}function Currency(){var a=this;this.currencies={ARS:"AR $%.2f",AUD:"AU $%.2f",BRL:"BR R$%.2f",CAD:"CAD $%.2f",CHF:"SFr. %.2f",CLP:"CL $%d",CNY:"%.2f&#20803;",COP:"CO $%.2f",DKK:"kr %.2f",EUR:"&euro; %.2f","EUR-at":"%.2f &euro;","EUR-be":"%.2f &euro;","EUR-de":"%.2f &euro;","EUR-fr":"%.2f &euro;","EUR-pt":"%.2f &euro;","EUR-es":"%.2f &euro;",GBP:"UK &pound;%.2f",HKD:"HK $%.2f",INR:"Rs. %.2f",JPY:"%d &#20870;",KRW:"&#8361; %d",MXN:"Mex $%.2f",MYR:"RM %.2f",NOK:"kr %.2f",NZD:"NZ $%.2f",PEN:"S/ %.2f",PHP:"P %.2f",SEK:"%.2f kr",SGD:"SGD $%.2f",USD:"US $%.2f",VEF:"BsF %.2f"};this.currencies_sans_prefix={ARS:"$%.2f",AUD:"$%.2f",BRL:"$%.2f",CAD:"$%.2f",CHF:"SFr. %.2f",CLP:"$%d",CNY:"%.2f&#20803;",COP:"$%.2f",DKK:"kr %.2f",EUR:"&euro; %.2f","EUR-at":"%.2f &euro;","EUR-be":"%.2f &euro;","EUR-de":"%.2f &euro;","EUR-fr":"%.2f &euro;","EUR-pt":"%.2f &euro;","EUR-es":"%.2f &euro;",GBP:"&pound; %.2f",HKD:"$%.2f",INR:"Rs. %.2f",JPY:"%d &#20870;",KRW:"&#8361; %d",MXN:"$%.2f",MYR:"RM %.2f",NOK:"kr %.2f",NZD:"$%.2f",PEN:"S/ %.2f",PHP:"P %.2f",SEK:"%.2f kr",SGD:"$%.2f",USD:"$%.2f",VEF:"BsF %.2f"};this.default_currency_type="USD";this.default_show_currency_prefix=true;this.decimal_replacements={FRA:",",DKK:",",NOK:",",SEK:",","EUR-at":",","EUR-be":",","EUR-de":",","EUR-es":",","EUR-fr":",","EUR-it":",","EUR-nl":",","EUR-pt":","};this.format_decimal=function(e,d,c){var b=d+(c?"-"+c:"");if(a.decimal_replacements[d]||a.decimal_replacements[b]){return e.replace_global(".",a.decimal_replacements[b]?a.decimal_replacements[b]:a.decimal_replacements[d])}else{return e}};this.format_currency=function(e,d){var b=a.default_currency_type;var g=null;var f=a.currencies;if(d){if(d.currency_type){b=d.currency_type}else{b=a.default_currency_type}if(d.country){g=b+"-"+d.country}if(typeof d.show_prefix!="undefined"){f=(d.show_prefix?a.currencies:a.currencies_sans_prefix)}else{f=a.currencies}}if(g){currency_string=f[g]?f[g]:f[b]}else{currency_string=f[b]}if(currency_string){var h=F.output.sprintf(currency_string,e);return a.format_decimal(h,b,d.country)}else{writeDebug("Warn: No matching currency type");var h=F.output.sprintf(f[a.default_currency_type],e);return a.format_decimal(h,a.default_currency_type)}}}F.currency=new Currency();F.photo_guestpassnotice_hide={action_element_id:"candy_hide_guestpass",message_container_id:"guestPassNotice",animation:null,hide:function(){this.animation.animate()},init:function(){var b=_ge(this.action_element_id),a=_ge(this.message_container_id);if(!b){return false}F.decorate(b,F._simple_button).button_go_go_go();this.animation=new YAHOO.util.Anim(a,{height:{to:0},padding:{to:0}},1,YAHOO.util.Easing.easeOut);this.animation.onComplete.subscribe(function(c){_ge(this.message_container_id).style.display="none";_set_cookie("flgp_d",1,0)},null,this);Y.E.on(b,"click",this.hide,null,this)}};Y.E.onDOMReady(function(){F.photo_guestpassnotice_hide.init()});(function(){if(_enable_popup_login&&!global_nsid){var b="/photo_grease_postlogin.gne",c=false,g=false,l=false,k=false;var h=function(){var m=Y.U.Connect.asyncRequest("GET","/fragment.gne?name=social-auth-fragment",{success:function(n){if(n.responseText=="1,0"){if(l){window.location="/photos/upload";return}if(k){window.location=k}else{window.location.reload()}}else{if(n.responseText=="1,1"){window.location="/"}}}},null)};var a=function(o){d();var n=o+"?popup=1&redir="+b+"?d="+window.location;try{web1999Window=window.open(n,"newWindow","width=650,height=650,resizable=1,scrollbars=1,location=yes")}catch(q){return true}try{if(web1999Window.focus){web1999Window.focus()}}catch(m){}window.setTimeout(function(){if(!web1999Window||web1999Window.closed||typeof web1999Window.closed==="undefined"||!c){var r=b+"?d="+window.location+"&notpopup=1"}},10);return false};function d(){if(document.cookie.match(/cookie_session=[^;]+/gi)){g=false;h()}else{window.setTimeout(d,20)}}function f(m){Y.E.stopEvent(m);g=true;l=false;k="/account/order/";a("/signin")}function j(m){Y.E.stopEvent(m);g=true;l=false;a("/signin")}function e(n){var m=Y.E.getTarget(n);if(m.id&&m.id==="head-signin-link"||m.id==="head-sign-up"){j(n)}else{if(m.id==="head-upload-link"){Y.E.stopEvent(n);g=true;l=true;a("/signin")}else{if(Y.D.hasClass(m,"signin-popup")){j(n)}}}}Y.E.onDOMReady(function(){var q=_ge("TopBar"),s=_ge("head-signin-link"),r=_ge("head-sign-up"),m=_ge("head-upload-link");var o=document.getElementById("buynowlink"),n=[m,s,r];Y.E.addListener(n.concat(Y.D.getElementsByClassName("signin-popup")),"click",e);if(o){Y.E.addListener(o,"click",j)}});window.onfocus=function(){if(c){g=false;h()}};window.onblur=function(){if(g){c=true}};document.onfocusout=function(){if(g){c=true}};document.onfocusin=function(){if(c){g=false;h()}}}})();