/*
 *  social-bookmarking.js
 *  Version 0.1
 *  Hugo Haas - http://larve.net/people/hugo/
 *  {home of social-bookmarking.js here}/
 *  Copyright (c) 2006 Hugo Haas
 *  License: GPL 2
 *
 *  This code is based on wp-notable 1.4 by Cal Evans.
 *  The images used are from the plugin.
 *
 *  Below is the copyright information from wp-notable.
 */

/*
Plugin Name: wp-notable
Plugin URI: http://www.calevans.com/view.php/page/notable
Version: 1.14
Description: Add social bookmark links to each blog entry.
Author: Cal Evans
Author URI: http://blog.calevans.com
*/

/*
 * Copyright 2006  Cal Evans
 * Thanks to Kirk Montgomery  (email : webmaster@maxpower.ca) for the graphics.
 *  
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * Modifications by John Griogair Bell jgbell@hermetic.com
 * Changes released under the same conditions
 */

// Replace with your URL here
// var image_dir="inc/images/";
var image_dir="/images/social_networking_iconpack";
function add_tool(icon, name, url) {
  var t = '<span class="socialAddButton" id="socialAddButton-' + icon + '"><a target="_blank" href="' + url + '" title="Add to ' + name +'"><img border=0 src="' + image_dir + '/' + icon + '_32.png" alt="' + name + '" /></a></span> ';
  return t;
}
function add_tool2(icon, name) {
  var t = '<span class="socialAddButton" id="socialAddButton-' + icon + '"><a target="_blank" href="#" onclick="Evernote.doClip({contentId:container,code:hermeticlibrary}); return false;" title="Add to ' + name +'"><img border=0 src="' + image_dir + '/' + icon + '_32.png" alt="' + name + '" /></a></span> ';
  return t;
}

function add_all() {
  var title = encodeURIComponent(document.title);
  var url = encodeURIComponent(document.URL);
  var t = 
	add_tool('delicious', 'Delicious', 'http://del.icio.us/post?url=' + url + '&amp;title=' + title)
	+ add_tool('twitter', 'Twitter', 'http://twitter.com/home?status=RT @HermeticLibrary ' + title + ' ' + url)
	+ add_tool('facebook', 'Facebook', 'http://www.facebook.com/share.php?u=' + url + '&t=' + title)
	+ add_tool('stumbleupon', 'StumbleUpon', 'http://www.stumbleupon.com/submit?url=' + url + '&title=' + title)
	+ add_tool('google', 'Google Bookmark', 'http://www.google.com/bookmarks/mark?op=add&bkmk=' + url + '&title=' + title + '&annotation=')
	+ add_tool('google', 'Google Reader', 'http://www.google.com/reader/link?url=' + url + '&title=' + title + '&src=The Hermetic Library')
	+ add_tool('googlebuzz', 'Google Buzz', 'http://www.google.com/buzz/post?url=' + url)
	+ add_tool('digg', 'Digg', 'http://digg.com/submit?phase=2&url=' + url + '&title=' + title)
	+ add_tool('friendfeed', 'FriendFeed', 'https://friendfeed.com/share?url=' + url + '&title=' + title)
	+ add_tool('reddit', 'Reddit', 'http://reddit.com/submit?url=' + url + '&title=' + title)
//	+ add_tool2('evernote', 'evernote', url, title)
	+ add_tool('evernote', 'Evernote', 'http://www.evernote.com/clip.action?code=hermeticlibrary&contentId=container&url=' + url + '&title=' + title)
	;
  return t;
}

