﻿var MSN_Check;     
                
document.write("<OBJECT classid='clsid:F3A614DC-ABE0-11d2-A441-00C04F795683' codeType='application/x-oleobject' height='0' id='MsgrObj' width='0'></OBJECT><OBJECT classid='clsid:FB7199AB-79BF-11d2-8D94-0000F875C541' codeType='application/x-oleobject' height='0' id='MsgrApp' width='0'></OBJECT>");     
      
if("undefined" != typeof(MsgrObj) && null != MsgrObj.object && "undefined" != typeof(MsgrApp) && null != MsgrApp.object)   
{   　　　   
    if(MsgrObj.LocalState == 1)  
    { 
        MSN_Check   =   false;   
    }　　　　   
    else     
    {
        MSN_Check   =   true; 
    }  　　　　   
}     
else   
{  
    MSN_Check   =   true;   
}
    
 // 给指定人发送消息
function MSG_SEND(mail)   
{   　　
    ADD_FRIEND(mail);   
    
    if(MSN_Check)   　　　   
    {   　　　　　　　     
        var State = MsgrObj.LocalState;  
           
        if(1 != State)   
        if(mail != MsgrObj.LocalLogonName)  
        { 
            MsgrApp.LaunchIMUI(mail);   
        }　　　　　　　   
        else     
        {   
            MsgrApp.Visible=1;
            MsgrApp.LaunchLogonUI();   
        }   　　　　   
    }     
}     
      
// 添加好友
function ADD_FRIEND(email)     
{   　　　　   
    if(MSN_Check)     
    {
        MsgrApp.LaunchAddContactUI(email);  
    }   
}  
