(function(){window.WebSiteManager=function(c){var a=extendsObject({contextUrl:undefined,beforeOpenSiteTopicCallback:undefined,beforeOpenSiteCallback:undefined},(typeof c==="string"?{contextUrl:c}:c));this.goToApp=function(e){spWindow.loadComponent(e)};this.goToAppPage=function(e){spWindow.loadContent(e)};this.goToAppTopic=function(e){this.openSiteTopic(e)};this.goToSite=function(f,e){this.openSite(f,e)};this.openIconDictionary=function(){SP_openWindow("dictionnaireIcones.jsp","dico","480","300","scrollbars=yes, resizable, alwaysRaised")};this.openSiteTopic=function(e){if(typeof a.beforeOpenSiteTopicCallback==="function"){a.beforeOpenSiteTopicCallback()}return spWindow.loadContent(sp.url.format(a.contextUrl,{Action:"Search",Id:e}))};this.openSite=function(f,e){if(typeof a.beforeOpenSiteCallback==="function"){a.beforeOpenSiteCallback()}return sp.ajaxRequest("siteAsJson").withParam("id",f).sendAndPromiseJsonResponse().then(function(h){var g=h.contentPath;if(d(h.type)){if(g.indexOf("://")!==-1){h.url=g}else{h.url="http://"+g}}else{h.url+="/"+g}b(h,e)})};var d=function(e){return e===WebSiteManager.Constants.LINK_SITE_TYPE||e===(""+WebSiteManager.Constants.LINK_SITE_TYPE)};var b=function(g,f){var e=extendsObject({popupTarget:"_blank",popupWidth:670,popupHeight:500,forceSitePopupOpening:false},a,f);if(!e.forceSitePopupOpening&&!g.popup){sp.navRequest("DisplaySite").withParam("Id",g.id).withParam("SitePage",g.url).go()}else{var h="width="+e.popupWidth+",height="+e.popupHeight+", toolbar=yes, scrollbars=yes, resizable, alwaysRaised";window.open(g.url,e.popupTarget,h)}}};WebSiteManager.Constants={LINK_SITE_TYPE:1}})();