//******************************************************************************************//
//* A function that opens the selected bookmark/share website and passes the URL and title
//* using the API for that site.
function openBookmarkSite(sitename) {
	var title = escape(document.title);
	var url = escape(location.href);
	if (sitename.toLowerCase() == "favorites") {
		if (window.sidebar) { // firefox
			window.sidebar.addPanel(document.title, location.href, "");
		} else if (document.all) { // IE
			external.AddFavorite(location.href, document.title);
		} else if (window.opera && window.print) { // opera
			var elem = document.createElement('a');
			elem.setAttribute('href', url);
			elem.setAttribute('title', title);
			elem.setAttribute('rel', 'sidebar');
			elem.click();
		}
	}
	else
	{
		var bookmarkURL;
		if (sitename.toLowerCase() == "delicious") {
			bookmarkURL = "https://secure.del.icio.us/login?url=" + url + "&title=" + title + "&noui&jump=close&partner=%5Bpartner%5D&v=4";
		}
		else if (sitename.toLowerCase() == "digg") {
			bookmarkURL = "http://digg.com/submit?url=" + url + "&title=" + title + "&media=news";
		}	
		else if (sitename.toLowerCase() == "facebook") {
			bookmarkURL = "http://www.facebook.com/sharer.php?u=" + url + "&t=" + title;
		}	
		else if (sitename.toLowerCase() == "google") {
			bookmarkURL = "http://www.google.com/bookmarks/mark?op=add&bkmk=" + url + "&title=" + title;
		}
		else if (sitename.toLowerCase() == "yahoo-myweb") {
			bookmarkURL = "http://myweb.yahoo.com/myresults/bookmarklet?&ei=UTF-8&u=" + url + "&t=" + title;
		}
		else if (sitename.toLowerCase() == "technorati") {
			bookmarkURL = "http://technorati.com/faves?sub=favthis&add=" + url;
		}
		acaShareWindowObjectReference = window.open(bookmarkURL, 
			"_blank",  "height=500,width=720,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
	}
}
