
function toggleSharePanel(onlyOpen)
{
	var likeContainer = jQuery('.likecontainer');
	if(likeContainer.attr('expanded') == 'true' && !onlyOpen)
	{
		//shrink
		likeContainer.animate({width: "23"});
		likeContainer.removeAttr('expanded');
	}
	else
	{
		//grow
		likeContainer.animate({width: "93"});
		likeContainer.attr('expanded', 'true');
		
		if(likeContainer.children().length == 0)
		{
			likeContainer.html(function() {
				var likeButtons = '';
				likeButtons += '<div class="socialbutton"><iframe src="http://www.facebook.com/plugins/like.php?app_id=240817539284564&amp;href=' + encodeURIComponent(window.location.href) + '&amp;send=false&amp;layout=box_count&amp;width=60&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=verdana&amp;height=60" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:60px; height:60px;" allowTransparency="true"></iframe></div>';
				//likeButtons += '<div class="socialbutton"><div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=240817539284564&amp;xfbml=1"></script><fb:like href="" send="false" layout="box_count" width="60" show_faces="false" font="verdana"></fb:like></div>';
				//likeButtons += '<div class="socialbutton"><div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=151565304922828&amp;xfbml=1"></script><fb:like href="https://www.picworkflow.com/" send="true" layout="box_count" width="60" show_faces="false" font="verdana"></fb:like></div>';
				likeButtons += '<div class="socialbutton"><g:plusone size="tall" href="' + encodeURI(window.location.href) + '"></g:plusone></div>';
				likeButtons += '<div class="socialbutton"><a href="https://twitter.com/share" class="twitter-share-button" data-url="' + encodeURI(window.location.href) + '" data-text="' + jQuery(document).attr('title') + '" data-count="vertical" data-via="bobbigmac">Tweet</a><script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script></div>';
				//likeButtons += '<div class="socialbutton"><iframe allowtransparency="true" frameborder="0" scrolling="no" src="https://platform.twitter.com/widgets/tweet_button.html" style="width:130px; height:50px;"></iframe></div>';
				return likeButtons;
			});
			try {
				gapi.plusone.go();
			} catch(exc) { }
		}
	}
}

jQuery(document).ready(function()
{
	jQuery('.likecontainer').click(function(e) {
		toggleSharePanel();
	});
});
