var insitu_init_page_set_description_div=function(_1){if(!_ok_for_scrumjax()){return false;}var _2=insitu_init_generic_description_div(_1,global_sets);_2.getInput=function(){return "<textarea name=\"content\" style=\"font-family:arial; font-size:16px; padding:3px; margin-top:14px; width:100%; height:200px;border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;\">"+this.form_content+"</textarea>";};return true;};var insitu_init_page_set_title_div=function(_3){if(!_ok_for_scrumjax()){return false;}var _4=insitu_init_generic_title_div(_3,global_sets);_4.getInput=function(){return "<input name=\"content\" value=\""+this.form_content.replace("\"","&#34;")+"\" style=\"font-size:32px; font-family:arial; padding:3px; width:100%; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;\">";};_4.getExtra=function(){return "<br>";};return true;};var insitu_init_page_photo_description_div=function(_5){if(!_ok_for_scrumjax()){return false;}var _6=insitu_init_generic_description_div(_5,global_photos);_6.getInput=function(){return "<textarea name=\"content\" style=\"font-family:arial; font-size:12px; padding:3px; margin-top:0px; width:100%; height:100px; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;\">"+this.form_content+"</textarea>";};_6.getExtra=function(){return "<br>";};return true;};var insitu_init_page_photo_title_div=function(_7){if(!_ok_for_scrumjax()){return false;}var _8=insitu_init_generic_title_div(_7,global_photos);_8.getInput=function(){return "<input name=\"content\" value=\""+this.form_content.replace("\"","&#34;")+"\" style=\"font-size:22px; font-weight: bold; font-family: Arial; padding:4px; width:100%; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;\">";};_8.getExtra=function(){return "<br>";};return true;};var insitu_init_page_photos_user_description_div=function(_9){if(!_ok_for_scrumjax()){return false;}var div=insitu_init_generic_description_div(_9,global_photos);div.getInput=function(){return "<textarea name=\"content\" style=\"font-family:arial; font-size:12px; padding:3px; margin-top:0px; width:240px; height:75px;border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;\">"+this.form_content+"</textarea>";};return true;};var insitu_init_page_photos_user_title_div=function(_11){if(!_ok_for_scrumjax()){return false;}var div=insitu_init_generic_title_div(_11,global_photos);div.getInput=function(){return "<input name=\"content\" value=\""+this.form_content.replace("\"","&#34;")+"\" style=\"font-size:14px; font-weight:bold; font-family:arial; padding:3px; width:240px; border:1px inset #e9e9ae; background-color:#ffffd3; margin-bottom:5px;\" />";};return true;};var insitu_init_generic_description_div=function(_12,_13){if(!_ok_for_scrumjax()){return false;}var div=_ge("description_div"+_12);div.title="Click to edit";div.hash_id=_12;if(!_13[div.hash_id]){alert("ERROR: no hash ob exists for "+div.hash_id);return false;}div.form_content=_13[div.hash_id].description;div.emptyText="<i>click here to add a description</i>&nbsp;";div.getExtra=function(){return "";};div.flickr_photos_getInfo_onLoad=div.flickr_photosets_getInfo_onLoad=function(_14,_15){if(_14){if(_15.documentElement.getElementsByTagName("description")[0].firstChild){var _16=_15.documentElement.getElementsByTagName("description")[0].firstChild.nodeValue;}else{var _16="";}_13[div.hash_id].description=div.form_content=_16;var _17=(_13[div.hash_id].description=="")?"&nbsp;":_13[div.hash_id].description.trim().nl2br();if(_17!=div.innerHTML){div.innerHTML=_17+"&nbsp;";}}else{div.form_content=_13[div.hash_id].description;div.innerHTML=(_13[div.hash_id].description=="")?"&nbsp;":_13[div.hash_id].description.trim().nl2br()+"&nbsp;";}};div.flickr_photos_setMeta_onLoad=div.flickr_photosets_editMeta_onLoad=function(_18,_19){if(_18){if(_ok_for_scrumjax_xml()){if(_13==global_sets){F.API.callMethod("flickr.photosets.getInfo",{photoset_id:this.hash_id},div);}else{if(_13==global_photos){F.API.callMethod("flickr.photos.getInfo",{photo_id:this.hash_id},div);}}}else{div.form_content=_13[div.hash_id].description;div.innerHTML=(_13[div.hash_id].description=="")?"&nbsp;":_13[div.hash_id].description.trim().nl2br()+"&nbsp;";}}else{_13[div.hash_id].description=div.form_content;div.innerHTML=(_13[div.hash_id].description=="")?"&nbsp;":_13[div.hash_id].description.trim().nl2br()+"&nbsp;";alert("Error: your description was NOT saved.");}};div.saveChanges=function(_20){deja_view_uh_huh();_13[this.hash_id].description=_20.content.value;this.innerHTML="<i>saving...</i>&nbsp;";this.endEditing();if(!_13[this.hash_id]){this.innerHTML="ERROR: no hash ob exists for "+this.hash_id;return false;}if(_13==global_sets){F.API.callMethod("flickr.photosets.editMeta",{photoset_id:this.hash_id,title:_13[this.hash_id].title,description:_13[this.hash_id].description},div);}else{if(_13==global_photos){F.API.callMethod("flickr.photos.setMeta",{photo_id:this.hash_id,title:_13[this.hash_id].title,description:_13[this.hash_id].description},div);}else{alert("unknown hash");}}};if(window.deja_view_should_refresh){div.innerHTML="...";}return insitu_init_editable_div(div);};var insitu_init_generic_title_div=function(_21,_22){if(!_ok_for_scrumjax()){return false;}var div=_ge("title_div"+_21);div.title="Click to edit";div.hash_id=_21;if(!_22[div.hash_id]){alert("ERROR: no hash ob exists for "+div.hash_id);return false;}div.form_content=_22[div.hash_id].title;div.emptyText="<i>click here to add a title</i>&nbsp;";div.getExtra=function(){return "";};div.flickr_photos_getInfo_onLoad=div.flickr_photosets_getInfo_onLoad=function(_23,_24){if(_23){if(_24.documentElement.getElementsByTagName("title")[0].firstChild){var _25=_24.documentElement.getElementsByTagName("title")[0].firstChild.nodeValue;}else{var _25="";}_22[div.hash_id].title=div.form_content=_25;var _26=(_22[div.hash_id].title=="")?"&nbsp;":_22[div.hash_id].title.escape_for_xml();if(_26!=div.innerHTML){div.innerHTML=_26;}}else{div.form_content=_22[div.hash_id].title;div.innerHTML=(_22[div.hash_id].title=="")?"&nbsp;":_22[div.hash_id].title.escape_for_display();}};div.flickr_photos_setMeta_onLoad=div.flickr_photosets_editMeta_onLoad=function(_27,_28,_29){if(_27){if(_ok_for_scrumjax_xml()){if(_22==global_sets){F.API.callMethod("flickr.photosets.getInfo",{photoset_id:this.hash_id},div);}else{if(_22==global_photos){F.API.callMethod("flickr.photos.getInfo",{photo_id:this.hash_id},div);}}}else{div.form_content=_22[div.hash_id].title;div.innerHTML=(_22[div.hash_id].title=="")?"&nbsp;":_22[div.hash_id].title.escape_for_display();}}else{_22[div.hash_id].title=div.form_content;div.innerHTML=(_22[div.hash_id].title=="")?"&nbsp;":_22[div.hash_id].title.escape_for_display();alert("Error: your title was NOT saved."+_29);}};div.saveChanges=function(_30){deja_view_uh_huh();_22[this.hash_id].title=_30.content.value;this.innerHTML="<i>saving...</i>&nbsp;";this.endEditing();if(!_22[this.hash_id]){this.innerHTML="ERROR: no hash ob exists for "+this.hash_id;return false;}if(_22==global_sets){F.API.callMethod("flickr.photosets.editMeta",{photoset_id:this.hash_id,title:_22[this.hash_id].title,description:_22[this.hash_id].description},div);}else{if(_22==global_photos){F.API.callMethod("flickr.photos.setMeta",{photo_id:this.hash_id,title:_22[this.hash_id].title,description:_22[this.hash_id].description},div);}else{alert("unknown hash");}}};if(window.deja_view_should_refresh){div.innerHTML="...";}return insitu_init_editable_div(div);};var insitu_init_editable_div=function(div){div.startEditing=function(){if(window.should_I_ignore_stuff_because_note_editing||window.should_I_ignore_stuff_because_of_button_action){return;}window.should_I_ignore_stuff_because_of_editable_div_action=1;var _31=_ge("photo_notes");if(_31&&_31.EXT){_31.EXT.take_her_away();}this.isEditing=true;this.unhighlight();this.style.display="none";var _32=this.getForm_div();_32.style.display="block";var _33=_32.firstChild;_33.content.focus();_33.content.select();};div.endEditing=function(){window.should_I_ignore_stuff_because_of_editable_div_action=0;this.isEditing=false;var _34=this.getForm_div();_34.innerHTML="";_34.style.display="none";this.style.display="block";};div.onclick=div.startEditing;div.getForm_div=function(){if(!this.form_div){this.form_div=document.createElement("div");this.parentNode.insertBefore(this.form_div,this);this.form_div.display_div=this;}var _35="<form onsubmit=\"this.parentNode.display_div.saveChanges(this); return false;\" style=\"margin-left:"+this.style.marginLeft+"\" style=\"margin-right:"+this.style.marginRight+"\">";_35+=this.getInput();_35+="<br /><input type=\"submit\" class=\"Butt\" value=\"SAVE\" />&nbsp;&nbsp;<span style=\"font-family:arial; font-size:12px;\">OR</span>&nbsp;&nbsp;<input type=\"button\" class=\"DeleteButt\" value=\"CANCEL\" onclick=\"this.form.parentNode.display_div.endEditing();\" /></form>";_35+=this.getExtra();this.form_div.innerHTML=_35;return this.form_div;};div.onmouseover=function(){if(window.should_I_ignore_stuff_because_note_editing||window.should_I_ignore_stuff_because_of_button_action){return;}this.highlight();};div.onmouseout=function(){if(this.hideTimer){clearTimeout(this.hideTimer);}this.hideTimer=setTimeout("var el = document.getElementById(\""+this.id+"\"); if (el) el.unhighlight()",1000);};div.highlight=function(){if(this.hideTimer){clearTimeout(this.hideTimer);}div.style.backgroundColor="#ffffd3";if(this.emptyText&&(div.innerHTML=="&nbsp;"||div.innerHTML==" "||div.innerHTML.charCodeAt(0)==160)){div.style.color="#888";div.innerHTML=this.emptyText;}};div.unhighlight=function(){if(this.hideTimer){clearTimeout(this.hideTimer);}div.style.backgroundColor="";if(this.emptyText&&div.innerHTML.toUpperCase()==this.emptyText.toUpperCase()){div.innerHTML="&nbsp;";div.style.color="#000";}};return div;};
