function Share(sTabPath) {
	var that = this;
	
	if (typeof(console) == "undefined") {
		console = {};
		console.log = function(sMessage) {
			//alert(sMessage);
		};
	}
	
	if (typeof(sTabPath) != "undefined") {
		this.sTabPath = sTabPath;
	} else {
		this.sTabPath = "";
	}
	
	that.oSubmitUrls = {
		Delicious: "http://del.icio.us/post?url=",
		Digg: "http://digg.com/submit?phase=2&url=",
		Furl: "http://www.furl.net/store?s=f&to=0&u=",
		Newsvine: "http://www.newsvine.com/_tools/seed&save?u=",
		Reddit: "http://reddit.com/submit?url=",
		Simpy: "http://www.simpy.com/simpy/LinkAdd.do?href=",
		StumbleUpon: "http://www.stumbleupon.com/submit?url=",
		Technorati: "http://technorati.com/faves?add=",
		Facebook: "http://www.facebook.com/share.php?u=",
		Spurl: "http://www.spurl.net/spurl.php?url=",
		Blogmarks: "http://blogmarks.net/my/new.php?mini=1&simple=1&url=",
		Google: "http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=",
		WindowsLive: "https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-au&url=",
		YahooMyWeb: "http://myweb.yahoo.com/myresults/bookmarklet?u=",
		Netscape: "http://www.netscape.com/submit/?U=",
		Fark: "http://cgi.fark.com/cgi/fark/edit.pl?new_url=",
		Slashdot: "http://slashdot.org/bookmark.pl?url=",
		AOLIM: "aim:goim?message=look+at:+",
		Yahoo: "ymsgr:sendIM?(select%20recipient)&m=",
		Netvous: "http://netvouz.com/action/submitBookmark?url=",
		PlugIM: "http://www.plugim.com/submit?url=",
		Squiddo: "http://www.squidoo.com/lensmaster/bookmark?"
	}
	
	this.init = function(aLinkNames) {
		
		that.sPageInfo = that.getPage();
		
		console.log("initialise share instance with " + aLinkNames.length + " item(s)");
		for (var i=0; i<aLinkNames.length; i++) {
			var sParentID = aLinkNames[i][0];
			var aList = aLinkNames[i][1];
			
			var eParent = document.getElementById(sParentID).childNodes[1];
			
			console.log("starting loop on " + sParentID + " with " + eParent.childNodes.length + " item(s)");
			for (j=0, nItemCount=0; j<eParent.childNodes.length; j++) {
				
				if (typeof(eParent.childNodes[j].id) != 'undefined') {
					var eElement = eParent.childNodes[j];
					console.log(eElement.id + " attach event with '" + aList[nItemCount] + "'");
					eElement.sLinkCode =  aList[nItemCount];
					
					var fEvent = function() {
						console.log("Set share target code to: " + this.sLinkCode);
						share.setTarget(this.sLinkCode);
					};
					
					if (typeof(eElement.addEventListener) != "undefined") {
						eElement.addEventListener("mouseover", fEvent, false);
					} else {
						eElement.attachEvent("mouseover", fEvent);
					}
					nItemCount++;
				}
			}
		}
	}
	
	this.submitPage = function(sService) {
		console.log("submitPage() called");
		
		var sLink = "";
		if (window.location.href.indexOf("?") > 0) {
			sLink = window.location.href.split("?")[0] + "?s=" + that.sTabPath;
		} else {
			if (share.sTabPath != "") {
				sLink = window.location.href + "?s=" + that.sTabPath;
			} else {
				sLink = window.location.href
			}
		}
		
		sLink = that.oSubmitUrls[sService] + escape(sLink);
		
		console.log("This page: " + sLink);
		window.open(sLink, 'share');
		
	}
	
	this.getPage = function() {
		var aPageInfo = [];
		if (window.location.href.indexOf("?") > 0) {
			aPageInfo = window.location.href.split("/").pop().split("?");
		} else {
			aPageInfo = window.location.href.split("/").pop();
		}
		
		if (typeof(aPageInfo[1]) != "undefined") {
			var aSections = aPageInfo[1].split("&");
			aPageInfo[1] = [];
			
			for (var i=0; i<aSections.length; i++) {
				var aSection = aSections[i].split("=");
				if (aSection[0] == "s") {
					aPageInfo[1].push(aSection[1].split("_"));
				}
			}			
		}
		
		return aPageInfo;
	}
	
	this.setTarget = function(sTabPath) {
		that.sTabPath = sTabPath;
	}
}