function postFB(cMsg, cId, wall)
{
	FB_RequireFeatures(["CanvasUtil"], function()
	{
		FB.init("e9cd142eef908d35931a91c3345bac8a", "./resources/xd_receiver.htm");
		FB.ensureInit(function()
		{
			FB.Connect.showPermissionDialog("publish_stream", function()
			{
				var alp = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
				var str = ''
				for (var i=0; i<cMsg.length; i++)
				{
					var c = cMsg.charAt(i)
					str += (alp.indexOf(c, 0) == -1) ? c : '?'
				}

				if (wall)
					FB.Connect.streamPublish('I just created a playable hangman message with hangtwit. Click the \"play this hangtwit\" button below to try to solve it!', {'media':[{'type':'image','src':'http://hangtwit.com/resources/btn_solve_075x075.png','href':'http://hangtwit.com/'+cId}], 'caption':str});
				else
					FB.Connect.showFeedDialog(127253924549, {id:cId});
			});
		});
	});
}

function postTwitter(cMsg, cId, newWin)
{
	if (newWin)
		window.open("http://hangtwit.com?postToTwitter="+cId, "_blank");
	else
		document.location = "http://hangtwit.com?postToTwitter="+cId;
}