if(typeof originalTheme==="undefined"){var originalTheme={}}(function(){originalTheme.validateAjaxResponse=function(B){if(B.substring(0,4)=="RWAR"){return B.substring(4)}else{return"<div class='rw_warning_box'><a href='"+contextPath+"/login.action?os_destination="+encodeURIComponent(window.location)+"'>"+originalTheme.notLoggedIn+"</a></div>"}};var A=new Array();originalTheme.addOrRemoveFav=function(D,E){if(A[E.id]==null){A[E.id]=true;var C;var F;var B;if(jQuery(E).hasClass("rw_yellow_star")){C=contextPath+"/ajaxactions/remove-favourite-space.action";F="rw_gray_star";B="rw_yellow_star";jQuery(E).removeClass("rw_yellow_star")}else{C=contextPath+"/ajaxactions/add-favourite-space.action";F="rw_yellow_star";B="rw_gray_star";jQuery(E).removeClass("rw_gray_star")}AJS.safe.ajax({url:C,type:"POST",data:{spaceKey:D},success:function(){jQuery(E).addClass(F);A[E.id]=null},error:function(I,H,G){alert("Error : "+H);A[E.id]=null;jQuery(E).addClass(B)}})}};originalTheme.addOrRemoveFavPage=function(B,E){var D;var F;var C;if(jQuery(E).hasClass("rw_yellow_star")){D=contextPath+"/ajaxactions/remove-favourite-page.action";F="rw_gray_star";C="rw_yellow_star";jQuery(E).removeClass("rw_yellow_star")}else{D=contextPath+"/ajaxactions/add-favourite-page.action";F="rw_yellow_star";C="rw_gray_star";jQuery(E).removeClass("rw_gray_star")}AJS.safe.ajax({url:D,type:"POST",data:{pageId:B},success:function(){jQuery(E).addClass(F)},error:function(I,H,G){alert("Error : "+H);jQuery(E).addClass(C)}})};originalTheme.showSmallLoader=function(B){jQuery(B).after("<img style='padding-left:5px;' src='"+contextPath+"/download/resources/com.refinedwiki.confluence.plugins.theme.original/images/ajax-loader-spinner-small.gif' />");jQuery(B).remove()};originalTheme.showDiv=function(B){jQuery("#"+B).show();jQuery("#"+B+"_show").hide();jQuery("#"+B+"_hide").show()};originalTheme.hideDiv=function(B){jQuery("#"+B).hide();jQuery("#"+B+"_show").show();jQuery("#"+B+"_hide").hide()};originalTheme.getPopupWidth=function(){var B=jQuery(window).width();B=B*0.9;if(B<1020){B=1020}return B};originalTheme.getPopupHeight=function(){var B=jQuery(window).height();B=B*0.9;if(B<600){B=600}else{if(B>900){B=900}}return B};originalTheme.showLoader=function(){if(jQuery("#rw_top_loader").length===0){jQuery("body").prepend('<div id="rw_top_loader"><div id="rw_top_loader_container"><span><img alt="..." src="'+contextPath+'/download/resources/com.refinedwiki.confluence.plugins.theme.original/images/ajax-loader-spinner.gif" /></span></div></div>')}else{jQuery("#rw_top_loader").show()}};originalTheme.hideLoader=function(){jQuery("#rw_top_loader").hide()};originalTheme.scrollToElement=function(B){originalTheme.scrollToElementWithOffset(B,0)};originalTheme.scrollToElementWithOffset=function(B,F){if(jQuery(B).length>0){var D=jQuery(window).scrollTop();var G=D+jQuery(window).height();var C=jQuery(B).offset().top;var E=C+jQuery(B).height();if(C<D||E>G){window.scroll(0,jQuery(B).offset().top-F)}}}})();

