/**
 * @author pascal.vanhecke
 */

var url = unescape(String(this.location));

var valoreId = url.split("appID=")[1];


if (valoreId!=undefined)
{
        var strLcid = "";
        var obj;
		var fBrowser = (navigator.appName == "Microsoft Internet Explorer") ? true : false;
        
		function TryItNow(appId)
		{
	        CheckMessenger();
	        LaunchApp(strLcid + appId, "");
		}
				
        function CheckMessenger()
				{
			eval ('try {obj = new ActiveXObject("MSNMessenger.P4QuickLaunch"); } catch (e) {obj = null;}');
			if (fBrowser == false)
					{
					location = "http://g.msn.com/8reen_us/IT/INSTALL_MSN_MESSENGER_DL.EXE";
					}             
			else if (obj == null){
				location = "http://g.msn.com/8reen_us/IT/INSTALL_MSN_MESSENGER_DL.EXE";
			}
		}
				
        function LaunchApp(appId, emailId)
			{
                if (obj != null)
						{
						 obj.LaunchApp(appId, emailId);
						}
		}
		
		function CheckMessenger()
		{
			eval ('try {obj = new ActiveXObject("MSNMessenger.P4QuickLaunch"); } catch (e) {obj = null;}');
			
			var strErrorPage = "error.html";
		
			if (!fBrowser)
			{
				ShowWindow(strErrorPage, 410, 130);
			}
		}
		
		//Display error message if the MSN Messenger client 6.2 is not installed or the browser is not Internet Explorer
		function ShowWindow(strError, width, height)
		{
		  if (window.showModalDialog)
		  {
		    window.showModalDialog(strError,null,"dialogWidth="+width+"px;dialogHeight="+height+"px;help=no;dialogLeft=160")
		  }else{
		
		    var ah = screen.availHeight;
		
		    var y = (ah - height) / 2;
		
		    window.top.captureEvents (Event.CLICK|Event.FOCUS)
		    window.top.onfocus = HandleFocus 
		    winModalWindow = window.open (strError,"ModalChild","dependent=yes,width="+width+",height="+height+",top="+y+",left=160,screenX=160,screenY="+y)
		    winModalWindow.focus()
		  }
		}
		
		function HandleFocus()
		{
		  if (winModalWindow)
		  {
		    if (!winModalWindow.closed)
		    {
		      winModalWindow.focus()
		    }else{
		      window.top.releaseEvents (Event.CLICK|Event.FOCUS)
		    }
		  }
		  return false;
		}

		
TryItNow(valoreId);

}	