﻿var messengerObj = null;

function CheckMessenger()
{
	eval ('try {messengerObj = new ActiveXObject("MSNMessenger.P4QuickLaunch"); } catch (e) {messengerObj = null;}');
}

function BlogIt(description)
{
	if (navigator.userAgent.indexOf("MSIE")>0)
	{
		var sel=document.selection.createRange();
		sel.expand("word");		
		window.location="http://spaces.live.com/BlogIt.aspx?Title=" + escape(document.title) + "&SourceURL=" + escape(window.location.href) + "&description=" + escape(description);
	}
}

function MailTo(subject, body)
{
	window.location="mailto:?subject=" + escape(subject) + "&body=" + escape(body);
}

function LaunchApp(appID, emailID)
{	
	if (messengerObj == null)
		CheckMessenger();
		
	if (messengerObj != null)	
		messengerObj.LaunchApp(appID, emailID);		
	else
		alert("Per avviare immediatamente il gioco devi avere Windows Live Messenger in esecuzione");
}

