Dave Hawes Blog
It is all about delivering

Remove 'Add Existing xxxxx to this record' button - version 1

 
This is the code snippet that so many people have now used I wanted to have some kind of version control! Lets call this version 1. The latest version can be found on the original post:
 
 
HideAssociatedViewButton('new_business_new_surveys', 'Add existing Survey to this record');
HideAssociatedViewButton('new_account_new_eventinvite', 'Add existing Event Invite to this record'); 
 
function HideAssociatedViewButton(loadAreaId, buttonTitle)
{
    var navElement = document.getElementById('nav_' + loadAreaId);
    if (navElement != null)
    {
        navElement.onclick = function LoadAreaOverride()
        {
            // Call the original method to launch the navigation link
            loadArea(loadAreaId); 
 
            var associatedViewIFrame = document.getElementById(loadAreaId + 'Frame');
            if (associatedViewIFrame != null)
            {
                associatedViewIFrame.onreadystatechange = function HideTitledButton()
                {
                    if (associatedViewIFrame.readyState == 'complete')
                    {
                        var iFrame = frames[window.event.srcElement.id];
                        var liElements = iFrame.document.getElementsByTagName('li');
                        for (var i = 0; i < liElements.length; i++)
                        {
                            if (liElements[i].getAttribute('title') == buttonTitle)
                            {
                                liElements[i].style.display = 'none';
                                break;
                            }
                        }
                    }
                }
            }
        }
    }
}