function AddToGallery(product_id, url, logged_in)
{
  if (true === logged_in)
  {
    menuSlider.Start(product_id, url);
  }
  else
  {
    $('account_action_message').show();
    $('account_action_message').update('<span class="error_message">You must be <a href="/account">logged in</a> to add a an item to your gallery</span>');
  }
  
  window.Timer = setTimeout("$('account_action_message').hide();", 3000);
  
  return false;
}

function BookmarkPage(logged_in)
{
  if (true === logged_in)
  {
    new Ajax.Request('/ajax/account/interests/add_bookmark/', {
      method: 'post',
      onSuccess: function(transport)
      {
        var json = transport.responseText.evalJSON();
        $('account_action_message').show();
        $('account_action_message').update(json.result);
      },
      onFailure: function(transport, jsonreponse)
      {
        alert('The request has taken longer than normal to load, please try again.\n\nIf the problem persists please contact the administrator.');
      },
      onException: function()
      {
        alert('An error has occured while processing your request, please try again.\n\nIf the problem persists please contact the administrator.');
      }
    });
  }
  else
  {
    $('account_action_message').show();
    $('account_action_message').update('<span class="error_message">You must be <a href="/account">logged in</a> to add a bookmark</span>');
  }
  
  window.Timer = setTimeout("$('account_action_message').hide();", 3000);
  
  return false;
}

function WatchArtist(artist_id, logged_in)
{
  if (true === logged_in)
  {
    new Ajax.Request('/ajax/account/interests/watch_artist/', {
      method: 'post',
      parameters: {
        w: artist_id
      } ,
      onSuccess: function(transport)
      {
        var json = transport.responseText.evalJSON();
        $('account_action_message').show();
        $('account_action_message').update(json.result);
      },
      onFailure: function(transport, jsonreponse)
      {
        alert('The request has taken longer than normal to load, please try again.\n\nIf the problem persists please contact the administrator.');
      },
      onException: function()
      {
        alert('An error has occured while processing your request, please try again.\n\nIf the problem persists please contact the administrator.');
      }
    });
  }
  else
  {
    $('account_action_message').show();
    $('account_action_message').update('<span class="error_message">You must be <a href="/account">logged in</a> to add a watched artist</span>');
  }
  
  window.Timer = setTimeout("$('account_action_message').hide();", 3000);
  
  return false;
}