(function(){var n=window.QuestionDataHandler=function(){this.sourceUrl="";this.success;this.fail;this.groups=[];this.generalErrorMsg="";this.defaultErrorMsg="An error occurred connecting to the server. Please refresh the browser and try again. If the problem persists, refer to the Contact Support link at the top of the page."};n.prototype.loadAllData=function(n){var i=this,r=this.getLocale(),t,u;this.success=n.success;this.fail=n.fail;tokenLocale=r.toLowerCase().replace("-","/");tokenLocale.indexOf("/")==-1&&(tokenLocale=tokenLocale+"/base");t=$("#TORwdPagelayout").data("source");t?this.sourceUrl=t.replace(/\{LOCALE\}/gi,tokenLocale):(u=MPNCore.getXmlPaths().gsc,this.sourceUrl=u+"/"+r+"/TopPartnerQuestions.xml");this.loadSupportOptimizationXml(function(){i.loadGroups(function(n){i.loadQuestions(n)})})};n.prototype.loadSupportOptimizationXml=function(n){var t=MPNCore.getLocalizedDataFile("SupportOptimization");typeof t!="undefined"?(this.generalErrorMsg=$("errormessage general",t).text(),this.generalErrorMsg?typeof n=="function"&&n():this.fail(this.defaultErrorMsg)):this.fail(this.defaultErrorMsg)};n.prototype.loadGroups=function(n,t){var i=this;performance.mark("stia_xml_cat_acs");$.ajax({url:i.getJsonpHandlerUrl(),data:{source:i.sourceUrl,parameters:""},success:function(r){var f=0,u;if(r.StatusCode==200){for(performance.mark("stia_xml_cat_acf"),u=$("group",$.parseXML(r.Results));f<u.length;f++)i.groups.push({title:u.eq(f).attr("title"),refid:u.eq(f).attr("refid"),detail:""});typeof n=="function"&&n(u)}else performance.mark("stia_xml_cat_ace"),typeof t=="function"&&t(),i.fail(i.generalErrorMsg)},error:function(){performance.mark("stia_xml_cat_ace");typeof t=="function"&&t();i.fail(i.generalErrorMsg)}})};n.prototype.loadQuestions=function(n){var e=this;for(i=0,count=0,l=n.length;i<l;i++){var o=0,r=0,t=[],s="",h="",c="",u,f,v="",y="",a=$("question",n.eq(i));for(t.push('<div class="content-area"><div class="questions-detail"><ul>'),o=0;o<a.length;o++){if(u=a.eq(o),s=u.find(">title").text(),h=u.find(">description").text(),c=u.find(">id").text(),f=u.find("articlelinks"),t.push("<li>"),t.push('\t<a class="subTitle anchor" name="'+c+'">'+s+"<\/a>"),t.push('\t<div class="paragraph">'+h+"<\/div>"),f.length>0){for(t.push('\t\t<div class="questions-detail">'),t.push('\t\t\t<div class="articlelinks"><ul>'),r=0;r<f.find("link").length;r++)v=e.replaceLocaltoUrl($("url",f).eq(r).text()),y=$("text",f).eq(r).text(),t.push('\t\t\t<li><a href="'+v+'">'+y+"<\/a><\/li>");t.push("\t\t<\/ul><\/div>");t.push("\t<\/div>")}t.push("<\/li>")}t.push("<\/ul><\/div><\/div>");e.groups[i].detail=t.join("");++count===l&&e.success(e.groups)}};n.prototype.getJsonpHandlerUrl=function(){return MPNCore.PartnerBI.getWebApiUrl()+"/member/utility/getcrossdomaindata"};n.prototype.replaceLocaltoUrl=function(n){return n.replace("$",this.getLocale())};n.prototype.getLocale=function(){var n=MPNCore.getLocale();return n=n.toLowerCase().replace("-","/"),n.indexOf("/")==-1&&(n=n+"/base"),n}})(),function(){var n=window.TORwdPagelayout=function(n){n&&n.length&&(this.$root=n);this.isDesignMode=""};n.delayfn=[];n.resizefn=[];n.scrollfn=[];n.initfn=[];n.pushResize=function(t,i){return n.resizefn.push(t),i||n.initfn.push(t),this};n.pushScroll=function(t,i){return n.scrollfn.push(t),i||n.initfn.push(t),this};n.pushInit=function(t){return n.initfn.push(t),this};n.delay=function(t){return n.delayfn.push(t),this};n.expand=function(t){for(var i in t)n.prototype[i]=t[i];return this};n.prototype={version:"3.8",init:function(){var i=this,t=0;if((this.isDesignMode=$("#MSOLayout_InDesignMode").val())&&$("#TORwdPagelayout").addClass("designmode"),!this.$root||this.isDesignMode){this.loaded();return}if(n.resizefn.length&&$(window).resize(function(){for(var t=0;t<n.resizefn.length;t++)i[n.resizefn[t]]()}),n.scrollfn.length&&$(window).scroll(function(){for(var t=0;t<n.scrollfn.length;t++)i[n.scrollfn[t]]()}),n.pushInit("clearEmptySpace"),n.delayfn.length)for(t=0;t<n.delayfn.length;t++)n.pushInit(n.delayfn[t]);n.pushInit("loaded");this.executeInitFn();this.getPara("torwd")&&alert("CSS Version: "+parseFloat($("#TORwdPagelayout").css("min-height"))+";\r\nJS Version: "+this.version)},executeInitFn:function(){var t=n.initfn.shift(),i=this;t&&setTimeout(function(){i[t]();i.executeInitFn()},10)},loaded:function(){var t=this,n;n=setInterval(function(){return function(){!0&&($("#TORwdPagelayout").addClass("loaded"),clearInterval(n))}}(n),100)},getRwdWidth:function(){return parseInt($("#TORwdPagelayout").css("left"))},clearEmptySpace:function(){this.$root.find(".nullable").each(function(){var r=0,u=$(this).find(".isnull"),t=u.length,n,i=0;for(!t&&(u=$(this))&&(t=1);r<t;r++)n=u.eq(r),n.hasClass("webpart-zone")?!n.find(".s4-wpTopTable").length&&++i&&n.remove():n.find(".ms-rtestate-field").length?$.trim(n.find(".ms-rtestate-field:last").text()).length||n.find("img").length||!++i||n.remove():!$.trim(n.text()).length&&++i&&n.remove();i==t&&$(this).length&&$(this).remove()})},getPara:function(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=i.exec(location.search);return t==null?"":decodeURIComponent(t[1].replace(/\+/g," "))}}}();TORwdPagelayout.expand({torwdScrollSpyInit:function(n,t){if(!this.isDesignMode){if(n.length==0||t.length==0){n.hide();return}this.scrollSpyLoadItems(n,t);this.scrollSpyBindEvents();this.scollSpyEnabled()&&(this.cacheTargets(),this.scrollSpyActive(),this.leftNavSticky())}},scrollSpyLoadItems:function(n,t){var l=this,r=$(['<div id="scrollspywp" class="'+$.trim(n.find(".MAPSTargetedCBQ-ScrollSpyEnabledContentItems").attr("class"))+'">','<div id="scrollspynavs" class="left-nav">','<ul class="no-list-style">',"<\/ul>","<\/div>",'<div id="scrollspymaincontent" class="main-content">','<ul class="no-list-style">',"<\/ul>","<\/div>","<\/div>"].join("")),e=[],h=[],c=t.length,u,i,o,f,s="p";for(this.targets=[];c--;)(u=t[c],i=u.title,o=u.detail,f=u.title,i&&o)&&(this.targets.push({title:i,hash:f,offset:0}),s==="p"?e.push('<li><a class="left-rail" href="#'+f+'">'+i+"<\/a><\/li>"):(e.push('<li><a class="left-rail" href="#'+f+'">'+i+'<\/a><ul class="no-list-style scrollspychildnavs">'),s="p"),h.push('<li class="parent"><div class="scrollspywp-title"><span>'+i+'<\/span><\/div><div class="scrollspywp-content">'+o+"<\/div><\/li>"));s==="p"&&(this.targets.reverse(),r.find("#scrollspynavs > ul").append(e.reverse().join("")),r.find("#scrollspynavs .left-rail").each(function(n){$(this).attr("index",n)}),r.find("#scrollspymaincontent > ul").append(h.reverse().join("")),n.find("#scrollspywp").remove(),n.html(r))},scrollSpyBindEvents:function(){var n=this;$("#scrollspynavs .left-rail").click(function(){if(n.activeEnabled){var t=$(this).parent(),i=parseInt($(this).attr("index"),10),r=navigator.userAgent.toLowerCase().indexOf("webkit")!==-1?"body":"html";n.activeEnabled=!1;$("#scrollspynavs li").removeClass("active");t.addClass("active");n.cacheTargets();$(r).animate({scrollTop:n.targets[i].offset+20},600,function(){n.scrollSpyActive();n.leftNavSticky();n.activeEnabled=!0})}});$("#scrollspymaincontent .scrollspywp-title").click(function(){var n=$(this).parent();n.hasClass("parent")?n.hasClass("expand")?(n.removeClass("expand"),n.nextAll().each(function(){if($(this).hasClass("child"))$(this).removeClass("child-show").removeClass("scrollspywp-expand");else return!1})):(n.addClass("expand"),n.nextAll().each(function(){if($(this).hasClass("child"))$(this).addClass("child-show");else return!1})):n.toggleClass("expand")})},cacheOffsets:{wpoffsettop:0,wpwidth:0,wpheight:0,leftNavHeight:0},targets:[],activeEnabled:!0,scollSpyLoaded:!1,scollSpyEnabled:function(){return $("#scrollspynavs").css("display")=="block"},cacheTargets:function(){var n=0,t=$("#scrollspywp"),i=$("#scrollspymaincontent >ul >li");if(t.length){for(;n<i.length;n++)this.targets[n].offset=parseInt(i.eq(n).offset().top,10);this.cacheOffsets.wpoffsettop=parseInt(t.offset().top,10);this.cacheOffsets.wpwidth=t.width();this.cacheOffsets.wpheight=t.height();this.cacheOffsets.leftNavHeight=$("#scrollspynavs").height()}},leftNavSticky:function(){var n=$("#scrollspynavs"),t=$(window).scrollTop();this.cacheOffsets.wpoffsettop<=t?this.cacheOffsets.wpoffsettop+this.cacheOffsets.wpheight-this.cacheOffsets.leftNavHeight>=t?n.css({position:"fixed",top:0,bottom:"",width:this.cacheOffsets.wpwidth*.238}):n.css({position:"absolute",top:"",bottom:0,width:this.cacheOffsets.wpwidth*.238}):n.css({position:"static",width:""})},udpateChildNav:function(){var t=this,o=$("#scrollspynavs"),f=o.find("li.active"),e=f.parent(),n=o.find(".scrollspychildnavs.active"),i,u=!1,r=300;f.length>0?e.hasClass("scrollspychildnavs")?(u=e.hasClass("active"),!u&&n.length?n.slideUp(r,function(){$(this).removeClass("active");t.leftNavSticky()}):u||e.slideDown(r,function(){$(this).addClass("active");t.leftNavSticky()})):(i=f.find(".scrollspychildnavs"),u=i.length?i.hasClass("active"):!1,i.length&&!u?(n.length&&n.slideUp(r,function(){$(this).removeClass("active");t.leftNavSticky()}),i.slideDown(r,function(){$(this).addClass("active");t.leftNavSticky()})):!i.length&&n.length&&n.slideUp(r,function(){$(this).removeClass("active");t.leftNavSticky()})):n.length>0&&n.slideUp(r,function(){$(this).removeClass("active");t.leftNavSticky()})},scrollSpyActive:function(){for(var i=$(window).scrollTop(),n=0,r=this.targets.length,t=$("#scrollspynavs li");n<r;n++){if(n===0&&i<this.targets[n].offset){t.removeClass("active");this.scollSpyLoaded&&location.hash&&location.hash!=="#"&&(location.hash="_");break}if(n===r-1&&i>=this.targets[n].offset){t.removeClass("active");t.eq(n).addClass("active");location.hash=this.targets[n].hash;break}if(i>=this.targets[n].offset&&i<this.targets[n+1].offset){t.removeClass("active");t.eq(n).addClass("active");location.hash=this.targets[n].hash;break}}this.udpateChildNav()},scrollSpyResizeFn:function(){this.scollSpyEnabled()&&this.activeEnabled&&(this.cacheTargets(),this.scrollSpyActive(),this.leftNavSticky())},scrollSpyScrollFn:function(){var n=this;this.scollSpyEnabled()&&this.activeEnabled&&(this.cacheTargets(),this.leftNavSticky(),this._leftNavActive&&clearTimeout(this._leftNavActive),this._leftNavActive=setTimeout(function(){n.scrollSpyActive();n._leftNavActive=null},20))},setActiveSection:function(){var i=0,t=location.hash,u=!1,r,n;if(t){for(t=decodeURI($.trim(t).replace("#",""));i<this.targets.length;i++)if(this.targets[i].hash==t)if(this.scollSpyEnabled()){$("#scrollspynavs .left-rail").eq(i).trigger("click");u=!0;break}else r=navigator.userAgent.toLowerCase().indexOf("webkit")!==-1?"body":"html",n=$("#scrollspymaincontent > ul > li").eq(i),$(r).animate({scrollTop:parseInt(n.offset().top,10)},100,function(){n.find(".scrollspywp-title").trigger("click")});u||(this.scollSpyEnabled()?(location.hash="#",location.hash="#"+t):(n=$('#scrollspymaincontent a.anchor[name="'+t+'"]'),n.length&&(r=navigator.userAgent.toLowerCase().indexOf("webkit")!==-1?"body":"html",n=n.parentsUntil(".no-list-style").last(),n.find(".scrollspywp-title").trigger("click"),location.hash="#",location.hash="#"+t)))}this.scollSpyLoaded=!0}}).pushResize("scrollSpyResizeFn",!0).pushScroll("scrollSpyScrollFn",!0);$(function(){var n=new TORwdPagelayout($("#TopIssuePage")),t;n.init();$("#topissuescrollspy").html('<div class="loading"><img alt="" src="/images/partner/loading.gif"><\/div>');t=new QuestionDataHandler;t.loadAllData({success:function(t){n.torwdScrollSpyInit($("#topissuescrollspy"),t);n.setActiveSection()},fail:function(n){$("#topissuescrollspy").html('<div class="paragraph errorText">'+n+"<\/div>")}})})