function seeNotification(elem){
var node=$(elem).parent().find('.notification-hidden');
var notif_id=node.attr("notifId")
var text=node.html();
var notifLink=node.attr("notifLink");
var linkText="";
if(notifLink!=undefined && notifLink!=null && notifLink!="null") linkText="
"+notifLink+"";
if(!$(elem).parent().hasClass("seen")){
$.ajax({
url: remoteAPIurl+'/api/v1/notification/'+notif_id+'?api_token='+token,
crossDomain: true,
type: "put",
dataType: 'json',
success: function(result, statusText, resObject){
$('[notifId="'+notif_id+'"]').parent().addClass("seen");
},
error: function() { console.log('error'); }
});
}
alert(text+linkText);
}
function getNotifications(category, offset){
var create_deferred = $.Deferred();
if(!offset) offset=0;
var limit=25;
$.ajax({
url: remoteAPIurl+'/api/v1/user/notifications?api_token='+token+"&limit="+limit+"&offset="+offset+"&category="+category,
crossDomain: true,
type: "get",
dataType: 'json',
success: function(result, statusText, resObject){
var counter=0;
$('.notifications .tab-pane').html('');
var tot_unpaging_record=result.tot_unpaging_record;
number_of_pages=Math.ceil(tot_unpaging_record/limit);
//$('.notifications .list-group li:not(:first-of-type)').remove();
//console.log(result.data);
$.each(result.data,function(id,elem){
counter++;
if(counter==1) var more_class="no-top-border";
else var more_class="";
notification_date=formatDate(elem.created_at);
var seen="";
if(elem.status==1) seen="seen";
$('.notifications .tab-'+category).append(
'