Something like this should work:
function AddToFavorites(obj, title, url){
if(window.sidebar){
window.sidebar.addPanel(title, url,"");
return false;
} else if(window.external){
window.external.AddFavorite( url, title);
return false;
} else if(window.opera && window.print){
obj.setAttribute('href',url);
obj.setAttribute('title',title);
obj.setAttribute('rel','sidebar');
obj.click();
return false;
}
}
Call it as follows:
<a href="#" onclick="AddToFavorites(this, 'your title', 'your url');">Bookmark This Page</a>