var defaultTitle="sweetmillion.com";

function sharePage(shareType, title, params) {
	var returnUrlNoEncode = $.jqURL.strip();
	var returnUrl = encodeURIComponent(returnUrlNoEncode);
	returnUrl += (params == null) ? '' : encodeURIComponent('?' + params);
	title = ((title == null)||(title == 'null')) ? encodeURIComponent(defaultTitle) : encodeURIComponent(title);
	switch (shareType) {
		case "delicious":
			url = 'http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url=' + returnUrl + '&amp;title=' + title;
			break;
		case "digg":
			url = 'http://digg.com/submit?url=' + returnUrl + '&title=' + title;
			break;
		case "facebook":
			url = 'http://www.facebook.com/sharer.php?u=' + returnUrl + '&t=' + title;
			break;
		case "myspace":
			url= 'http://www.myspace.com/index.cfm?fuseaction=postto&u='+ returnUrl + '&t=' + title;
			break;
		case "stumbleupon":
			url = 'http://www.stumbleupon.com/submit?url=' +returnUrl + '&title=' + title;
			break;
		case "twitter":
			url = 'http://www.twitter.com/home?status=' + returnUrlNoEncode;
			break;
		case "yahoo":
			url = 'http://buzz.yahoo.com/buzz?targetUrl=' + returnUrl + '&headline=' + title;
			break;
		default:
			alert("ShareType ["+shareType+"] not supported!");
	}
	var w=$.jqURL.loc(url, {w:800,h:440,wintype:'_blank'});
	if(w==undefined) alert("Please disable your popup blocker.");
}
