AJS.toInit(function(A){AJS.applySearchPlaceholders=function(C){var B=A(".quick-search-query, input[type=search]",C);if(!B.length){return }B.each(function(){$searchBox=A(this);$searchBox.data("quicksearch",{placeholder:$searchBox.attr("placeholder")||$searchBox.closest("form").find("input[type='submit']").val(),placeholded:true})});if(!A.browser.safari){B.val(B.data("quicksearch").placeholder);B.addClass("placeholded");B.focus(function(){var D=A(this);if(D.data("quicksearch").placeholded){D.data("quicksearch").placeholded=false;D.val("");D.removeClass("placeholded")}});B.blur(function(){var D=A(this);if(D.data("quicksearch").placeholder&&(/^\s*$/).test(D.val())){D.val(D.data("quicksearch").placeholder);D.data("quicksearch").placeholded=true;D.addClass("placeholded")}})}else{B.each(function(){this.type="search"});B.attr("results",10);B.attr("placeholder",B.data("quicksearch").placeholder);B.val("")}};AJS.applySearchPlaceholders();A("#messageContainer .confluence-messages").each(function(){var B=this;if(!getCookie(B.id)){A(B).show();A(".message-close-button",B).click(function(){A(B).slideUp();setCookie(B.id,true)})}})});AJS.General={getContextPath:AJS.Confluence.getContextPath};(function(){var A={};AJS.I18n={keys:{},get:function(D,B,C){if(A[D]){if(typeof B=="function"){B(AJS.I18n.keys)}return }AJS.$.ajax({url:AJS.Confluence.getContextPath()+"/rest/prototype/1/i18n/"+D,data:{locale:AJS.params.userLocale},dataType:"json",success:function(E){AJS.I18n.load(E);A[D]=true;if(typeof B=="function"){B(E)}},error:function(E,F){AJS.log("Error loading I18n for "+D+":"+F);if(typeof C=="function"){C(F)}}})},load:function(B){AJS.$.extend(AJS.I18n.keys,B)},getText:function(B,C){var D=AJS.params["i18n."+B]||AJS.I18n.keys[B]||B;if(!C){return D}if(arguments.length==2&&C instanceof Array){C.unshift(D)}else{C=Array.prototype.slice.call(arguments,0);C[0]=D}return AJS.format.apply(AJS,C)}}})();jQuery.fn.selectableEffects=function(A,B,C){var E=jQuery,D=E(this);if(C){D.data("properties",C)}D.click(function(G){var F=E(this);if(B){B(this,F.data("properties"))}A.find(".selected").removeClass("selected");F.addClass("selected");return AJS.stopEvent(G)});D.hover(function(){E(this).addClass("hover")},function(){E(this).removeClass("hover")})};
AJS.html=function(A){var B=new String(A);B.isHtml=true;return B};AJS.toInit(function(B){var A={};AJS.loadTemplateScripts=function(E){E=E||document;B("script",E).each(function(){if(this.type=="text/x-template"){A[this.title]=AJS.html(this.text)}})};AJS.loadTemplateScripts();AJS.getTemplate=function(E){return A[E]};var D={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"};AJS.escapeEntities=function(E){if(E==null){return E}if(E.isHtml){return""+E}return(""+E).replace(/[&<>'"]/g,function(F){return D[F]||F})};function C(F){var E=arguments;return F.replace(/\{(\d+)\}/g,function(I,G){var H=E[parseInt(G,10)+1];return H!=null?H:I})}AJS.renderTemplate=function(E,F){if(!AJS.getTemplate(E)){return""}if(!B.isArray(F)){F=Array.prototype.slice.call(arguments,1)}var I=AJS.getTemplate(E).toString();var H=[I];for(var G=0;G<F.length;G++){H.push(AJS.escapeEntities(F[G]))}return C.apply(this,H)};AJS.loadTemplatesFromUrl=function(E,F){B.ajax({url:E,data:{locale:AJS.params.userLocale},dataType:"html",success:function(G){var H=AJS("div").append(G);AJS.loadTemplateScripts(H);F()}})}});
AJS.menuShowCount=0;jQuery.fn.ajsMenu=function(A){A=A||{};var B=jQuery;var D=null;var C=function(E){if(typeof AJS.dropDownTimer!="undefined"&&AJS.dropDownHider){clearTimeout(AJS.dropDownTimer);delete AJS.dropDownTimer;AJS.dropDownHider();AJS.dropDownHider=null}};B(".ajs-button",this).each(function(){B(this).mouseover(C)});B(".ajs-menu-item",this).each(function(){var G=this,E=B(this),K=B(".ajs-drop-down",G);if(!K.length){return }K=K[0];K.hidden=true;K.focused=-1;K.hide=function(){if(!this.hidden){E.toggleClass("opened");B(G.parentNode).toggleClass("menu-bar-open");var N=B("a",this);B(this).toggleClass("assistive");this.hidden=true;B(document).unbind("click",this.fhide).unbind("keydown",this.fmovefocus).unbind("keypress",this.blocker);if(this.focused+1){B(N[this.focused]).removeClass("active")}this.focused=-1}};K.show=function(){if(typeof this.hidden=="undefined"||this.hidden){var N=this,R=B(this);R.toggleClass("assistive");E.toggleClass("opened");B(G.parentNode).toggleClass("menu-bar-open");this.hidden=false;this.timer=setTimeout(function(){B(document).click(N.fhide)},1);B(document).keydown(N.fmovefocus).keypress(N.blocker);var O=B("a",N);O.each(function(T){var S=this.parentNode.parentNode;B(this).hover(function(U){if(S.focused+1){B(O[S.focused].parentNode).removeClass("active")}B(this.parentNode).addClass("active");S.focused=T},function(U){if(S.focused+1){B(O[S.focused].parentNode).removeClass("active")}S.focused=-1})});var Q=(window.pageYOffset||document.documentElement.scrollTop);var P=Q+B(window).height();R.removeClass("above");if(!A.isFixedPosition){if(R.offset().top+R.height()>P){R.addClass("above");if(R.offset().top<Q){R.removeClass("above")}}}}};K.fmovefocus=function(N){K.movefocus(N)};K.fhide=function(N){K.hide(N)};K.blocker=function(N){var O=N.which;if(O==40||O==38){return false}};K.movefocus=function(P){var S=P.which,O=this.getElementsByTagName("a"),R=this.focused,N=(S==9),Q;do{switch(S){case 40:case 9:if(P.shiftKey){this.focused--}else{this.focused++}break;case 38:this.focused--;break;case 27:this.hide();return false;default:return true}Q=(this.focused<0||this.focused>O.length-1)}while(!Q&&B(O[this.focused].parentNode).hasClass("assistive"));if(N&&Q){if(R!=-1){B(O[R].parentNode).removeClass("active")}this.focused=-1;this.hide();return false}else{if(!N){if(this.focused<0){this.focused=O.length-1}else{if(this.focused>O.length-1){this.focused=0}}}}if(R>=0){B(O[R].parentNode).removeClass("active")}O[this.focused].focus();B(O[this.focused].parentNode).addClass("active");P.stopPropagation();P.preventDefault();return false};K.show();clearTimeout(K.timer);var H=B(K),F=H.offset();K.hide();var J=B(".trigger",G);if(J.length){var L=function(){clearTimeout(AJS.dropDownTimer);delete AJS.dropDownTimer;AJS.dropDownHider();AJS.dropDownHider=null;K.show()};var M=function(O){var N=typeof AJS.dropDownTimer!="undefined";D=K;if(N){L()}else{AJS.dropDownShower=function(){K.show();delete AJS.dropDownShowerTimer};AJS.dropDownShowerTimer=setTimeout(AJS.dropDownShower,O)}};var I=function(N){var O=typeof AJS.dropDownShowerTimer!="undefined";if(O){clearTimeout(AJS.dropDownShowerTimer);delete AJS.dropDownShowerTimer}if(typeof AJS.dropDownTimer!="undefined"){clearTimeout(AJS.dropDownTimer);delete AJS.dropDownHider}AJS.dropDownHider=function(){K.hide();delete AJS.dropDownTimer};AJS.dropDownTimer=setTimeout(AJS.dropDownHider,N)};E.mouseover(function(){M(500)});E.mouseout(function(){I(300)});J.click(function(){if(K.hidden){K.show()}else{K.hide()}})}})};AJS.toInit(function(D){var B=["action-view-source-link","view-user-history-link"];for(var E=B.length;E--;){D("#"+B[E]).click(function(L){window.open(this.href,(this.id+"-popupwindow").replace(/-/g,"_"),"width=600, height=400, scrollbars, resizable");L.preventDefault();return false})}var F=function(L,M){var N=D("#ajax-error");if(N.length==0){D("#com-atlassian-confluence").prepend("<div id='ajax-error'></div>");N=D("#ajax-error")}N.append("<span class='error'>"+L+"<a class='close'>Close</a></span>");N.find("a.close").click(function(){var O=D(this).parent();D(O).slideUp(1000,function(){D(O).remove();if(D("#ajax-error").children(".error").length==0){D("#ajax-error").remove()}});return false});M.removeClass("waiting")};D("#page-favourite").click(function(N){var M=D(this);if(M.hasClass("waiting")){return AJS.stopEvent(N)}M.addClass("waiting");var L=AJS.Confluence.getContextPath()+"/json/addfavourite.action";if(M.hasClass("selected")){L=AJS.Confluence.getContextPath()+"/json/removefavourite.action"}AJS.safeAjax({url:L,type:"POST",dataType:"json",data:{entityId:AJS.params.pageId},success:function(P){if(P.actionErrors){for(var O=0;O<P.actionErrors.length;O++){F(P.actionErrors,M)}return }if(P.errorMessage){F(P.errorMessage,M);return }M.removeClass("waiting");M.toggleClass("selected");M.toggleClass("ie-page-favourite-selected")},error:function(O){F("Server error while updating favourite",M)}});return AJS.stopEvent(N)});var J=D("#page-watch"),K=D("#page-unwatch"),H=D(J.parent("li")),I=D(K.parent("li"));if(J.hasClass("inactive")){H.addClass("assistive")}if(K.hasClass("inactive")){I.addClass("assistive")}var G=function(L,M,N){M.addClass("waiting");AJS.safe.ajax({url:L,type:"POST",dataType:"json",data:{entityId:AJS.params.pageId},success:function(P){if(P.actionErrors){for(var O=0;O<P.actionErrors.length;O++){F(P.actionErrors,M)}return }if(P.errorMessage){F(P.errorMessage,M);return }M.removeClass("waiting");M.toggleClass("inactive");N.toggleClass("inactive");M.parent("li").toggleClass("assistive");N.parent("li").toggleClass("assistive")},error:function(O){M.removeClass("waiting");F("Server error while updating favourite",menuItem)}})};J.click(function(L){G(AJS.Confluence.getContextPath()+"/pages/startwatching.action",J,K);J.addClass("waiting");return AJS.stopEvent(L)});K.click(function(L){G(AJS.Confluence.getContextPath()+"/pages/stopwatching.action",K,J);K.addClass("waiting");return AJS.stopEvent(L)});var A=D("#action-menu-link"),C=D("#add-menu-link");if(A.length){A.next().addClass("most-right-menu-item")}else{if(C.length){C.next().addClass("most-right-menu-item")}}D(".ajs-menu-bar").ajsMenu({isFixedPosition:true})});AJS.$(function(A){A("#header-menu-bar .ajs-menu-item").each(function(){var C=A(this),D=A(".ajs-drop-down",this),B=C.width();if(B>D.width()){D.width(B.valueOf()+50);AJS.log("Dropdown width override occurred")}})});
jQuery.fn.simpleScrollTo=function(C){var E=jQuery;var A=E(this[0]);var B=E(C).position().top;var D=B+E(C).outerHeight()-A.outerHeight();if(B<0){A.scrollTop(A.scrollTop()+B)}else{if(D>0){A.scrollTop(A.scrollTop()+D)}}return this};
AJS.toInit(function(A){A("a#websudo-drop.drop-non-websudo").click(function(){A.getJSON(A(this).attr("href"),function(){A("li#confluence-message-websudo-message").slideUp()});return false})});

