/**
 * Opens Account Profile popover
 */
function openAccountProfile(link) {
    var container = $('account_profile');
  
    profileDraggable = new Draggable(container, {
        handle:'account_profile_handle',
        starteffect:false,
        endeffect:false
    });
  
    var top = document.viewport.getScrollOffsets().top;
    Element.setStyle($('account_profile'), {top: 100 + top + 'px'});
    var arrayPageSize = getPageSize();

    var url = link;
    
    new Ajax.Updater('account_profile_body', url, {method: 'get'});

    container.setStyle({zIndex: "99999"});   
    container.show(); 
}

/** 
 * Closes modal window.
 */
function closeAccountProfile() {
  profileDraggable.destroy();
  
  $('account_profile').hide();
}

