function getTopicDataList(topicID,page) {
    $j('table#sourceListing').html('<tr><td><img src="http://i.szperus.pl/media/loading.gif" /><br /><br />Ładowanie elementów...</td></tr>');
    
    $j.ajax({
        type: "GET",
        url: "topic/getMyData/"+page+"/"+topicID,
        success: function(msg) {
            $j('table#sourceListing').html('');
            $j('table#sourceListing').html(msg);            
        }
    });
}

function addFavouriteTopic(topicID) {
    $j.ajax({
        type: "GET",
        url: "profile/addtopic/"+topicID+"/1",
        success: function(msg) {
            if (msg == 1) {
                $j('a#tuusun').show();
                $j('a#tudodaj').hide();
            } else { alert(msg); }
        }
    });
}

function delFavouriteTopic(topicID) {
    $j.ajax({
        type: "GET",
        url: "profile/deltopic/"+topicID+"/1",
        success: function(msg) {
            if (msg == 1) {
                $j('a#tuusun').hide();
                $j('a#tudodaj').show();
            } else { alert(msg); }
        }
    });
}

function addSubTopic(topicID) {
    $j.ajax({
        type: "GET",
        url: "profile/addtopic/"+topicID+"/2",
        success: function(msg) {
            if (msg == 1) {
                $j('a#tousun').show();
                $j('a#tododaj').hide();
            } else { alert(msg); }
        }
    });
}

function delSubTopic(topicID) {
    $j.ajax({
        type: "GET",
        url: "profile/deltopic/"+topicID+"/2",
        success: function(msg) {
            if (msg == 1) {
                $j('a#tousun').hide();
                $j('a#tododaj').show();
            } else { alert(msg); }
        }
    });
}
