var icon_ccbgdiv=null;var icon_ccdiv=null;var icon_doneit=null;var icon_isPopped=false;var icon_scrollTim=null;var icon_popup_w=300;var icon_popup_h=330;var icon_buddyIcon=null;var icon_data=null;var icon_progress_w=136;var icon_progress_h=49;function icon_windowClose(){clearTimeout(icon_scrollTim);YAHOO.util.Event.removeListener(window,"resize",icon_positionWindow);YAHOO.util.Event.removeListener(window,"scroll",icon_positionWindowOnScroll);icon_ccdiv.style.display="none";icon_ccbgdiv.style.display="none";icon_isPopped=false;}function icon_windowOpen(_1){icon_data=_ge("person_hover").hover_persons[_1];if(!icon_data){alert("can't find buddyicon data for NSID '"+_1+"'");return;}var _1=icon_data.buddyNsid;var _2=icon_data.isContact;var _3=new String(icon_data.buddyUserName).escape_for_xml();var _4=icon_data.isFriend;var _5=icon_data.isFamily;var _6=(icon_data.gender=="M")?"him":(icon_data.gender=="F")?"her":"them";var _7=(icon_data.gender=="M")?"he":(icon_data.gender=="F")?"she":"they";if(_2){if(_4&&_5){document.getElementById("contactChangerText1").innerHTML=_3+" is marked as <b>friend</b> and <b>family</b>.";document.getElementById("contactChangerText2").innerHTML="You can remove "+_3+" from your list of friends, or remove "+_6+" from your list of family(in either case "+_7+" will remain a contact of yours).";}else{if(_4){document.getElementById("contactChangerText1").innerHTML=_3+" is marked as your <b>friend</b>.";document.getElementById("contactChangerText2").innerHTML="You can add "+_3+" to your list of <i>family</i>, or remove "+_6+" as a friend("+_7+" will remain a contact of yours).";}else{if(_5){document.getElementById("contactChangerText1").innerHTML=_3+" is marked as <b>family</b>.";document.getElementById("contactChangerText2").innerHTML="You can add "+_3+" to your list of <i>friends</i>, or remove "+_6+" from your list of family("+_7+" will remain a contact of yours).";}else{document.getElementById("contactChangerText1").innerHTML=_3+" is currently your <b>contact</b>.";document.getElementById("contactChangerText2").innerHTML="You can add "+_3+" to your list of <i>friends</i> or <i>family</i>(or both).";}}}document.getElementById("contactChangerText3").innerHTML="Or, <a href=\"#\" onclick=\"icon_removeContact('"+_1+"'); return false;\">remove</a> "+_3+" completely from your contacts.";}else{document.getElementById("contactChangerText1").innerHTML=_3+" will be <b>added</b> as your contact.";document.getElementById("contactChangerText2").innerHTML="You can also add "+_3+" to your list of <i>friends</i> or <i>family</i>(or both).";document.getElementById("contactChangerText3").innerHTML="<i>Marking them as friend or family is optional. It can also be changed at any time.</i>";}document.getElementById("contactChangerIcon").src=_ge("person_hover").hover_curr_img.src;document.getElementById("contactChangerCheckFriend").checked=_4;document.getElementById("contactChangerCheckFamily").checked=_5;_ge("person_hover").hover_go_away();icon_ccdiv.style.display="block";icon_ccbgdiv.style.display="block";icon_isPopped=true;icon_positionWindow();YAHOO.util.Event.addListener(window,"resize",icon_positionWindow);YAHOO.util.Event.addListener(window,"scroll",icon_positionWindowOnScroll);return false;}function icon_positionWindowOnScroll(_8){if(icon_doneit==false){return;}icon_doneit=false;clearTimeout(icon_scrollTim);icon_scrollTim=setTimeout("icon_positionWindowOnScroll(true)",50);if(_8){icon_doneit=true;icon_positionWindow();}}function icon_positionWindow(){if(!icon_isPopped){return;}if(window.innerWidth){var ww=window.innerWidth;var wh=window.innerHeight;var bgX=window.pageXOffset;var bgY=window.pageYOffset;}else{var ww=document.body.clientWidth;var wh=document.body.clientHeight;var bgX=document.body.scrollLeft;var bgY=document.body.scrollTop;}icon_ccdiv.style.left=(bgX+((ww-icon_popup_w)/2))+"px";icon_ccdiv.style.top=(bgY+((wh-icon_popup_h)/2))+"px";icon_ccbgdiv.style.left=bgX;icon_ccbgdiv.style.top=bgY;}function icon_windowCloseDone(){icon_ccdiv.style.display="none";var _13=_ge("person_hover").hover_icon.nsid;var fri=document.getElementById("contactChangerCheckFriend").checked;var fam=document.getElementById("contactChangerCheckFamily").checked;var _16=fri==icon_data.isFriend;var _17=fam==icon_data.isFamily;if(_16&&_17&&icon_data.isContact){icon_windowClose();return;}icon_showProgress("Working...");var _18={};_18.flickr_contacts_edit_onLoad=function(_19,_20,_21,_22){if(_19){icon_data.isContact=true;icon_data.isFriend=fri;icon_data.isFamily=fam;_ge("person_hover").hover_persons[_22.user_id]=null;icon_showProgress("Success");window.setTimeout("icon_hideProgress(); icon_windowClose();",300);}else{icon_showProgress("Failure");window.setTimeout("icon_hideProgress(); icon_windowClose();",500);}};_18.flickr_contacts_add_onLoad=_18.flickr_contacts_edit_onLoad;if(icon_data.isContact){F.API.callMethod("flickr.contacts.edit",{user_id:icon_data.buddyNsid,friend:fri?1:0,family:fam?1:0},_18);}else{F.API.callMethod("flickr.contacts.add",{user_id:icon_data.buddyNsid,friend:fri?1:0,family:fam?1:0},_18);}}function icon_removeContact(_23){icon_ccdiv.style.display="none";icon_showProgress("Working...");var _24={};_24.flickr_contacts_remove_onLoad=function(_25,_26,_27,_28){if(_25){icon_data.isContact=false;_ge("person_hover").hover_persons[_28.user_id]=null;icon_showProgress("Success");window.setTimeout("icon_hideProgress(); icon_windowClose();",500);}else{icon_showProgress("Failure");window.setTimeout("icon_hideProgress(); icon_windowClose();",500);}};F.API.callMethod("flickr.contacts.remove",{user_id:icon_data.buddyNsid},_24);}function icon_showProgress(_29){if(!global_comm_div){_make_comm_div("1002");}global_comm_div.start_comming(_29);}function icon_hideProgress(){global_comm_div.stop_comming();}function iframeify(_30){if(document.all&&!window.opera){var _31="<iframe "+"style='position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; "+"z-index: -1; filter:Alpha(Opacity=\"0\");' "+">";var _32=document.createElement(_31);_30.appendChild(_32);}}function personmenu_process_img(img){var _34=function(el){if(el["className"]=="xBuddyIcon"){return false;}if(el["className"]=="xBuddyIconH"){return false;}if(el["className"]=="xBuddyIconX"){return false;}if(el["className"]=="person_hover_img"){return false;}var _36=el.src.split("/");var _37=_36[_36.length-1];if((_36[4]=="buddyicons"||(_36[4]&&_36[4].substr(0,13)=="buddyicon.jpg"))){el.nsid=(_36[4].substr(0,13)=="buddyicon.jpg")?_37.split("?")[1]:_37.split(".")[0];return true;}return false;};if(_34(img)){_ge("person_hover").hover_add_img(img);img.onmouseover=_hitch(_ge("person_hover"),"icon_mouseover");img.onmouseout=_hitch(_ge("person_hover"),"icon_mouseout");}}function personmenu_init(){F.decorate(_ge("person_hover"),F._person_hover).hover_go_go_go();var _38=document.getElementsByTagName("IMG");for(var i=0;i<_38.length;i++){personmenu_process_img(_38[i]);}icon_ccbgdiv=document.getElementById("contactChangerBackground");var _40=35;icon_ccbgdiv.style.backgroundColor="#000";icon_ccbgdiv.style.opacity=_40/100;icon_ccbgdiv.style.MozOpacity=_40/100;icon_ccbgdiv.style.filter="alpha(opacity="+_40+")";icon_ccdiv=document.getElementById("contactChangerPopup");iframeify(icon_ccbgdiv);}F._person_hover=new Object();F._person_hover.hover_go_go_go=function(){this.hover_persons={};this.hover_showing=0;this.hover_menu_showing=0;this.hover_show_timer=null;this.hover_hide_timer=null;this.hover_anim_timer=null;this.hover_over=0;this.hover_curr_img=null;_decorate(_ge("personmenu_button_bar"),1,null,1,1,1);_ge("personmenu_down_button").EXT.menu.on_item_selected=function(){if(_ge("person_hover").hover_menu_showing){_ge("person_hover").hover_go_away();}};if(document.all){_ge("person_hover_inner").style.width="79px";_ge("person_hover_inner").style.height="58px";}this.onmouseover=_hitch(this,"hover_mouseover");this.onmouseout=_hitch(this,"hover_mouseout");};F._person_hover.hover_add_img=function(img){var id="hover_img"+img.nsid;if(_ge(id)){return;}var _42=document.createElement("IMG");_42.id=id;_42.nsid=img.nsid;_42.src=img.src;_42.className="person_hover_img";_ge("person_hover_link").appendChild(_42);};F._person_hover.hover_mouseover=function(e){clearTimeout(this.hover_hide_timer);this.hover_over=1;};F._person_hover.hover_mouseout=function(e){this.hover_over=0;if(this.hover_menu_showing){return;}this.hover_hide_timer=setTimeout(function(){var _44=_ge("person_hover");if(!_44.hover_over){_44.hover_hide();}},500);};F._person_hover.icon_mouseover=function(e){if(this.hover_menu_showing){return;}clearTimeout(this.hover_hide_timer);this.hover_icon=_get_event_src(e);if(this.hover_showing){this.hover_place_and_show();}if(this.hover_curr_img&&this.hover_curr_img.nsid!=this.hover_icon.nsid){this.hover_curr_img.style.display="none";}this.hover_curr_img=_ge("hover_img"+this.hover_icon.nsid);this.hover_curr_img.style.display="block";_ge("person_hover_link").href=(this.hover_icon.parentNode.href)?this.hover_icon.parentNode.href:"/photos/"+this.hover_icon.nsid+"/";if(!this.hover_showing){var _45=this.hover_icon;this.hover_show_timer=setTimeout(function(){var _46=_ge("person_hover");if(_45==_46.hover_icon){_46.hover_place_and_show();}},100);}};F._person_hover.hover_go_away=function(){this.hover_menu_showing=0;clearTimeout(this.hover_show_timer);clearTimeout(this.hover_hide_timer);clearTimeout(this.hover_anim_timer);this.hover_over=0;this.hover_hide_menu();this.hover_hide();};F._person_hover.icon_mouseout=function(e){if(this.hover_showing){return;}clearTimeout(this.hover_show_timer);};F._person_hover.hover_hide=function(){this.hover_showing=0;this.style.display="none";YAHOO.util.Event.removeListener(window,"resize",this.window_resize);YAHOO.util.Event.removeListener(window,"scroll",this.window_scroll);};F._person_hover.window_mousedown=function(e,_47){var _48=_get_event_src(e);while(_48){if(_48.id=="person_hover"||_48.id=="personmenu_down_button"){return;}_48=_48.parentNode;}_47.hover_go_away();};F._person_hover.window_resize=function(e,_49){_49.hover_place();};F._person_hover.window_scroll=function(e,_50){_50.hover_place();};F._person_hover.hover_place_and_show=function(){this.hover_place();this.hover_show_hover();};F._person_hover.hover_show_hover=function(){this.hover_showing=1;this.style.display="block";YAHOO.util.Event.addListener(window,"resize",this.window_resize,this);YAHOO.util.Event.addListener(window,"scroll",this.window_scroll,this);};F._person_hover.hover_place=function(){var x=_find_x(this.hover_icon);var y=_find_y(this.hover_icon);x-=_pi((48-this.hover_icon.width)/2);y-=_pi((48-this.hover_icon.height)/2);this.style.left=(x-6)+"px";this.style.top=(y-5)+"px";};F._person_hover.hover_toggle_menu=function(){if(this.hover_menu_showing){this.hover_hide_menu();}else{this.hover_show_menu();}};F._person_hover.hover_add_contact=function(){icon_windowOpen(this.hover_icon.nsid);};F._person_hover.hover_hide_menu=function(){this.hover_menu_showing=0;_ge("person_hover_shadow").className="shadowLight";_ge("personmenu_down_button").EXT.menu.hide_menu();_ge("personmenu_down_button").EXT.set_img_srcs_and_change("personmenu_down");YAHOO.util.Event.removeListener(window,"mousedown",this.window_mousedown);};F._person_hover.hover_actually_show_menu=function(){clearTimeout(this.hover_anim_timer);_ge("personmenu_down_button").EXT.menu.show_menu();_ge("person_hover_pulser_img").style.display="none";_ge("person_hover_link").style.display="block";var _53=_ge("personmenu_down_menu");var _54=_find_y(_53)+_53.offsetHeight+5;var _55=_find_screen_height()+document.body.scrollTop;var _56=_54-_55;if(_56>0){anim_do_scroll_to_scrollTop(document.body,10,35,document.body.scrollTop+_56,"easeInOutQuad");}};F._person_hover.hover_show_menu=function(_57){this.hover_menu_showing=1;_ge("person_hover_shadow").className="shadowDark";_ge("personmenu_down_button").EXT.menu.hide_menu();_ge("personmenu_down_button").EXT.set_img_srcs_and_change("personmenu_up");if(this.hover_icon.nsid==global_nsid){YAHOO.util.Event.addListener(document.body,"mousedown",this.window_mousedown,this);_ge("person_menu_other_div").style.display="none";_ge("person_menu_you_div").style.display="block";_ge("personmenu_relationship_p").innerHTML="Hi, you.";_ge("personmenu_relationship_p").style.display="block";this.hover_actually_show_menu();}else{_ge("person_menu_you_div").style.display="none";_ge("person_menu_other_div").style.display="block";var _58=this.hover_persons[this.hover_icon.nsid];if(_58){YAHOO.util.Event.addListener(document.body,"mousedown",this.window_mousedown,this);var _59=_58.getRelationshipHTML();if(_59){_ge("personmenu_relationship_p").innerHTML=_59;_ge("personmenu_contact_link").style.display="none";_ge("personmenu_relationship_p").style.display="block";}else{_59="Add <strong>"+_58.buddyUserName+"</strong> as a contact?";_ge("personmenu_contact_link").innerHTML=_59;_ge("personmenu_contact_link").href="/relationship.gne?id="+_58.buddyNsid;_ge("personmenu_relationship_p").style.display="none";_ge("personmenu_contact_link").style.display="block";}_ge("personmenu_photos_link").href=_58.getPhotosUrl();_ge("personmenu_profile_link").href=_58.getProfileUrl();_ge("personmenu_tags_link").href=_58.getTagsUrl();_ge("personmenu_archives_link").href=_58.getArchivesUrl();if(_ge("personmenu_map_link")){_ge("personmenu_map_link").href=_58.getMapUrl();}_ge("personmenu_faves_link").href=_58.getFavoritesUrl();_ge("personmenu_contacts_link").href=_58.getContactsUrl();_ge("personmenu_mail_link").href=_58.getSendMailUrl();var _60=(_58.isBlocked)?"Unblock ":"Block ";_60+="<b>"+_58.buddyUserName+"</b>";_ge("personmenu_block_link").innerHTML=_60;_ge("personmenu_block_link").href="/ignore.gne?id="+_58.buddyNsid;this.hover_actually_show_menu();}else{if(_57){}else{this.hover_anim_timer=setTimeout(function(){_ge("person_hover_link").style.display="none";_ge("person_hover_pulser_img").style.display="block";},1000);F.API.callMethod("flickr.people.getInfo",{user_id:this.hover_icon.nsid},this,null,null,null,0,0);}}}};F._person_hover.flickr_people_getInfo_onLoad=function(_61,_62,_63){var _64=_62.documentElement.getElementsByTagName("person")[0].getAttribute("nsid");this.hover_persons[_64]=new BuddyData(_62);if(this.hover_menu_showing){this.hover_show_menu(1);}};function BuddyData(xml){var _66=xml.documentElement;var _67=_66;var _68=_66.getElementsByTagName("person").item(0);this.buddyNsid=_68.getAttribute("nsid");this.isContact=_68.getAttribute("contact")==="1";this.isFriend=_68.getAttribute("friend")==="1";this.isFamily=_68.getAttribute("family")==="1";this.isRevContact=_68.getAttribute("revcontact")==="1";this.isRevFriend=_68.getAttribute("revfriend")==="1";this.isRevFamily=_68.getAttribute("revfamily")==="1";this.isBlocked=_68.getAttribute("ignored")==="1";this.gender=_68.getAttribute("gender");this.buddyUserName=this.buddyNsid;try{this.buddyUserName=_66.getElementsByTagName("username").item(0).firstChild.nodeValue.escape_for_display();}catch(e){}try{this.buddyRealName=_66.getElementsByTagName("realname").item(0).firstChild.nodeValue.escape_for_display();}catch(e){}this.photosUrl="http://www.flickr.com/photos/"+this.buddyNsid+"/";this.profileUrl="http://www.flickr.com/people/"+this.buddyNsid+"/";try{this.photosUrl=_66.getElementsByTagName("photosurl").item(0).firstChild.nodeValue;}catch(e){}try{this.profileUrl=_66.getElementsByTagName("profileurl").item(0).firstChild.nodeValue;}catch(e){}}BuddyData.prototype={isBlocked:function(){return this.isBlocked;},isContact:function(){return this.isContact;},isFriend:function(){return this.isFriend;},isFamily:function(){return this.isFamily;},isRevContact:function(){return this.isRevContact;},isRevFriend:function(){return this.isRevFriend;},isRevFamily:function(){return this.isRevFamily;},isMe:function(){if(global_nsid){return this.buddyNsid==global_nsid;}else{return false;}},getYourRecentActivityUrl:function(){return "/recent_activity.gne";},getYourFlickrMailUrl:function(){return "/messages.gne?ok=1";},getYourAccountUrl:function(){return "/account/";},getYourBuddyIconEditUrl:function(){return "/iconbuilder/";},getPhotosUrl:function(){return this.photosUrl;},getProfileUrl:function(){return this.profileUrl;},getTagsUrl:function(){return this.photosUrl+"tags/";},getArchivesUrl:function(){return this.photosUrl+"archives/";},getMapUrl:function(){return this.photosUrl+"map/";},getFavoritesUrl:function(){return this.photosUrl+"favorites/";},getContactsUrl:function(){return this.profileUrl+"contacts/";},getSendMailUrl:function(){return "/messages_write.gne?to="+this.buddyNsid;},getRelationshipHTML:function(){var _69="<a href=\"/relationship.gne?id="+this.buddyNsid+"\" onclick=\"return icon_windowOpen('"+this.buddyNsid+"');\">Change</a>";switch(true){case this.isBlocked:return "You are blocking "+this.buddyUserName;case this.isFriend&&this.isFamily:return "<strong>"+this.buddyUserName+"</strong> is friends and family.  "+_69;case this.isFriend:return "<strong>"+this.buddyUserName+"</strong> is a friend.  "+_69;case this.isFamily:return "<strong>"+this.buddyUserName+"</strong> is family.  "+_69;case this.isContact:return "<strong>"+this.buddyUserName+"</strong> is a contact.  "+_69;default:return null;}},getReverseRelationshipHTML:function(){switch(true){case this.isRevFriend&&this.isRefFamily:return this.buddyUserName+" counts you as friends and family.";case this.isRevFriend:return this.buddyUserName+" counts you as a friend.";case this.isRefFamily:return this.buddyUserName+" counts you as family.";case this.isRevContact:return this.buddyUserName+" counts you as a contact.";default:return null;}}};

