if(typeof originalTheme==="undefined"){var originalTheme={}}(function(){originalTheme.activity={};jQuery(document).ready(function(){if(jQuery("#rw_activity_macro_wrapper").length>0){B()}});function B(){jQuery.ajax({type:"POST",url:contextPath+"/ajaxactions/init-activity-stream.action",data:{start:"0",stepSize:jQuery("#stepSizeVarActivity").html(),types:jQuery("#typesVarActivity").html(),categoryKey:jQuery("#categoryKeyVarActivity").html(),spaces:jQuery("#spacesVarActivity").html(),init:true},success:function(C){C=originalTheme.validateAjaxResponse(C);jQuery("#rw_activity_macro_wrapper").html(C);jQuery("#rw_activity_macro_loader").hide();jQuery("#rw_activity_macro_wrapper").show()},error:function(C){if(C.status!=0){jQuery("#rw_activity_macro_wrapper").html("<div class='rw_warning_box'>"+C.status+" "+C.statusText+"</div>").show();jQuery("#rw_activity_macro_loader").hide()}}})}function A(E,C,D){jQuery("#rw_activity_macro_container").fadeTo("fast",0.5);jQuery.ajax({type:"POST",url:contextPath+"/ajaxactions/update-activity-stream.action",data:{types:E,selectedTab:C,selectedTeam:D,start:"0",stepSize:jQuery("#stepSizeVarActivity").html(),categoryKey:jQuery("#categoryKeyVarActivity").html(),spaces:jQuery("#spacesVarActivity").html()},success:function(F){F=originalTheme.validateAjaxResponse(F);jQuery("#rw_activity_macro_container").html(F);jQuery("#rw_activity_macro_container").fadeTo("fast",1)},error:function(F){if(F.status!=0){jQuery("#rw_activity_macro_wrapper").html("<div class='rw_warning_box'>"+F.status+" "+F.statusText+"</div>").show();jQuery("#rw_activity_macro_loader").hide()}}})}originalTheme.activity.initFilter=function(C){jQuery('#rw_content_types input[type="checkbox"]:checked').each(function(){jQuery(this).parent().removeClass("rw_selected");jQuery(this).parent().find("input").attr("checked",false)});if(C.length>0){typeList=C.split(",");for(i=0;i<typeList.length;i++){var D=typeList[i];jQuery("#rw_content_types li.rw_type_"+D).addClass("rw_selected");jQuery("#rw_content_types li.rw_type_"+D).find("input").attr("checked",true)}jQuery("#rw_filter_button").addClass("rw_filter_on");jQuery("#rw_filter_button #rw_filter_button_off").hide();jQuery("#rw_filter_button #rw_filter_button_on").show()}else{jQuery("#rw_content_types li.rw_type_all").addClass("rw_selected");jQuery("#rw_content_types li.rw_type_all").find("input").attr("checked",true)}};originalTheme.activity.toggleThumbnail=function(F){var E=document.getElementById("twixie-"+F);if(E.className.indexOf("right")!=-1){E.className="rw_icon_container_16 rw_arrow_down"}else{E.className="rw_icon_container_16 rw_arrow_right"}var D="thumbnail-"+F;var C=document.getElementById(D);if(C.style.display=="none"){C.style.display=""}else{C.style.display="none"}};originalTheme.activity.loadMoreActivityStream=function(){jQuery("#rw_load_more_activity_link span.rw_load_more_text").hide();jQuery("#rw_load_more_activity_link img.rw_load_more_image").show();jQuery("#rw_load_more_activity_link").addClass("rw_load_more_link_loading");jQuery.ajax({type:"POST",url:contextPath+"/ajaxactions/update-activity-stream.action",data:{types:jQuery("#typesVarActivityMore").html(),selectedTab:jQuery("#selectedTabVarActivityMore").html(),selectedTeam:jQuery("#selectedTeamVarActivityMore").html(),start:jQuery("#startVarActivityMore").html(),stepSize:jQuery("#stepSizeVarActivity").html(),categoryKey:jQuery("#categoryKeyVarActivity").html(),spaces:jQuery("#spacesVarActivity").html()},success:function(C){C=originalTheme.validateAjaxResponse(C);jQuery("#rw_recently_vars").remove();jQuery("#rw_load_more_activity_link").remove();jQuery("#rw_activity_macro_container").append(C)},error:function(C){if(C.status!=0){jQuery("#rw_activity_macro_wrapper").html("<div class='rw_warning_box'>"+C.status+" "+C.statusText+"</div>").show();jQuery("#rw_activity_macro_loader").hide()}}})};originalTheme.activity.filterContent=function(){var E="";var C="";var D="";if(!jQuery("#rw_content_types li.rw_type_all").find("input").attr("checked")){jQuery('#rw_content_types input[type="checkbox"]:checked').each(function(){if(jQuery(this).val().length>0){E+=jQuery(this).val()+","}});if(E.length>0){E=E.substring(0,E.length-1)}}if(jQuery("#rw_space_filter_menu li.rw_active").length){C=jQuery("#rw_space_filter_menu li.rw_active").attr("id").substring(10)}if(jQuery("#rw_spaces_team li.rw_active_team").length){D=jQuery("#rw_spaces_team li.rw_active_team").attr("id").substring(8)}A(E,C,D)};originalTheme.activity.filterBySpaces=function(D,E){var C=jQuery("#rw_space_filter_menu");C.find("li.rw_active").removeClass("rw_active");C.find("#rw_spaces_"+D).addClass("rw_active");C.find("li.rw_active_team").removeClass("rw_active_team");if(E!=""){C.find("#rw_team_"+E).addClass("rw_active_team")}originalTheme.activity.filterContent()}})();
if(typeof originalTheme==="undefined"){var originalTheme={}}(function(){originalTheme.spaces={};var J;var W;var S;var K;var O;var L;var R;jQuery(document).ready(function(){if(jQuery("#rw_spaces_macro").length>0){J=jQuery(jQuery("#rw_category_item_template").html());W=jQuery(jQuery("#rw_category_base_template").html());S=jQuery(jQuery("#rw_space_item_template").html());K=jQuery(jQuery("#rw_spaces_template").html());O=jQuery(jQuery("#rw_no_spaces_template").html());L=jQuery(jQuery("#rw_spaces_loader").html());R=jQuery("#spacesVarClosedCategories").html();if(jQuery("#spacesVarCategoryKey").length>0){E(jQuery("#spacesVarCategoryKey").html(),jQuery("#rw_spaces_macro_container"))}else{U(jQuery("#spacesVarSpacesSelectedTab").html(),jQuery("#spacesVarSelectedTeam").html(),jQuery("#spacesVarSpaceDirectory").html())}}});function I(){var X=jQuery("#rw_spaces_macro_container");X.html(L);jQuery.ajax({url:contextPath+"/rest/originaltheme/1.0/categories/withspaces",type:"GET",dataType:"json",cache:false,success:function(Y){X.html("");if(typeof (Y.categories)!=="undefined"&&Y.categories.length>0){M(Y.categories,jQuery("#rw_spaces_macro_container"))}if(typeof (Y.spaces)!=="undefined"&&Y.spaces.length>0){H(Y.spaces,jQuery("#rw_spaces_macro_container"))}},error:function(Y){if(Y.status!=0){X.html("<div class='rw_warning_box'>"+Y.status+" "+Y.statusText+"</div>").show()}}})}function Q(){var X=jQuery("#rw_spaces_macro_container");X.html(L);jQuery.ajax({url:contextPath+"/rest/originaltheme/1.0/categories/",type:"GET",dataType:"json",cache:false,success:function(Y){X.html("");if(typeof (Y.categories)!=="undefined"&&Y.categories.length>0){G(Y.categories,X)}if(typeof (Y.spaces)!=="undefined"&&Y.spaces.length>0){H(Y.spaces,X)}V(X)},error:function(Y){if(Y.status!=0){X.html("<div class='rw_warning_box'>"+Y.status+" "+Y.statusText+"</div>").show()}}})}function E(Y,X){X.html(L);jQuery.ajax({url:contextPath+"/rest/originaltheme/1.0/category/"+Y+"/withspaces/",type:"GET",dataType:"json",cache:false,success:function(Z){X.html("");if(typeof (Z.spaces)==="undefined"&&typeof (Z.subCategories)==="undefined"){X.html(O)}else{C(Z,X)}},error:function(Z){if(Z.status!=0){X.html("<div class='rw_warning_box'>"+Z.status+" "+Z.statusText+"</div>").show()}}})}function B(Y){var X=jQuery("#rw_spaces_macro_container");X.html(L);jQuery.ajax({url:contextPath+"/rest/originaltheme/1.0/spaces/label/"+Y,type:"GET",dataType:"json",cache:false,success:function(Z){X.html("");H(Z.spaces,X)},error:function(Z){if(Z.status!=0){X.html("<div class='rw_warning_box'>"+Z.status+" "+Z.statusText+"</div>").show()}}})}function T(){var X=jQuery("#rw_spaces_macro_container");X.html(L);jQuery.ajax({url:contextPath+"/rest/originaltheme/1.0/spaces/favourite",type:"GET",dataType:"json",cache:false,success:function(Y){X.html("");if(typeof (Y.spaces)!=="undefined"&&Y.spaces.length>0){H(Y.spaces,X)}else{X.html(O)}},error:function(Y){if(Y.status!=0){X.html("<div class='rw_warning_box'>"+Y.status+" "+Y.statusText+"</div>").show()}}})}function D(X){X.html(L);jQuery.ajax({url:contextPath+"/rest/originaltheme/1.0/spaces/uncategorized",type:"GET",dataType:"json",cache:false,success:function(Y){X.html("");if(typeof (Y.spaces)!=="undefined"&&Y.spaces.length>0){H(Y.spaces,X)}else{X.html(O)}},error:function(Y){if(Y.status!=0){X.html("<div class='rw_warning_box'>"+Y.status+" "+Y.statusText+"</div>").show()}}})}function N(X){jQuery.ajax({url:contextPath+"/ajaxactions/set-spaces-selected-tab.action",data:{value:X},type:"POST",dataType:"json",cache:false,success:function(Y){}})}function P(X){jQuery.ajax({url:contextPath+"/ajaxactions/set-spaces-selected-team.action",data:{value:X},type:"POST",dataType:"json",cache:false,success:function(Y){}})}function M(Y,X){if(typeof (Y)!=="undefined"){jQuery.each(Y,function(){F(this,X)})}}function G(Y,X){if(typeof (Y)!=="undefined"){jQuery.each(Y,function(){var a=J.clone(),d=jQuery("div.rw_spaces_category_title",a),c=jQuery("div.rw_spaces_category_title span",a),b=jQuery("div.rw_spaces_subcategories",a),Z=this.nameKey;originalTheme.spaces.toggleCategorySection(d);c.html(this.name);d.click(function(f){E(Z,b);d.unbind(f)});X.append(a)})}}function F(a,X){var Z=J.clone(),d=jQuery("div.rw_spaces_category_title",Z),c=jQuery("div.rw_spaces_category_title span",Z),Y=jQuery("ul.rw_spaces_links",Z),b=jQuery("div.rw_spaces_subcategories",Z);if(R==="true"){originalTheme.spaces.toggleCategorySection(d)}c.html(a.name);A(a.spaces,Y);M(a.subCategories,b);X.append(Z)}function C(a,X){var Z=W.clone(),Y=jQuery("ul.rw_spaces_links",Z),b=jQuery("div.rw_spaces_subcategories",Z);A(a.spaces,Y);M(a.subCategories,b);X.append(Z)}function A(Y,X){if(typeof (Y)!=="undefined"){jQuery.each(Y,function(b){var e=S.clone(),c=jQuery("a",e),Z=jQuery("span.rw_spaces_space_name",e),f=jQuery("span.rw_spaces_favourite",e),a=jQuery("span.rw_spaces_description",e),d=this.key;Z.html(this.name);if(b&1){}else{e.addClass("rw_alternating")}if(userIsLoggedIn){if(this.favourite){f.addClass("rw_yellow_star")}else{f.addClass("rw_gray_star")}f.click(function(g){originalTheme.addOrRemoveFav(d,this);g.stopPropagation()})}else{f.remove()}c.click(function(){window.location=contextPath+"/display/"+d});if(typeof (this.description)!=="undefined"){a.html(this.description)}X.append(e)})}}function H(Z,X){var a=K.clone(),Y=jQuery("ul.rw_spaces_links",a);A(Z,Y);X.append(a)}function V(X){var a=J.clone(),d=jQuery("div.rw_spaces_category_title",a),c=jQuery("div.rw_spaces_category_title span",a),Z=jQuery("ul.rw_spaces_links",a),b=jQuery("div.rw_spaces_subcategories",a),Y=this.nameKey;originalTheme.spaces.toggleCategorySection(d);c.html(unCategorizedSpaces);d.click(function(f){D(Z);d.unbind(f)});X.append(a)}function U(X,Y,Z){jQuery("#rw_spacelist_menu .rw_active").removeClass("rw_active");jQuery("#rw_spacelist_menu .rw_active_team").removeClass("rw_active_team");if(X==="team"){if(Z==="true"){jQuery("#rw_spacelist_menu #rw_team_"+Y).addClass("rw_active")}else{jQuery("#rw_spacelist_menu #rw_spacelist_team").addClass("rw_active");jQuery("#rw_spacelist_menu #rw_team_"+Y).addClass("rw_active_team")}if(jQuery("#rw_spacelist_menu #rw_team_"+Y).hasClass("rw_is_category")){E(Y,jQuery("#rw_spaces_macro_container"))}else{B(Y)}}else{if(X==="my"){jQuery("#rw_spacelist_menu #rw_spacelist_my").addClass("rw_active");T()}else{jQuery("#rw_spacelist_menu #rw_spacelist_all").addClass("rw_active");if(R==="true"){Q()}else{I()}}}}originalTheme.spaces.filterSpaces=function(X){originalTheme.spaces.filterSpaces(X,"",false)};originalTheme.spaces.filterSpaces=function(X,Y){originalTheme.spaces.filterSpaces(X,Y,false)};originalTheme.spaces.filterSpaces=function(X,Y,Z){U(X,Y,Z);N(X);if(X==="team"){P(Y)}};originalTheme.spaces.toggleCategorySection=function(X){if(jQuery(X).hasClass("rw_category_closed")){jQuery(X).removeClass("rw_category_closed");jQuery(X).next().show()}else{jQuery(X).addClass("rw_category_closed");jQuery(X).next().hide()}}})();
if(typeof originalTheme==="undefined"){var originalTheme={}}(function(){originalTheme.news={};jQuery(document).ready(function(){jQuery("#main .rw_news_macro").each(function(){A(jQuery(this))})});function A(B){jQuery.ajax({type:"POST",url:contextPath+"/ajaxactions/load-news.action",data:{start:0,stepSize:B.find("#stepSizeVarNews").html(),profilePic:B.find("#profilePicVarNews").html(),spaces:B.find("#spacesVarNews").html(),type:B.find("#typeVarNews").html(),labels:B.find("#labelsVarNews").html(),content:B.find("#contentVarNews").html()},success:function(C){C=originalTheme.validateAjaxResponse(C);B.find("#news_container").append(C);B.find("#news_loader").remove();B.show()},error:function(C){if(C.status!=0){jQuery("#rw_news_macro").html("<div class='rw_warning_box'>"+C.status+" "+C.statusText+"</div>").show();jQuery("#news_loader").hide()}}})}originalTheme.news.loadMoreNews=function(B){B.find("#rw_load_more_news_link .rw_load_more_text").hide();B.find("#rw_load_more_news_link .rw_load_more_image").show();B.find("#rw_load_more_news_link").addClass("rw_load_more_link_loading");jQuery.ajax({type:"POST",url:contextPath+"/ajaxactions/load-news.action",data:{start:B.find("#startVarNews").html(),profilePic:B.find("#profilePicVarNews").html(),spaces:B.find("#spacesVarNews").html(),type:B.find("#typeVarNews").html(),labels:B.find("#labelsVarNews").html(),stepSize:B.find("#stepSizeVarNews").html(),content:B.find("#contentVarNews").html()},success:function(C){C=originalTheme.validateAjaxResponse(C);B.find("#rw_news_vars").remove();B.find("#rw_load_more_news_link").remove();B.find("#news_container").append(C)},error:function(C){if(C.status!=0){jQuery("#rw_news_macro").html("<div class='rw_warning_box'>"+C.status+" "+C.statusText+"</div>").show();jQuery("#news_loader").hide()}}})};originalTheme.news.toggleNewsItem=function(B){if(jQuery(B).parent().hasClass("rw_open")){jQuery(B).parent().removeClass("rw_open");jQuery(B).parent().find(".rw_news_item_content").hide()}else{jQuery(B).parent().addClass("rw_open");jQuery(B).parent().find(".rw_news_item_content").show()}}})();
if(typeof originalTheme==="undefined"){var originalTheme={}}(function(){originalTheme.spacenews={};jQuery(document).ready(function(){jQuery("#main .rw_space_news_macro").each(function(){A(jQuery(this))})});function A(B){jQuery.ajax({type:"POST",url:contextPath+"/ajaxactions/init-space-news.action",data:{collapsed:B.find("#collapsedVarSpaceNews").html(),pageId:B.find("#pageIdVarSpaceNews").html()},success:function(C){C=originalTheme.validateAjaxResponse(C);B.find("#rw_space_news_macro").html(C).show();B.find("#rw_space_news_loader").hide()},error:function(C){if(C.status!=0){jQuery("#rw_space_news_macro").html("<div class='rw_warning_box'>"+C.status+" "+C.statusText+"</div>").show();jQuery("#rw_space_news_loader").hide()}}})}originalTheme.spacenews.showSpaceNews=function(B){var C=jQuery(B).parent();C.find("#rw_space_news_container").show();C.find("#rw_space_news_show").hide();C.find("#rw_space_news_hide").show()};originalTheme.spacenews.hideSpaceNews=function(B){var C=jQuery(B).parent();C.find("#rw_space_news_container").hide();C.find("#rw_space_news_show").show();C.find("#rw_space_news_hide").hide()}})();

