I've changed the original script's function a bit which I colored in red (changes) in the following code
Code:
function bookmarksite(){
title = document.title;
url = window.location.href;
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
Please note that the function doesn't have any arguments now so you can call it just like bookmarksite()
Example
Code:
<a href="javascript:bookmarksite();">Bookmark this site!</a>
Bookmarks