var gp_editing={id:function(a){return $(a).attr("id").substr(13)},new_edit_area:function(a){a=gp_editing.id(a);return gp_editing.get_edit_area(a)},get_path:function(a){a=$("a#ExtraEditLink"+a);return 0==a.length?!1:a.attr("href")},get_edit_area:function(a){a=$("#ExtraEditArea"+a);if(0==a.length)return!1;$("#edit_area_overlay_top").hide();$(".ExtraEditLink").remove();$(".editable_area").unbind(".gp");var b=a.find(".twysiwygr:first");b.length&&(a=b);a.addClass("gp_editing");return a},close_editor:function(a,
b){b.preventDefault();window.location=strip_from(window.location.href,"#")},save_changes:function(a,b){b.preventDefault();if(gp_editor){loading();var c=gp_editor.save_path,c=strip_from(c,"#"),d="";0<c.indexOf("?")&&(d=strip_to(c,"?")+"&");d=d+"cmd=save&"+gp_editor.gp_saveData();gpresponse.ck_saved=function(){gp_editor&&(gp_editor.updateElement(),gp_editor.resetDirty(),"ck_close"==a&&gp_editing.close_editor(a,b))};$gp.postC(c,d)}},editor_tools:function(){var a=$("#ckeditor_area");$("#ckeditor_top").html("");
$("#ckeditor_bottom").html("");SimpleDrag(a.find(".toolbar"),a,"fixed",function(a){gpui.ckx=a.left;gpui.cky=a.top;gpui.ckd&&(gpui.ckd=!1,gp_editing.setdock(!0));$gp.SaveGPUI()});gp_editing.setdock(!1)},setdock:function(a){var b=$("#ckeditor_wrap").show(),c=$("#ckeditor_area").show(),d=$("body");a&&$gp.SaveGPUI();gpui.ckd?(c.addClass("docked").removeClass("keep_viewable"),d.css({"margin-top":"+=30px"}),b.css({height:30}),c.css({top:"auto",left:0,bottom:0}).bind("mouseenter.gpdock",function(){b.stop(!0,
!0,!0).animate({height:c.height()},100)}).bind("mouseleave.gpdock",function(){b.stop(!0,!0,!0).delay(500).animate({height:30})})):(c.removeClass("docked").addClass("keep_viewable"),a&&$("body").css({"margin-top":"-=30px"}),b.css({height:0}),c.css({top:gpui.cky,left:gpui.ckx,bottom:"auto"}).unbind(".gpdock"),$(window).resize())},strip_special:function(a){return a}};gplinks.ck_close=gp_editing.close_editor;gplinks.ck_save=gp_editing.save_changes;gplinks.ck_docklink=function(){gpui.ckd=!gpui.ckd;gp_editing.setdock(!0)};