//Copyright (c) 2000 Microsoft Corporation.  All rights reserved.
//<script>

var g_iCurFlag = -1;
var g_iCurStatus = -1;
var m_gobjXMLHTTP;
var objMsgViewer;
var g_szImagePath;

function private_getXMLHTTPObj()
{
	if (typeof(m_gobjXMLHTTP) != "OBJECT"){
		try
		{
			m_gobjXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
		}  
		catch(e)
		{
			return(false);
		}
	}
	return(true);    
}

function window.onload() 
{
	var x=0,iFlag=0;

	g_szImagePath = g_szVirtualRoot + "/img/";
	window.document.all.msgBody.style.backgroundColor = "window";

	window.document.attachEvent("onkeydown",event_onkeydown);
}

function onCbClick(szCommand, varValue )
{
	if(event.button == 2)
	{
		return(false);
	}   
	var szURL  = window.document.location.protocol + "//" + window.document.location.hostname  + window.document.location.pathname + "?Cmd=" + szCommand; 
	var fOpen = true;
	
	switch(szCommand.toUpperCase()) 
	{
		case "PRINT":
			window.print();
			fOpen=false;
		break;
		case "HELP":
			LaunchHelp();	
			fOpen=false;
		break;
		case "MOVE":
			//Move message function is defined in webclientutil.js
			var szMsgURL = window.document.location.protocol + "//" + window.document.location.hostname  + window.document.location.pathname;
			var szContentClass = "urn:content-classes:message";
			if (MoveMessage(g_szUserBase, szMsgURL, g_szVirtualRoot, szContentClass))
			{
				if (window.opener != null) 
				{
					window.opener.RefreshMessageList();
				}
				self.close();
			}
			
			fOpen=false;
		break;
		case "DELETE":
			DeleteMessage(szURL, g_szUserBase)
			fOpen=false;
		break;
	}
	if(fOpen)
	{
		openNewWindow(szURL, "", 640, 480);
		self.close();        
	}       
	return(true);   
}

function event_onkeydown() 
{
	switch(event.keyCode) 
	{   
		case 27:
			window.close();
		break;            
	}
	return(true);
}


