');
}else{
var index=0;
$("#events").empty();
$.each(data, function(text, val) {
index++;
var title = val['Title'];
title= decodeBase64(title);// decodeBase64(val['Title']);
//title = title.replace('
','')
title =title.replace(/
/gi, '');
title =title.replace(/<\/br>/gi, '');
var subtitle = val['SubTitle'];
subtitle= decodeBase64(subtitle);// decodeBase64(val['Title']);
subtitle =subtitle.replace(/
/gi, '');
subtitle =subtitle.replace(/<\/br>/gi, '');
subtitle =subtitle.replace('(','');
subtitle =subtitle.replace(')','');
//subtitle =subtitle.replace(/\)/gi, '');
meetingcode=(val['MeetingCode']);
mydate= val['StartDate'];
var arr=mydate.split('/');
var monthname= $('#month').find('option[value=' + arr[1] + ']').text();
startdate = arr[0] + "-" + monthname + "-" + arr[2] ;
mydate= val['EndDate'];
arr=mydate.split('/');
monthname= $('#month').find('option[value=' + arr[1] + ']').text();
enddate = arr[0] + "-" + monthname + "-" + arr[2] ;
var respofficer = val['RespOfficer'];
respofficer=decodeBase64(val['RespOfficer']);
var country = val['Country'];
country=decodeBase64(country);
city=val['City'];
var languages = val['Languages'];
languages=decodeBase64(languages);
//alert(title);
link=(val['Link']);
$("#events").append('
');
if (link!=''){
title = "
"+title+"";
}else{
title = title ;
}
$("#meeting_"+index).append('
'+title+'
');
$("#meeting_"+index).append('
'+subtitle+" "+languages+'
');
$("#meeting_"+index).append('
'+city+', '+country+' '+startdate+' / '+enddate+'
');
$("#meeting_"+index).append('
'+labels[0]+' '+respofficer+'
');
$("#meeting_"+index).append('
'+labels[1]+' '+meetingcode+'
');
})
}
})
};
// $("select").selectbox('detach');
/** ***************************************************************************************************/
// public method for decoding
function decodeBase64(input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
while (i < input.length) {
enc1 = _keyStr.indexOf(input.charAt(i++));
enc2 = _keyStr.indexOf(input.charAt(i++));
enc3 = _keyStr.indexOf(input.charAt(i++));
enc4 = _keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output = output + String.fromCharCode(chr1);
if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
}
output = _utf8_decodeBase64(output);
return output;
};
// private method for UTF-8 decoding
_utf8_decodeBase64 = function (utftext) {
var string = "";
var i = 0;
var c = c1 = c2 = 0;
while ( i < utftext.length ) {
c = utftext.charCodeAt(i);
if (c < 128) {
string += String.fromCharCode(c);
i++;
}
else if((c > 191) && (c < 224)) {
c2 = utftext.charCodeAt(i+1);
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
}
else {
c2 = utftext.charCodeAt(i+1);
c3 = utftext.charCodeAt(i+2);
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return string;
} ;
// $("select").selectbox('attach');
});