var mXmlHttp; 
var mIE			= document.all;
var mIE5 		= (navigator.appVersion.indexOf("MSIE 5.5")!=-1) ? 1 : 0; 
var mOpera 		= ((navigator.userAgent.indexOf("Opera6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1)) ? 1 : 0; 
var mNetscape 	= (navigator.userAgent.indexOf('Netscape') >= 0) ? 1 : 0; 

var wWin                    = window;
var vm_winie				= false;
var vm_macie				= false;
var vw_Agent				= navigator.userAgent.toUpperCase();


function DoDownload(pAction)
{
    var wURL = "./sendmail.asp?a=" + escape(pAction); 

    mXmlHttp = GetXmlHttpObject(StateChangeHandler); 

    SendXmlHttp(mXmlHttp, wURL); 
    
    return true;
} 

function StateChangeHandler() 
{
}

function SendXmlHttp(pXmlhttp, pURL)
{ 
    try
    { 
		pXmlhttp.open('GET', pURL, true); 
		pXmlhttp.send(null); 
    } 
    catch(e) { } 
} 

function GetXmlHttpObject(pHandler)
{ 
    var wXmlHttp = null;

    if (mIE)
    { 
        var wStrObjName = (mIE5) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP';
        
        try
        {
            wXmlHttp	= new ActiveXObject(wStrObjName);
            wXmlHttp.onreadystatechange = pHandler;
        }
        catch(e)
        {
        	return;
        }
    }
    else if (mOpera)
    {
        return;
    }
    else
    {
    	try
    	{
	        wXmlHttp 			= new XMLHttpRequest();
	        wXmlHttp.onload 	= pHandler;
	        wXmlHttp.onerror 	= pHandler;
        }
        catch(e)
        {
        	return;
        }
    }
    
    return wXmlHttp;
} 

if (vw_Agent.indexOf("WIN") >= 0 && vw_Agent.indexOf("MSIE") >= 0)
    vm_winie = true;

if (vw_Agent.indexOf("MAC") >= 0 && vw_Agent.indexOf("MSIE") >= 0)
    vm_macie = true;

function zm_contextmenu()
{
	return false;
}

function zm_click(vf_event)
{
	if (vm_winie && (event.button == 2))
	{
		event.cancelBubble = true;
		event.returnValue = false;
		
		return false;
	}
}

document.oncontextmenu = zm_contextmenu;
document.onmousedown = zm_click;
document.onmouseup = zm_click;

