﻿function doRequestFollow(name)
{
  $.ajax(
    {
      url: "/ajax/DoRequestFollow.ashx",
      type: "POST",
      data: { name: name },
      cache: false,
      dataType: 'json',
      timeout: 10000,
      success: function(jsonObj){
        defaultCallback(jsonObj);
        }
     }
   );
}

function removeFollow(name)
{
  $('#removeQuestion h2').html('Biztos nem követed tovább?');
  $.blockUI({ message: $('#removeQuestion') });
 
  $('#rmpqYes').click(function()
    {
      doRemoveFollow(name, true);
      return false;
    }
  ); 

  $('#rmpqNo').click(function()
    {
      $.unblockUI(); 
      return false;
    }
  );
}

function doRemoveFollow(name, isList)
{
  $.ajax(
    {
      url: "/ajax/DoRemoveFollow.ashx",
      type: "POST",
      data: { name: name, islist: isList },
      cache: false,
      dataType: 'json',
      timeout: 10000,
      success: function(jsonObj){
        defaultCallback(jsonObj);
        }
     }
   );
}

////////////////////////////////////////////////////////////////////////////

function removeFollower(from, followerId)
{
  $('#removeQuestion h2').html('Biztosan törlöd a követőt?');
  $.blockUI({ message: $('#removeQuestion') });
 
  $('#rmpqYes').click(function()
    {
      doRemoveFollower(from, followerId);
      return false;
    }
  ); 

  $('#rmpqNo').click(function()
    {
      $.unblockUI(); 
      return false;
    }
  );
}

function doRemoveFollower(from, followerId)
{
  $.ajax(
    {
      url: "/ajax/DoRemoveFollower.ashx",
      type: "POST",
      data: {
              currentUrl: location.href,
              from: from,
              followerId: followerId
            },
      cache: false,
      dataType: 'json',
      timeout: 10000,
      success: function(jsonObj){
        defaultCallback(jsonObj);
        }
     }
   );
}
