F.picnik_2={go_go_go:function(){if(picnik_token){this.show()}else{F.fragment_getter.get("/photo_picnik_auth_fragment.gne",{},this,"fragment_onLoad")}},loadSwfObjJs:function(){if(!this.swfJsWritten){this.loadJs(page_p.swfObjSrc);this.swfJsWritten=true}return(window.SWFObject)?true:false},loadUrlkitJs:function(){if(!this.urlkiJsWritten){this.loadJs(picnik_urlkit_path);this.urlJsWritten=true}},loadJs:function(B){var A=document.createElement("script");A.src=B;A.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(A);writeDebug("picnik js source: "+A.src)},initSwf:function(){if(!this.p_div){this.header_height=35;this.p_div=document.createElement("div");this.p_div.id="picnik-div";var H=document.createElement("div");H.id="picnik-div-header";H.style.height=this.header_height+"px";var C=document.createElement("div");C.id="picnik-div-header-inner";H.appendChild(C);var E=_ge("FlickrLogo").parentNode.cloneNode(true);try{E.firstChild.id="FlickrLogo2";E.style.background="none"}catch(G){}C.appendChild(E);var B=document.createElement("span");var D=document.createTextNode(F.output.get("picnik_mode"));B.appendChild(D);if(page_p.id){B.innerHTML+=" "+F.output.get("picnik_return_to_photo",page_p.id);F.set_spaceid("792600342")}else{B.innerHTML+=" "+F.output.get("picnik_return_to_stream")}C.appendChild(B);this.p_swf_cont=document.createElement("div");this.p_swf_cont.id="picnik-cont";this.p_swf_cont.style.height=(Y.U.Dom.getViewportHeight()-(this.header_height+10))+"px";this.p_div.appendChild(H);this.p_div.appendChild(this.p_swf_cont);this.p_div.style.height=Y.U.Dom.getViewportHeight()+"px";this.p_div.style.width="100%";this.p_div.style.position="absolute";this.p_div.style.top="0px";this.p_div.style.left="0px";document.getElementsByTagName("body")[0].appendChild(this.p_div);var A=deconcept.SWFObjectUtil.getPlayerVersion();if(A.major<9){Y.U.Dom.addClass(this.p_swf_cont,"picnik_no_flash");this.p_swf_cont.innerHTML=F.output.get("picnik_no_flash")}else{this.writeSwf()}}else{this.writeSwf();this.p_div.style.top="0px";this.p_div.style.left="0px"}Y.U.Event.addListener(window,"resize",this.resize,this);window.onbeforeunload=F.picnik_2.saveChangesDialog;_ge("Main").style.display="none";_ge("MainFooterClear").style.display="none";_ge("FooterWrapper").style.display="none"},writeSwf:function(){var C=new SWFObject(picnik_swf_path,"picnik","100%","100%","9.0.28","#ffffff",true);C.addParam("allowFullScreen","true");C.addParam("allowScriptAccess","always");C.addVariable("serverurl","http://www.picnik.com");C.addVariable("loglevel","30");C.addVariable("lite","true");C.addVariable("host","Flickr lite");C.addVariable("authservice","Flickr");C.addVariable("userid",global_nsid);C.addVariable("token",picnik_token);if(typeof (_is_picnik_basket)!="undefined"&&_is_picnik_basket==true){var B="<_multi>";for(var A=0;A<page_photo_id.split(",").length;A++){B+="<item id='"+page_photo_id.split(",")[A]+"' ss='flickr'/>"}B+="</_multi>";C.addVariable("_multi",B);C.addVariable("_ss_cmd","multi")}else{C.addVariable("_ss_itemid",page_photo_id)}C.addVariable("_ss_setid",picnik_set_id);if(C.write(this.p_swf_cont)){var D=new SWFMacMouseWheel(C)}F.changes_count=true},fragment_onLoad:function(E,B,D){this.lightBoxBg=_ge("contactChangerBackground");this.lightBox=document.createElement("div");this.lightBox.style.position="absolute";var A=500;var C=290;this.lightBox.style.width=A+"px";this.lightBox.style.height=C+"px";this.lightBox.style.top=((Y.U.Dom.getViewportHeight()/2)-(C/2))-30;this.lightBox.style.left=(Y.U.Dom.getViewportWidth()/2)-(A/2);this.lightBox.style.zIndex=20001;this.lightBoxBg.style.display="block";document.getElementsByTagName("body")[0].appendChild(this.lightBox);this.lightBox.innerHTML=B},resize:function(B,A){A.p_div.style.height=Y.U.Dom.getViewportHeight()+"px";A.p_swf_cont.style.height=(Y.U.Dom.getViewportHeight()-Y.U.Dom.getRegion("picnik-div-header").bottom)+"px"},show:function(){if(this.loadSwfObjJs()){this.initSwf();this.loadUrlkitJs()}else{setTimeout(function(){F.picnik_2.show()},300)}},doAuth:function(){window.page_always_post_fragment_requests=true;F.fragment_getter.get("/services/auth/picnik.gne",{magic_cookie:global_auth_hash},this,"digestAuthResponse")},digestAuthResponse:function(success,responseText,params){var rsp=eval("("+responseText+")");this.lightBox.style.display="none";this.lightBoxBg.style.display="none";if(rsp.picnik_auth.stat){picnik_token=rsp.picnik_auth.token;this.go_go_go()}else{F.photo_confirm_msg.add(1,F.output.get("picnik_auth_fail"))}},cancelAuth:function(){this.lightBoxBg.style.display="none";this.lightBox.style.display="none"},its_raining:function(A){writeDebug("3) its_raining response: "+A);F.changes_count=false;if(A){if(A==page_photo_id){window.location.replace(page_p.url+"?editreplace=1")}else{window.location.href=page_p.ownersUrl+A+"/?eOrig="+page_photo_id}}else{if(_ge("Main")){_ge("Main").style.display=""}if(_ge("MainFooterClear")){_ge("MainFooterClear").style.display=""}if(_ge("FooterWrapper")){_ge("FooterWrapper").style.display=""}this.p_div.style.top="-9999px";this.p_div.style.left="-9999px";F.photo_confirm_msg.add(1,F.output.get("picnik_cancel_edit"))}},saveChangesDialog:function(B){var C=true;var A=document.getElementById("picnik");if(A&&typeof (A.IsNavigateOk)!="undefined"){C=A.IsNavigateOk()}if(!C){return F.output.get("global_unsaved")}}};F.picnik={its_raining:function(A){writeDebug("2) its_raining response: "+A);if(page_p.id){var C=true;var B=document.getElementById("picnik");if(B&&typeof (B.IsNavigateOk)!="undefined"){C=B.IsNavigateOk()}if(C){if(A!=null){if(A==page_p.id){window.location.replace(page_p.url+"?editreplace=1")}else{window.location.href=page_p.ownersUrl+A+"/?eOrig="+page_photo_id}}else{if(_ge("Main")){_ge("Main").style.display=""}if(_ge("MainFooterClear")){_ge("MainFooterClear").style.display=""}if(_ge("FooterWrapper")){_ge("FooterWrapper").style.display=""}F.picnik_2.p_div.style.top="-9999px";F.picnik_2.p_div.style.left="-9999px";F.photo_confirm_msg.add(1,F.output.get("picnik_cancel_edit"));window.onbeforeunload=null}}else{if(_ge("Main")){_ge("Main").style.display=""}if(_ge("MainFooterClear")){_ge("MainFooterClear").style.display=""}if(_ge("FooterWrapper")){_ge("FooterWrapper").style.display=""}F.picnik_2.p_div.style.top="-9999px";F.picnik_2.p_div.style.left="-9999px";F.photo_confirm_msg.add(1,F.output.get("picnik_cancel_edit"));window.onbeforeunload=null}}else{window.location.href="/photos/me/?editreplace=1"}}};