/*
 * jQuery quick bookmark-this-page
 * http://anny.fm/ 2010
 * Ripped off from 
http://calisza.wordpress.com/2008/11/03/javascript-jquery-bookmark-script/
 *
 */

(function($)
{

  // Create jqobject.
	$.fn.bookmarker = function()
	{
		return this.each(function()
		{
		  // Init jqobject.
		  init( $(this) );
		});
	};

  // Init function for jqobject.
  function init( bookmark ) { bookmark.click( function()
  {
    if( $.browser.msie )
    {
      // Standard.
      window.external.AddFavorite( url, title );
    }
    else if( $.browser.opera )
    {
      // Exploit sidebar rel.
      $(this).attr("rel","sidebar");
      return true;
    }
    else
    {
      // Safari/Firefox don't allow this kind of bookmarking.
      alert( "Your browser does not support this action. Please bookmark this page manually." );
    }

    return false;

  });}

})(jQuery);


