function totalCountry(e) {
	  var data__ = e.data;

      //select data set of current year and find current selected country
      // var found = -1;
      // data__.data[data__.currentPos].data.forEach(function(k,i) { if(k.name == data__.currentCountry) found = i; });
      // if(found!=-1) {
        // var all_tas = data__.data[data__.currentPos].data[found].ta_total_arr;
        var all_tas = data__.total_arr;
        // console.log(all_tas);
        var all_tas_arr = [];
        all_tas.forEach(function(k,i) {
          var found = -1;
          data__.data_tas.forEach(function(l,m) { if(l.id == k) found = l; });
          if(found != -1) all_tas_arr.push({id:k,year:found.year});
        });

        postMessage({'cmd':'totalCountryBack','data':all_tas_arr});
      // }
	}
// get all ids and suitable years for all ftas for the selected country to the selected year
get all ids and suitable years for all ftas for the selected country to the selected year
get all ids and suitable years for all ftas for the selected country to the selected year
function totalCountry(e) {
	  var data__ = e.data;
        var all_tas = data__.total_arr;
        var all_tas_arr = [];
        all_tas.forEach(function(k,i) {
          var found = -1;
          data__.data_tas.forEach(function(l,m) { if(l.id == k) found = l; });
          if(found != -1) all_tas_arr.push({id:k,year:found.year});
        });
        postMessage({'cmd':'totalCountryBack','data':all_tas_arr});
	}
function totalCountry ( e ) { var data__ = e . data ; var all_tas = data__ . total_arr ; var all_tas_arr = [ ] ; all_tas . forEach ( function ( k , i ) { var found = - 1 ; data__ . data_tas . forEach ( function ( l , m ) { if ( l . id == k ) found = l ; } ) ; if ( found != - 1 ) all_tas_arr . push ( { id : k , year : found . year } ) ; } ) ; postMessage ( { 'cmd' : 'totalCountryBack' , 'data' : all_tas_arr } ) ; }
get all ids and suitable years for all ftas for the selected country to the selected year
get all ids and suitable years for all ftas for the selected country to the selected year
//select data set of current year and find current selected country // var found = -1; // data__.data[data__.currentPos].data.forEach(function(k,i) { if(k.name == data__.currentCountry) found = i; }); // if(found!=-1) { // var all_tas = data__.data[data__.currentPos].data[found].ta_total_arr; // console.log(all_tas); // }