
var shareSection = null;
var shareUrl = null;
var sTitle = "Full Throttle - Energy Drink";
var sSummary = "Full Throttle is the hardest working energy drink on the block. Check out the all-new drinkfullthrottle.com to see what we're all about.";
var bConcatenate = true;
var sImage = homeBase+"images/logo.png";
function shareThis(type, title, summary)
{
	if(title == null) title = sTitle;
	if(summary == null) summary = sSummary;
    if (type != null)
    {
        var URL = "";
        var Bookmark  = "";
        var BookmarkRoot = (homeBase != null)?homeBase:location.href.substring((location.href.lastIndexOf("/"))+1);
        if(shareUrl!=null){
          Bookmark = shareUrl;
        }
        else{
          Bookmark = BookmarkRoot;
        }
        var Title = escape(title);
        var Content = escape(summary);
        switch (type.toLowerCase())
        {
            case "linkedin":
                URL = "http://www.linkedin.com/shareArticle?mini=true&url="+Bookmark+"&title="+Title+"&summary="+Content+"&source="+BookmarkRoot;
                window.open(URL);
                break;

            case "digg":
                URL = "http://digg.com/remote-submit?phase=2&url="+Bookmark+"&title="+Title+"&bodytext="+Content; //"&topic=510"; <.food and drink???  509 autos
                window.open(URL);
                break;

            case "delicious":
                URL = "http://del.icio.us/post?url="+Bookmark+"&title="+Title+"&description="+Content;
                window.open(URL);
                break;

            case "myspace":
                URL = "http://www.myspace.com/index.cfm?fuseaction=postto&u="+Bookmark+"&t="+Title+"&c=";
				URL += "<img src='"+sImage+"' /><br />";
				URL += Content;
                window.open(URL);
                break;

            case "twitter":
				if(bConcatenate)
					Content = Bookmark+" "+Title+"-"+Content;
/*				Content = Content.substr(0,140);
				if(Content.length == 140)
					Content = Content.substr(0, 137)+"...";*/
                URL = "http://twitter.com/home?status="+Content;
                window.open(URL);
                break;

            case "facebook":
                URL = "http://www.facebook.com/sharer.php?u="+Bookmark+"&t="+Title;
                window.open(URL);
                break;
				
            case "blogger":
			    URL = 'http://www.blogger.com/blog_this.pyra?t='+Content+'&u='+Bookmark+ '&n=' + Title;
                window.open(URL);
                break;				
        }
    }
}

function shareEmail(obj)
{
	var sHref = String(obj.href);
	if(shareSection != null)
	{
		sHref += (sHref.indexOf('?') >= 0)?'&':'?';
		sHref += 'name='+escape(shareSection);
	}
	var Bookmark  = "";
	var BookmarkRoot = (homeBase != null)?homeBase:location.href.substring((location.href.lastIndexOf("/"))+1);
	if(shareUrl!=null){
		Bookmark = shareUrl;
	}
	else{
		Bookmark = BookmarkRoot;
	}
	if(Bookmark != null)
	{
		sHref += (sHref.indexOf('?') >= 0)?'&':'?';
		sHref += 'url='+encodeURIComponent(Bookmark);	
	}
	var objAux = _getParams(obj.getAttribute('params'));
	if(openPopup != null)
	{
		openPopup(null,sHref,objAux);
	}
	else
	{
		var strAux = "";
		for(var ids in objAux)
		{
			if(strAux != "") strAux += ",";
			strAux += ids+":'"+objAux[ids]+"'";
		}
		var fnc = "openPopup(null,'"+sHref+"',{"+strAux+"},'"+obj.id+"')";
		callParentFunction(fnc);
	}
	//openPopup(obj);
	
	return false;
}