/*

Small script used to generate a browser bookmark link. Currently, it makes a bookmark link for IE, but only a popup "CTRL-D" or "CTRL-T" message for Firefox and Opera.

Note: the variables bookmarkTitle and bookmarkUrl must be set before this is called. In our Modx setup, the best way is to set them in the header using the linkSubmissionUrl snippet we defined. For example, place the following in the HTML head:

<script type="text/javascript">
var bookmarkTitle = "[[linkSubmissionURL? &field=`title`]]";
var bookmarkUrl = "[[linkSubmissionURL]]";
</script>

*/


 function AddBrowserBookmark() {

 //title = "[[linkSubmissionURL? &field=`title`]]"; 
  // Blogger - Replace with <$BlogItemTitle$> 
  // MovableType - Replace with <$MTEntryTitle$>

 //url = "[[linkSubmissionURL]]";
  // Blogger - Replace with <$BlogItemPermalinkURL$> 
  // MovableType - Replace with <$MTEntryPermalink$>
  // WordPress - <?php bloginfo('url'); ?>


        if (window.sidebar) { // Mozilla Firefox Bookmark

        // changed to add a popup message because addPanel makes a bookmark point to the side panel in Firefox
        //      window.sidebar.addPanel(title, url,"");

                alert('Hit CTRL-D to bookmark this page');

	} else if( window.external ) { // IE Favorite

		window.external.AddFavorite( bookmarkUrl, bookmarkTitle);

	} else if(window.opera && window.print) { // Opera Hotlist

		alert('Hit CTRL-T to bookmark this page');
	}
}


function CreateBookmarkLink () { 

if (window.sidebar) {

  document.write('<a class="firefoxBookmarkLink" href="javascript:AddBrowserBookmark();">Bookmark Page</a>');

} else if (window.external) {

  document.write('<a class="ieBookmarkLink" href="javascript:AddBrowserBookmark();">Add to Favorites</a>');

} else if (window.opera && window.print) {

   document.write('<a class="operaBookmarkLink" href="javascript:AddBrowserBookmark();">Add Bookmark</a>');

}

}
