

//var msgs="<div id=\"infobox\">..</div>";
//document.write(msgs);
//ES_Form_set(_ID('infobox'));


function iniBlock(){
    edit1=ES_Block_set(_ID('infobox'),{drag:true,title:'详细内容',style:"width:580px;height:270px;top:88px;left:25px",overflow:'auto',resizable:false,showClose:true});  
    edit1.style.display = "none"
    ES_Shadow.hide();
}

//iniBlock();


//显示信息内容
function showEditPad()
{
    edit1.style.display="";
    ES_Shadow.hide();
}

var showMsg=function()
{
    KeepActiveIM.Run();
    
}

//弹出提示
function pop(count)
{
    var MSG1 = new CLASS_MSN_MESSAGE("aa",200,120,"短消息提示：","您有 "+count+" 条未查看消息","点击查看详细内容");  
    MSG1.rect(null,null,null,screen.height-50); 
    MSG1.speed    = 10; 
    MSG1.step    = 5; 
    MSG1.show();  
}
       
       
//显示信息
function viewMsg(str)
{
	window.open("/es_im/webForm.aspx",'','width=680px,height=490px,resizable=no');
	return;

    var info1=str.split('\r\n');
    var msg="";
    for(var y=info1.length-1;y>=0;y--)
    {
        var Item=info1[y].split('<$item$>');
        if(Item[0]!="")
        {
            msg+="<div>"+Item[2]+" 对您说：</div>"
            msg+="<div style='padding:10px'><b>"+Item[0]+"</b></div>"
            msg+="<div style='color:#A2A2A2'>"+Item[3]+"</div>"
            msg+="<div style='padding-top:20px;'></div></div>"
         }
    }

    _ID('infobox').innerHTML=msg;
    showEditPad();
    KeepActiveIM.Send("del"); //看完信息清除

}   


       
//alert弹出
function viewAlert(str)
{
	if(str !=0)
	{
		pop(str);
	} 
}
       
  
function   showPopMenu(str){   
    PopMenu   =   window.createPopup(); 
    PopMenu.document.body.innerHTML   =   str;   
    PopMenu.show(200,200,500,300,document.body);   
}   
  


//异步************************************************************
var KeepActiveIM = new Object()
KeepActiveIM.Run=function(iType)
{ 
  KeepActiveIM.Send(iType); 
  setTimeout('KeepActiveIM.Run()',60000);
} 

KeepActiveIM.XMLHTTP=function()
{ 
  var A=null; 
  try 
  { 
     A=new ActiveXObject("Msxml2.XMLHTTP") 
  } 
  catch(e) 
  { 
     try 
     { 
        A=new ActiveXObject("Microsoft.XMLHTTP") 
     } 
     catch(oc)
      { 
        A=null 
     } 
  }
  if ( !A && typeof XMLHttpRequest != "undefined" )
   { 
     A=new XMLHttpRequest() 
   }
   return A 
} 



KeepActiveIM.Send=function(iType)
{ 
  try 
  { 
       var xhr = KeepActiveIM.XMLHTTP() 
       //需新建一asp.net页面，文件名不限，但要更改下面的文件名称
       xhr.open("GET", "/ES_IM/PopMsg.aspx?iType="+iType, false); 
       xhr.send(null);
       
       var info1=xhr.responseText.split('\r\n');
       var count=info1.length-3;
       str=xhr.responseText
		   //alert(str);
       if(str !=0)
       {
            viewAlert(str);
	    xhr.abort()
       }
             
   } 
  catch (e)
   { 
       //alert(e.message); 
	xhr.abort()
  } 
} 

document.write("<script language=\"javascript\" src=\"/js/ES_IMPop.js\"></script>");

