jQuery.template("entitlement-editor-item",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="item" data-dataset-id="'),typeof datasetId!="undefined"&&datasetId!=null&&__.push($.encode(typeof datasetId=="function"?datasetId.call($item):datasetId)),__.push('" data-segment-id="'),typeof segmentId!="undefined"&&segmentId!=null&&__.push($.encode(typeof segmentId=="function"?segmentId.call($item):segmentId)),__.push('">  <div class="item-actions">   <div class="item-make-copy" title="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-editor-item.htm","Make a copy"))),__.push('"><i class="knoema-ico copy"><\/i><\/div>   <div class="item-delete"><i class="knoema-ico delete"><\/i><\/div>  <\/div>  <label class="mtl-checkbox">   <input type="checkbox" '),typeof isApproved!="undefined"&&isApproved!=null&&(typeof isApproved=="function"?isApproved.call($item):isApproved)&&__.push(' checked="checked" '),__.push(' class="mtl-checkbox-input column-select-checkbox" />   <span class="mtl-checkbox-bg"><\/span>  <\/label>  '),typeof datasetName!="undefined"&&datasetName!=null&&__.push($.encode(typeof datasetName=="function"?datasetName.call($item):datasetName)),__.push(" <\/div>");return __});jQuery.template("entitlement-editor",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="entitlement-editor">  <div class="column">   <h4>    '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-editor.htm","Datasets"))),__.push('   <\/h4>   <div class="list">    '),typeof entitlements!="undefined"&&entitlements!=null&&$.each(typeof entitlements=="function"?entitlements.call($item):entitlements,function(n,entitlement){with(this)__.push("     "),typeof entitlement!="undefined"&&entitlement!=null&&(__=__.concat($item.nest("entitlement-editor-item",entitlement,null))),__.push("    ")}),__.push('   <\/div>  <\/div>  <div class="column">   <h4>    '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-editor.htm","Permissions"))),__.push('   <\/h4>   <div class="filter"><\/div>  <\/div> <\/div>');return __});jQuery.template("entitlement-slider-editor",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="entitlement-slider">   <div class="simple slide">    '),typeof(ownerEmail||isNewUser)!="undefined"&&(ownerEmail||isNewUser)!=null&&(typeof(ownerEmail||isNewUser)=="function"?(ownerEmail||isNewUser).call($item):ownerEmail||isNewUser)?(__.push("    <h4>     "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","Account"))),__.push("    <\/h4>    "),typeof isNewUser!="undefined"&&isNewUser!=null&&(typeof isNewUser=="function"?isNewUser.call($item):isNewUser)&&(__.push('    <div class="find-user">     <input id="find-user" placeholder="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","Type e-mail address to find an account"))),__.push('" />     <button class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","Find"))),__.push('<\/button>     <div class="error-message" style="display: none"><\/div>    <\/div>    ')),__.push('    <div class="user clearfix"><\/div>    ')):!0&&(__.push("    <h4>     "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","Portal"))),__.push('    <\/h4>    <b class="portal">'),typeof name!="undefined"&&name!=null&&__.push($.encode(typeof name=="function"?name.call($item):name)),__.push("<\/b>    ")),__.push('    <h4 class="companies-header">     '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","Companies"))),__.push('     <span>      <span id="copy-companies" class="copy-paste-btn" title="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","Copy companies to clipboard"))),__.push('"><i class="knoema-ico copy"><\/i><\/span>      <span id="paste-companies" class="copy-paste-btn" title="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","Paste companies from clipboard"))),__.push('"><i class="knoema-ico paste"><\/i><\/span>      <span id="clear-companies" class="copy-paste-btn" title="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","Clear companies"))),__.push('"><i class="knoema-ico delete"><\/i><\/span>     <\/span>    <\/h4>    <div class="paste-warning hide">     <div class="warning-text">      '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","No companies found for tickers:"))),__.push(' <span class="not-founded-tickers"><\/span>     <\/div>     <div class="warning-btn"><i class="knoema-ico close"><\/i><\/div>    <\/div>    <ul id="companies-select" class="tagit"><\/ul>    <input id="companies-selected" type="hidden" />    <h4>     '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","Datasets"))),__.push('    <\/h4>    <div class="datasets">     '),typeof datasets!="undefined"&&datasets!=null&&$.each(typeof datasets=="function"?datasets.call($item):datasets,function(){with(this)__.push('     <div class="item" data-dataset-id="'),typeof id!="undefined"&&id!=null&&__.push($.encode(typeof id=="function"?id.call($item):id)),__.push('">      <label class="mtl-checkbox">       <input type="checkbox" id="'),typeof id!="undefined"&&id!=null&&__.push($.encode(typeof id=="function"?id.call($item):id)),__.push('" class="mtl-checkbox-input column-select-checkbox" />       <span class="mtl-checkbox-bg"><\/span>      <\/label>      <label for="'),typeof id!="undefined"&&id!=null&&__.push($.encode(typeof id=="function"?id.call($item):id)),__.push('">'),typeof name!="undefined"&&name!=null&&__.push($.encode(typeof name=="function"?name.call($item):name)),__.push("<\/label>     <\/div>     ")}),__.push('    <\/div>   <\/div>   <div class="advanced slide">    <a href="#" class="slide-selector">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlement-slider-editor.htm","Back"))),__.push("<\/a>    "),!0&&(__=__.concat($item.nest("entitlement-editor",null))),__.push("   <\/div>  <\/div>");return __});jQuery.template("entitlements",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="entitlement-table">  <div class="row header">   <div class="item name">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlements.htm","Client/User"))),__.push('<\/div>   <div class="item permissions">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/entitlements.htm","Permissions"))),__.push('<\/div>  <\/div>  <div class="body">   '),typeof entitlements!="undefined"&&entitlements!=null&&$.each(typeof entitlements=="function"?entitlements.call($item):entitlements,function(){with(this)__.push('    <div class="row" data-owner="'),typeof(ownerEmail||name)!="undefined"&&(ownerEmail||name)!=null&&__.push($.encode(typeof(ownerEmail||name)=="function"?(ownerEmail||name).call($item):ownerEmail||name)),__.push('">     '),typeof!ownerEmail!="undefined"&&!ownerEmail!=null&&(typeof!ownerEmail=="function"?(!ownerEmail).call($item):!ownerEmail)?(__.push('     <div class="item name">'),typeof name!="undefined"&&name!=null&&__.push($.encode(typeof name=="function"?name.call($item):name)),__.push("<\/div>     ")):!0&&(__.push('     <div class="item name">      <div class="info">       <div class="item">'),typeof name!="undefined"&&name!=null&&__.push($.encode(typeof name=="function"?name.call($item):name)),__.push('<\/div>       <div class="item">'),typeof ownerEmail!="undefined"&&ownerEmail!=null&&__.push($.encode(typeof ownerEmail=="function"?ownerEmail.call($item):ownerEmail)),__.push("<\/div>      <\/div>     <\/div>     ")),__.push('     <div class="item permissions">      '),typeof permissions!="undefined"&&permissions!=null&&$.each(typeof permissions=="function"?permissions.call($item):permissions,function(n,permission){with(this)__.push("       <div>"),typeof permission!="undefined"&&permission!=null&&__.push($.encode(typeof permission=="function"?permission.call($item):permission)),__.push("<\/div>      ")}),__.push("     <\/div>    <\/div>   ")}),__.push("  <\/div> <\/div>");return __});jQuery.template("error-handling-dialog",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push("<ul>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/error-handling-dialog.htm","Some errors were found"))),__.push(":  "),typeof response.Errors!="undefined"&&response.Errors!=null&&$.each(typeof response.Errors=="function"?response.Errors.call($item):response.Errors,function(n,error){with(this)__.push("   <li>"),typeof error!="undefined"&&error!=null&&__.push($.encode(typeof error=="function"?error.call($item):error)),__.push("<\/li>  ")}),__.push("  <\/ul>");return __});jQuery.template("metadata-column-topics",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<ul data-column="'),typeof column!="undefined"&&column!=null&&__.push($.encode(typeof column=="function"?column.call($item):column)),__.push('" class="topics">   '),typeof topics!="undefined"&&topics!=null&&$.each(typeof topics=="function"?topics.call($item):topics,function(i,topic){with(this)__.push('   <li data-topic-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('">'),typeof topic.Name!="undefined"&&topic.Name!=null&&__.push($.encode(typeof topic.Name=="function"?topic.Name.call($item):topic.Name)),__.push("<\/li>   ")}),__.push("  <\/ul>");return __});jQuery.template("metadata-culture",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="form">    <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-culture.htm","Supported languages"))),__.push('<\/label>      <ul id="supported">    '),typeof Languages!="undefined"&&Languages!=null&&$.each(typeof Languages=="function"?Languages.call($item):Languages,function(n,lang){with(this)__.push('    <li>     <input id="'),typeof lang.ISO!="undefined"&&lang.ISO!=null&&__.push($.encode(typeof lang.ISO=="function"?lang.ISO.call($item):lang.ISO)),__.push('" name="languages[]" type="checkbox" value="'),typeof lang.ISO!="undefined"&&lang.ISO!=null&&__.push($.encode(typeof lang.ISO=="function"?lang.ISO.call($item):lang.ISO)),__.push('" '),typeof lang.Supported!="undefined"&&lang.Supported!=null&&(typeof lang.Supported=="function"?lang.Supported.call($item):lang.Supported)&&__.push("checked"),__.push(' />&nbsp;      <label for="'),typeof lang.ISO!="undefined"&&lang.ISO!=null&&__.push($.encode(typeof lang.ISO=="function"?lang.ISO.call($item):lang.ISO)),__.push('">'),typeof lang.Name!="undefined"&&lang.Name!=null&&__.push($.encode(typeof lang.Name=="function"?lang.Name.call($item):lang.Name)),__.push("<\/label>     <\/li>   ")}),__.push('   <\/ul>  <\/div>      <div id="lang-required" class="hidden">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-culture.htm","Please select at least one language."))),__.push("<\/div>    "),typeof Metadata.Dataset!="undefined"&&Metadata.Dataset!=null&&(typeof Metadata.Dataset=="function"?Metadata.Dataset.call($item):Metadata.Dataset)&&(__.push('  <hr />  <a id="save-metadata" class="ui-button save-metadata">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-culture.htm","Save"))),__.push("<\/a>  ")),__.push("");return __});jQuery.template("metadata-editor",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="clear"><\/div>  <div id="tabs">   <ul>    <li class="hidden"><a href="#dummy"><\/a><\/li>    <li><a href="#facts">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-editor.htm","Facts"))),__.push('<\/a><\/li>    <li><a href="#topics">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-editor.htm","Topics"))),__.push("<\/a><\/li>    "),typeof!isCountry!="undefined"&&!isCountry!=null&&(typeof!isCountry=="function"?(!isCountry).call($item):!isCountry)&&(__.push('<li><a href="#country-groups">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-editor.htm","Country Groups"))),__.push("<\/a><\/li>")),__.push("    "),typeof Languages!="undefined"&&Languages!=null&&(typeof Languages=="function"?Languages.call($item):Languages)&&(__.push('<li><a href="#lang">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-editor.htm","Languages"))),__.push("<\/a><\/li>")),__.push('   <\/ul>   <!--http://forum.jquery.com/topic/how-to-select-first-tab-->   <div class="hidden" id="dummy">   <\/div>   <div id="facts">   <\/div>   <div id="topics">   <\/div>   '),typeof!isCountry!="undefined"&&!isCountry!=null&&(typeof!isCountry=="function"?(!isCountry).call($item):!isCountry)&&__.push('   <div id="country-groups">   <\/div>   '),__.push("   "),typeof Languages!="undefined"&&Languages!=null&&(typeof Languages=="function"?Languages.call($item):Languages)&&__.push('<div id="lang"><\/div>'),__.push("  <\/div>");return __});jQuery.template("metadata-fact-form",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="infomessage">   '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-fact-form.htm","Select title for fact from drop down list or enter your own from keyboard."))),__.push('  <\/div>    <div class="form">   <form id="fact-fields" data-group="'),typeof fact.Group!="undefined"&&fact.Group!=null&&__.push($.encode(typeof fact.Group=="function"?fact.Group.call($item):fact.Group)),__.push('" data-fact-index="'),typeof factIndex!="undefined"&&factIndex!=null&&__.push($.encode(typeof factIndex=="function"?factIndex.call($item):factIndex)),__.push('">      <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-fact-form.htm","Title"))),__.push("<\/label><br />    "),typeof(fact.TitleColumn=="")!="undefined"&&fact.TitleColumn==""!=null&&(typeof(fact.TitleColumn=="")=="function"?(fact.TitleColumn=="").call($item):fact.TitleColumn=="")?(__.push('     <div class="select-holder">      <div id="title-holder" class="control-group" style="display:none">       <select id="Title" name="Title" class="chzn-select">        '),typeof factsDataset.columns!="undefined"&&factsDataset.columns!=null&&$.each(typeof factsDataset.columns=="function"?factsDataset.columns.call($item):factsDataset.columns,function(n,column){with(this)__.push("         "),typeof(column.type=="Text")!="undefined"&&column.type=="Text"!=null&&(typeof(column.type=="Text")=="function"?(column.type=="Text").call($item):column.type=="Text")&&(__.push("          "),typeof(fact.Title==column.name)!="undefined"&&fact.Title==column.name!=null&&(typeof(fact.Title==column.name)=="function"?(fact.Title==column.name).call($item):fact.Title==column.name)?(__.push('           <option value="'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push('" selected>'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push("<\/option>          ")):!0&&(__.push('           <option value="'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push('">'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push("<\/option>          ")),__.push("         ")),__.push("         ")}),__.push('       <\/select>      <\/div>      <input id="title-manual-textfield" type="text" class="text-box" name="Title" value="'),typeof fact.Title!="undefined"&&fact.Title!=null&&__.push($.encode(typeof fact.Title=="function"?fact.Title.call($item):fact.Title)),__.push('" />     <\/div>     <a href="#" id="input-toggle" data-state="input" class="ui-button">      '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-fact-form.htm","Select"))),__.push("     <\/a>    ")):!0&&(__.push('     <div class="select-holder">      <div id="title-holder" class="control-group">       <select name="Title" class="chzn-select">        '),typeof factsDataset.columns!="undefined"&&factsDataset.columns!=null&&$.each(typeof factsDataset.columns=="function"?factsDataset.columns.call($item):factsDataset.columns,function(n,column){with(this)__.push("         "),typeof(column.type=="Text")!="undefined"&&column.type=="Text"!=null&&(typeof(column.type=="Text")=="function"?(column.type=="Text").call($item):column.type=="Text")&&(__.push("          "),typeof(fact.TitleColumn==column.name)!="undefined"&&fact.TitleColumn==column.name!=null&&(typeof(fact.TitleColumn==column.name)=="function"?(fact.TitleColumn==column.name).call($item):fact.TitleColumn==column.name)?(__.push('           <option value="'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push('" selected>'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push("<\/option>          ")):!0&&(__.push('           <option value="'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push('">'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push("<\/option>          ")),__.push("         ")),__.push("        ")}),__.push('       <\/select>      <\/div>      <input id="title-manual-textfield" type="text" class="text-box" name="Title" value="'),typeof fact.Title!="undefined"&&fact.Title!=null&&__.push($.encode(typeof fact.Title=="function"?fact.Title.call($item):fact.Title)),__.push('" style="display:none"/>     <\/div>     <a href="#" id="input-toggle" data-state="select" class="ui-button">      '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-fact-form.htm","Edit"))),__.push("     <\/a>    ")),__.push('      <div class="control-group">     <label for="Column">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-fact-form.htm","Value"))),__.push('<\/label>     <select id="Column" name="Column" class="chzn-select">      '),typeof factsDataset.columns!="undefined"&&factsDataset.columns!=null&&$.each(typeof factsDataset.columns=="function"?factsDataset.columns.call($item):factsDataset.columns,function(n,column){with(this)__.push("       "),typeof(column.type=="Text"||column.type=="Number")!="undefined"&&(column.type=="Text"||column.type=="Number")!=null&&(typeof(column.type=="Text"||column.type=="Number")=="function"?(column.type=="Text"||column.type=="Number").call($item):column.type=="Text"||column.type=="Number")&&(__.push("        "),typeof(fact.Column==column.name)!="undefined"&&fact.Column==column.name!=null&&(typeof(fact.Column==column.name)=="function"?(fact.Column==column.name).call($item):fact.Column==column.name)?(__.push('         <option value="'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push('" selected>'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push("<\/option>        ")):!0&&(__.push('         <option value="'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push('">'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push("<\/option>        ")),__.push("       ")),__.push("      ")}),__.push('        <\/select>    <\/div>      <div class="control-group">     <label for="DateColumn">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-fact-form.htm","Date column"))),__.push('<\/label>     <select id="DateColumn" name="DateColumn" class="chzn-select" style="width: 641px;">      <option value="">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-fact-form.htm","Not selected"))),__.push("<\/option>      "),typeof factsDataset.columns!="undefined"&&factsDataset.columns!=null&&$.each(typeof factsDataset.columns=="function"?factsDataset.columns.call($item):factsDataset.columns,function(n,column){with(this)__.push("        "),typeof(fact.DateColumn==column.name)!="undefined"&&fact.DateColumn==column.name!=null&&(typeof(fact.DateColumn==column.name)=="function"?(fact.DateColumn==column.name).call($item):fact.DateColumn==column.name)?(__.push('         <option value="'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push('" selected>'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push("<\/option>        ")):!0&&(__.push('         <option value="'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push('">'),typeof column.name!="undefined"&&column.name!=null&&__.push($.encode(typeof column.name=="function"?column.name.call($item):column.name)),__.push("<\/option>        ")),__.push("      ")}),__.push('        <\/select>    <\/div>        <div class="control-group">     <label for="Precision">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-fact-form.htm","Precision"))),__.push('<\/label>     <select id="Precision" name="Precision">      <option value="-">-<\/option>      <option value="0" '),typeof(fact.Precision==0)!="undefined"&&fact.Precision==0!=null&&(typeof(fact.Precision==0)=="function"?(fact.Precision==0).call($item):fact.Precision==0)&&__.push("selected"),__.push('>0<\/option>      <option value="1" '),typeof(fact.Precision==1)!="undefined"&&fact.Precision==1!=null&&(typeof(fact.Precision==1)=="function"?(fact.Precision==1).call($item):fact.Precision==1)&&__.push("selected"),__.push('>1<\/option>      <option value="2" '),typeof(fact.Precision==2)!="undefined"&&fact.Precision==2!=null&&(typeof(fact.Precision==2)=="function"?(fact.Precision==2).call($item):fact.Precision==2)&&__.push("selected"),__.push('>2<\/option>      <option value="3" '),typeof(fact.Precision==3)!="undefined"&&fact.Precision==3!=null&&(typeof(fact.Precision==3)=="function"?(fact.Precision==3).call($item):fact.Precision==3)&&__.push("selected"),__.push('>3<\/option>      <option value="4" '),typeof(fact.Precision==4)!="undefined"&&fact.Precision==4!=null&&(typeof(fact.Precision==4)=="function"?(fact.Precision==4).call($item):fact.Precision==4)&&__.push("selected"),__.push(">4<\/option>     <\/select>    <\/div>       <\/form>    <\/div>");return __});jQuery.template("metadata-facts",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof isCommunity!="undefined"&&isCommunity!=null&&(typeof isCommunity=="function"?isCommunity.call($item):isCommunity)&&(__.push('  <div id="atlas-country">   <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Country:"))),__.push("<\/label>   "),typeof metadata.RegionId!="undefined"&&metadata.RegionId!=null&&(typeof metadata.RegionId=="function"?metadata.RegionId.call($item):metadata.RegionId)?(__.push('    <a href="#'),typeof metadata.RegionId!="undefined"&&metadata.RegionId!=null&&__.push($.encode(typeof metadata.RegionId=="function"?metadata.RegionId.call($item):metadata.RegionId)),__.push('" id="country-selector" data-text="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Not set"))),__.push('">'),typeof metadata.RegionId!="undefined"&&metadata.RegionId!=null&&__.push($.encode(typeof metadata.RegionId=="function"?metadata.RegionId.call($item):metadata.RegionId)),__.push("<\/a>   ")):!0&&(__.push('    <a href="#" id="country-selector" class="not-set" data-text="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Not set"))),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Not set"))),__.push("<\/a>   ")),__.push('   <div id="country-profile" '),typeof(metadata.RegionId?"":'class="hidden"')!="undefined"&&(metadata.RegionId?"":'class="hidden"')!=null&&__.push($.encode(typeof(metadata.RegionId?"":'class="hidden"')=="function"?(metadata.RegionId?"":'class="hidden"').call($item):metadata.RegionId?"":'class="hidden"')),__.push('>    <input type="checkbox" '),typeof(metadata.ShowCountryProfile?"checked":"")!="undefined"&&(metadata.ShowCountryProfile?"checked":"")!=null&&__.push($.encode(typeof(metadata.ShowCountryProfile?"checked":"")=="function"?(metadata.ShowCountryProfile?"checked":"").call($item):metadata.ShowCountryProfile?"checked":"")),__.push(' id="country-profile-check"/>    <label for="country-profile-check">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Show country profile"))),__.push("<\/label>   <\/div>  <\/div>  ")),__.push('    <div id="facts-dataset" class="form">   '),typeof metadata.Dataset!="undefined"&&metadata.Dataset!=null&&(typeof metadata.Dataset=="function"?metadata.Dataset.call($item):metadata.Dataset)?(__.push("    <div>     <label>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Dataset:"))),__.push('<\/label>     <a href="/'),typeof metadata.Dataset!="undefined"&&metadata.Dataset!=null&&__.push($.encode(typeof metadata.Dataset=="function"?metadata.Dataset.call($item):metadata.Dataset)),__.push('">'),typeof factsDatasetDetails.name!="undefined"&&factsDatasetDetails.name!=null&&__.push($.encode(typeof factsDatasetDetails.name=="function"?factsDatasetDetails.name.call($item):factsDatasetDetails.name)),__.push('<\/a>    <\/div>    <p>     <a href="#" class="ui-button" id="change-atlas-facts-dataset">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Change dataset"))),__.push("<\/a>    <\/p>   ")):!0&&(__.push('    <div class="infomessage alert">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Please select dataset!"))),__.push('<\/div>    <a href="#" class="ui-button" id="change-atlas-facts-dataset">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Choose dataset"))),__.push("<\/a>   ")),__.push('  <\/div>    <div id="facts-list">   <table class="knoema-table">    <tbody>     '),typeof metadata.Facts!="undefined"&&metadata.Facts!=null&&(typeof metadata.Facts=="function"?metadata.Facts.call($item):metadata.Facts)&&(__.push("      "),typeof groups!="undefined"&&groups!=null&&$.each(typeof groups=="function"?groups.call($item):groups,function(j,group){with(this)__.push('       <tr data-group="'),typeof(j+1)!="undefined"&&j+1!=null&&__.push($.encode(typeof(j+1)=="function"?(j+1).call($item):j+1)),__.push('">        <td colspan="2" class="group">         '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Group"))),__.push(" "),typeof(j+1)!="undefined"&&j+1!=null&&__.push($.encode(typeof(j+1)=="function"?(j+1).call($item):j+1)),__.push("        <\/td>       <\/tr>       "),typeof group!="undefined"&&group!=null&&$.each(typeof group=="function"?group.call($item):group,function(i,fact){with(this)__.push('       <tr data-fact-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-fact-group="'),typeof(j+1)!="undefined"&&j+1!=null&&__.push($.encode(typeof(j+1)=="function"?(j+1).call($item):j+1)),__.push('">        <td>         '),typeof(fact.TitleColumn==""||fact.TitleColumn==null)!="undefined"&&(fact.TitleColumn==""||fact.TitleColumn==null)!=null&&(typeof(fact.TitleColumn==""||fact.TitleColumn==null)=="function"?(fact.TitleColumn==""||fact.TitleColumn==null).call($item):fact.TitleColumn==""||fact.TitleColumn==null)?(__.push("          "),typeof fact.Title!="undefined"&&fact.Title!=null&&__.push($.encode(typeof fact.Title=="function"?fact.Title.call($item):fact.Title)),__.push("         ")):!0&&(__.push("          "),typeof fact.TitleColumn!="undefined"&&fact.TitleColumn!=null&&__.push($.encode(typeof fact.TitleColumn=="function"?fact.TitleColumn.call($item):fact.TitleColumn)),__.push("         ")),__.push('        <\/td>        <td style="white-space: nowrap"         data-column="'),typeof fact.Column!="undefined"&&fact.Column!=null&&__.push($.encode(typeof fact.Column=="function"?fact.Column.call($item):fact.Column)),__.push('"         data-title="'),typeof fact.Title!="undefined"&&fact.Title!=null&&__.push($.encode(typeof fact.Title=="function"?fact.Title.call($item):fact.Title)),__.push('"         data-title-column="'),typeof fact.TitleColumn!="undefined"&&fact.TitleColumn!=null&&__.push($.encode(typeof fact.TitleColumn=="function"?fact.TitleColumn.call($item):fact.TitleColumn)),__.push('"         data-date-column="'),typeof fact.DateColumn!="undefined"&&fact.DateColumn!=null&&__.push($.encode(typeof fact.DateColumn=="function"?fact.DateColumn.call($item):fact.DateColumn)),__.push('"         data-precision="'),typeof fact.Precision!="undefined"&&fact.Precision!=null&&__.push($.encode(typeof fact.Precision=="function"?fact.Precision.call($item):fact.Precision)),__.push('"         data-is-substring="'),typeof fact.IsSubstring!="undefined"&&fact.IsSubstring!=null&&__.push($.encode(typeof fact.IsSubstring=="function"?fact.IsSubstring.call($item):fact.IsSubstring)),__.push('"         >         <a href="#" class="delete-fact" title="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Delete fact"))),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Delete"))),__.push('<\/a>&nbsp;         <a href="#" class="edit-fact" title="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Edit fact"))),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Edit"))),__.push("<\/a>        <\/td>       <\/tr>       ")}),__.push("      ")}),__.push("       ")),__.push('    <\/tbody>   <\/table>     <hr />      <a href="#" class="ui-button" id="create-fact">    '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Create fact"))),__.push('   <\/a>   <a href="#" class="ui-button" id="create-group">    '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Create group"))),__.push("   <\/a>  <\/div>    "),typeof metadata.Dataset!="undefined"&&metadata.Dataset!=null&&(typeof metadata.Dataset=="function"?metadata.Dataset.call($item):metadata.Dataset)&&(__.push('  <hr />  <a id="save-metadata" class="ui-button save-metadata">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-facts.htm","Save"))),__.push("<\/a>  ")),__.push("");return __});jQuery.template("metadata-group-countries",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof(countries.length===0)!="undefined"&&countries.length===0!=null&&(typeof(countries.length===0)=="function"?(countries.length===0).call($item):countries.length===0)?(__.push("  "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-group-countries.htm","No countries in group yet"))),__.push(" ")):!0&&(__.push("  <thead>   <tr>    <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-group-countries.htm","ID"))),__.push("<\/th>    <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-group-countries.htm","Name"))),__.push("<\/th>    <th><\/th>   <\/tr>  <\/thead>  <tbody>   "),typeof countries!="undefined"&&countries!=null&&$.each(typeof countries=="function"?countries.call($item):countries,function(n,country){with(this)__.push("   <tr>    <td>"),typeof country.regionId!="undefined"&&country.regionId!=null&&__.push($.encode(typeof country.regionId=="function"?country.regionId.call($item):country.regionId)),__.push("<\/td>    <td>"),typeof country.name!="undefined"&&country.name!=null&&__.push($.encode(typeof country.name=="function"?country.name.call($item):country.name)),__.push('<\/td>    <td><a href="#" class="delete-country" data-id="'),typeof country.regionId!="undefined"&&country.regionId!=null&&__.push($.encode(typeof country.regionId=="function"?country.regionId.call($item):country.regionId)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-group-countries.htm","Delete"))),__.push("<\/a><\/td>   <\/tr>   ")}),__.push("  <\/tbody> ")),__.push("");return __});jQuery.template("metadata-groups",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="form" style="display: inline">  '),typeof(typeof groups=="undefined"||Object.keys(groups).length===0)!="undefined"&&(typeof groups=="undefined"||Object.keys(groups).length===0)!=null&&(typeof(typeof groups=="undefined"||Object.keys(groups).length===0)=="function"?(typeof groups=="undefined"||Object.keys(groups).length===0).call($item):typeof groups=="undefined"||Object.keys(groups).length===0)?(__.push('   <select id="group-select" disabled="disabled">    <option value="">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-groups.htm","No any groups yet"))),__.push("<\/option>   <\/select>  ")):!0&&(__.push('   <select id="group-select">    '),typeof Object.keys!="undefined"&&Object.keys!=null&&$.each(Object.keys(groups),function(n,group){with(this)__.push('     <option value="'),typeof group!="undefined"&&group!=null&&__.push($.encode(typeof group=="function"?group.call($item):group)),__.push('" '),typeof(selected&&selected===group)!="undefined"&&(selected&&selected===group)!=null&&(typeof(selected&&selected===group)=="function"?(selected&&selected===group).call($item):selected&&selected===group)&&__.push('selected="selected"'),__.push(">"),typeof group!="undefined"&&group!=null&&__.push($.encode(typeof group=="function"?group.call($item):group)),__.push("<\/option>     ")}),__.push("   <\/select>  ")),__.push(' <\/div>  <br /> <br /> <a id="create-country-group" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-groups.htm","Add group"))),__.push("<\/a> "),typeof(typeof groups!="undefined"&&Object.keys(groups).length!==0)!="undefined"&&(typeof groups!="undefined"&&Object.keys(groups).length!==0)!=null&&(typeof(typeof groups!="undefined"&&Object.keys(groups).length!==0)=="function"?(typeof groups!="undefined"&&Object.keys(groups).length!==0).call($item):typeof groups!="undefined"&&Object.keys(groups).length!==0)&&(__.push(' <a id="delete-country-group" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-groups.htm","Delete group"))),__.push('<\/a> <a id="edit-country-group" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-groups.htm","Edit group"))),__.push('<\/a>  <div id="group-countries">  <h3>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-groups.htm","Countries in group"))),__.push('<\/h3>  <table class="knoema-table">   <\/table> <\/div> ')),__.push("  "),typeof(typeof groups!="undefined")!="undefined"&&typeof groups!="undefined"!=null&&(typeof(typeof groups!="undefined")=="function"?(typeof groups!="undefined").call($item):typeof groups!="undefined")&&(__.push(' <hr /> <a id="save-metadata" class="ui-button save-metadata">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-groups.htm","Save"))),__.push("<\/a> ")),__.push("");return __});jQuery.template("metadata-indicator-editor-dataset-filter",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<table>   <tr>    <td width="250px">     <div class="control-group">      <label for="Time">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-dataset-filter.htm","Time"))),__.push('<\/label>      <input id="Time" name="Time" value="'),typeof indicator.Time!="undefined"&&indicator.Time!=null&&__.push($.encode(typeof indicator.Time=="function"?indicator.Time.call($item):indicator.Time)),__.push('" class="text-box" disabled />      <div class="field-error" data-field="Time"><\/div>     <\/div>    <\/td>    <td valign="top">     <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-dataset-filter.htm","Dataset"))),__.push('<\/label>     <br />     <a href="#" class="dataset-id-container primary" data-region-dimension-id="'),typeof dataset.regionDimensionId!="undefined"&&dataset.regionDimensionId!=null&&__.push($.encode(typeof dataset.regionDimensionId=="function"?dataset.regionDimensionId.call($item):dataset.regionDimensionId)),__.push('" data-dataset-id="'),typeof dataset.id!="undefined"&&dataset.id!=null&&__.push($.encode(typeof dataset.id=="function"?dataset.id.call($item):dataset.id)),__.push('">'),typeof dataset.name!="undefined"&&dataset.name!=null&&__.push($.encode(typeof dataset.name=="function"?dataset.name.call($item):dataset.name)),__.push(", <em>"),typeof dataset.id!="undefined"&&dataset.id!=null&&__.push($.encode(typeof dataset.id=="function"?dataset.id.call($item):dataset.id)),__.push('<\/em><\/a>     <br /><br />     <a id="change-dataset" class="change-dataset ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-dataset-filter.htm","Change dataset"))),__.push('<\/a>     <a id="add-dataset" class="add-dataset ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-dataset-filter.htm","Add dataset"))),__.push('<\/a>    <\/td>   <\/tr>  <\/table>    <div class="container">   <div id="filter-members">    <div class="control-group">     <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-dataset-filter.htm","Filter members"))),__.push('<\/label>     <table class="knoema-table" id="Table1">      <thead>       <tr>        <th>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-dataset-filter.htm","Parameter"))),__.push("<\/th>        <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-dataset-filter.htm","Value"))),__.push("<\/th>       <\/tr>      <\/thead>      <tbody>       "),typeof indicator.Filter!="undefined"&&indicator.Filter!=null&&$.each(typeof indicator.Filter=="function"?indicator.Filter.call($item):indicator.Filter,function(n,filterEntry){with(this)__.push("       <tr>        <td>"),typeof filterEntry.Parameter!="undefined"&&filterEntry.Parameter!=null&&__.push($.encode(typeof filterEntry.Parameter=="function"?filterEntry.Parameter.call($item):filterEntry.Parameter)),__.push("<\/td>        <td>"),typeof filterEntry.Value!="undefined"&&filterEntry.Value!=null&&__.push($.encode(typeof filterEntry.Value=="function"?filterEntry.Value.call($item):filterEntry.Value)),__.push("<\/td>       <\/tr>       ")}),__.push('      <\/tbody>     <\/table>    <\/div>   <\/div>   <hr />   <a id="choose-dimension" class="choose-dimension ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-dataset-filter.htm","Configure filter"))),__.push("<\/a>  <\/div>");return __});jQuery.template("metadata-indicator-editor-datasets-tab-filter",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push("<h3>"),typeof dataset.name!="undefined"&&dataset.name!=null&&__.push($.encode(typeof dataset.name=="function"?dataset.name.call($item):dataset.name)),__.push('<\/h3>  <a id="change-dataset" class="change-dataset ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-datasets-tab-filter.htm","Change dataset"))),__.push('<\/a><a id="choose-dimension" class="choose-dimension ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-datasets-tab-filter.htm","Configure filter"))),__.push("<\/a>  "),typeof!addTime!="undefined"&&!addTime!=null&&(typeof!addTime=="function"?(!addTime).call($item):!addTime)&&(__.push('<a id="remove-dataset" class="remove-dataset ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-datasets-tab-filter.htm","Remove dataset"))),__.push("<\/a>")),__.push('  <label for="Scale" class="inline">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-datasets-tab-filter.htm","Unit Scale"))),__.push('   <select name="Scale" class="scale '),typeof addTime!="undefined"&&addTime!=null&&(typeof addTime=="function"?addTime.call($item):addTime)?__.push("primary"):!0&&__.push("secondary"),__.push('">    <option value="1" '),typeof(addTime&&indicator.Scale==1||!addTime&&indicator.SecondaryScale==1)!="undefined"&&(addTime&&indicator.Scale==1||!addTime&&indicator.SecondaryScale==1)!=null&&(typeof(addTime&&indicator.Scale==1||!addTime&&indicator.SecondaryScale==1)=="function"?(addTime&&indicator.Scale==1||!addTime&&indicator.SecondaryScale==1).call($item):addTime&&indicator.Scale==1||!addTime&&indicator.SecondaryScale==1)&&__.push('selected="selected"'),__.push('>1<\/option>    <option value="1000" '),typeof(addTime&&indicator.Scale==1e3||!addTime&&indicator.SecondaryScale==1e3)!="undefined"&&(addTime&&indicator.Scale==1e3||!addTime&&indicator.SecondaryScale==1e3)!=null&&(typeof(addTime&&indicator.Scale==1e3||!addTime&&indicator.SecondaryScale==1e3)=="function"?(addTime&&indicator.Scale==1e3||!addTime&&indicator.SecondaryScale==1e3).call($item):addTime&&indicator.Scale==1e3||!addTime&&indicator.SecondaryScale==1e3)&&__.push('selected="selected"'),__.push('>k<\/option>    <option value="1000000" '),typeof(addTime&&indicator.Scale==1e6||!addTime&&indicator.SecondaryScale==1e6)!="undefined"&&(addTime&&indicator.Scale==1e6||!addTime&&indicator.SecondaryScale==1e6)!=null&&(typeof(addTime&&indicator.Scale==1e6||!addTime&&indicator.SecondaryScale==1e6)=="function"?(addTime&&indicator.Scale==1e6||!addTime&&indicator.SecondaryScale==1e6).call($item):addTime&&indicator.Scale==1e6||!addTime&&indicator.SecondaryScale==1e6)&&__.push('selected="selected"'),__.push('>M<\/option>    <option value="1000000000" '),typeof(addTime&&indicator.Scale==1e9||!addTime&&indicator.SecondaryScale==1e9)!="undefined"&&(addTime&&indicator.Scale==1e9||!addTime&&indicator.SecondaryScale==1e9)!=null&&(typeof(addTime&&indicator.Scale==1e9||!addTime&&indicator.SecondaryScale==1e9)=="function"?(addTime&&indicator.Scale==1e9||!addTime&&indicator.SecondaryScale==1e9).call($item):addTime&&indicator.Scale==1e9||!addTime&&indicator.SecondaryScale==1e9)&&__.push('selected="selected"'),__.push('>B<\/option>   <\/select>  <\/label>  <br /><br />  <div class="container">   <div id="filter-members">    <div class="control-group">     <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-datasets-tab-filter.htm","Filter members"))),__.push('<\/label>     <table class="knoema-table" id="Table1">      <thead>       <tr>        <th>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-datasets-tab-filter.htm","Parameter"))),__.push("<\/th>        <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-datasets-tab-filter.htm","Value"))),__.push("<\/th>       <\/tr>      <\/thead>      <tbody>       "),typeof addTime!="undefined"&&addTime!=null&&(typeof addTime=="function"?addTime.call($item):addTime)&&(__.push('       <tr>        <td>Time<\/td>        <td id="indicator-time">'),typeof indicator.Time!="undefined"&&indicator.Time!=null&&__.push($.encode(typeof indicator.Time=="function"?indicator.Time.call($item):indicator.Time)),__.push("<\/td>       <\/tr>       ")),__.push("       "),typeof filter!="undefined"&&filter!=null&&$.each(typeof filter=="function"?filter.call($item):filter,function(n,filterEntry){with(this)__.push("       <tr>        <td>"),typeof filterEntry.Parameter!="undefined"&&filterEntry.Parameter!=null&&__.push($.encode(typeof filterEntry.Parameter=="function"?filterEntry.Parameter.call($item):filterEntry.Parameter)),__.push("<\/td>        <td>"),typeof filterEntry.Value!="undefined"&&filterEntry.Value!=null&&__.push($.encode(typeof filterEntry.Value=="function"?filterEntry.Value.call($item):filterEntry.Value)),__.push("<\/td>       <\/tr>       ")}),__.push("      <\/tbody>     <\/table>    <\/div>   <\/div>  <\/div>");return __});jQuery.template("metadata-indicator-editor-datasets-tab",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="ds-tabs">   <ul>    <li class="hidden"><a href="#dummy-tab"><\/a><\/li>    <li class="dataset-tab"><a href="#primary-source" class="dataset-id-container primary" data-dataset-id="'),typeof indicator.DatasetId!="undefined"&&indicator.DatasetId!=null&&__.push($.encode(typeof indicator.DatasetId=="function"?indicator.DatasetId.call($item):indicator.DatasetId)),__.push('" data-region-dimension-id="'),typeof indicator.RegionDimensionId!="undefined"&&indicator.RegionDimensionId!=null&&__.push($.encode(typeof indicator.RegionDimensionId=="function"?indicator.RegionDimensionId.call($item):indicator.RegionDimensionId)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-datasets-tab.htm","Primary source"))),__.push('<\/a><\/li>    <li class="dataset-tab"><a href="#secondary-source" class="dataset-id-container secondary" data-dataset-id="'),typeof indicator.SecondaryDatasetId!="undefined"&&indicator.SecondaryDatasetId!=null&&__.push($.encode(typeof indicator.SecondaryDatasetId=="function"?indicator.SecondaryDatasetId.call($item):indicator.SecondaryDatasetId)),__.push('" data-region-dimension-id="'),typeof indicator.SecondaryRegionDimensionId!="undefined"&&indicator.SecondaryRegionDimensionId!=null&&__.push($.encode(typeof indicator.SecondaryRegionDimensionId=="function"?indicator.SecondaryRegionDimensionId.call($item):indicator.SecondaryRegionDimensionId)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor-datasets-tab.htm","Secondary source"))),__.push('<\/a><\/li>   <\/ul>     <div id="dummy-tab">     <\/div>   <div id="primary-source" class="primary-source tab" data-dataset-id="'),typeof indicator.DatasetId!="undefined"&&indicator.DatasetId!=null&&__.push($.encode(typeof indicator.DatasetId=="function"?indicator.DatasetId.call($item):indicator.DatasetId)),__.push('">     <\/div>   <div id="secondary-source" class="secondary-source tab" data-dataset-id="'),typeof indicator.SecondaryDatasetId!="undefined"&&indicator.SecondaryDatasetId!=null&&__.push($.encode(typeof indicator.SecondaryDatasetId=="function"?indicator.SecondaryDatasetId.call($item):indicator.SecondaryDatasetId)),__.push('">       <\/div>  <\/div>');return __});jQuery.template("metadata-indicator-editor",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div id="indicator-editor" data-indicator-index="'),typeof indicatorIndex!="undefined"&&indicatorIndex!=null&&__.push($.encode(typeof indicatorIndex=="function"?indicatorIndex.call($item):indicatorIndex)),__.push('">   <div class="form">    <div class="form-grid">     <div class="form-grid-row">      <div class="control-group">       <label for="text-name">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor.htm","Name"))),__.push('<\/label>       <input type="text" name="Name" id="text-name" value="'),typeof indicator.Name!="undefined"&&indicator.Name!=null&&__.push($.encode(typeof indicator.Name=="function"?indicator.Name.call($item):indicator.Name)),__.push('" class="text-box" />       <div class="field-error" data-field="Name"><\/div>      <\/div>     <\/div>     <div class="form-grid-row">      <div class="form-grid">       <div class="form-grid-cell short-name-editor">        <div class="control-group inline-block">         <label for="text-short">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor.htm","Short name"))),__.push('<\/label>         <input type="text" name="ShortName" id="text-short" value="'),typeof indicator.ShortName!="undefined"&&indicator.ShortName!=null&&__.push($.encode(typeof indicator.ShortName=="function"?indicator.ShortName.call($item):indicator.ShortName)),__.push('" class="text-box short-wide" />         <div class="field-error" data-field="ShortName"><\/div>        <\/div>       <\/div>       <div class="form-grid-cell">        <div class="control-group inline-block keywords">         <label for="text-short">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor.htm","Keywords"))),__.push('<\/label>         <input type="text" name="Keywords" id="text-keywords" value="'),typeof indicator.Keywords!="undefined"&&indicator.Keywords!=null&&__.push($.encode(typeof indicator.Keywords=="function"?indicator.Keywords.call($item):indicator.Keywords)),__.push('" class="text-box short-wide" />        <\/div>       <\/div>      <\/div>     <\/div>     <div class="form-grid-row">      <div class="form-grid">       <div class="form-grid-cell unit-editor-cell">        <div class="unit-editor control-group">         <label for="text-unit">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor.htm","Unit"))),__.push('<\/label>         <input type="text" name="Unit" id="text-unit" value="'),typeof indicator.Unit!="undefined"&&indicator.Unit!=null&&__.push($.encode(typeof indicator.Unit=="function"?indicator.Unit.call($item):indicator.Unit)),__.push('" class="text-box" />         <br />         <input type="checkbox" id="SmallerIsBetter" name="SmallerIsBetter" '),typeof indicator.SmallerIsBetter!="undefined"&&indicator.SmallerIsBetter!=null&&(typeof indicator.SmallerIsBetter=="function"?indicator.SmallerIsBetter.call($item):indicator.SmallerIsBetter)&&__.push(' checked="checked" '),__.push(' />&nbsp;         <label for="SmallerIsBetter" class="inline">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor.htm","Smaller value is better"))),__.push('<\/label>         <label for="Precision" class="inline">          '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor.htm","Precision"))),__.push('          <select id="Precision" name="Precision">           <option value="0" '),typeof(indicator.Precision==0)!="undefined"&&indicator.Precision==0!=null&&(typeof(indicator.Precision==0)=="function"?(indicator.Precision==0).call($item):indicator.Precision==0)&&__.push(' selected="selected" '),__.push('>0<\/option>           <option value="1" '),typeof(indicator.Precision==1)!="undefined"&&indicator.Precision==1!=null&&(typeof(indicator.Precision==1)=="function"?(indicator.Precision==1).call($item):indicator.Precision==1)&&__.push(' selected="selected" '),__.push('>1<\/option>           <option value="2" '),typeof(indicator.Precision==2)!="undefined"&&indicator.Precision==2!=null&&(typeof(indicator.Precision==2)=="function"?(indicator.Precision==2).call($item):indicator.Precision==2)&&__.push(' selected="selected" '),__.push('>2<\/option>           <option value="3" '),typeof(indicator.Precision==3)!="undefined"&&indicator.Precision==3!=null&&(typeof(indicator.Precision==3)=="function"?(indicator.Precision==3).call($item):indicator.Precision==3)&&__.push(' selected="selected" '),__.push('>3<\/option>           <option value="4" '),typeof(indicator.Precision==4)!="undefined"&&indicator.Precision==4!=null&&(typeof(indicator.Precision==4)=="function"?(indicator.Precision==4).call($item):indicator.Precision==4)&&__.push(' selected="selected" '),__.push('>4<\/option>          <\/select>         <\/label>        <\/div>       <\/div>       <div class="form-grid-cell ">        <div class="desc-editor control-group">         <label for="text-desc">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicator-editor.htm","Description"))),__.push('<\/label>         <textarea name="Description" id="text-desc" rows="4" class="wide">'),typeof indicator.Description!="undefined"&&indicator.Description!=null&&__.push($.encode(typeof indicator.Description=="function"?indicator.Description.call($item):indicator.Description)),__.push('<\/textarea>         <div class="field-error" data-field="Description"><\/div>        <\/div>       <\/div>      <\/div>     <\/div>    <\/div>   <\/div>  <\/div>');return __});jQuery.template("metadata-indicators",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof(topic&&topic.Indicators)!="undefined"&&(topic&&topic.Indicators)!=null&&(typeof(topic&&topic.Indicators)=="function"?(topic&&topic.Indicators).call($item):topic&&topic.Indicators)&&(__.push('  <table class="knoema-table">   <thead>    <tr>     '),typeof checkbox!="undefined"&&checkbox!=null&&(typeof checkbox=="function"?checkbox.call($item):checkbox)&&__.push("<th><\/th>"),__.push("     <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicators.htm","Short name"))),__.push("<\/th>     <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicators.htm","Name"))),__.push("<\/th>     <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicators.htm","Unit"))),__.push('<\/th>     <th class="nowrap">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicators.htm","Time"))),__.push('<\/th>     <th class="nowrap">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicators.htm","Dataset"))),__.push('<\/th>     <th class="nowrap">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicators.htm","Precision"))),__.push('<\/th>     <th class="nowrap">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicators.htm","Actions"))),__.push('<\/th>    <\/tr>   <\/thead>   <tbody class="indicator">    '),typeof topic.Indicators!="undefined"&&topic.Indicators!=null&&$.each(typeof topic.Indicators=="function"?topic.Indicators.call($item):topic.Indicators,function(i,indicator){with(this)__.push('    <tr data-path="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('" data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-regionless="'),typeof topic.IsRegionless!="undefined"&&topic.IsRegionless!=null&&__.push($.encode(typeof topic.IsRegionless=="function"?topic.IsRegionless.call($item):topic.IsRegionless)),__.push('">     '),typeof checkbox!="undefined"&&checkbox!=null&&(typeof checkbox=="function"?checkbox.call($item):checkbox)&&(__.push('<td style="padding-left: 0"><input type="checkbox" value="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('"/><\/td>')),__.push('     <td style="padding-left: 6px">'),typeof indicator.ShortName!="undefined"&&indicator.ShortName!=null&&__.push($.encode(typeof indicator.ShortName=="function"?indicator.ShortName.call($item):indicator.ShortName)),__.push("<\/td>     <td>      "),typeof(indicator.Name=="")!="undefined"&&indicator.Name==""!=null&&(typeof(indicator.Name=="")=="function"?(indicator.Name=="").call($item):indicator.Name=="")?(__.push("       "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicators.htm",'-Empty field "Name"-'))),__.push("      ")):!0&&(__.push("       "),typeof indicator.Name!="undefined"&&indicator.Name!=null&&__.push($.encode(typeof indicator.Name=="function"?indicator.Name.call($item):indicator.Name)),__.push("      ")),__.push("     <\/td>     <td>"),typeof indicator.Unit!="undefined"&&indicator.Unit!=null&&__.push($.encode(typeof indicator.Unit=="function"?indicator.Unit.call($item):indicator.Unit)),__.push("<\/td>     <td>      "),typeof(indicator.Time!=null&&indicator.Time!="")!="undefined"&&(indicator.Time!=null&&indicator.Time!="")!=null&&(typeof(indicator.Time!=null&&indicator.Time!="")=="function"?(indicator.Time!=null&&indicator.Time!="").call($item):indicator.Time!=null&&indicator.Time!="")?(__.push("       "),typeof indicator.Time!="undefined"&&indicator.Time!=null&&__.push($.encode(typeof indicator.Time=="function"?indicator.Time.call($item):indicator.Time)),__.push("      ")):!0&&(__.push("       "),typeof indicator.Year!="undefined"&&indicator.Year!=null&&__.push($.encode(typeof indicator.Year=="function"?indicator.Year.call($item):indicator.Year)),__.push("      ")),__.push("      "),typeof(indicator.SecondaryFilter&&indicator.SecondaryFilter.length>0)!="undefined"&&(indicator.SecondaryFilter&&indicator.SecondaryFilter.length>0)!=null&&(typeof(indicator.SecondaryFilter&&indicator.SecondaryFilter.length>0)=="function"?(indicator.SecondaryFilter&&indicator.SecondaryFilter.length>0).call($item):indicator.SecondaryFilter&&indicator.SecondaryFilter.length>0)&&(__.push("      <br />       "),typeof indicator.SecondaryFilter!="undefined"&&indicator.SecondaryFilter!=null&&$.each(typeof indicator.SecondaryFilter=="function"?indicator.SecondaryFilter.call($item):indicator.SecondaryFilter,function(n,filter){with(this)__.push("        "),typeof(filter.Parameter=="Time")!="undefined"&&filter.Parameter=="Time"!=null&&(typeof(filter.Parameter=="Time")=="function"?(filter.Parameter=="Time").call($item):filter.Parameter=="Time")&&(__.push("        "),typeof filter.Value!="undefined"&&filter.Value!=null&&__.push($.encode(typeof filter.Value=="function"?filter.Value.call($item):filter.Value)),__.push("        ")),__.push("       ")}),__.push("      ")),__.push('     <\/td>     <td class="nowrap">      <a href="/'),typeof indicator.DatasetId!="undefined"&&indicator.DatasetId!=null&&__.push($.encode(typeof indicator.DatasetId=="function"?indicator.DatasetId.call($item):indicator.DatasetId)),__.push('">'),typeof indicator.DatasetId!="undefined"&&indicator.DatasetId!=null&&__.push($.encode(typeof indicator.DatasetId=="function"?indicator.DatasetId.call($item):indicator.DatasetId)),__.push("<\/a>      "),typeof indicator.SecondaryDatasetId!="undefined"&&indicator.SecondaryDatasetId!=null&&(typeof indicator.SecondaryDatasetId=="function"?indicator.SecondaryDatasetId.call($item):indicator.SecondaryDatasetId)&&(__.push('      <br />      <a href="/'),typeof indicator.SecondaryDatasetId!="undefined"&&indicator.SecondaryDatasetId!=null&&__.push($.encode(typeof indicator.SecondaryDatasetId=="function"?indicator.SecondaryDatasetId.call($item):indicator.SecondaryDatasetId)),__.push('">'),typeof indicator.SecondaryDatasetId!="undefined"&&indicator.SecondaryDatasetId!=null&&__.push($.encode(typeof indicator.SecondaryDatasetId=="function"?indicator.SecondaryDatasetId.call($item):indicator.SecondaryDatasetId)),__.push("<\/a>      ")),__.push("     <\/td>     <td>"),typeof indicator.Precision!="undefined"&&indicator.Precision!=null&&__.push($.encode(typeof indicator.Precision=="function"?indicator.Precision.call($item):indicator.Precision)),__.push('<\/td>     <td class="nowrap '),typeof indicator.ErrorMessage!="undefined"&&indicator.ErrorMessage!=null&&(typeof indicator.ErrorMessage=="function"?indicator.ErrorMessage.call($item):indicator.ErrorMessage)&&__.push("error"),__.push('">      <a href="#" class="edit-indicator" data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-path="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('" data-regionless="'),typeof topic.IsRegionless!="undefined"&&topic.IsRegionless!=null&&__.push($.encode(typeof topic.IsRegionless=="function"?topic.IsRegionless.call($item):topic.IsRegionless)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicators.htm","Edit"))),__.push('<\/a> |      <a href="#" class="delete-indicator" data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-path="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('" data-regionless="'),typeof topic.IsRegionless!="undefined"&&topic.IsRegionless!=null&&__.push($.encode(typeof topic.IsRegionless=="function"?topic.IsRegionless.call($item):topic.IsRegionless)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-indicators.htm","Delete"))),__.push("<\/a>      "),typeof indicator.ErrorMessage!="undefined"&&indicator.ErrorMessage!=null&&(typeof indicator.ErrorMessage=="function"?indicator.ErrorMessage.call($item):indicator.ErrorMessage)&&(__.push('      <img title="'),typeof indicator.ErrorMessage!="undefined"&&indicator.ErrorMessage!=null&&__.push($.encode(typeof indicator.ErrorMessage=="function"?indicator.ErrorMessage.call($item):indicator.ErrorMessage)),__.push('" alt="" src="/img/v3/search/info.png" />      ')),__.push("     <\/td>    <\/tr>    ")}),__.push("   <\/tbody>  <\/table>  ")),__.push("");return __});jQuery.template("metadata-project-form",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<hr />  <div class="form">   '),typeof projects!="undefined"&&projects!=null&&(typeof projects=="function"?projects.call($item):projects)&&(__.push('   <div class="select-holder">    <div id="title-holder" class="control-group">     <select name="Title" class="chzn-select">      <option><\/option>      '),typeof projects!="undefined"&&projects!=null&&$.each(typeof projects=="function"?projects.call($item):projects,function(n,project){with(this)__.push('      <option value="'),typeof project.Id!="undefined"&&project.Id!=null&&__.push($.encode(typeof project.Id=="function"?project.Id.call($item):project.Id)),__.push('">'),typeof project.Title!="undefined"&&project.Title!=null&&__.push($.encode(typeof project.Title=="function"?project.Title.call($item):project.Title)),__.push("<\/option>      ")}),__.push("     <\/select>    <\/div>   <\/div>   ")),__.push('   <div class="control-group">    <input id="topic-index" value="'),typeof topic.index!="undefined"&&topic.index!=null&&__.push($.encode(typeof topic.index=="function"?topic.index.call($item):topic.index)),__.push('" type="hidden" />    <input id="old-topic-column" value="'),typeof topic.Column!="undefined"&&topic.Column!=null&&__.push($.encode(typeof topic.Column=="function"?topic.Column.call($item):topic.Column)),__.push('" type="hidden" />    <input id="topic-cp-id" value="'),typeof topic.CollectionProjectId!="undefined"&&topic.CollectionProjectId!=null&&__.push($.encode(typeof topic.CollectionProjectId=="function"?topic.CollectionProjectId.call($item):topic.CollectionProjectId)),__.push('" type="hidden" />      <label for="topic-name">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-project-form.htm","Topic name"))),__.push('<\/label>    <input id="topic-name" class="text-box" type="text" name="Name" value="'),typeof topic.Name!="undefined"&&topic.Name!=null&&__.push($.encode(typeof topic.Name=="function"?topic.Name.call($item):topic.Name)),__.push('"/>        <select id="topic-column" name="Column" style="display: none">     <option value="0" selected><\/option>    <\/select>   <\/div>   <div class="control-group">    <label for="topic-description">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-project-form.htm","Topic description"))),__.push('<\/label>    <textarea id="topic-description">'),typeof topic.Description!="undefined"&&topic.Description!=null&&__.push($.encode(typeof topic.Description=="function"?topic.Description.call($item):topic.Description)),__.push("<\/textarea>   <\/div>  <\/div>");return __});jQuery.template("metadata-project-indicators",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof topic!="undefined"&&topic!=null&&(typeof topic=="function"?topic.call($item):topic)&&(__.push("  <p><\/p>  "),typeof(topic.SubTopics&&topic.SubTopics.length>0)!="undefined"&&(topic.SubTopics&&topic.SubTopics.length>0)!=null&&(typeof(topic.SubTopics&&topic.SubTopics.length>0)=="function"?(topic.SubTopics&&topic.SubTopics.length>0).call($item):topic.SubTopics&&topic.SubTopics.length>0)&&(__.push('  <table class="knoema-table">   <tbody class="subtopic">    '),typeof topic.SubTopics!="undefined"&&topic.SubTopics!=null&&$.each(typeof topic.SubTopics=="function"?topic.SubTopics.call($item):topic.SubTopics,function(i,subtopic){with(this)__.push('    <tr data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-path="structuredTopics['),typeof columnIndex!="undefined"&&columnIndex!=null&&__.push($.encode(typeof columnIndex=="function"?columnIndex.call($item):columnIndex)),__.push("]["),typeof topicIndex!="undefined"&&topicIndex!=null&&__.push($.encode(typeof topicIndex=="function"?topicIndex.call($item):topicIndex)),__.push(']">     <td class="group" style="width: 420px">      '),typeof subtopic.Name!="undefined"&&subtopic.Name!=null&&__.push($.encode(typeof subtopic.Name=="function"?subtopic.Name.call($item):subtopic.Name)),__.push("     <\/td>    <\/tr>    "),typeof(subtopic.Indicators&&subtopic.Indicators.length>0)!="undefined"&&(subtopic.Indicators&&subtopic.Indicators.length>0)!=null&&(typeof(subtopic.Indicators&&subtopic.Indicators.length>0)=="function"?(subtopic.Indicators&&subtopic.Indicators.length>0).call($item):subtopic.Indicators&&subtopic.Indicators.length>0)&&(__.push('    <tr class="not-topic">     <td style="padding-left: 0">      <table class="knoema-table">       <thead>        <tr>         <th>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-project-indicators.htm","Short name"))),__.push("<\/th>         <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-project-indicators.htm","Name"))),__.push("<\/th>         <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-project-indicators.htm","Unit"))),__.push('<\/th>         <th class="nowrap">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-project-indicators.htm","Dataset"))),__.push('<\/th>         <th>Actions<\/th>        <\/tr>       <\/thead>       <tbody class="indicator">        '),typeof subtopic.Indicators!="undefined"&&subtopic.Indicators!=null&&$.each(typeof subtopic.Indicators=="function"?subtopic.Indicators.call($item):subtopic.Indicators,function(j,indicator){with(this)__.push('        <tr data-path="structuredTopics['),typeof columnIndex!="undefined"&&columnIndex!=null&&__.push($.encode(typeof columnIndex=="function"?columnIndex.call($item):columnIndex)),__.push("]["),typeof topicIndex!="undefined"&&topicIndex!=null&&__.push($.encode(typeof topicIndex=="function"?topicIndex.call($item):topicIndex)),__.push("].SubTopics["),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push(']" data-index="'),typeof j!="undefined"&&j!=null&&__.push($.encode(typeof j=="function"?j.call($item):j)),__.push('">         <td style="padding-left: 6px">'),typeof indicator.ShortName!="undefined"&&indicator.ShortName!=null&&__.push($.encode(typeof indicator.ShortName=="function"?indicator.ShortName.call($item):indicator.ShortName)),__.push("<\/td>         <td>          "),typeof(indicator.Name=="")!="undefined"&&indicator.Name==""!=null&&(typeof(indicator.Name=="")=="function"?(indicator.Name=="").call($item):indicator.Name=="")?(__.push("           "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-project-indicators.htm",'-Empty field "Name"-'))),__.push("          ")):!0&&(__.push("           "),typeof indicator.Name!="undefined"&&indicator.Name!=null&&__.push($.encode(typeof indicator.Name=="function"?indicator.Name.call($item):indicator.Name)),__.push("          ")),__.push("         <\/td>         <td>"),typeof indicator.Unit!="undefined"&&indicator.Unit!=null&&__.push($.encode(typeof indicator.Unit=="function"?indicator.Unit.call($item):indicator.Unit)),__.push('<\/td>         <td class="nowrap"><a href="/'),typeof indicator.DatasetId!="undefined"&&indicator.DatasetId!=null&&__.push($.encode(typeof indicator.DatasetId=="function"?indicator.DatasetId.call($item):indicator.DatasetId)),__.push('">'),typeof indicator.DatasetId!="undefined"&&indicator.DatasetId!=null&&__.push($.encode(typeof indicator.DatasetId=="function"?indicator.DatasetId.call($item):indicator.DatasetId)),__.push('<\/a><\/td>         <td class="nowrap">          <a href="#" class="edit-indicator" data-index="'),typeof j!="undefined"&&j!=null&&__.push($.encode(typeof j=="function"?j.call($item):j)),__.push('" data-path="structuredTopics['),typeof columnIndex!="undefined"&&columnIndex!=null&&__.push($.encode(typeof columnIndex=="function"?columnIndex.call($item):columnIndex)),__.push("]["),typeof topicIndex!="undefined"&&topicIndex!=null&&__.push($.encode(typeof topicIndex=="function"?topicIndex.call($item):topicIndex)),__.push("].SubTopics["),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push(']">Edit description<\/a>         <\/td>        <\/tr>        ')}),__.push("       <\/tbody>      <\/table>     <\/td>    <\/tr>    ")),__.push("    ")}),__.push("   <\/tbody>  <\/table>  <br />  ")),__.push("  ")),__.push("");return __});jQuery.template("metadata-subtopics",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<table class="knoema-table">   <tbody class="subtopic">    '),typeof topic.SubTopics!="undefined"&&topic.SubTopics!=null&&$.each(typeof topic.SubTopics=="function"?topic.SubTopics.call($item):topic.SubTopics,function(i,subtopic){with(this)__.push('    <tr data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-path="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('">     <td class="group" style="width: 420px">      '),typeof subtopic.Name!="undefined"&&subtopic.Name!=null&&__.push($.encode(typeof subtopic.Name=="function"?subtopic.Name.call($item):subtopic.Name)),__.push('     <\/td>     <td class="group">      '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-subtopics.htm","Column"))),__.push(": "),typeof subtopic.Column!="undefined"&&subtopic.Column!=null&&__.push($.encode(typeof subtopic.Column=="function"?subtopic.Column.call($item):subtopic.Column)),__.push('     <\/td>     <td class="group">      <a href="#" class="edit" data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-path="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-subtopics.htm","Edit"))),__.push('<\/a> |      <a href="#" class="delete" data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-path="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-subtopics.htm","Delete subtopic"))),__.push('<\/a> |      <a href="#" class="add-indicator" data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-path="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-subtopics.htm","Add indicator(s)"))),__.push("<\/a>     <\/td>    <\/tr>    "),typeof(subtopic.Indicators&&subtopic.Indicators.length>0)!="undefined"&&(subtopic.Indicators&&subtopic.Indicators.length>0)!=null&&(typeof(subtopic.Indicators&&subtopic.Indicators.length>0)=="function"?(subtopic.Indicators&&subtopic.Indicators.length>0).call($item):subtopic.Indicators&&subtopic.Indicators.length>0)&&(__.push('    <tr class="not-topic">     <td colspan="3" style="padding-left: 0">      '),!0&&(__=__.concat($item.nest("metadata-indicators",{topic:subtopic,path:path+".SubTopics["+i+"]",checkbox:!0}))),__.push("     <\/td>    <\/tr>    ")),__.push("    ")}),__.push("   <\/tbody>  <\/table>");return __});jQuery.template("metadata-topic-form",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="form">      <div class="control-group">          <div class="input-block">              <label class="mtl-textbox">                  <input id="topic-name" type="text" class="mtl-textbox-input" name="Name" placeholder="&nbsp;" value="'),typeof topic.Name!="undefined"&&topic.Name!=null&&__.push($.encode(typeof topic.Name=="function"?topic.Name.call($item):topic.Name)),__.push('">                  <span class="mtl-textbox-label">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-form.htm","Topic name"))),__.push('<\/span>                  <span class="mtl-textbox-border"><\/span>              <\/label>          <\/div>          <input id="topic-index" value="'),typeof topic.index!="undefined"&&topic.index!=null&&__.push($.encode(typeof topic.index=="function"?topic.index.call($item):topic.index)),__.push('" type="hidden" />          <input id="topic-key" value="'),typeof topic.key!="undefined"&&topic.key!=null&&__.push($.encode(typeof topic.key=="function"?topic.key.call($item):topic.key)),__.push('" type="hidden" />          <input id="old-topic-column" value="'),typeof topic.Column!="undefined"&&topic.Column!=null&&__.push($.encode(typeof topic.Column=="function"?topic.Column.call($item):topic.Column)),__.push('" type="hidden" />      <\/div>   <div class="control-group">    <label for="topic-column">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-form.htm","Column"))),__.push('<\/label>    <select id="topic-column" name="Column">     '),typeof columns!="undefined"&&columns!=null&&$.each(typeof columns=="function"?columns.call($item):columns,function(i){with(this)__.push('     <option value="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" '),typeof(topic.Column==i)!="undefined"&&topic.Column==i!=null&&(typeof(topic.Column==i)=="function"?(topic.Column==i).call($item):topic.Column==i)&&__.push(" selected"),__.push(">"),typeof(i+1)!="undefined"&&i+1!=null&&__.push($.encode(typeof(i+1)=="function"?(i+1).call($item):i+1)),__.push("<\/option>     ")}),__.push("    <\/select>   <\/div>     "),typeof regionlessCheckbox!="undefined"&&regionlessCheckbox!=null&&(typeof regionlessCheckbox=="function"?regionlessCheckbox.call($item):regionlessCheckbox)?(__.push('   <div class="control-group">      <input id="was-topic-regionless" type="hidden" value="'),typeof!!topic.IsRegionless!="undefined"&&!!topic.IsRegionless!=null&&__.push($.encode(typeof!!topic.IsRegionless=="function"?(!!topic.IsRegionless).call($item):!!topic.IsRegionless)),__.push('" />    <label for="is-topic-regionless" id="is-topic-regionless-label">     <input id="is-topic-regionless" class="text-box" type="checkbox" name="IsRegionless" value="True" '),typeof topic.IsRegionless!="undefined"&&topic.IsRegionless!=null&&(typeof topic.IsRegionless=="function"?topic.IsRegionless.call($item):topic.IsRegionless)&&__.push(' checked="checked" '),__.push(" />     "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-form.htm","indicators in this topic do not have regional dimension"))),__.push("    <\/label>     <\/div>   ")):!0&&(__.push('    <input id="is-topic-regionless" class="text-box invisible" type="checkbox" name="IsRegionless" value="True" '),typeof topic.IsRegionless!="undefined"&&topic.IsRegionless!=null&&(typeof topic.IsRegionless=="function"?topic.IsRegionless.call($item):topic.IsRegionless)&&__.push(' checked="checked" '),__.push(' />    <input id="was-topic-regionless" type="hidden" value="'),typeof topic.IsRegionless!="undefined"&&topic.IsRegionless!=null&&(typeof topic.IsRegionless=="function"?topic.IsRegionless.call($item):topic.IsRegionless)?__.push("true"):!0&&__.push("false"),__.push('" />   ')),__.push("  <\/div>");return __});jQuery.template("metadata-topic-indicators",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof topic!="undefined"&&topic!=null&&(typeof topic=="function"?topic.call($item):topic)&&(__.push("   <h3>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-indicators.htm","Key indicators"))),__.push("<\/h3>   "),typeof topic.IsRegionless!="undefined"&&topic.IsRegionless!=null&&(typeof topic.IsRegionless=="function"?topic.IsRegionless.call($item):topic.IsRegionless)?(__.push("    "),!0&&(__=__.concat($item.nest("metadata-indicators",{topic:topic,path:"regionlessTopics["+topicIndex+"]"}))),__.push("   ")):!0&&(__.push("    "),!0&&(__=__.concat($item.nest("metadata-indicators",{topic:topic,path:"structuredTopics["+columnIndex+"]["+topicIndex+"]"}))),__.push("   ")),__.push('   <br />   <a id="add-indicator" class="ui-button" href="#">    '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-indicators.htm","Add indicator(s)"))),__.push('   <\/a>   <a id="add-subtopic" class="ui-button" href="#">    '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-indicators.htm","Add subtopic"))),__.push('   <\/a>   <a id="create-column" class="ui-button">    '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-indicators.htm","Add column"))),__.push("   <\/a>   <p><\/p>   "),typeof(topic.SubTopics&&topic.SubTopics.length>0)!="undefined"&&(topic.SubTopics&&topic.SubTopics.length>0)!=null&&(typeof(topic.SubTopics&&topic.SubTopics.length>0)=="function"?(topic.SubTopics&&topic.SubTopics.length>0).call($item):topic.SubTopics&&topic.SubTopics.length>0)&&(__.push("    "),!0&&(__=__.concat($item.nest("metadata-subtopics",{topic:topic,path:topic.IsRegionless?"regionlessTopics["+topicIndex+"]":"structuredTopics["+columnIndex+"]["+topicIndex+"]"}))),__.push('    <br />    <p class="indicators-selected">     '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-indicators.htm","Indicators selected"))),__.push(': <span>0<\/span>     <button id="apply-delete" class="ui-button" disabled>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-indicators.htm","Delete"))),__.push("<\/button>     "),typeof(topic.SubTopics.length>1)!="undefined"&&topic.SubTopics.length>1!=null&&(typeof(topic.SubTopics.length>1)=="function"?(topic.SubTopics.length>1).call($item):topic.SubTopics.length>1)&&(__.push("      "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-indicators.htm","or"))),__.push(' <button id="apply-move" class="ui-button" disabled>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-indicators.htm","Move"))),__.push("<\/button> "),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topic-indicators.htm","to"))),__.push('      <select id="select-subtopic" name="Subtopic" disabled>       '),typeof topic.SubTopics!="undefined"&&topic.SubTopics!=null&&$.each(typeof topic.SubTopics=="function"?topic.SubTopics.call($item):topic.SubTopics,function(i,subtopic){with(this)__.push('        <option value="'),typeof(topic.IsRegionless?"regionlessTopics["+topicIndex+"].SubTopics["+i+"]":"structuredTopics["+columnIndex+"]["+topicIndex+"].SubTopics["+i+"]")!="undefined"&&(topic.IsRegionless?"regionlessTopics["+topicIndex+"].SubTopics["+i+"]":"structuredTopics["+columnIndex+"]["+topicIndex+"].SubTopics["+i+"]")!=null&&__.push($.encode(typeof(topic.IsRegionless?"regionlessTopics["+topicIndex+"].SubTopics["+i+"]":"structuredTopics["+columnIndex+"]["+topicIndex+"].SubTopics["+i+"]")=="function"?(topic.IsRegionless?"regionlessTopics["+topicIndex+"].SubTopics["+i+"]":"structuredTopics["+columnIndex+"]["+topicIndex+"].SubTopics["+i+"]").call($item):topic.IsRegionless?"regionlessTopics["+topicIndex+"].SubTopics["+i+"]":"structuredTopics["+columnIndex+"]["+topicIndex+"].SubTopics["+i+"]")),__.push('">'),typeof subtopic.Name!="undefined"&&subtopic.Name!=null&&__.push($.encode(typeof subtopic.Name=="function"?subtopic.Name.call($item):subtopic.Name)),__.push("<\/option>       ")}),__.push("      <\/select>     ")),__.push("    <\/p>   ")),__.push("  ")),__.push("");return __});jQuery.template("metadata-topics-sorter",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="infomessage">   '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics-sorter.htm","Select desired column and reorder topics in it"))),__.push('  <\/div>    <select class="column-switcher">   '),typeof columns!="undefined"&&columns!=null&&$.each(typeof columns=="function"?columns.call($item):columns,function(i){with(this)__.push('    <option value="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics-sorter.htm","Column"))),__.push(" "),typeof(i+1)!="undefined"&&i+1!=null&&__.push($.encode(typeof(i+1)=="function"?(i+1).call($item):i+1)),__.push("<\/option>   ")}),__.push("   "),typeof(regionless&&regionless.length>1)!="undefined"&&(regionless&&regionless.length>1)!=null&&(typeof(regionless&&regionless.length>1)=="function"?(regionless&&regionless.length>1).call($item):regionless&&regionless.length>1)&&(__.push('    <option value="3">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics-sorter.htm","Regionless"))),__.push("<\/option>   ")),__.push('  <\/select>    <hr />    <div class="topics-holder">  <\/div>');return __});jQuery.template("metadata-topics",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div class="form" style="display: inline">   '),typeof(structuredTopics.length==0&&regionlessTopics.length==0)!="undefined"&&(structuredTopics.length==0&&regionlessTopics.length==0)!=null&&(typeof(structuredTopics.length==0&&regionlessTopics.length==0)=="function"?(structuredTopics.length==0&&regionlessTopics.length==0).call($item):structuredTopics.length==0&&regionlessTopics.length==0)?(__.push('    <div class="infomessage alert">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics.htm","Please create topic!"))),__.push('<\/div>    <select id="topic-select" disabled="disabled">     <option value="null">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics.htm","No any topics yet"))),__.push("<\/option>    <\/select>   ")):!0&&(__.push('    <select id="topic-select">     '),typeof structuredTopics!="undefined"&&structuredTopics!=null&&$.each(typeof structuredTopics=="function"?structuredTopics.call($item):structuredTopics,function(i,topics){with(this)__.push('      <optgroup label="Column '),typeof(i+1)!="undefined"&&i+1!=null&&__.push($.encode(typeof(i+1)=="function"?(i+1).call($item):i+1)),__.push('" data-column-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('">       '),typeof topics!="undefined"&&topics!=null&&$.each(typeof topics=="function"?topics.call($item):topics,function(j,topic){with(this)__.push('       <option value="'),typeof i.toString!="undefined"&&i.toString!=null&&__.push($.encode(i.toString()+j.toString())),__.push('" data-index="'),typeof j!="undefined"&&j!=null&&__.push($.encode(typeof j=="function"?j.call($item):j)),__.push('" data-column="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('">'),typeof topic.Name!="undefined"&&topic.Name!=null&&__.push($.encode(typeof topic.Name=="function"?topic.Name.call($item):topic.Name)),__.push("<\/option>        ")}),__.push("      <\/optgroup>     ")}),__.push("     "),typeof(regionlessTopics&&regionlessTopics.length>0)!="undefined"&&(regionlessTopics&&regionlessTopics.length>0)!=null&&(typeof(regionlessTopics&&regionlessTopics.length>0)=="function"?(regionlessTopics&&regionlessTopics.length>0).call($item):regionlessTopics&&regionlessTopics.length>0)&&(__.push('     <optgroup label="Regionless">      '),typeof regionlessTopics!="undefined"&&regionlessTopics!=null&&$.each(typeof regionlessTopics=="function"?regionlessTopics.call($item):regionlessTopics,function(i,topic){with(this)__.push('      <option value="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-regionless="true">'),typeof topic.Name!="undefined"&&topic.Name!=null&&__.push($.encode(typeof topic.Name=="function"?topic.Name.call($item):topic.Name)),__.push("<\/option>      ")}),__.push("     <\/optgroup>     ")),__.push('    <\/select>    <span class="indicators-total">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics.htm","Total number of indicators"))),__.push(':<\/span>    <a id="update-indicators" href="#">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics.htm","Update indicators"))),__.push("<\/a>   ")),__.push('  <\/div>    <br />  <br />  <a id="create-topic" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics.htm","Add topic"))),__.push("<\/a>  "),typeof isWDA!="undefined"&&isWDA!=null&&(typeof isWDA=="function"?isWDA.call($item):isWDA)&&(__.push('  <a id="create-topic-from-collection" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics.htm","Add Collection Project"))),__.push("<\/a>  ")),__.push("  "),typeof(structuredTopics.length!=0||regionlessTopics.length!=0)!="undefined"&&(structuredTopics.length!=0||regionlessTopics.length!=0)!=null&&(typeof(structuredTopics.length!=0||regionlessTopics.length!=0)=="function"?(structuredTopics.length!=0||regionlessTopics.length!=0).call($item):structuredTopics.length!=0||regionlessTopics.length!=0)&&(__.push('  <a id="delete-topic" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics.htm","Delete topic"))),__.push('<\/a>  <a id="edit-topic" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics.htm","Edit topic"))),__.push('<\/a>  <a id="reorder-topics" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics.htm","Reorder topics"))),__.push('<\/a>    <div id="topic-indicators">  <\/div>  ')),__.push("    "),typeof(structuredTopics.length>0||regionlessTopics.length>0)!="undefined"&&(structuredTopics.length>0||regionlessTopics.length>0)!=null&&(typeof(structuredTopics.length>0||regionlessTopics.length>0)=="function"?(structuredTopics.length>0||regionlessTopics.length>0).call($item):structuredTopics.length>0||regionlessTopics.length>0)&&(__.push('  <hr />  <a id="save-metadata" class="ui-button save-metadata">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-topics.htm","Save"))),__.push("<\/a>  ")),__.push("");return __});jQuery.template("metadata-update-indicators",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof(topic&&topic.Indicators)!="undefined"&&(topic&&topic.Indicators)!=null&&(typeof(topic&&topic.Indicators)=="function"?(topic&&topic.Indicators).call($item):topic&&topic.Indicators)&&(__.push('  <table class="knoema-table">   <thead>    <tr>     <th class="no-padding"><input type="checkbox" class="all"/><\/th>     <th>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-update-indicators.htm","Name"))),__.push('<\/th>     <th class="nowrap">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-update-indicators.htm","Old Dataset"))),__.push('<\/th>     <th class="nowrap">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-update-indicators.htm","New Dataset"))),__.push('<\/th>    <\/tr>   <\/thead>   <tbody class="indicator">    '),typeof topic.Indicators!="undefined"&&topic.Indicators!=null&&$.each(typeof topic.Indicators=="function"?topic.Indicators.call($item):topic.Indicators,function(i,indicator){with(this)__.push("    "),typeof(datasets[indicator.DatasetId]||datasets[indicator.SecondaryDatasetId])!="undefined"&&(datasets[indicator.DatasetId]||datasets[indicator.SecondaryDatasetId])!=null&&(typeof(datasets[indicator.DatasetId]||datasets[indicator.SecondaryDatasetId])=="function"?(datasets[indicator.DatasetId]||datasets[indicator.SecondaryDatasetId]).call($item):datasets[indicator.DatasetId]||datasets[indicator.SecondaryDatasetId])&&(__.push("    "),typeof indicator.ErrorMessage!="undefined"&&indicator.ErrorMessage!=null&&(typeof indicator.ErrorMessage=="function"?indicator.ErrorMessage.call($item):indicator.ErrorMessage)?(__.push('    <tr data-path="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('" data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" class="error">    ')):!0&&(__.push('    <tr data-path="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('" data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('">    ')),__.push('     <td class="no-padding"><input type="checkbox" value="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('" class="indicator"/><\/td>     <td>      '),typeof indicator.Name!="undefined"&&indicator.Name!=null&&__.push($.encode(typeof indicator.Name=="function"?indicator.Name.call($item):indicator.Name)),__.push('     <\/td>     <td class="nowrap">      '),typeof datasets[indicator.DatasetId]!="undefined"&&datasets[indicator.DatasetId]!=null&&(typeof datasets[indicator.DatasetId]=="function"?datasets[indicator.DatasetId].call($item):datasets[indicator.DatasetId])&&(__.push('      <a href="/'),typeof indicator.DatasetId!="undefined"&&indicator.DatasetId!=null&&__.push($.encode(typeof indicator.DatasetId=="function"?indicator.DatasetId.call($item):indicator.DatasetId)),__.push('">'),typeof indicator.DatasetId!="undefined"&&indicator.DatasetId!=null&&__.push($.encode(typeof indicator.DatasetId=="function"?indicator.DatasetId.call($item):indicator.DatasetId)),__.push("<\/a>      ")),__.push("      "),typeof datasets[indicator.SecondaryDatasetId]!="undefined"&&datasets[indicator.SecondaryDatasetId]!=null&&(typeof datasets[indicator.SecondaryDatasetId]=="function"?datasets[indicator.SecondaryDatasetId].call($item):datasets[indicator.SecondaryDatasetId])&&(__.push('      <br />      <a href="/'),typeof indicator.SecondaryDatasetId!="undefined"&&indicator.SecondaryDatasetId!=null&&__.push($.encode(typeof indicator.SecondaryDatasetId=="function"?indicator.SecondaryDatasetId.call($item):indicator.SecondaryDatasetId)),__.push('">'),typeof indicator.SecondaryDatasetId!="undefined"&&indicator.SecondaryDatasetId!=null&&__.push($.encode(typeof indicator.SecondaryDatasetId=="function"?indicator.SecondaryDatasetId.call($item):indicator.SecondaryDatasetId)),__.push("<\/a>      ")),__.push('     <\/td>     <td class="nowrap">      '),typeof datasets[indicator.DatasetId]!="undefined"&&datasets[indicator.DatasetId]!=null&&(typeof datasets[indicator.DatasetId]=="function"?datasets[indicator.DatasetId].call($item):datasets[indicator.DatasetId])&&(__.push('      <a href="/'),typeof datasets[indicator.DatasetId]!="undefined"&&datasets[indicator.DatasetId]!=null&&__.push($.encode(typeof datasets[indicator.DatasetId]=="function"?datasets[indicator.DatasetId].call($item):datasets[indicator.DatasetId])),__.push('">'),typeof datasets[indicator.DatasetId]!="undefined"&&datasets[indicator.DatasetId]!=null&&__.push($.encode(typeof datasets[indicator.DatasetId]=="function"?datasets[indicator.DatasetId].call($item):datasets[indicator.DatasetId])),__.push("<\/a>      ")),__.push("      "),typeof datasets[indicator.SecondaryDatasetId]!="undefined"&&datasets[indicator.SecondaryDatasetId]!=null&&(typeof datasets[indicator.SecondaryDatasetId]=="function"?datasets[indicator.SecondaryDatasetId].call($item):datasets[indicator.SecondaryDatasetId])&&(__.push('      <br />      <a href="/'),typeof datasets[indicator.SecondaryDatasetId]!="undefined"&&datasets[indicator.SecondaryDatasetId]!=null&&__.push($.encode(typeof datasets[indicator.SecondaryDatasetId]=="function"?datasets[indicator.SecondaryDatasetId].call($item):datasets[indicator.SecondaryDatasetId])),__.push('" class="secondary">'),typeof datasets[indicator.SecondaryDatasetId]!="undefined"&&datasets[indicator.SecondaryDatasetId]!=null&&__.push($.encode(typeof datasets[indicator.SecondaryDatasetId]=="function"?datasets[indicator.SecondaryDatasetId].call($item):datasets[indicator.SecondaryDatasetId])),__.push("<\/a>      ")),__.push("     <\/td>    <\/tr>    "),typeof indicator.ErrorMessage!="undefined"&&indicator.ErrorMessage!=null&&(typeof indicator.ErrorMessage=="function"?indicator.ErrorMessage.call($item):indicator.ErrorMessage)&&(__.push('    <tr class="error">     <td colspan="4">      '),typeof(typeof indicator.ErrorMessage=="string")!="undefined"&&typeof indicator.ErrorMessage=="string"!=null&&(typeof(typeof indicator.ErrorMessage=="string")=="function"?(typeof indicator.ErrorMessage=="string").call($item):typeof indicator.ErrorMessage=="string")?(__.push("       "),typeof indicator.ErrorMessage!="undefined"&&indicator.ErrorMessage!=null&&__.push($.encode(typeof indicator.ErrorMessage=="function"?indicator.ErrorMessage.call($item):indicator.ErrorMessage)),__.push("      ")):!0&&(__.push("       "),typeof indicator.ErrorMessage!="undefined"&&indicator.ErrorMessage!=null&&$.each(typeof indicator.ErrorMessage=="function"?indicator.ErrorMessage.call($item):indicator.ErrorMessage,function(i,error){with(this)__.push("        "),typeof(i+1)!="undefined"&&i+1!=null&&__.push($.encode(typeof(i+1)=="function"?(i+1).call($item):i+1)),__.push(". "),typeof error!="undefined"&&error!=null&&__.push($.encode(typeof error=="function"?error.call($item):error)),__.push("<br />       ")}),__.push("      ")),__.push("     <\/td>    <\/tr>    ")),__.push("    ")),__.push("    ")}),__.push("   <\/tbody>  <\/table>  ")),__.push("");return __});jQuery.template("metadata-update-subtopics",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<table class="knoema-table">   <tbody class="subtopic">    '),typeof topic.SubTopics!="undefined"&&topic.SubTopics!=null&&$.each(typeof topic.SubTopics=="function"?topic.SubTopics.call($item):topic.SubTopics,function(i,subtopic){with(this)__.push("    "),typeof(subtopic.Indicators&&subtopic.Indicators.length>0&&anyIndicators)!="undefined"&&(subtopic.Indicators&&subtopic.Indicators.length>0&&anyIndicators)!=null&&subtopic.Indicators&&subtopic.Indicators.length>0&&anyIndicators(subtopic.Indicators)&&(__.push('    <tr data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-path="'),typeof path!="undefined"&&path!=null&&__.push($.encode(typeof path=="function"?path.call($item):path)),__.push('">     <td class="group">      '),typeof subtopic.Name!="undefined"&&subtopic.Name!=null&&__.push($.encode(typeof subtopic.Name=="function"?subtopic.Name.call($item):subtopic.Name)),__.push('     <\/td>    <\/tr>    <tr class="not-topic">     <td class="no-padding">      '),!0&&(__=__.concat($item.nest("metadata-update-indicators",{topic:subtopic,path:path+".SubTopics["+i+"]",checkbox:!0,datasets:datasets}))),__.push("     <\/td>    <\/tr>    ")),__.push("    ")}),__.push("   <\/tbody>  <\/table>");return __});jQuery.template("metadata-update-topic-indicators",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof topic!="undefined"&&topic!=null&&(typeof topic=="function"?topic.call($item):topic)&&(__.push('   <a href="#" id="select-all">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-update-topic-indicators.htm","Select all indicators"))),__.push("<\/a>   "),typeof anyIndicators!="undefined"&&anyIndicators!=null&&anyIndicators.call($item,topic.Indicators)&&(__.push("    <h3>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-update-topic-indicators.htm","Key indicators"))),__.push("<\/h3>    "),typeof topic.IsRegionless!="undefined"&&topic.IsRegionless!=null&&(typeof topic.IsRegionless=="function"?topic.IsRegionless.call($item):topic.IsRegionless)?(__.push("     "),!0&&(__=__.concat($item.nest("metadata-update-indicators",{topic:topic,path:"regionlessTopics["+topicIndex+"]",checkbox:!0,datasets:datasets}))),__.push("    ")):!0&&(__.push("     "),!0&&(__=__.concat($item.nest("metadata-update-indicators",{topic:topic,path:"structuredTopics["+columnIndex+"]["+topicIndex+"]",checkbox:!0,datasets:datasets}))),__.push("    ")),__.push("   ")),__.push("   <p><\/p>   "),typeof(topic.SubTopics&&topic.SubTopics.length>0)!="undefined"&&(topic.SubTopics&&topic.SubTopics.length>0)!=null&&(typeof(topic.SubTopics&&topic.SubTopics.length>0)=="function"?(topic.SubTopics&&topic.SubTopics.length>0).call($item):topic.SubTopics&&topic.SubTopics.length>0)&&(__.push("    "),!0&&(__=__.concat($item.nest("metadata-update-subtopics",{topic:topic,path:topic.IsRegionless?"regionlessTopics["+topicIndex+"]":"structuredTopics["+columnIndex+"]["+topicIndex+"]",anyIndicators:anyIndicators,datasets:datasets}))),__.push("    <br />   ")),__.push("  ")),__.push("");return __});jQuery.template("metadata-update",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<a href="#" id="back-to-topics">« '),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-update.htm","Back to topics"))),__.push('<\/a>    <div class="form" style="display: inline">   <select id="topic-select">    '),typeof structuredTopics!="undefined"&&structuredTopics!=null&&$.each(typeof structuredTopics=="function"?structuredTopics.call($item):structuredTopics,function(i,topics){with(this)__.push('     <optgroup label="Column '),typeof(i+1)!="undefined"&&i+1!=null&&__.push($.encode(typeof(i+1)=="function"?(i+1).call($item):i+1)),__.push('" data-column-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('">      '),typeof topics!="undefined"&&topics!=null&&$.each(typeof topics=="function"?topics.call($item):topics,function(j,topic){with(this)__.push('      <option value="'),typeof i.toString!="undefined"&&i.toString!=null&&__.push($.encode(i.toString()+j.toString())),__.push('" data-index="'),typeof j!="undefined"&&j!=null&&__.push($.encode(typeof j=="function"?j.call($item):j)),__.push('" data-column="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('">'),typeof topic.Name!="undefined"&&topic.Name!=null&&__.push($.encode(typeof topic.Name=="function"?topic.Name.call($item):topic.Name)),__.push("<\/option>       ")}),__.push("     <\/optgroup>    ")}),__.push("    "),typeof(regionlessTopics&&regionlessTopics.length>0)!="undefined"&&(regionlessTopics&&regionlessTopics.length>0)!=null&&(typeof(regionlessTopics&&regionlessTopics.length>0)=="function"?(regionlessTopics&&regionlessTopics.length>0).call($item):regionlessTopics&&regionlessTopics.length>0)&&(__.push('     <optgroup label="Regionless">      '),typeof regionlessTopics!="undefined"&&regionlessTopics!=null&&$.each(typeof regionlessTopics=="function"?regionlessTopics.call($item):regionlessTopics,function(i,topic){with(this)__.push('      <option value="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-index="'),typeof i!="undefined"&&i!=null&&__.push($.encode(typeof i=="function"?i.call($item):i)),__.push('" data-regionless="true">'),typeof topic.Name!="undefined"&&topic.Name!=null&&__.push($.encode(typeof topic.Name=="function"?topic.Name.call($item):topic.Name)),__.push("<\/option>      ")}),__.push("     <\/optgroup>    ")),__.push('   <\/select>   <button id="indicators-update" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-update.htm","Update selected indicators"))),__.push('<\/button>   <span class="indicators-total">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/metadata-update.htm","Total number of outdated indicators"))),__.push(':<\/span>  <\/div>    <div id="topic-indicators">  <\/div>');return __});jQuery.template("provider-asset-editor",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div id="provider-asset-dialog" title="'),typeof title!="undefined"&&title!=null&&__.push($.encode(typeof title=="function"?title.call($item):title)),__.push('">  <label for="asset-name">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/provider-asset-editor.htm","Name"))),__.push('<\/label>  <input type="text" value="'),typeof name!="undefined"&&name!=null&&__.push($.encode(typeof name=="function"?name.call($item):name)),__.push('" id="asset-name"/>  <label for="asset-file-name">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/provider-asset-editor.htm","File Name"))),__.push('<\/label>  <input type="text" value="'),typeof fileName!="undefined"&&fileName!=null&&__.push($.encode(typeof fileName=="function"?fileName.call($item):fileName)),__.push('" id="asset-file-name" readonly="readonly"/> <\/div>');return __});jQuery.template("provider-insight-editor",function(n,t){var $=n,__=[],i=t.data;with(i)__.push('<div id="provider-insight-dialog" title="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/provider-insight-editor.htm","Add insight"))),__.push('">  <label for="insight-link">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/atlas/provider-insight-editor.htm","Link"))),__.push('<\/label>  <input type="text" value="" id="insight-link"/>  <div id="dialog-warning-message"><\/div> <\/div>');return __})