function guideTitleEdit(b){var d=getId(b);var c=$("guide_title_cont_"+b).firstChild.innerHTML;var a=$("guide_title_"+d);a.innerHTML='<input type="text" id="guideTitleInput_'+d+'" value="'+c+'" style="border: 1px solid #ccc; width: 300px; margin-bottom: 5px;"/><a href="javascript:stvoid();" onclick="guideTitleChange(\''+b+"');\">done</a>";$("guideTitleInput_"+d).focus()}function guideTitleChange(d){var f=getId(d);var e=$("guideTitleInput_"+f);if(trim(e.value)==""){startNewMessageDialog("please enter guide title");return}var c=new RequestHandler(onChangeGuideTitle,null,null,this);var a={newTitle:e.value,guide:d};var b=BASE_URL+"/actions/json/GuideUpdateInfo.do";requestDispatcher.requestCommand(a,b,c)}function onChangeGuideTitle(a){if(a.result=="ok"){var c=$("guideTitleInput_"+getId(a.guideId)).value;var b=$("guide_title_"+getId(a.guideId));b.innerHTML='<h3 id="guide_title_cont_'+a.guideId+'"><a href="'+BASE_URL+"/guide/"+fullProfileId+"c"+a.guideId+"/"+c+'">'+escapeHTML(c)+'</h3><a href="javascript:stvoid();" onclick="guideTitleEdit(\''+a.guideId+'\');">edit</a>&nbsp;<a href="javascript:stvoid();" onclick="guideRemove(\''+a.guideId+"');\">remove</a>"}}function guideDescriptionEdit(b){var d=getId(b);var a=$("guide_description_"+d);$("guide_description_controls_"+d).style.display="none";var c=a.innerHTML;a.innerHTML='<textarea id="guideDescriptionInput_'+d+'" style="border: 1px solid #ccc; width: 500px; height: 200px;"></textarea><br/> <a href="javascript:stvoid();" onclick="guideDescriptionChange(\''+b+"');\">done</a>";$("guideDescriptionInput_"+d).focus();$("guideDescriptionInput_"+d).innerHTML=trim(c)}function guideDescriptionChange(d){var f=getId(d);var e=$("guideDescriptionInput_"+f);if(trim(e.value)==""){startNewMessageDialog("please enter guide description");return}var c=new RequestHandler(onChangeGuideDescription,null,null,this);var a={newDescription:e.value,guide:d};var b=BASE_URL+"/actions/json/GuideUpdateInfo.do";requestDispatcher.requestCommand(a,b,c)}function onChangeGuideDescription(a){if(a.result=="ok"){var c=$("guideDescriptionInput_"+getId(a.guideId)).value;var b=$("guide_description_"+getId(a.guideId));b.innerHTML=escapeHTML(c)+"&nbsp;";$("guide_description_controls_"+getId(a.guideId)).style.display="inline"}}function getId(a){return a.substring(0,a.indexOf("c"))}function guideRemove(a){startNewConfirmDialog("Are you sure you want to delete this guide?",guideRemoveAccept,a)}function guideRemoveAccept(b){var d=new RequestHandler(onDeleteGuide,null,null,this);var a={guide:b};var c=BASE_URL+"/actions/json/GuideRemove.do";requestDispatcher.requestCommand(a,c,d)}function onDeleteGuide(a){if(a.result=="ok"){var b="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Loading...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";showProgress(((NavigatorProperties.product=="Opera")?"":'<img src="'+Images.spinner.src+'"/> &nbsp;')+b);reloadPage(document.location.href)}else{}}function guideEdit(b){var a="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Loading...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";showProgress(((NavigatorProperties.product=="Opera")?"":'<img src="'+Images.spinner.src+'"/> &nbsp;')+a);window.setTimeout("document.location.href = BASE_URL + '/guideEdit/"+b+"'",0)};