(function(){window.WebSiteManager=function(params){var __context=extendsObject({contextUrl:undefined,beforeOpenSiteTopicCallback:undefined,beforeOpenSiteCallback:undefined},typeof params==="string"?{contextUrl:params}:params);this.goToApp=function(componentId){spWindow.loadComponent(componentId)};this.goToAppPage=function(page){spWindow.loadContent(page)};this.goToAppTopic=function(id){this.openSiteTopic(id)};this.goToSite=function(id,options){this.openSite(id,options)};this.openIconDictionary=function(){SP_openWindow("dictionnaireIcones.jsp",
"dico","480","300","scrollbars\x3dyes, resizable, alwaysRaised")};this.openSiteTopic=function(id){if(typeof __context.beforeOpenSiteTopicCallback==="function")__context.beforeOpenSiteTopicCallback();return spWindow.loadContent(sp.url.format(__context.contextUrl,{"Action":"Search","Id":id}))};this.openSite=function(siteId,options){if(typeof __context.beforeOpenSiteCallback==="function")__context.beforeOpenSiteCallback();return sp.ajaxRequest("siteAsJson").withParam("id",siteId).sendAndPromiseJsonResponse().then(function(site){var sitePath=
site.contentPath;if(__isLinkSite(site.type))if(sitePath.indexOf("://")!==-1)site.url=sitePath;else site.url="http://"+sitePath;else site.url+="/"+sitePath;__display(site,options)})};var __isLinkSite=function(siteType){return siteType===WebSiteManager.Constants.LINK_SITE_TYPE||siteType===""+WebSiteManager.Constants.LINK_SITE_TYPE};var __display=function(site,options){var __options=extendsObject({popupTarget:"_blank",popupWidth:670,popupHeight:500,forceSitePopupOpening:false},__context,options);if(!__options.forceSitePopupOpening&&
!site.popup)sp.navRequest("DisplaySite").withParam("Id",site.id).withParam("SitePage",site.url).go();else{var windowParams="width\x3d"+__options.popupWidth+",height\x3d"+__options.popupHeight+", toolbar\x3dyes, scrollbars\x3dyes, resizable, alwaysRaised";window.open(site.url,__options.popupTarget,windowParams)}}};WebSiteManager.Constants={LINK_SITE_TYPE:1}})();