$('ul.user_contextmenu').superfish({   
  delay:      500,
  animation:  {opacity:'show',height:'show'},
  speed:      'normal',
  dropShadows: true,
  autoArrows:   false 
});

// Track open context menu
var open_cmenu = null;

// Open the child context menu when the item is click
function open_context_menu( pParentElement )
{
  child = $(pParentElement).children("ul");


  // If we were not the old menu
  if( child.position().top < 0 )
  {
	  // Close old menu
	  if( open_cmenu != null )
	  {
	    open_cmenu.css('top', -9999);
	  }
  
    // This is our new active menu
    open_cmenu = child;
    child.css('top', '1.1em');
    child.css('z-index', '99');
   }
  else
  {
    // Null out the menu since we are closing it
    open_cmenu = null;
    child.css('top', -9999);
    child.css('z-index', '1');
  }
    
  return false;
}

function cm_request_friendship( pRequestUrl, pMessage )
{
  // Send the AJAX request
  $.ajax({ url: pRequestUrl,
           success: function(){
             var $dialog = $('<div></div>').html(pMessage).dialog({title: 'Friendship Request'});
           }
         });
}
