﻿var xmlHttp_User;
var width = 66;
var tops=0;
var left=0;
function createXMLHttpRequest_User()
{ //创建一个xmlHttpRequest对象
    
    try{  xmlHttp_User = new ActiveXObject("Msxml2.XMLHTTP"); }
    catch(e)
    {
        try{  xmlHttp_User = new ActiveXObject("Microsoft.XMLHTTP"); }
        catch(e){  xmlHttp_User = null; }    
    }
    if( ! xmlHttp_User && (typeof XMLHttpRequest != "undefined") )
         xmlHttp_User = new XMLHttpRequest();   
    
}
function dealAct_User(url)
{   
	if(document.getElementById("u")!=null)
	{
		var tip=document.getElementById('u');	    
	    tip.style.top=tops-1+'px';
	    tip.style.left=left+width*1+'px';
	    document.getElementById("u").innerHTML = "<center><img src=\"/images/loading.gif\" style=\"margin-top:20px;margin-bottom:20px;\" /></center>";
	}
    createXMLHttpRequest_User();
     xmlHttp_User.onreadystatechange = handleStateChange_User; //请求状态改变事件触发handleStateChange功能
     xmlHttp_User.open("GET",url); //采用get方法提交数据
     xmlHttp_User.send(null);         
}
function handleStateChange_User()
{
    if( xmlHttp_User.readyState == 4)
    {   //表示请求状态 4为完成
        if( xmlHttp_User.status == 200)
        {
            //http状态指示码             
            var rs = xmlHttp_User.responseText ;//alert(event.Top);  
            document.getElementById("u").innerHTML=rs;    //alert(rs);  
      
	    
	    var tip=document.getElementById('u');	    
	    tip.style.top=tops-1+'px';
	    tip.style.left=left+width*1+'px';
        }
    }        
}
function showUser(uid,w)
{
    var p=KK.position(event.srcElement);
    left = p.Left;
    tops = p.Top;	
    width = w;
    document.getElementById('u').style.display="";
    dealAct_User("/getUserInfo.Aspx?uid="+uid+"&"+Math.random());
}
var KK={};
KK.position=function(o)
{
	var p={Top:0,Left:0};
	while(!!o){
		p.Top+=o.offsetTop;
		p.Left+=o.offsetLeft;
		o=o.offsetParent;
	}
	return p;
}
function hide()
{
	document.getElementById('u').style.display="none";
}
