function CallService(n){jq191.ajax({type:Type,url:Url,data:Data,contentType:ContentType,dataType:DataType,processdata:ProcessData,success:n,error:ServiceFailed})}function GetDashboardData(n,t,i,r,u,f,e){Type=u;Url=i+r;isEmpty(n)||isEmpty(t)||(Type=="GET"?Url="{0}?{1}={2}".format(Url,t,n):Data=JSON.parse('{ "'+t+'":"'+n+'" }'));ContentType="application/json; charset=utf-8";DataType=isEmpty(e)?"json":e;ProcessData=!1;Method=r;CallService(f)}function ServiceSucceeded(){DataType=="jsonp"}function ServiceFailed(n){if(alert("FAIL"+n.responseText),n.responseText){var t=n.responseText;t?error(t):error({Message:"Unknown server error."})}return}function ServiceFailed(n){alert("Service call failed: "+n.status+""+n.statusText);Type=null;Url=null;Data=null;ContentType=null;DataType=null;ProcessData=null}function DrawCountryProfile(n,t,i,r){if(typeof n=="undefined"){alert("Argument required and must be a valid barObject array!");return}var l=n,w=new Date,h=r,u=30,c=4,o=20,a=o*n.length+c*n.length+u*2,v="bar",f=t,b=w.getFullYear(),e=d3.scale.linear().domain([f,b]).range([u,h-u]),k=d3.scale.linear().domain([0,a-u]).range([a-u,u]),s=d3.select(i).append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr("version","1.1").attr("width",h).attr("height",a),y=d3.svg.axis(),p=d3.svg.axis();y.scale(e);p.scale(k);p.ticks(0);y.orient("bottom");p.orient("left");y.tickFormat(d3.format("Y"));s.append("g").attr("class","axis").attr("transform","translate(-1,"+(a-u)+")").call(y);s.append("g").attr("class","axis").attr("transform","translate("+(u-1)+", 0)").call(p);s.selectAll("rect").data(l).enter().append("rect").attr("class","barPeriod1").attr("id",function(n,t){return v+t.toString()}).attr("style","shape-rendering: crispEdges").attr("x",u).attr("y",function(n,t){return u+t*(o+c)}).attr("width",0).transition().duration(500).attr("width",function(n){return n.period1<f?n.period2<f?n.period3<f?h-u*2:e(n.period3)-u:e(n.period2)-u:e(n.period1)-u}).attr("height",o);d3.selectAll(".barPeriod1").append("title").text(function(n){return"No Action: {0}-{1}\n{2}.".format(f,n.period1<f?n.period2<f?n.period3<f?"current":n.period3:n.period2:n.period1,n.barName.split("_")[0])});s.selectAll().data(l).enter().append("rect").attr("class","barPeriod2").attr("id",function(n,t){return v+t.toString()}).attr("style","shape-rendering: crispEdges").attr("x",function(n){return n.period1<f?u:e(n.period1)}).attr("y",function(n,t){return u+t*(o+c)}).attr("width",0).transition().duration(700).attr("width",function(n){return n.period1<f?0:n.period2<f?n.period3<f?h-(e(n.period1)+u):e(n.period3)-e(n.period2):e(n.period2)-e(n.period1)}).attr("height",o);d3.selectAll(".barPeriod2").append("title").text(function(n){return"Signatory: {0}-{1}\n{2}.".format(n.period1,n.period2<f?n.period3<f?"current":n.period3:n.period2,n.barName.split("_")[0])});s.selectAll().data(l).enter().append("rect").attr("class","barPeriod3").attr("id",function(n,t){return v+t.toString()}).attr("style","shape-rendering: crispEdges").attr("x",function(n){return n.period2<f?u:e(n.period2)}).attr("y",function(n,t){return u+t*(o+c)}).attr("width",0).transition().duration(1e3).attr("width",function(n){return n.period2<f?0:n.period3<f?h-(e(n.period2)+u):e(n.period3)-e(n.period2)}).attr("height",o);d3.selectAll(".barPeriod3").append("title").text(function(n){return"State Party: {0}-{1}\n{2}.".format(n.period2,n.period3<f?"current ":n.period3,n.barName.split("_")[0])});s.selectAll().data(l).enter().append("rect").attr("class","barPeriod4").attr("id",function(n,t){return v+t.toString()}).attr("style","shape-rendering: crispEdges").attr("x",function(n){return n.period3<f?u:e(n.period3)}).attr("y",function(n,t){return u+t*(o+c)}).attr("width",0).transition().duration(1e3).attr("width",function(n){return n.period3<f?0:h-(e(n.period3)+u)}).attr("height",o);d3.selectAll(".barPeriod4").append("title").text(function(n){return"Denounced: {0}-{1}\n{2}.".format(n.period3,"current",n.barName.split("_")[0])});s.append("defs").append("clipPath").attr("id","textClip").append("rect").attr("x",u).attr("y",u).attr("width",h-u*6).attr("height",a-u*2);s.selectAll().data(l).enter().append("text").text(function(n){var t=n.barName.split("_");return t[1]==null?"NA":t[1].toString()}).attr("x",u+2).attr("y",function(n,t){return u+t*(o+c)+o/1.5}).attr("anchor","left").attr("clip-path","url(#textClip)").attr("font-family","sans-serif").attr("font-size","10px").attr("fill","black")}function JSdict(){this.Keys=[];this.Values=[]}function MarkupStabilizer(){var t="",n="",i="",r=!1,u=!1;jq191(".main_slct_box").on("click",function(){var f=jq191(this).hasClass("popup");return t=jq191(this).attr("id"),n==""&&(n=i==""?t:i),t!=n&&(jq191(".slct_sub_box").hide(),n="",i=t),jq191(this).next().is(":visible")?(jq191(this).next().hide(),jq191(".slct_sub_box").hide()):(f?u?jq191(this).next().show():jq191(this).next().show(function(){jq191("#scrollbar_ppup").tinyscrollbar({sizethumb:40});u=!0}):r?(jq191(this).next().show(),jq191("#container_ddlRatifications").is(":visible")||jq191("#container_ddlRatifications").show()):jq191(this).next().show(function(){jq191("#scrollbar_rat").tinyscrollbar();r=!0}),jq191("#ppup_cntrylst").css("display","block")),!1});jq191(".slct_sub_box li.top_lvl").bind("click",function(n){var t,i;return jq191(n.target).is("li#opRegion span")?!1:(t=jq191(this).find("span").html(),jq191(this).parent().parent().hide(),i=jq191(this).parent().parent().prev().find(".dd_content"),i.html(t),!1)});jq191(".ulRegions li").bind("click",function(){var t=jq191(this).html(),n;return jq191(this).parent().parent().parent().parent().hide(),n=jq191(this).parent().parent().parent().parent().prev().find(".dd_content"),n.html(t),!1});jq191("#ppup_dd_ul li").bind("click",function(){var t=jq191(this).html(),n;jq191(this).parent().parent().hide();n=jq191(this).parent().parent().parent().parent().parent().prev().find(".dd_content");n.html(t);jq191(".slct_sub_box").is(":visible")&&jq191(".slct_sub_box").hide()});jq191(document.body).on("click",function(n){"track, thumb".indexOf(jq191(n.target).attr("class"))==-1&&jq191(".slct_sub_box").is(":visible")&&jq191(".slct_sub_box").hide();jq191("#desc_cntnt_main").is(":visible")&&jq191("#desc_cntnt_main").fadeOut(200)});jq191("#scrollbar1").tinyscrollbar();jq191("#list_tab").bind("click",function(){jq191(this).addClass("slctd");jq191(this).siblings().removeClass("slctd");jq191("#graph_tab_ar").hide();jq191("#list_tab_ar").show();jq191("#dr_tab_ar").hide();jq191("#scrollbar2").tinyscrollbar();isScrollbarList=!0;isScrollbarDr=!1});jq191("#dr_tab").bind("click",function(){jq191(this).addClass("slctd");jq191(this).siblings().removeClass("slctd");jq191("#graph_tab_ar").hide();jq191("#list_tab_ar").hide();jq191("#dr_tab_ar").show();jq191("#scrollbar3").tinyscrollbar();isScrollbarList=!1;isScrollbarDr=!0});jq191(".close_ppup_icn").bind("click",function(){RemoveMaskingDiv();jq191("#list_tab").click();jq191(".ppup_main").hide()});jq191("#desc_txt").click(function(n){n.stopPropagation();jq191("#desc_cntnt_main").slideToggle("slow")})}function RenderMap(n,t,i){mapObj.length||typeof mapObj.length!="undefined"?(t.tooltipData=i,mapObj.setThemes(n,t)):mapObj=jq191("#google2dmap").diDrawMap({aID:"12",language:"en",mapWidth:690,mapHeight:300,modepos:"right",zoomIn:!0,zoomOut:!0,pan:!0,zoomFrame:!0,nudge:!0,labels:!1,showTooltip:!0,showTimeLabel:!1,showLegend:!0,legendDivId:"legendDiv",showIndicator:!1,indBoxStyle:"background-color:#F2F2F2;",floatting:!1,themeType:"Color",showTimeSlider:!1,showTimeLabel:!1,showMRDText:!0,singleClick:{allow:!0,callback:ShowCountryProfileMapClick,selectedColor:""},doubleClick:{allow:!1,callback:mapDoubleClick,drillDown:!0},timePeriodCallback:changeTimePeriodText,mouseHoverCallback:highlightLegend,showLoader:!0,myData:n,baseLayerNames:["ohchr_afr","ohchr_asi","ohchr_eur","ohchr_lac","ohchr_nam","ohchr_ocn"],playButton:!1,modestyle:"#ffffff",mapSettings:{bgColor:"transparent",borderColor:"#B4B4B4",tooltipData:i,themes:t,zoomAreaId:""},text:{zoomIn:"Zoom In",zoomOut:"Zoom Out",fullExtent:"Full Extent",zoomFrame:"Zoom in frame",pan:"Pan",nudge:"Nudge",label:"Show label",defaultTxt:"Default",playText:"Time Series",tooltip:"Tooltip"},tooltipSettings:{Notch:!1,ClickSticky:!1,OffsetX:-14,OffsetY:8,BorderRadius:"5px",Shadow:!1,ShadowWidth:2,ShadowColor:"#000000",Opacity:90,CenterMouse:!1,Above:!0,BgColor:"#000000",BorderColor:"#000000",Padding:6,FontColor:"#FFFFFF",FontFace:"Verdana,Geneva,sans-serif",FontSize:"8pt",FontWeight:""},mapHighlightSetting:{cursorStyle:"default",borderStroke:!1,strokeWidth:.2,strokeColor:"",fillColor:"808080",fillOpacity:.5,fillShadow:!0}},function(){})}function DisplayRegion(n){var t={ohchr_afr:!1,ohchr_asi:!1,ohchr_eur:!1,ohchr_lac:!1,ohchr_nam:!1,ohchr_ocn:!1};if(isEmpty(n))t={ohchr_afr:!0,ohchr_asi:!0,ohchr_eur:!0,ohchr_lac:!0,ohchr_nam:!0,ohchr_ocn:!0};else switch(n){case"ASI":t.ohchr_asi=!0;break;case"EUR":t.ohchr_eur=!0;break;case"AFR":t.ohchr_afr=!0;break;case"LAC":t.ohchr_lac=!0;break;case"OCN":t.ohchr_ocn=!0;break;case"NAM":t.ohchr_nam=!0}mapObj.setLayersVisibility(t)}function ShowCountryProfileMapClick(n){var t=GetCountryIdByAreaId(n,0,Countries.length);jq191(".{0} li#{1}".format(ClassUlCountries,t)).click()}function mapSingleClick(n){alert("Single click called."+n)}function mapDoubleClick(){}function hot_selection_func(n){alert("Hot selection function is working fine. The Area id is "+n)}function indcallback(){}function zoomToArea(n){mapObj.zoomToArea(n)}function RefreshMapImage(){mapObj.refreshMapImage()}function setAreas(n){mapObj.setAreas(n,function(){})}function setDotSize(n){var t={dotSize:n};mapObj.editTheme(0,t)}function setDotDensity(n){var t={value:n};mapObj.editTheme(0,t)}function changeTimePeriodText(n){jq191("#timeperiodText").html(n);RatId==0||(mapObj.length||typeof mapObj.length!="undefined")&&n<(new Date).getFullYear()&&(RemoveClass(ClassUlCountries,!0,"li"),ApplyLegendClassesCountryStatus(CRsByRatId,n),GetMapRatification(RatId,null,n))}function highlightLegend(n){n!=""&&(n.action=="hover"?jq191("#lText_"+n.index).attr("class","legendTextHover"):jq191("#lText_"+n.index).attr("class","legendText"))}function PopulateCountries(){Cache.countries!=undefined?PopulateCountriesSuccess(Cache.countries):GetDashboardData(null,null,ServiceUrl,CountriesMethod,"GET",PopulateCountriesSuccess)}function PopulateCountriesSuccess(n){if(Countries=n,!isEmpty(Countries)){Cache.countries==undefined&&(Cache.countries=Countries);var t=Countries,i=ge(CtlListCountries);i.appendChild(GetCountriesUL(t));PopulatePpupCountryList();jq191(".{0} li".format(ClassUlCountries)).bind("click",function(){ApplyMaskingDiv(102,!1);jq191("."+ClassCountryProfilePopup).show();GetWindowCentered(jq191("."+ClassCountryProfilePopup),700,600);jq191(".{0} li#cp_{1}".format(ClassCountryProfilePopup,this.id)).click();jq191("#ppup_dd span.dd_content").text(jq191(this).text());jq191("#list_tab").click()});PopulateRegions();ShowHideCtl(CtlListRegions,!0);GetMapAggregation();SortCountriesBy("AreaId");MarkupStabilizer()}}function GetCountriesUL(n){var r=document.createElement("ul"),u,t,i;for(r.setAttribute("class",ClassUlCountries),u=n.length,t=0;t<u;t++)"ERU_GRL".match(n[t].AreaId)||(i=document.createElement("li"),i.setAttribute("id",n[t].Id),i.textContent=n[t].CountryName,r.appendChild(i));return r}function PopulatePpupCountryList(){var e=ge(CtlPpupCtryList),r=document.createElement("ul"),f,t,i,u,n;for(r.setAttribute("class",ClassUlPpupCountries),r.setAttribute("id","ppup_dd_ul"),f=Countries.length,t=0;t<f;t++)i=document.createElement("li"),u=document.createElement("span"),i.setAttribute("class",""),i.setAttribute("id","cp_"+Countries[t].Id),u.textContent=Countries[t].CountryName,i.appendChild(u),r.appendChild(i);e.appendChild(r);n=jq191("#"+CtlPpupCtryList+" li");n[0].className=n[0].className+" "+ClassRatListTopLi;n[n.length-1].className=n[n.length-1].className+" "+ClassRatListBottomLi;jq191(".{0} li".format(ClassUlPpupCountries)).bind("click",function(){ApplyMaskingSec(102,!0,"MaskCountryProfile","busyImg1");ApplyMaskingSec(102,!0,"MaskCountryProfileDr","busyImg2");var n=this.id.split("_")[1];ShowCountryProfilePopUpGrids(n)})}function UpdateSocialSharing(n){for(var i,t=0;t<Countries.length;t++)if(Countries[t].Id==n){i=Countries[t].CountryName;break}var r=CallbackUrl+"Index/"+n,u="View country profile for {0} on OHCHR Dashboard".format(i),f={url:CallbackUrl,title:u,description:"OHCHR website hosts an interactive dashboard to view countries around the globe according to the respective treaties and ratifications. To know more, simply navigate to the current country profile information viewed below!"};addthis.update("share","url",r)}function PopulateRatifications(){Cache.ratifications!=undefined?PopulateRatificationsSuccess(Cache.ratifications):GetDashboardData(null,null,ServiceUrl,RatificationsMethod,"GET",PopulateRatificationsSuccess)}function PopulateRatificationsSuccess(n){var s,t,u,h,i,r,f,e,o;if(!isEmpty(n)){for(Ratifications=n,Ratifications.sort(function(n,t){return n.DisplayOrder<t.DisplayOrder?-1:n.DisplayOrder>t.DisplayOrder?1:0}),Cache.ratifications==undefined&&(Cache.ratifications=Ratifications),s=ge(CtlDdlRatifications),t=document.createElement("ul"),t.setAttribute("id",CtlUlRatifications),u=document.createElement("li"),u.setAttribute("value",0),u.textContent=DefaultRatificationTitle,t.appendChild(u),h=Ratifications.length,i=0;i<h;i++)r=document.createElement("li"),r.setAttribute("value",Ratifications[i].Id),f=Ratifications[i].RatificationName,f.match(/Optional/)||f.match(/optional/)||r.setAttribute("class",ClassBold),r.textContent=f,t.appendChild(r);s.appendChild(t);jq191("#ulRatifications li").bind("click",function(){var t=jq191(this).html(),n;jq191(this).parent().parent().hide();n=jq191(this).parent().parent().parent().parent().parent().prev().find(".dd_content");n.html(t);n.attr("title",t);jq191(".slct_sub_box").is(":visible")&&jq191(".slct_sub_box").hide();ChangeRatification(this)});e=jq191("#"+CtlUlRatifications+" li");e[0].setAttribute("class",ClassBold+" "+ClassRatListTopLi);e[e.length-1].setAttribute("class",ClassRatListBottomLi);o=jq191("#isSharedUrl");o.length>0&&setTimeout(function(){jq191(".{0} li#{1}".format(ClassUlCountries,o.val())).click()},1e3)}}function PopulateRegions(){var t=[],o=ge(CtlOpRegion),s,i,u,e,r,f,n;if(Cache.countries!=undefined)for(s=Countries.length,i=0;i<s;i++)jq191.inArray(Countries[i].RegionId,t)==-1&&t.push(Countries[i].RegionId);for(u=document.createElement("ul"),e=document.createElement("span"),u.setAttribute("class",ClassUlRegions),e.textContent="Regions",o.appendChild(e),r=0;r<t.length;r++){f=document.createElement("li");n=document.createElement("span");f.setAttribute("id",t[r]);switch(t[r]){case"ASI":n.textContent="Asia";break;case"EUR":n.textContent="Europe";break;case"AFR":n.textContent="Africa";break;case"LAC":n.textContent="Latin America and the Caribbean";break;case"OCN":n.textContent="Oceania";break;case"NAM":n.textContent="North America"}f.appendChild(n);u.appendChild(f)}o.appendChild(u);jq191("."+ClassUlRegions+" li").bind("click",function(){RegionClicked(this)})}function ShowCountryProfilePopUpGrids(n){GetDashboardData(n,"countryId",ServiceUrl,RatificationsByCountryMethod,"GET",ShowCountryProfilePopUpGridsSuccess)}function ShowCountryProfilePopUpGridsSuccess(n){function a(n){r.className+=" "+n;f.className+=" "+n}var r,e,f,o,it=ge(CtlTableCountryStat),p=ge(CtlTableRatDeclarations),w,d,g,s,ut,h,t,nt,tt,c,i,u,l,v,y;it.innerHTML="";p.innerHTML="";var w,b=" ppup_row_even",k=!1,rt=!1,ft;for(RemoveClass(ClassCountryProfileListContainer,!0,"td",null,LegendNoAction),RemoveClass(ClassCountryProfileListContainer,!0,"td",null,LegendSignatory),RemoveClass(ClassCountryProfileListContainer,!0,"td",null,LegendStateParty),h=0;h<Ratifications.length;h++){for(ft=!1,w=CountryStatus.NoAction,d="NA",g="NA",s="",ut="",t=0;t<n.length;t++)n[t].RatificationId==Ratifications[h].Id&&(w=n[t].CountryStatus,nt=new Date(setToDDMM(n[t].SignatoryDate)).getFullYear(),tt=new Date(setToDDMM(n[t].StatePartyDate)).getFullYear(),d=nt<=SqlDefaultDate?"NA":nt,g=tt<=SqlDefaultDate?"NA":tt,s=n[t].Declaration,ut=n[t].AnnotationUrl);c=document.createElement("tr");i=document.createElement("tr");r=document.createElement("td");e=document.createElement("td");e.setAttribute("class","ppup_tbl_wdth");u=document.createElement("td");r.setAttribute("class","ppup_tbl_td_l style4");u.setAttribute("class","ppup_tbl_td_r");f=document.createElement("td");o=document.createElement("td");f.setAttribute("class","ppup_tbl_td_l three_clmn_frst style5 bg_tdw_lft");o.setAttribute("class","style3 bg_tdw_rgt");k&&(e.className+=b,u.className+=b,o.className+=b);k=!k;switch(w){case CountryStatus.NoAction:a(LegendNoAction);break;case CountryStatus.Signatory:a(LegendSignatory);break;case CountryStatus.StateParty:a(LegendStateParty);break;case CountryStatus.Denunciation:a(LegendNoAction)}l=Ratifications[h];v=l.RatificationName;v.match(/Optional/)||v.match(/optional/)||(r.className+=" fnt_bld",f.className+=" fnt_bld");r.textContent="{0} :{1}".format(v,new Date(setToDDMM(l.StartDate)).getFullYear());e.textContent="Signature: {0}, Ratification/Accession: {1}".format(d,g);isEmpty(s)||(rt=!0,u.textContent="✓",o.innerHTML=s);c.appendChild(r);c.appendChild(e);c.appendChild(u);it.appendChild(c);f.textContent="{0} ({1})".format(l.RatificationName,l.Acronym);i.appendChild(f);i.appendChild(o);isEmpty(s)||p.appendChild(i)}rt||(y=document.createElement("td"),y.textContent="This State has made no declarations.",i.appendChild(y),p.appendChild(y));isScrollbarList&&jq191("#scrollbar2").tinyscrollbar_update();isScrollbarDr&&jq191("#scrollbar3").tinyscrollbar_update();RemoveMaskingDiv(null,"MaskCountryProfile");RemoveMaskingDiv(null,"MaskCountryProfileDr")}function GetRatificationById(n){for(var t=0;t<Ratifications.length;t++)if(Ratifications[t].Id==n)return Ratifications[t]}function SortCountriesBy(n){switch(n){case"Id":Countries.sort(function(n,t){return n.Id<t.Id?-1:n.Id>t.Id?1:0});break;case"AreaId":Countries.sort(function(n,t){return n.AreaId.charAt(0)<t.AreaId.charAt(0)?-1:n.AreaId.charAt(0)>t.AreaId.charAt(0)?1:n.AreaId.charAt(1)<t.AreaId.charAt(1)?-1:n.AreaId.charAt(1)>t.AreaId.charAt(1)?1:n.AreaId.charAt(2)<t.AreaId.charAt(2)?-1:n.AreaId.charAt(2)>t.AreaId.charAt(2)?1:0});break;default:Countries.sort(function(n,t){return n.Id<t.Id?-1:n.Id>t.Id?1:0})}}function GetCountryIdByAreaId(n,t,i){var u,r;if(t==i)u=Countries[t-1].AreaId==n?Countries[t-1].Id:!1;else{if(r=Math.floor((t+i)/2),Countries[r].AreaId==n)return Countries[r].Id;Countries[r].AreaId.charAt(0)>n.charAt(0)?u=GetCountryIdByAreaId(n,t,r):Countries[r].AreaId.charAt(0)<n.charAt(0)?u=GetCountryIdByAreaId(n,r+1,i):Countries[r].AreaId.charAt(0)==n.charAt(0)&&(Countries[r].AreaId.charAt(1)>n.charAt(1)?u=GetCountryIdByAreaId(n,t,r):Countries[r].AreaId.charAt(1)<n.charAt(1)?u=GetCountryIdByAreaId(n,r+1,i):Countries[r].AreaId.charAt(1)==n.charAt(1)&&(Countries[r].AreaId.charAt(2)>n.charAt(2)?u=GetCountryIdByAreaId(n,t,r):Countries[r].AreaId.charAt(2)<n.charAt(2)&&(u=GetCountryIdByAreaId(n,r+1,i))))}return u}function ChangeRatification(n){if(ApplyMaskingSec(102,!0,"MaskMap","busyImgMap"),ApplyMaskingSec(102,!0,"MaskCountryList","busyImgCountryList"),UnpressCountryFilters(),ClearHatchSelection(),n.value==0){GetMapAggregation();return}RatId=n.value;GetDashboardData(RatId,"ratificationId",ServiceUrl,CountriesForRatificationMethod,"GET",GetCountriesForRatificationSuccess)}function GetCountriesForRatificationSuccess(n){isEmpty(n)||(CRsByRatId=n,ApplyLegendClassesCountryStatus(CRsByRatId),UpdateLegendFilterIds(EnumUpdateFilterFor.Ratification),GetMapRatification(RatId))}function ApplyLegendClassesCountryStatus(n,t){var e,i,r,u,f;for(RemoveClass(ClassUlCountries,!0,"li"),i=0;i<Countries.length;i++){for(r=0;r<n.length;r++)if(n[r].CountryId==Countries[i].Id){isEmpty(t)?e=n[r].CountryStatus:(u=new Date(setToDDMM(n[r].StatePartyDate)).getFullYear(),u=u==SqlDefaultDate?"NA":u,f=new Date(setToDDMM(n[r].SignatoryDate)).getFullYear(),f=f==SqlDefaultDate?"NA":f,e=u!="NA"&&u<=t?CountryStatus.StateParty:f!="NA"&&f<=t?CountryStatus.Signatory:CountryStatus.NoAction);break}else e=CountryStatus.NoAction;switch(e){case CountryStatus.NoAction:ApplyClass(ClassUlCountries,null,Countries[i].Id,LegendNoAction);break;case CountryStatus.Signatory:ApplyClass(ClassUlCountries,null,Countries[i].Id,LegendSignatory);break;case CountryStatus.StateParty:ApplyClass(ClassUlCountries,null,Countries[i].Id,LegendStateParty);break;case CountryStatus.Denunciation:ApplyClass(ClassUlCountries,null,Countries[i].Id,LegendNoAction)}}}function ApplyLegendClassesCountryRatCount(){var n,t;for(RemoveClass(ClassUlCountries,!0,"li"),t=0;t<Countries.length;t++)n=CRdictionary.getVal(Countries[t].Id),n||(n=0),n<5?ApplyClass(ClassUlCountries,null,Countries[t].Id,Legend04):n>=5&&n<10?ApplyClass(ClassUlCountries,null,Countries[t].Id,Lengend59):n>=10&&n<15?ApplyClass(ClassUlCountries,null,Countries[t].Id,Legend1014):n>=15&&n<=18&&ApplyClass(ClassUlCountries,null,Countries[t].Id,Legend1518)}function MapObj(n,t){this.h=n;this.r=t}function GetMapAggregation(n){Cache.crForAggregateMap!=undefined?GetMapAggregationInvoke(Cache.crForAggregateMap,n):(isEmpty(n)||alert("Mapload error!"),GetDashboardData(null,null,ServiceUrl,CrForMapAggregationMethod,"GET",GetMapAggregationSuccess))}function GetMapAggregationSuccess(n){GetMapAggregationInvoke(n)}function GetMapAggregationInvoke(n,t){var c,s,i,r,u,f,a;Cache.crForAggregateMap==undefined&&(Cache.crForAggregateMap=n);RatId=0;ge(CtlRatificationHeading).innerHTML=DefaultRatificationTitle;ge(CtlLastSyncedDate).innerHTML="";UpdateLegendFilterIds(EnumUpdateFilterFor.Countries);SetPdfLinks(null,!0);ShowHideCtl(ClassContainerHatchButtons,!0,!0);ShowHideCtl(CtlLgdAggregation,!1);ShowHideCtl(CtlLgdCountryStat,!0);ge(CtlRatificationDesc).innerHTML=DefaultRatificationDesc;var v=[],e=[],h=!1;CRdictionary=new JSdict;var o="{",l=(new Date).getFullYear();if(Cache.countries!=undefined){for(s=0,CountryRatifications=n,Countries=Cache.countries,i=0;i<Countries.length;i++)for(r=0;r<CountryRatifications.length;r++)CountryRatifications[r].CountryId==Countries[i].Id&&(u=new Date(setToDDMM(CountryRatifications[r].StatePartyDate)).getFullYear(),f=new Date(setToDDMM(CountryRatifications[r].SignatoryDate)).getFullYear(),u!=SqlDefaultDate&&u<l&&(l=u),f!=SqlDefaultDate&&f<l&&(l=f));for(i=0;i<Countries.length;i++){for(r=0;r<CountryRatifications.length;r++)CountryRatifications[r].CountryId==Countries[i].Id&&(c=Countries[i].Id,u=new Date(setToDDMM(CountryRatifications[r].StatePartyDate)).getFullYear(),f=new Date(setToDDMM(CountryRatifications[r].SignatoryDate)).getFullYear(),isEmpty(t)?(f!=SqlDefaultDate||u!=SqlDefaultDate)&&(e.push([f,u]),h=!0):u!=SqlDefaultDate&&u<=t?(e.push([f,u]),h=!0):f!=SqlDefaultDate&&f<=t&&(e.push([f,u]),h=!0));if(h){for(e.sort(function(n,t){return n[0]<=SqlDefaultDate&&t[0]<=SqlDefaultDate?n[1]<t[1]?-1:n[1]>t[1]?1:0:n[0]<t[0]?n[0]<=SqlDefaultDate?n[1]<t[0]?-1:n[1]>t[0]?1:0:-1:n[0]>t[0]?t[0]<=SqlDefaultDate?n[0]<t[1]?-1:n[0]>t[1]?1:0:1:0}),a=0;a<e.length;a++)e[a][1]!=SqlDefaultDate&&s++;e=[];h=!1}c==0||CRdictionary.contains(c)||CRdictionary.add(c,s);v.push([Countries[i].AreaId,Countries[i].CountryName,"",s]);o+='"{0}":"<div><div class=\'fnt_bld\'>{1}<\/div>{2} treaties<\/div>",'.format(Countries[i].AreaId,Countries[i].CountryName.replace("Greenland","Greenland (Denmark)"),s);s=0;c=0}}v.sort(function(n,t){return n[2]<t[2]?-1:n[2]>t[2]?1:n[3]<t[3]?-1:n[3]>t[3]?1:0});o.lastIndexOf(",")!=-1&&(o=o.substring(o.lastIndexOf(","),0));o+="}";ApplyLegendClassesCountryRatCount(CountryRatifications);RemoveMaskingDiv(null,"MaskMap");RemoveMaskingDiv(null,"MaskCountryList");RenderMap(new MapObj(["Area_ID","Area_Name","TimePeriod","RatificationCount"],v),aggThemeJSON,JSON.parse(o),null);RemoveMaskingDiv();isEmpty(Cache.currentRegionId)||ShowCountriesByRegion(Cache.currentRegionId)}function GetMapRatification(n,t,i){var r,nt,k,l,tt,vt,p,s;SetPdfLinks(n);ShowHideCtl(CtlLgdAggregation,!0);ShowHideCtl(CtlLgdCountryStat,!1);dispHatchLgd1=!1;dispHatchLgd2=!1;isEmpty(Cache.currentRegionId)||ShowCountriesByRegion(Cache.currentRegionId);r=[];k=["Area_ID","Area_Name","TimePeriod","CountryStatus"];switch(t){case EnumHatchOps.AllowIndividualCom:k.push("IndividualComAllowed");nt=hatchThemeJSON;nt[1].breaks[0].FillStyle="LightUpwardDiagonal";break;case EnumHatchOps.AllowInquiryProc:k.push("InquiryProcAllowed");nt=hatchThemeJSON;nt[1].breaks[0].FillStyle="LightDownwardDiagonal";break;case EnumHatchOps.AllowBoth:k.push("IndividualComAllowed");k.push("InquiryProcAllowed");nt=hatchThemeJSON2}var b=0,it=0,d=0,st,ut,ft,c="{";for(l=0;l<Ratifications.length;l++)if(isEmpty(Date.parse(Ratifications[l].LastSynced))&&(Ratifications[l].LastSynced=Ratifications[l].LastSynced.split("T")[0],Ratifications[l].StartDate=Ratifications[l].StartDate.split("T")[0],Ratifications[l].ProposalDate=Ratifications[l].ProposalDate.split("T")[0]),Ratifications[l].Id==n){ft=Ratifications[l].RatificationName;ge(CtlLastSyncedDate).innerHTML="[Last Updated: {0}]".format(new Date(Ratifications[l].LastSynced).getFullYear()<=SqlDefaultDate?"NA":new Date(Ratifications[l].LastSynced).ddMMMyyyy());st=new Date(Ratifications[l].StartDate).getFullYear();ut=new Date(Ratifications[l].ProposalDate).getFullYear();ge(CtlRatificationHeading).innerHTML="{0}".format(ft);break}for(ft==FooterCondRat?ShowHideCtl(CtlFooterCondText,!1):ShowHideCtl(CtlFooterCondText,!0),p=0;p<Countries.length;p++){var f,u,ht,yt,a,w,rt,et="NA",ot="NA",o="NA",e="NA",g="NA",v,y,h="";for(f=Countries[p].CountryName,u=Countries[p].AreaId,yt=new Date(Countries[p].CreationDate),ht=CountryStatus.NoAction,s=0;s<CRsByRatId.length;s++)if(CRsByRatId[s].RatificationId==n&&CRsByRatId[s].CountryId==Countries[p].Id){ht=CRsByRatId[s].CountryStatus;a=CRsByRatId[s].IsIndividualComAllowed;w=CRsByRatId[s].IsInquiryProcAllowed;v=new Date(setToDDMM(CRsByRatId[s].IndividualComDate));y=new Date(setToDDMM(CRsByRatId[s].InquiryProcDate));var ct=new Date(setToDDMM(CRsByRatId[s].SignatoryDate)),lt=new Date(setToDDMM(CRsByRatId[s].StatePartyDate)),at=new Date(setToDDMM(CRsByRatId[s].DenunciationDate));et=v.getFullYear()<=SqlDefaultDate?"NA":v.ddMMMyyyy();ot=y.getFullYear()<=SqlDefaultDate?"NA":y.ddMMMyyyy();o=ct.getFullYear()<=SqlDefaultDate?"NA":ct;e=lt.getFullYear()<=SqlDefaultDate?"NA":lt;g=at.getFullYear()<=SqlDefaultDate?"NA":at;break}if(!dispHatchLgd1&&a&&(dispHatchLgd1=!0),!dispHatchLgd2&&w&&(dispHatchLgd2=!0),c+='"{0}":"<div class=\'fnt_bld\'>{1}<\/div>'.format(u,f.replace("Greenland","Greenland (Denmark)")),o=="NA"&&e=="NA"){c+="<div>No Action<\/div>";n!=17?u!="ERU"&&b++:b++;switch(t){case EnumHatchOps.AllowIndividualCom:a?(r.push([u,f,h,CountryStatus.NoAction,""]),r.push([u,f,v.getFullYear(),CountryStatus.NoAction,1])):r.push([u,f,h,CountryStatus.NoAction,""]);break;case EnumHatchOps.AllowInquiryProc:w?(r.push([u,f,h,CountryStatus.NoAction,""]),r.push([u,f,y.getFullYear(),CountryStatus.NoAction,1])):r.push([u,f,h,CountryStatus.NoAction,""]);break;case EnumHatchOps.AllowBoth:a||w?(a&&(r.push([u,f,h,CountryStatus.NoAction,"",""]),r.push([u,f,v.getFullYear(),CountryStatus.NoAction,1,""])),w&&(r.push([u,f,h,CountryStatus.NoAction,"",""]),r.push([u,f,y.getFullYear(),CountryStatus.NoAction,"",1]))):r.push([u,f,h,CountryStatus.NoAction,"",""]);break;default:r.push([u,f,h,CountryStatus.NoAction])}}else{if(tt=o!="NA",tt)if(c+="<div>{0}: {1}<\/div>".format(TooltipSigTxt,o.ddMMMyyyy()),vt=e=="NA"?SqlDefaultDate:e.getFullYear(),o.getFullYear()!=vt)switch(t){case EnumHatchOps.AllowIndividualCom:r.push([u,f,h,CountryStatus.NoAction,""]);a?o.getFullYear()==v.getFullYear()?r.push([u,f,o.getFullYear(),CountryStatus.Signatory,1]):(r.push([u,f,o.getFullYear(),CountryStatus.Signatory,""]),r.push([u,f,v.getFullYear(),CountryStatus.Signatory,1])):r.push([u,f,o.getFullYear(),CountryStatus.Signatory,""]);break;case EnumHatchOps.AllowInquiryProc:r.push([u,f,h,CountryStatus.NoAction,""]);w?o.getFullYear()==y.getFullYear()?r.push([u,f,o.getFullYear(),CountryStatus.Signatory,1]):(r.push([u,f,o.getFullYear(),CountryStatus.Signatory,""]),r.push([u,f,y.getFullYear(),CountryStatus.Signatory,1])):r.push([u,f,o.getFullYear(),CountryStatus.Signatory,""]);break;case EnumHatchOps.AllowBoth:r.push([u,f,h,CountryStatus.NoAction,"",""]);a||w?(a&&(o.getFullYear()==v.getFullYear()?r.push([u,f,o.getFullYear(),CountryStatus.Signatory,1,""]):(r.push([u,f,o.getFullYear(),CountryStatus.Signatory,"",""]),r.push([u,f,v.getFullYear(),CountryStatus.Signatory,1,""]))),w&&(o.getFullYear()==y.getFullYear()?r.push([u,f,o.getFullYear(),CountryStatus.Signatory,"",1]):(a||r.push([u,f,o.getFullYear(),CountryStatus.Signatory,"",""]),r.push([u,f,y.getFullYear(),CountryStatus.Signatory,"",1])))):r.push([u,f,o.getFullYear(),CountryStatus.Signatory,"",""]);break;default:r.push([u,f,h,CountryStatus.NoAction]);r.push([u,f,o.getFullYear(),CountryStatus.Signatory])}else r.push([u,f,h,CountryStatus.NoAction]);if(e!="NA"){c+="<div>{0}: {1}<\/div>".format(TooltipStPartyTxt,e.ddMMMyyyy());switch(t){case EnumHatchOps.AllowIndividualCom:tt||r.push([u,f,h,CountryStatus.NoAction,""]);a?e.getFullYear()==v.getFullYear()?r.push([u,f,e.getFullYear(),CountryStatus.StateParty,1]):(r.push([u,f,e.getFullYear(),CountryStatus.StateParty,""]),r.push([u,f,v.getFullYear(),CountryStatus.StateParty,1])):r.push([u,f,e.getFullYear(),CountryStatus.StateParty,""]);break;case EnumHatchOps.AllowInquiryProc:tt||r.push([u,f,h,CountryStatus.NoAction,""]);w?e.getFullYear()==y.getFullYear()?r.push([u,f,e.getFullYear(),CountryStatus.StateParty,1]):(a||r.push([u,f,e.getFullYear(),CountryStatus.StateParty,""]),r.push([u,f,y.getFullYear(),CountryStatus.StateParty,1])):r.push([u,f,e.getFullYear(),CountryStatus.StateParty,""]);break;case EnumHatchOps.AllowBoth:tt||r.push([u,f,h,CountryStatus.NoAction,"",""]);a||w?(a&&(e.getFullYear()==v.getFullYear()?r.push([u,f,e.getFullYear(),CountryStatus.StateParty,1,""]):(r.push([u,f,e.getFullYear(),CountryStatus.StateParty,"",""]),r.push([u,f,v.getFullYear(),CountryStatus.StateParty,1,""]))),w&&(e.getFullYear()==y.getFullYear()?r.push([u,f,e.getFullYear(),CountryStatus.StateParty,"",1]):(a||r.push([u,f,e.getFullYear(),CountryStatus.StateParty,"",""]),r.push([u,f,y.getFullYear(),CountryStatus.StateParty,"",1])))):r.push([u,f,e.getFullYear(),CountryStatus.StateParty,"",""]);break;default:tt||r.push([u,f,h,CountryStatus.NoAction]);r.push([u,f,e.getFullYear(),CountryStatus.StateParty])}}u!="GRL"&&(o!="NA"&&e!="NA"?isEmpty(i)?d++:e.getFullYear()<=i?d++:o.getFullYear()<=i?it++:n!=17?u!="ERU"&&b++:b++:o=="NA"&&e!="NA"?isEmpty(i)?d++:e.getFullYear()<=i?d++:n!=17?u!="ERU"&&b++:b++:o!="NA"&&e=="NA"&&(isEmpty(i)?it++:o.getFullYear()<=i?it++:n!=17?u!="ERU"&&b++:b++))}if(g!="NA"){c+="<div>Denunciation Date: {0}<\/div>".format(g.ddMMMyyyy());switch(t){case EnumHatchOps.AllowIndividualCom:r.push([u,f,g.getFullYear(),CountryStatus.NoAction,""]);break;case EnumHatchOps.AllowInquiryProc:r.push([u,f,g.getFullYear(),CountryStatus.NoAction,""]);break;case EnumHatchOps.AllowBoth:r.push([u,f,g.getFullYear(),CountryStatus.NoAction,"",""]);break;default:r.push([u,f,g.getFullYear(),CountryStatus.NoAction])}}et!="NA"&&(c+="<div>{0}: {1}<\/div>".format(TooltipIndComTxt,et));ot!="NA"&&(c+="<div>{0}: {1}<\/div>".format(TooltipInqProcTxt,ot));a=w=!1;c+='",'}if(c.lastIndexOf(",")!=-1&&(c=c.substring(c.lastIndexOf(","),0)),c+="}",r.sort(function(n,t){return n[2]<t[2]?-1:n[2]>t[2]?1:n[3]<t[3]?-1:n[3]>t[3]?1:0}),ut<=SqlDefaultDate)for(p=0;isEmpty(rt);){if(rt=r[p][2],p==r.length)break;p++}else rt=ut;for(s=0;s<r.length;s++)r[s][3]==CountryStatus.NoAction&&isEmpty(r[s][2])&&(r[s][2]=rt);r[r.length-1][2]<(new Date).getFullYear()&&r.push([r[r.length-1][0],r[r.length-1][1],(new Date).getFullYear(),r[r.length-1][3]]);isEmpty(i)?((dispHatchLgd1||dispHatchLgd2)&&ShowHideCtl(ClassContainerHatchButtons,!1,!0),dispHatchLgd1?ShowHideCtl(ClassHatch1,!1,!1):ShowHideCtl(ClassHatch1,!0,!1),dispHatchLgd2?ShowHideCtl(ClassHatch2,!1,!1):ShowHideCtl(ClassHatch2,!0,!1),RemoveMaskingDiv(null,"MaskMap"),RemoveMaskingDiv(null,"MaskCountryList"),isEmpty(t)?RenderMap(new MapObj(k,r),ratificationThemeJSON,JSON.parse(c)):(RenderMap(new MapObj(k,r),nt,JSON.parse(c)),t=null)):mapObj.setTooltipData(JSON.parse(c));jq191("#svgCountryStat .lgdNoAction").next().text("{0} ({1})".format("No Action",b));jq191("#svgCountryStat .lgdSignatory").next().text("{0} ({1})".format("Signatory",it));isEmpty(i)?jq191("#svgCountryStat .lgdStateParty").next().text("{0} ({1})".format("State Party",d)):i<st?jq191("#svgCountryStat .lgdStateParty").next().text("{0} ({1})".format("Ratn/Accn",d)):jq191("#svgCountryStat .lgdStateParty").next().text("{0} ({1})".format("State Party",d))}function handleAksaiChin(n){for(var r=[],i,t=0;t<n.length;t++)n[t][0]=="CHN"&&r.push(["AKC","Aksai Chin",n[t][2],n[t][3]]);for(i=0;i<r.length;i++)n.push(r[i])}function SetPdfLinks(n,t){var i;if(ShowHideCtl(ClassContainerPdfLinks,!1,!0),t)return jq191("#"+CtlLinkPdf3+",#"+CtlLinkPdf2).hide(),ge(CtlLinkPdf1).href=MvcUrl+TotalRatificationMetadataPath,!0;jq191("#"+CtlLinkUnderlyingExcl+",#"+CtlLinkPdf2).show();var r="#",u="#",f="#",e="";for(i=0;i<Ratifications.length;i++)if(Ratifications[i].Id==n){r=Ratifications[i].PdfUrl1;u=Ratifications[i].PdfUrl2;f=Ratifications[i].PdfUrl3;e=Ratifications[i].Description;break}ge(CtlLinkPdf1).href=r;ge(CtlLinkPdf2).href=u;ge(CtlLinkPdf3).href=f;ge(CtlRatificationDesc).innerHTML=e}function BarObject(n,t,i,r){this.barName=n;this.period1=t;this.period2=i;this.period3=r}function ShowCountryProfile(n){for(var u,f,e,c=(new Date).getFullYear(),s=[],r=Cache.ratifications,o,i,h,t=0;t<n.length;t++){for(i=0;i<r.length;i++)r[i].Id==n[t].RatificationId&&(o=r[i].RatificationName,o+="_"+r[i].Acronym,h=new Date(r[i].StartDate).getFullYear());u=new Date(setToDDMM(n[t].SignatoryDate)).getFullYear();f=new Date(setToDDMM(n[t].StatePartyDate)).getFullYear();e=new Date(setToDDMM(n[t].DenunciationDate)).getFullYear();u<=SqlDefaultDate&&(u=0);f<=SqlDefaultDate&&(f=0);e<=SqlDefaultDate&&(e=0);s.push(new BarObject(o,u,f,e))}}function GetMinDateForCountryProfile(n){var t=0,i,r;if(n.sort(function(n,t){return n.period2<t.period2?-1:n.period2>t.period2?1:0}),n[t].period2==0){while(n[t].period2==0)t++;r=n[t].period2}else r=n[0].period2;if(t=0,n.sort(function(n,t){return n.period1<t.period1?-1:n.period1>t.period1?1:0}),n[t].period1==0){while(n[t].period1==0)t++;i=n[t].period1}else i=n[0].period1;return i<r?i:r}function HatchButtonClicked(n){UnpressCountryFilters();ApplyLegendClassesCountryStatus(CRsByRatId);switch(n.id){case CtlBtnIndividualCom:n.className.match(ClassBtnPressed)?(RemoveClass(ClassContainerHatchButtons,!0,null,CtlBtnIndividualCom,ClassBtnPressed),n.setAttribute("title","Show States that have accepted the individual communications procedure"),ge(CtlBtnInquiryProc).className.match(ClassBtnPressed)?GetMapRatification(RatId,EnumHatchOps.AllowInquiryProc):GetMapRatification(RatId)):(ApplyClass(ClassContainerHatchButtons,null,CtlBtnIndividualCom,ClassBtnPressed),n.setAttribute("title","Hide overlay of States that have accepted individual communications procedure"),ge(CtlBtnInquiryProc).className.match(ClassBtnPressed)?GetMapRatification(RatId,EnumHatchOps.AllowBoth):GetMapRatification(RatId,EnumHatchOps.AllowIndividualCom));break;case CtlBtnInquiryProc:n.className.match(ClassBtnPressed)?(RemoveClass(ClassContainerHatchButtons,!0,null,CtlBtnInquiryProc,ClassBtnPressed),n.setAttribute("title","Show States that have accepted the inquiry procedure"),ge(CtlBtnIndividualCom).className.match(ClassBtnPressed)?GetMapRatification(RatId,EnumHatchOps.AllowIndividualCom):GetMapRatification(RatId)):(ApplyClass(ClassContainerHatchButtons,null,CtlBtnInquiryProc,ClassBtnPressed),n.setAttribute("title","Hide overlay of States that have accepted inquiry procedure"),ge(CtlBtnIndividualCom).className.match(ClassBtnPressed)?GetMapRatification(RatId,EnumHatchOps.AllowBoth):GetMapRatification(RatId,EnumHatchOps.AllowInquiryProc))}}function ClearHatchSelection(){RemoveClass(ClassContainerHatchButtons,!0,null,CtlBtnInquiryProc,ClassBtnPressed);RemoveClass(ClassContainerHatchButtons,!0,null,CtlBtnIndividualCom,ClassBtnPressed);ge(CtlBtnIndividualCom).setAttribute("title","Show States that have accepted the individual communications procedure");ge(CtlBtnInquiryProc).setAttribute("title","Show States that have accepted the inquiry procedure")}function UpdateLegendFilterIds(n){switch(n){case EnumUpdateFilterFor.Countries:jq191(".{0} li".format(ClassCntryFltrContainer)).each(function(){var n=jq191(this);isEmpty(this.className.match(LegendNoAction))?isEmpty(this.className.match(LegendSignatory))?isEmpty(this.className.match(LegendStateParty))||(n.removeClass(LegendStateParty),n.addClass(Legend1014),this.id=Legend1014):(n.removeClass(LegendSignatory),n.addClass(Lengend59),this.id=Lengend59):(n.removeClass(LegendNoAction),n.addClass(Legend04),this.id=Legend04);this.id==Legend1518&&n.show();n.removeAttr("title")});break;case EnumUpdateFilterFor.Ratification:jq191(".{0} li".format(ClassCntryFltrContainer)).each(function(){var n=jq191(this);isEmpty(this.className.match(Legend04))?isEmpty(this.className.match(Lengend59))?isEmpty(this.className.match(Legend1014))||(n.removeClass(Legend1014),n.addClass(LegendStateParty),n.attr("title",StatePartyTitle),this.id=LegendStateParty):(n.removeClass(Lengend59),n.addClass(LegendSignatory),n.attr("title",SignatoryTitle),this.id=LegendSignatory):(n.removeClass(Legend04),n.addClass(LegendNoAction),n.attr("title",NoActionTitle),this.id=LegendNoAction);this.id==Legend1518&&n.hide()})}}function CountryLegendFilterClicked(n){function r(){jq191(".{0} li".format(ClassUlCountries)).removeClass(ClassLegendFilterApplied)}var i=!0,t,u=jq191(".{0} #{1}".format(ClassCntryFltrContainer,n.id));isEmpty(n.className.match(ClassBtnPressed))?(i=!1,u.addClass(ClassBtnPressed),t=".{0} li:not(.{1},.".format(ClassUlCountries,n.id)):(u.removeClass(ClassBtnPressed),t=".{0} li:not(.".format(ClassUlCountries));jq191(".{0} li:not(#{1})".format(ClassCntryFltrContainer,n.id)).each(function(){isEmpty(this.className.match(ClassBtnPressed))||(t+=this.id+",.",i=!1)});i?r():(t.lastIndexOf(",.")!=-1&&(t=t.substring(t.lastIndexOf(",."),0)),t+=")",r(),jq191(t).addClass(ClassLegendFilterApplied));jq191("#scrollbar1").tinyscrollbar_update()}function UnpressCountryFilters(){jq191(".{0} li".format(ClassCntryFltrContainer)).removeClass(ClassBtnPressed)}function ShowCountriesByRegion(n){for(var t=".{0} li:not(#".format(ClassUlCountries),i=0;i<Countries.length;i++)Countries[i].RegionId==n&&(t+=Countries[i].Id+",#");t.lastIndexOf(",#")!=-1&&(t=t.substring(t.lastIndexOf(",#"),0));t+=")";RemoveRegionFilter(!1);jq191(t).addClass(ClassRegionFilterApplied)}function RemoveRegionFilter(n){jq191(".{0} li".format(ClassUlCountries)).removeClass(ClassRegionFilterApplied);n&&(Cache.currentRegionId="",DisplayRegion(),ShowHideCtl(ClassLgdTextGlobal,!0,!0));jq191("#scrollbar1").tinyscrollbar_update()}function RegionClicked(n){isEmpty(n)||(Cache.currentRegionId=n.id);ShowHideCtl(ClassLgdTextGlobal,!1,!0);DisplayRegion(Cache.currentRegionId);ShowCountriesByRegion(Cache.currentRegionId);jq191("#scrollbar1").tinyscrollbar_update()}function InvokePrintPdf(){var o,u,n,t,a,v,y,s,f,e;u=jq191("#ppup_dd span.dd_content").text();o="<h2 class='txt_cntr'>Country Profile for {0}<\/h2><p />".format(u);jq191("caption").each(function(){jq191(this).show()});var h=jq191("#grid1td1"),i=jq191("#grid1td2"),c=jq191("#grid2td1"),r=jq191("#grid2td2"),l=jq191("#grid2td0");h.addClass("bdr-rgt");i.removeClass("hdr_blnk");i.addClass("bdr-lft");c.attr("class","bdr-rgt");l.attr("style","width: 37.5%;");r.removeClass("hdr_blnk");r.addClass("bdr-lft");f=jq191("#ppup_grid1 td").filter(".ppup_row_even");f.each(function(){jq191(this).removeClass("ppup_row_even")});e=jq191("#ppup_grid2 td").filter(".ppup_row_even");e.each(function(){jq191(this).removeClass("ppup_row_even")});n=jq191("#ppup_grid1").html().toString();n=n.replace("scrollbar2","");n=n.replace("scrollbar","dsp_nne");t=jq191("#ppup_grid2").html().toString();t=t.replace("scrollbar3","");t=t.replace("scrollbar","dsp_nne");f.each(function(){jq191(this).addClass("ppup_row_even")});e.each(function(){jq191(this).addClass("ppup_row_even")});h.removeClass("bdr-rgt");i.removeClass("bdr-lft");i.addClass("hdr_blnk");c.removeAttr("class");l.attr("style","width: 36%;");r.removeClass("bdr-lft");r.addClass("hdr_blnk");jq191("caption").each(function(){jq191(this).hide()});s=MvcUrl+"Content/Dashboard.css";PostPdfHtml(o,u,n,t,a,v,y,MvcUrl,s,"GenerateCountryProfilePdf")}function InvokePrintMapPdf(){var i,r,f,e,o,n,s="",t,u,h=jq191(".lgnd_lst_main"),c=ge("btnIndividualCom"),l=ge("btnIncProc");if(f=h.html().toString(),dispHatchLgd1&&c.className.match(ClassBtnPressed)&&(u="1"),dispHatchLgd2&&l.className.match(ClassBtnPressed)&&(u+="_2"),e='<span>Definition and meta-data: <a href="https://www.ohchr.org/Documents/Issues/HRIndicators/MetadataRatificationStatus.pdf">https://www.ohchr.org/Documents/Issues/HRIndicators/MetadataRatificationStatus.pdf<\/a><\/span><br /><span>Source: Database of the United Nations Office of Legal Affairs (OLA) <a href="https://treaties.un.org">https://treaties.un.org<\/a><\/span><br><span>For application of treaties to overseas, non-self-governing and other territories, shown here in grey, see <a href="https://treaties.un.org">https://treaties.un.org<\/a><\/span><br><br><span>Note:  The boundaries and the names shown and the designations used on these maps do not imply official endorsement or acceptance by the United Nations. Final boundary between the Republic of Sudan and the Republic of South Sudan has not yet been determined Dotted line represents approximately the Line of Control in Jammu and Kashmir agreed upon by India and Pakistan. The final status of Jammu and Kashmir has not yet been agreed upon by the parties.<\/span>',!isEmpty(Cache.currentRegionId))switch(Cache.currentRegionId){case"ASI":n="Asia";break;case"EUR":n="Europe";break;case"AFR":n="Africa";break;case"LAC":n="Latin America and the Caribbean";break;case"OCN":n="Oceania";break;case"NAM":n="North America"}RatId==0?(r="AllTreaties",i=isEmpty(n)?DefaultRatificationTitle:DefaultRatificationTitle+": "+n):(t=GetRatificationById(RatId),r=t.Acronym,i=isEmpty(n)?t.RatificationName:t.RatificationName+": "+n,s="Last Updated: {0}".format(new Date(t.LastSynced).ddMMMyyyy()));o=mapObj.getSessionId();PostPdfHtml(i,r,f,e,o,"462","1183",s,u,"GenerateMapPdf")}function getUnderlyingExcel(){PostPdfHtml(RatId,null,null,null,null,null,null,null,null,UnderlyingExcelMethod)}function setToDDMM(n){return n.replace(/([0-9]+)\/([0-9]+)/,"$2/$1")}function PostPdfHtml(n,t,i,r,u,f,e,o,s,h){docTitle=n;countryName=t;grid1=i;grid2=r;svgHtml=u;svgHeight=f;svgWidth=e;baseUrl=o;svgCss=s;postUrl=CallbackUrl+h;isEmpty(jq191("#"+pdfFormId))||(ge(pdfFormContainer).innerHTML="");CreateDynamicForm();jq191("#"+pdfFormId).submit()}function CreateDynamicForm(){var n=document.createElement("form"),t,i,r,u,f,e,o,s,h,c;n.setAttribute("method","post");n.setAttribute("action",postUrl);n.setAttribute("id",pdfFormId);t=document.createElement("input");t.setAttribute("type","hidden");t.setAttribute("name","svgCss");t.setAttribute("value",svgCss);i=document.createElement("input");i.setAttribute("type","hidden");i.setAttribute("name","grid1");i.setAttribute("value",grid1);r=document.createElement("input");r.setAttribute("type","hidden");r.setAttribute("name","grid2");r.setAttribute("value",grid2);u=document.createElement("input");u.setAttribute("type","hidden");u.setAttribute("name","svgHtml");u.setAttribute("value",svgHtml);f=document.createElement("input");f.setAttribute("type","hidden");f.setAttribute("name","svgHeight");f.setAttribute("value",svgHeight);e=document.createElement("input");e.setAttribute("type","hidden");e.setAttribute("name","svgWidth");e.setAttribute("value",svgWidth);o=document.createElement("input");o.setAttribute("type","hidden");o.setAttribute("name","baseUrl");o.setAttribute("value",baseUrl);s=document.createElement("input");s.setAttribute("type","hidden");s.setAttribute("name","docTitle");s.setAttribute("value",docTitle);h=document.createElement("input");h.setAttribute("type","hidden");h.setAttribute("name","countryName");h.setAttribute("value",countryName);c=document.createElement("input");c.setAttribute("type","submit");c.setAttribute("value","Submit");c.setAttribute("style","display:none");n.appendChild(t);n.appendChild(i);n.appendChild(r);n.appendChild(u);n.appendChild(f);n.appendChild(e);n.appendChild(o);n.appendChild(s);n.appendChild(h);n.appendChild(c);ge(pdfFormContainer).appendChild(n)}var Type,Url,Data,ContentType,DataType,ProcessData,Method,wcfUrl="",isScrollbarList,isScrollbarDr,mapObj,RatId,CountriesByRatId,dispHatchLgd1,dispHatchLgd2,PreviousPpupObjWidth,pdfFormId,pdfFormContainer,docTitle,countryName,grid1,grid2,svgHtml,svgHeight,svgWidth,baseUrl,svgCss,postUrl;String.prototype.format||(String.prototype.format=function(){var n=arguments;return this.replace(/{(\d+)}/g,function(t,i){return typeof n[i]!="undefined"?n[i]:t})});JSdict.prototype.getVal||(JSdict.prototype.getVal=function(n){if(n==null)return"Key cannot be null";for(var t=0;t<this.Keys.length;t++)if(this.Keys[t]==n)return this.Values[t];return!1});JSdict.prototype.contains||(JSdict.prototype.contains=function(n){if(n==null)return"Key cannot be null";for(var t=0;t<this.Keys.length;t++)if(this.Keys[t]==n)return!0;return!1});JSdict.prototype.update||(JSdict.prototype.update=function(n,t){var i;if(n==null||t==null)return"Key or Value cannot be null";if(r!=f)return"Dictionary inconsistent. Keys length don't match values!";var r=this.Keys.length,f=this.Values.length,u=!1;for(i=0;i<r;i++)if(this.Keys[i]==n){this.Values[i]=t;u=!0;break}if(!u)return!1});JSdict.prototype.add||(JSdict.prototype.add=function(n,t){var r,u,i;if(typeof n=="number"||typeof n=="string"){if(n==null||t==null)return"Key or Value cannot be null";if(r!=u)return"Dictionary inconsistent. Keys length don't match values!";for(r=this.Keys.length,u=this.Values.length,i=0;i<r;i++)if(this.Keys[i]==n)return"Duplicate keys not allowed!";this.Keys.push(n);this.Values.push(t)}else return"Only number or string can be key!"});JSdict.prototype.remove||(JSdict.prototype.remove=function(n){var t;if(n==null)return"Key cannot be null";if(i!=u)return"Dictionary inconsistent. Keys length don't match values!";var i=this.Keys.length,u=this.Values.length,r=!1;for(t=0;t<i;t++)if(this.Keys[t]==n){this.Keys.shift(n);this.Values.shift(this.Values[t]);r=!0;break}if(!r)return!1}),function(n,t,i){jq191.fn.jScrollPane=function(r){function u(r,u){function li(t){var u,d,g,c,p,w,nt=!1,tt=!1;if(f=t,o===i)p=r.scrollTop(),w=r.scrollLeft(),r.css({overflow:"hidden",padding:0}),h=r.innerWidth()+ht+4,s=r.innerHeight(),r.width(h),o=n('<div class="jspPane" />').css("padding",yi).append(r.children()),e=n('<div class="jspContainer" />').css({width:h+"px",height:s+"px"}).append(o).appendTo(r);else{if(r.css("width",""),nt=f.stickToBottom&&or(),tt=f.stickToRight&&sr(),c=r.innerWidth()+ht!=h||r.outerHeight()!=s,c&&(h=r.innerWidth()+ht,s=r.innerHeight(),e.css({width:h+"px",height:s+"px"})),!c&&pi==y&&o.outerHeight()==v){r.width(h);return}pi=y;o.css("width","");r.width(h);e.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}o.css("overflow","auto");y=t.contentWidth?t.contentWidth:o[0].scrollWidth;v=o[0].scrollHeight;o.css("overflow","");oi=y/h;gt=v/s;k=gt>1;b=oi>1;b||k?(r.addClass("jspScrollable"),u=f.maintainPosition&&(l||a),u&&(d=et(),g=ot()),nr(),tr(),ir(),u&&(yt(tt?y-h:d,!1),ft(nt?v-s:g,!1)),lr(),hr(),br(),f.enableKeyboardNavigation&&vr(),f.clickOnTrack&&ur(),pr(),f.hijackInternalLinks&&wr()):(r.removeClass("jspScrollable"),o.css({top:0,width:e.width()-ht}),cr(),ar(),yr(),di());f.autoReinitialise&&!at?at=setInterval(function(){li(f)},f.autoReinitialiseDelay):!f.autoReinitialise&&at&&clearInterval(at);p&&r.scrollTop(0)&&ft(p,!1);w&&r.scrollLeft(0)&&yt(w,!1);r.trigger("jsp-initialised",[b||k])}function nr(){k&&(e.append(n('<div class="jspVerticalBar" />').append(n('<div class="jspCap jspCapTop" />'),n('<div class="jspTrack" />').append(n('<div class="jspDrag" />').append(n('<div class="jspDragTop" />'),n('<div class="jspDragBottom" />'))),n('<div class="jspCap jspCapBottom" />'))),ni=e.find(">.jspVerticalBar"),g=ni.find(">.jspTrack"),p=g.find(">.jspDrag"),f.showArrows&&(wt=n('<a class="jspArrow jspArrowUp" id="jspArrowUp" />').bind("mousedown.jsp",ut(0,-1)).bind("click.jsp",pt),bt=n('<a class="jspArrow jspArrowDown" id="jspArrowDown" />').bind("mousedown.jsp",ut(0,1)).bind("click.jsp",pt),f.arrowScrollOnHover&&(wt.bind("mouseover.jsp",ut(0,-1,wt)),bt.bind("mouseover.jsp",ut(0,1,bt))),ki(g,f.verticalArrowPositions,wt,bt)),lt=s,e.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){lt-=n(this).outerHeight()}),p.hover(function(){p.addClass("jspHover")},function(){p.removeClass("jspHover")}).bind("mousedown.jsp",function(t){n("html").bind("dragstart.jsp selectstart.jsp",pt);p.addClass("jspActive");var i=t.pageY-p.position().top;return n("html").bind("mousemove.jsp",function(n){ct(n.pageY-i,!1)}).bind("mouseup.jsp mouseleave.jsp",gi),!1}),wi())}function wi(){g.height(lt+"px");l=0;si=f.verticalGutter+g.outerWidth();o.width(h-si-ht);try{ni.position().left===0&&o.css("margin-left",si+"px")}catch(n){}}function tr(){b&&(e.append(n('<div class="jspHorizontalBar" />').append(n('<div class="jspCap jspCapLeft" />'),n('<div class="jspTrack" />').append(n('<div class="jspDrag" />').append(n('<div class="jspDragLeft" />'),n('<div class="jspDragRight" />'))),n('<div class="jspCap jspCapRight" />'))),ti=e.find(">.jspHorizontalBar"),nt=ti.find(">.jspTrack"),w=nt.find(">.jspDrag"),f.showArrows&&(kt=n('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",ut(-1,0)).bind("click.jsp",pt),dt=n('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",ut(1,0)).bind("click.jsp",pt),f.arrowScrollOnHover&&(kt.bind("mouseover.jsp",ut(-1,0,kt)),dt.bind("mouseover.jsp",ut(1,0,dt))),ki(nt,f.horizontalArrowPositions,kt,dt)),w.hover(function(){w.addClass("jspHover")},function(){w.removeClass("jspHover")}).bind("mousedown.jsp",function(t){n("html").bind("dragstart.jsp selectstart.jsp",pt);w.addClass("jspActive");var i=t.pageX-w.position().left;return n("html").bind("mousemove.jsp",function(n){vt(n.pageX-i,!1)}).bind("mouseup.jsp mouseleave.jsp",gi),!1}),st=e.innerWidth(),bi())}function bi(){e.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){st-=n(this).outerWidth()});nt.width(st+"px");a=0}function ir(){if(b&&k){var t=nt.outerHeight(),i=g.outerWidth();lt-=t;n(ti).find(">.jspCap:visible,>.jspArrow").each(function(){st+=n(this).outerWidth()});st-=i;s-=i;h-=t;nt.parent().append(n('<div class="jspCorner" />').css("width",t+"px"));wi();bi()}b&&o.width(e.outerWidth()-ht+"px");v=o.outerHeight();gt=v/s;b&&(rt=Math.ceil(1/oi*st),rt>f.horizontalDragMaxWidth?rt=f.horizontalDragMaxWidth:rt<f.horizontalDragMinWidth&&(rt=f.horizontalDragMinWidth),w.width(rt+"px"),tt=st-rt,vi(a));k&&(it=Math.ceil(1/gt*lt),it>f.verticalDragMaxHeight?it=f.verticalDragMaxHeight:it<f.verticalDragMinHeight&&(it=f.verticalDragMinHeight),p.height(it+"px"),d=lt-it,ai(l))}function ki(n,t,i,r){var u="before",f="after",e;t=="os"&&(t=/Mac/.test(navigator.platform)?"after":"split");t==u?f=t:t==f&&(u=t,e=i,i=r,r=e);n[u](i)[f](r)}function ut(n,t,i){return function(){return rr(n,t,this,i),this.blur(),!1}}function rr(t,i,r,u){r=n(r).addClass("jspActive");var o,e,s=!0,h=function(){t!==0&&c.scrollByX(t*f.arrowButtonSpeed);i!==0&&c.scrollByY(i*f.arrowButtonSpeed);e=setTimeout(h,s?f.initialDelay:f.arrowRepeatFreq);s=!1};h();o=u?"mouseout.jsp":"mouseup.jsp";u=u||n("html");u.bind(o,function(){r.removeClass("jspActive");e&&clearTimeout(e);e=null;u.unbind(o)})}function ur(){di();k&&g.bind("mousedown.jsp",function(t){if(t.originalTarget===i||t.originalTarget==t.currentTarget){var e=n(this),y=e.offset(),o=t.pageY-y.top-l,r,h=!0,a=function(){var p=e.offset(),n=t.pageY-p.top-it/2,i=s*f.scrollPagePercent,y=d*i/(v-s);if(o<0)l-y>n?c.scrollByY(-i):ct(n);else if(o>0)l+y<n?c.scrollByY(i):ct(n);else{u();return}r=setTimeout(a,h?f.initialDelay:f.trackClickRepeatFreq);h=!1},u=function(){r&&clearTimeout(r);r=null;n(document).unbind("mouseup.jsp",u)};return a(),n(document).bind("mouseup.jsp",u),!1}});b&&nt.bind("mousedown.jsp",function(t){if(t.originalTarget===i||t.originalTarget==t.currentTarget){var e=n(this),v=e.offset(),o=t.pageX-v.left-a,r,s=!0,l=function(){var p=e.offset(),n=t.pageX-p.left-rt/2,i=h*f.scrollPagePercent,v=tt*i/(y-h);if(o<0)a-v>n?c.scrollByX(-i):vt(n);else if(o>0)a+v<n?c.scrollByX(i):vt(n);else{u();return}r=setTimeout(l,s?f.initialDelay:f.trackClickRepeatFreq);s=!1},u=function(){r&&clearTimeout(r);r=null;n(document).unbind("mouseup.jsp",u)};return l(),n(document).bind("mouseup.jsp",u),!1}})}function di(){nt&&nt.unbind("mousedown.jsp");g&&g.unbind("mousedown.jsp")}function gi(){n("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");p&&p.removeClass("jspActive");w&&w.removeClass("jspActive")}function ct(n,t){k&&(n<0?n=0:n>d&&(n=d),t===i&&(t=f.animateScroll),t?c.animate(p,"top",n,ai):(p.css("top",n),ai(n)))}function ai(n){n===i&&(n=p.position().top);e.scrollTop(0);l=n;var t=l===0,u=l==d,h=n/d,f=-h*(v-s);(ii!=t||ui!=u)&&(ii=t,ui=u,r.trigger("jsp-arrow-change",[ii,ui,ri,fi]));fr(t,u);o.css("top",f);r.trigger("jsp-scroll-y",[-f,t,u]).trigger("scroll")}function vt(n,t){b&&(n<0?n=0:n>tt&&(n=tt),t===i&&(t=f.animateScroll),t?c.animate(w,"left",n,vi):(w.css("left",n),vi(n)))}function vi(n){n===i&&(n=w.position().left);e.scrollTop(0);a=n;var t=a===0,u=a==tt,s=n/tt,f=-s*(y-h);(ri!=t||fi!=u)&&(ri=t,fi=u,r.trigger("jsp-arrow-change",[ii,ui,ri,fi]));er(t,u);o.css("left",f);r.trigger("jsp-scroll-x",[-f,t,u]).trigger("scroll")}function fr(n,t){f.showArrows&&(wt[n?"addClass":"removeClass"]("jspDisabled"),bt[t?"addClass":"removeClass"]("jspDisabled"))}function er(n,t){f.showArrows&&(kt[n?"addClass":"removeClass"]("jspDisabled"),dt[t?"addClass":"removeClass"]("jspDisabled"))}function ft(n,t){var i=n/(v-s);ct(i*d,t)}function yt(n,t){var i=n/(y-h);vt(i*tt,t)}function ei(t,i,r){var u,v,y,o=0,c=0,p,w,b,k,l,a;try{u=n(t)}catch(d){return}for(v=u.outerHeight(),y=u.outerWidth(),e.scrollTop(0),e.scrollLeft(0);!u.is(".jspPane");)if(o+=u.position().top,c+=u.position().left,u=u.offsetParent(),/^body|html$/i.test(u[0].nodeName))return;p=ot();b=p+s;o<p||i?l=o-f.verticalGutter:o+v>b&&(l=o-s+v+f.verticalGutter);l&&ft(l,r);w=et();k=w+h;c<w||i?a=c-f.horizontalGutter:c+y>k&&(a=c-h+y+f.horizontalGutter);a&&yt(a,r)}function et(){return-o.position().left}function ot(){return-o.position().top}function or(){var n=v-s;return n>20&&n-ot()<10}function sr(){var n=y-h;return n>20&&n-et()<10}function hr(){e.unbind(ci).bind(ci,function(n,t,i,r){var u=a,e=l;return c.scrollBy(i*f.mouseWheelSpeed,-r*f.mouseWheelSpeed,!1),u==a&&e==l})}function cr(){e.unbind(ci)}function pt(){return!1}function lr(){o.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(n){ei(n.target,!1)})}function ar(){o.find(":input,a").unbind("focus.jsp")}function vr(){function h(){var n=a,r=l;switch(t){case 40:c.scrollByY(f.keyboardSpeed,!1);break;case 38:c.scrollByY(-f.keyboardSpeed,!1);break;case 34:case 32:c.scrollByY(s*f.scrollPagePercent,!1);break;case 33:c.scrollByY(-s*f.scrollPagePercent,!1);break;case 39:c.scrollByX(f.keyboardSpeed,!1);break;case 37:c.scrollByX(-f.keyboardSpeed,!1)}return i=n!=a||r!=l}var t,i,u=[];b&&u.push(ti[0]);k&&u.push(ni[0]);o.focus(function(){r.focus()});r.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(r){if(r.target===this||u.length&&n(r.target).closest(u).length){var f=a,e=l;switch(r.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:t=r.keyCode;h();break;case 35:ft(v-s);t=null;break;case 36:ft(0);t=null}return i=r.keyCode==t&&f!=a||e!=l,!i}}).bind("keypress.jsp",function(n){return n.keyCode==t&&h(),!i});f.hideFocus?(r.css("outline","none"),"hideFocus"in e[0]&&r.attr("hideFocus",!0)):(r.css("outline",""),"hideFocus"in e[0]&&r.attr("hideFocus",!1))}function yr(){r.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function pr(){if(location.hash&&location.hash.length>1){var t,r,i=escape(location.hash.substr(1));try{t=n("#"+i+', a[name="'+i+'"]')}catch(u){return}t.length&&o.find(i)&&(e.scrollTop()===0?r=setInterval(function(){e.scrollTop()>0&&(ei(t,!0),n(document).scrollTop(e.position().top),clearInterval(r))},50):(ei(t,!0),n(document).scrollTop(e.position().top)))}}function wr(){n(document.body).data("jspHijack")||(n(document.body).data("jspHijack",!0),n(document.body).delegate("a[href*=#]","click",function(i){var c=this.href.substr(0,this.href.indexOf("#")),s=location.href,f,r,u,h,e,o;if(location.href.indexOf("#")!==-1&&(s=location.href.substr(0,location.href.indexOf("#"))),c===s){f=escape(this.href.substr(this.href.indexOf("#")+1));r;try{r=n("#"+f+', a[name="'+f+'"]')}catch(l){return}r.length&&(u=r.closest(".jspScrollable"),h=u.data("jsp"),h.scrollToElement(r,!0),u[0].scrollIntoView&&(e=n(t).scrollTop(),o=r.offset().top,(o<e||o>e+n(t).height())&&u[0].scrollIntoView()),i.preventDefault())}}))}function br(){var u,f,t,i,n,r=!1;e.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(e){var o=e.originalEvent.touches[0];u=et();f=ot();t=o.pageX;i=o.pageY;n=!1;r=!0}).bind("touchmove.jsp",function(e){if(r){var o=e.originalEvent.touches[0],s=a,h=l;return c.scrollTo(u+t-o.pageX,f+i-o.pageY),n=n||Math.abs(t-o.pageX)>5||Math.abs(i-o.pageY)>5,s==a&&h==l}}).bind("touchend.jsp",function(){r=!1}).bind("click.jsp-touchclick",function(){if(n)return n=!1,!1})}function kr(){var n=ot(),t=et();r.removeClass("jspScrollable").unbind(".jsp");r.replaceWith(hi.append(o.children()));hi.scrollTop(n);hi.scrollLeft(t);at&&clearInterval(at)}var f,c=this,o,h,s,e,y,v,oi,gt,k,b,p,d,l,w,tt,a,ni,g,si,lt,it,wt,bt,ti,nt,st,rt,kt,dt,at,yi,ht,pi,ii=!0,ri=!0,ui=!1,fi=!1,hi=r.clone(!1,!1).empty(),ci=jq191.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";yi=r.css("paddingTop")+" "+r.css("paddingRight")+" "+r.css("paddingBottom")+" "+r.css("paddingLeft");ht=(parseInt(r.css("paddingLeft"),10)||0)+(parseInt(r.css("paddingRight"),10)||0);jq191.extend(c,{reinitialise:function(n){n=jq191.extend({},f,n);li(n)},scrollToElement:function(n,t,i){ei(n,t,i)},scrollTo:function(n,t,i){yt(n,i);ft(t,i)},scrollToX:function(n,t){yt(n,t)},scrollToY:function(n,t){ft(n,t)},scrollToPercentX:function(n,t){yt(n*(y-h),t)},scrollToPercentY:function(n,t){ft(n*(v-s),t)},scrollBy:function(n,t,i){c.scrollByX(n,i);c.scrollByY(t,i)},scrollByX:function(n,t){var i=et()+Math[n<0?"floor":"ceil"](n),r=i/(y-h);vt(r*tt,t)},scrollByY:function(n,t){var i=ot()+Math[n<0?"floor":"ceil"](n),r=i/(v-s);ct(r*d,t)},positionDragX:function(n,t){vt(n,t)},positionDragY:function(n,t){ct(n,t)},animate:function(n,t,i,r){var u={};u[t]=i;n.animate(u,{duration:f.animateDuration,easing:f.animateEase,queue:!1,step:r})},getContentPositionX:function(){return et()},getContentPositionY:function(){return ot()},getContentWidth:function(){return y},getContentHeight:function(){return v},getPercentScrolledX:function(){return et()/(y-h)},getPercentScrolledY:function(){return ot()/(v-s)},getIsScrollableH:function(){return b},getIsScrollableV:function(){return k},getContentPane:function(){return o},scrollToBottom:function(n){ct(d,n)},hijackInternalLinks:jq191.noop,destroy:function(){kr()}});li(u)}return r=jq191.extend({},jq191.fn.jScrollPane.defaults,r),jq191.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){r[this]=r[this]||r.speed}),this.each(function(){var t=n(this),i=t.data("jsp");i?i.reinitialise(r):(n("script",t).filter('[type="text/javascript"],:not([type])').remove(),i=new u(t,r),t.data("jsp",i))})};jq191.fn.jScrollPane.defaults={showArrows:!1,maintainPosition:!0,stickToBottom:!1,stickToRight:!1,clickOnTrack:!0,autoReinitialise:!1,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:i,animateScroll:!1,animateDuration:300,animateEase:"linear",hijackInternalLinks:!1,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:!1,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:!0,hideFocus:!1,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:.8}}(jQuery,this),function(n){function r(t){var i=t||window.event,e=[].slice.call(arguments,1),r=0,f=0,u=0;return t=n.event.fix(i),t.type="mousewheel",i.wheelDelta&&(r=i.wheelDelta/120),i.detail&&(r=-i.detail/3),u=r,i.axis!==undefined&&i.axis===i.HORIZONTAL_AXIS&&(u=0,f=-1*r),i.wheelDeltaY!==undefined&&(u=i.wheelDeltaY/120),i.wheelDeltaX!==undefined&&(f=i.wheelDeltaX/-120),e.unshift(t,r,f,u),(n.event.dispatch||n.event.handle).apply(this,e)}var t=["DOMMouseScroll","mousewheel"],i;if(n.event.fixHooks)for(i=t.length;i;)n.event.fixHooks[t[--i]]=n.event.mouseHooks;n.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var n=t.length;n;)this.addEventListener(t[--n],r,!1);else this.onmousewheel=r},teardown:function(){if(this.removeEventListener)for(var n=t.length;n;)this.removeEventListener(t[--n],r,!1);else this.onmousewheel=null}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})}(jQuery);isScrollbarList=!1;isScrollbarDr=!1,function(n){n.fn.ellipsis=function(){return this.each(function(){var t=n(this),f;if(t.css("overflow")=="hidden"){var r=t.html(),u=t.hasClass("multiline"),i=n(this.cloneNode(!0)).hide().css("position","absolute").css("overflow","visible").width(u?t.width():"auto").height(u?"auto":t.height());t.after(i);function e(){return i.height()>t.height()}function o(){return i.width()>t.width()}for(f=u?e:o;r.length>0&&f();)r=r.substr(0,r.length-1),i.html(r+"...");t.html(i.html());i.remove()}})}}(jQuery);mapObj={};var aggThemeJSON=[{themeType:"Color",dataSeriesIds:[1],breakCount:4,breakType:"Discontinuous",legendBgColor:"Transparent",legendTitleVisible:!1,decimals:1,MissingColor:"#B8B8A6",tooltipData:"",breaks:[{caption:"",Title:"",RangeFrom:"-1",RangeTo:"4",Color:"#990033"},{caption:"",Title:"",RangeFrom:"5",RangeTo:"9",Color:"#FF7519"},{caption:"",Title:"",RangeFrom:"10",RangeTo:"14",Color:"#3083FF"},{caption:"",Title:"",RangeFrom:"15",RangeTo:"18",Color:"#003D99"}]}],ratificationThemeJSON=[{themeType:"Color",dataSeriesIds:[1],showLegendTitle:!0,BGColor:"transparent",breakCount:3,breakType:"Discontinuous",decimals:4,MissingColor:"#B8B8A6",tooltipData:"",breaks:[{caption:"NoAction",Title:"NoAction",RangeFrom:"0",RangeTo:"0",Color:"#FF7519"},{caption:"Signatory",Title:"Signatory",RangeFrom:"1",RangeTo:"1",Color:"#3083FF"},{caption:"StateParty",Title:"StateParty",RangeFrom:"2",RangeTo:"2",Color:"#003D99"}]}],hatchThemeJSON=[{themeType:"Color",dataSeriesIds:[1],breakCount:3,breakType:"Discontinuous",legendBgColor:"Transparent",legendTitleVisible:!1,decimals:1,MissingColor:"#B8B8A6",tooltipData:"",breaks:[{caption:"NoAction",Title:"NoAction",RangeFrom:"0",RangeTo:"0",Color:"#FF7519"},{caption:"Signatory",Title:"Signatory",RangeFrom:"1",RangeTo:"1",Color:"#3083FF"},{caption:"StateParty",Title:"StateParty",RangeFrom:"2",RangeTo:"2",Color:"#003D99"}]},{themeType:"Hatch",dataSeriesIds:[2],breakCount:1,breakType:"Discontinuous",legendBgColor:"Transparent",legendTitleVisible:!1,decimals:1,MissingColor:"Transparent",breaks:[{caption:"Individual Com Allowed",Title:"IndComAllow",RangeFrom:"1",RangeTo:"1",Color:"#FFFFFF",FillStyle:""}]}],hatchThemeJSON2=[{themeType:"Color",dataSeriesIds:[1],breakCount:3,breakType:"Discontinuous",legendBgColor:"Transparent",legendTitleVisible:!1,decimals:1,MissingColor:"#B8B8A6",tooltipData:"",breaks:[{caption:"NoAction",Title:"NoAction",RangeFrom:"0",RangeTo:"0",Color:"#FF7519"},{caption:"Signatory",Title:"Signatory",RangeFrom:"1",RangeTo:"1",Color:"#3083FF"},{caption:"StateParty",Title:"StateParty",RangeFrom:"2",RangeTo:"2",Color:"#003D99"}]},{themeType:"Hatch",dataSeriesIds:[2],breakCount:1,breakType:"Discontinuous",legendBgColor:"Transparent",legendTitleVisible:!1,decimals:1,MissingColor:"Transparent",breaks:[{caption:"Individual Com Allowed",Title:"IndComAllow",RangeFrom:"1",RangeTo:"1",Color:"#FFFFFF",FillStyle:"LightUpwardDiagonal"}]},{themeType:"Hatch",dataSeriesIds:[3],breakCount:1,breakType:"Discontinuous",legendBgColor:"Transparent",legendTitleVisible:!1,decimals:1,MissingColor:"Transparent",breaks:[{caption:"Inquiry Proc Allowed",Title:"InqProcAllow",RangeFrom:"1",RangeTo:"1",Color:"#FFFFFF",FillStyle:"LightDownwardDiagonal"}]}],CtlListCountries="container_listCountries",CtlDdlRatifications="container_ddlRatifications",CtlListRegions="container_listRegions",CtlCountryProfile="container_countryProfile",CtlLgdAggregation="svgRatCount",CtlLgdCountryStat="svgCountryStat",CtlBtnIndividualCom="btnIndividualCom",CtlBtnInquiryProc="btnIncProc",CtlLinkPdf1="link1",CtlLinkPdf2="link2",CtlLinkPdf3="link3",CtlLinkUnderlyingExcl="link5",CtlLinkPrintMapPdf="link4",CtlRatificationDesc="ratDescription",CtlRatificationHeading="ratHeading",CtlLastSyncedDate="lastSynced",CtlUlRatifications="ulRatifications",CtlFooterCondText="cond_footerText1",CtlOpRegion="opRegion",CtlPpupCtryList="ppup_cntrylst",CtlTableCountryStat="tblCntryStat",CtlTableRatDeclarations="tblDeclarations",CtlGridCountryStat="list_tab_ar",CtlGridDeclarations="dr_tab_ar",CtlLnkPrintPdf="lnkPrintPdf",FooterCondRat="Optional Protocol to the Convention on the Rights of the Child on a communications procedure",ClassContainerHatchButtons="container_hatchBtns",ClassHatch1="hatch1",ClassHatch2="hatch2",ClassUlCountries="ulCountries",ClassUlPpupCountries="ulPpupCountries",ClassUlRegions="ulRegions",ClassSelected="selected",ClassBtnPressed="btnPressed",ClassContainerPdfLinks="container_ratLinks",ClassLgdTextGlobal="txtGlobal",ClassRatListTopLi="",ClassRatListBottomLi="brdr_btm_nne",ClassCntryFltrContainer="lgn_bx",ClassLegendFilterApplied="lgndFilter",ClassRegionFilterApplied="rgnFilter",ClassCountryProfilePopup="ppup_main",ClassBold="fnt_bld",ClassCountryProfileListContainer="container_countryProfileList",CallbackUrl=MvcUrl+"/Home/",ServiceUrl=MvcUrl+"/webapi/dashboarddata/",TotalRatificationMetadataPath="/Stock/Documents/MetadataRatificationTotal_Dashboard.pdf",CountriesMethod="GetCountries",RatificationsMethod="GetRatifications",CountriesForRatificationMethod="GetCountriesForRatification",CountryRatificationsMethod="GetCountryRatifications",CrForMapAggregationMethod="GetCRsForAggregationMap",RatificationsByCountryMethod="GetRatificationsByCountry",UnderlyingExcelMethod="GetUnderlyingExcel",Countries,Ratifications,CountryRatifications,CRsByRatId,DefaultRatificationTitle="Ratification of 18 International Human Rights Treaties",DefaultRatificationDesc="The indicator refers to the expression by the State of its consent to be bound by a human rights treaty under international law. A 'State party' to a treaty is a State that has expressed its consent, by an act of ratification, accession or succession, and where the treaty has entered into force (or a State about to become a party after formal reception by the United Nations Secretariat of the State’s decision to be a party). A 'Signatory' to a treaty is a State that provided a preliminary endorsement of the instrument and its intent to examine the treaty domestically and consider ratifying it.  'No action' means that a State did not express its consent.A value of 1 is assigned to a 'State party' (or a State about to become a party after formal reception by the United Nations Secretariat of the State’s decision to be a party) and 0 otherwise. The provisions under the treaty determine the moment of its entry into force.",TooltipSigTxt="Signature",TooltipStPartyTxt="Ratification/Accession",TooltipIndComTxt="Acceptance of individual communications procedure",TooltipInqProcTxt="Acceptance of inquiry procedure",OpCountries="opCountries",SqlDefaultDate=1753,Cache={},CRdictionary,CtlCntryFltr1=Legend04="lgd04",CtlCntryFltr2=Lengend59="lgd59",CtlCntryFltr3=Legend1014="lgd1014",CtlCntryFltr4=Legend1518="lgd1518",LegendStateParty="lgdStateParty",LegendSignatory="lgdSignatory",LegendNoAction="lgdNoAction",StatePartyTitle="State Party",NoActionTitle="No Action",SignatoryTitle="Signatory",CountryStatus={NoAction:0,Signatory:1,StateParty:2},EnumHatchOps={AllowIndividualCom:1,AllowInquiryProc:2,AllowBoth:3},EnumUpdateFilterFor={Countries:0,Ratification:1};CountriesByRatId=[];jq191(document).keyup(function(n){n.keyCode==27&&jq191(".close_ppup_icn").click()});jq191(document).ready(function(){ApplyMaskingDiv(102,!0);PopulateCountries();PopulateRatifications();jq191(".{0} li".format(ClassCntryFltrContainer)).bind("click",function(){CountryLegendFilterClicked(this)});jq191(".map_main").show()});pdfFormId="pdfForm";pdfFormContainer="postPdfForm"