
/* opens FriendsRequestDialog */
function requestFriend( labelCancel, username, userId )
{
  // set the user-Id in our form
  $('relation_to_asset_id').value = userId;
  
  Dialog.alert( $('friendsRequest').innerHTML, 
                { 
                  className:"alphacube", width:600, okLabel: labelCancel
                }
  );

  // set username, which we wanna add
  $('friendsName').innerHTML = username;
  
  // hide ok-button, he is just closing the window and at this moment useless.
  $$('.alphacube_buttons').invoke( 'hide' );
  
}

/* This function is called when hits send-button */
function sendFriendsRequest()
{
  $('friendsRequestForm').submit();
  document.getElementById('friendsRequestStatus').style.visibility = 'visible';

  Dialog.okCallback();
}


function showRequestResult( userId )
{
  // show progressbar
  //top.$('#friendsRequestResult').invoke( 'show' );
  //top.document.getElementById('friendsRequestResult').style.display = 'block';

  //load new status
  top.document.getElementById('friendStatus'+userId).style.display  = 'none';
  top.document.getElementById('friendWaiting'+userId).style.display = 'block';
}

function checkFriendsBoxes()
{
  $$('#friendsList input').each(function(o){o.checked = $('mark').checked;}); 
}