
$(function(){
    $('a.bookmark, a[@rel="bookmark"]').click(function(){
        return Bookmark.add(this);
    })
});

var Bookmark = {
    title   : document.title,
    url     : document.location,

    add : function (anchor)
    {
        if (window.external) {
              window.external.AddFavorite(this.url, this.title);

        } else if (window.sidebar) {
              window.sidebar.addPanel(this.title, this.url, '');

        } else if (window.opera) {
              anchor.rel = 'sidebar';
              anchor.href = '';
              return true;
        }
	      else
        {
		      alert('Unfortunately your browser doesn\'t support this feature. In order to bookmark this site please do so manually through your browser.');
	      }
        return false;
    }
};
