/*-
 * Copyright (c) 2008 Fredrik Lindberg - http://www.shapeshifter.se
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

var shares = eval('{shares:[{"name":"delicious","image":"delicious_24x24.png","title":"Bookmark at Del.icio.us","url":"https://secure.del.icio.us/login?url=%url%&title=%title%&noui&jump=close&v=4"},{"name":"digg","image":"Digg_24x24.png","title":"Digg This!","url":"http://digg.com/submit?url=%url%&title=%title%"},{"name":"stumbleupon","image":"Stumbleupon_24x24.png","title":"Stumble upon","url":"http://www.stumbleupon.com/submit?url=%url%&title=%title%"},{"name":"google","image":"Google_24x24.png","title":"Google Buzz","url":"http://www.google.com/buzz/post?message=%title%&url=%url%&imageurl="},{"name":"twitter","image":"Twitter_24x24.png","title":"Twitter","url":"http://twitter.com/?status=%url%"},{"name":"reddit","image":"Reddit_24x24.png","title":"Reddit","url":"http://reddit.com/submit?url=%url%&title=%title%"},{"name":"diigo","image":"Diigo_24x24.png","title":"Diigo","url":"http://www.diigo.com/post?url=%url%&title=%title%"},{"name":"facebook","image":"FaceBook_24x24.png","title":"Share on Facebook","url":"http://www.facebook.com/sharer.php?u=%url%&t=%title%"},{"name":"blogmarks","image":"BlogMarks_24x24.png","title":"BlogMarks","url":"http://blogmarks.net/my/new.php?mini=1&simple=1&url=%url%&title=%title%"},{"name":"blinklist","image":"Blinklist_24x24.png","title":"Blinklist","url":"http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=%url%&Title=%title%"},{"name":"magnolia","image":"Magnolia_24x24.png","title":"ma.gnolia","url":"http://ma.gnolia.com/bookmarklet/add?url=%url%&title=%title%"},{"name":"technorati","image":"Technorati_24x24.png","title":"Technorati","url":"http://technorati.com/faves?add=%url%"},{"name":"hyves","image":"0.png","title":"0","url":"0"},{"name":"linkedin","image":"0.png","title":"0","url":"0"}]}');

var share_icon_path = '';
var share_show = '';

var _share_icon_path = '/images/';
var _share_show = ['facebook', 'google', 'twitter','linkedin'];

if (share_icon_path) { _share_icon_path = share_icon_path; }
if (share_show) { _share_show = share_show; }

var share_docurl = location.href;
if (typeof share_domain != "undefined") {
	var tmp = share_docurl.indexOf("/", 7);
	if (tmp > 0) {
		share_docurl = 'http://' + share_domain + share_docurl.substring(tmp);
	}
	else {
		share_docurl = share_domain;
	}
}

for (j = 0; j < _share_show.length; j++) {
	for (i = 0; i < shares.length; i++) {
		if (shares[i].name == _share_show[j]) {
			var url = shares[i].url;
			var img = shares[i].image;
			url = url.replace("%url%", encodeURI(share_docurl));
			url = url.replace("%title%", escape(document.title));
			
			if(shares[i].name=="linkedin") {
	
				document.write('<div style="padding-top:1px; float:left; cursor:pointer; padding-right:5px;"><script type="text/javascript" src="http://platform.linkedin.com/in.js"></script><script type="in/share"></script></div>');	
				
			} else if(shares[i].name=="twitter") {
				document.write('<div style="padding-top:0px; padding-right:5px; float:left; cursor:pointer;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="045juridischNL" style="cursor:pointer;">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>');
			} else if(shares[i].name=="hyves") {
				
				document.write("<div style=' float:left; cursor:pointer; padding-right:5px;'><script type='text/javascript'>Hyves.connect.tip({title: '" + escape(document.title) + "', body:'" + encodeURI(window.location) + "', category:'12'}, {iconsize:24});</script></div>");
			} else {
				document.write('<div style=" float:left; cursor:pointer; padding-right:5px;"><a href="' + url + '" title="'+ shares[i].title +'" target="_blank"><img src="' + _share_icon_path + img + '" border="0" class="button_share" height="20"></a></div>');
			}
		}
	}
}

