//Edit by ThanhDC
var objClicked = null;
$j(document).ready(function(){
$j('.fs_follow_icon a').click(function(){
objClicked = this;
});
if(typeof contact_importer != 'undefined' && contact_importer != ""){
tb_show("Kết nối bạn bè",my_base_url+my_pligg_base+"/actions/connect/thickboxConnect.php?contact_importer="+contact_importer+"&height=469&width=512&", "");
}
});
// Send invitation to friend on 360
function send360Invite() {
$j('#send_invite').attr('disabled', 'disabled');
$j(".thickbox_ajaxload_wait1").show();
var user = $j("#owner_username").val();
var pass = $j("#owner_password").val();
var url = $j("#friend_url").val();
var msg = encodeURIComponent($j("#invite_comment").val());
$j.ajax({
type: "POST",
url: my_base_url+my_pligg_base+"/ajaxFriendInviteSender",
data: "frurl="+url+"&comment="+msg+"&usr="+user+"&pwd="+pass,
success: function(result) {
if (/ERROR/.test(result)) {
result = result.substring(7, result.length);
window.alert(result);
} else {
$j("#send_report").show();
$j("#box_send_invite").hide();
$j(".thickbox_ajaxload_wait1").hide();
}
}
});
}
/* View followers on Follow Suggestion */
function getFollowers(id) {
$j("#ajaxLoading").show();
$j.ajax({
type: "POST",
url: my_base_url+my_pligg_base+"/actions/connect/ajaxFollowSuggestionGetFollowers.php",
data: "id="+id,
success: function(result) {
if (/ERROR/.test(result)) {
result = result.substring(7, result.length);
window.alert(result);
} else {
$j("#gs-followers-"+id).html(result);
}
$j("#ajaxLoading").hide();
}
});
return false;
}
/* Follow a Follow Suggestion */
function followSuggestion(id) {
$j("#ajaxLoading").show();
$j.ajax({
type: "POST",
url: my_base_url+my_pligg_base+"/ajaxFriendFollow",
data: "to_id="+id,
success: function(result) {
if (/ERROR/.test(result)) {
result = result.substring(7, result.length);
$j("#ajaxLoading").hide();
window.alert(result);
} else {
$j("#ajaxLoading").hide();
$j("#gs-follow-"+id).html("Đã quan tâm");
removeFollowSuggestion(id);
}
}
});
return false;
}
/* Hide and load another Channel Suggestion */
function removeChannelSuggestion(id) {
$j("#ajaxLoading").show();
$j("#gs-suggestion-"+id).fadeOut(1000);
$j.ajax({
type: "POST",
url: my_base_url+my_pligg_base+"/actions/connect/ajaxChannelSuggestionRemove.php",
data: "id="+id,
success: function(result) {
if (/ERROR/.test(result)) {
result = result.substring(7, result.length);
window.alert(result);
} else {
if (result!="NA") {
$j("#gs-suggestion-container").html(result);
} else {
$j("#gs_widget").hide();
}
}
$j("#ajaxLoading").hide();
}
});
return false;
}
/* View subscribers on Channel Suggestion */
function getChannelSubscribers(id) {
$j("#ajaxLoading").show();
$j.ajax({
type: "POST",
url: my_base_url+my_pligg_base+"/actions/connect/ajaxChannelSuggestionGetSubscribers.php",
data: "id="+id,
success: function(result) {
if (/ERROR/.test(result)) {
result = result.substring(7, result.length);
window.alert(result);
} else {
$j("#gs-followers-"+id).html(result);
}
$j("#ajaxLoading").hide();
}
});
return false;
}
/* Subscribe a Channel Suggestion */
function subscribeChannelSuggestion(id) {
$j("#ajaxLoading").show();
$j.ajax({
type: "POST",
url: my_base_url+my_pligg_base+"/ajaxChannelSubcribe",
data: "id="+id,
success: function(result) {
if (/ERROR/.test(result)) {
result = result.substring(7, result.length);
$j("#ajaxLoading").hide();
window.alert(result);
} else {
$j("#ajaxLoading").hide();
$j("#gs-follow-"+id).html("Đã quan tâm");
removeChannelSuggestion(id);
}
}
});
return false;
}