var viw=0;
var savid="";
var ids_old="";

function getIE(e)
{
  var t=e.offsetTop;
  var l=e.offsetLeft;
  while(e=e.offsetParent){
    t+=e.offsetTop;
    l+=e.offsetLeft;
    }
    return {top:t,left:l}
  }
function _showDiv(daihao,l,t)
{
    if(savid != daihao)
        return;
    else
        savid="";

    var url = "../interface/companyinfo.asp?daihao=" + daihao;
    
	apDivcom.innerHTML ="";
    var myAjax = new ajax(url, {dataType: 'html', onComplete: function(data) {
            apDivcom.innerHTML = data.responseText;

		apDiv2.style.display = "block";
		if(l> apDiv2.offsetWidth) l -= apDiv2.offsetWidth;
		if(t> apDiv2.offsetHeight & apDiv2.offsetHeight>260) t -= apDiv2.offsetHeight;

		apDiv2.style.left = l;
		apDiv2.style.top = t;

		//apDivcom.innerHTML += ("<br>" + "bH:" + document.body.offsetHeight + " bW:" + document.body.offsetWidth + "<br>l:" + l + " t:" + t + "<br>apW:" + apDiv2.offsetWidth + " apH:" + apDiv2.offsetHeight);
		viw=1;
        }
    });
	

}

function showlight(ids)
{
	clist.disabled=true;
	try{
	changeclassDiv(ids_old,"divborderhind");
	changeclassDiv(ids,"divbordershow");
	}catch(err)	{}
	ids_old = ids;
	clist.disabled=false;
}

function changeclassDiv(tmpids,clsname)
{
	var arrid = tmpids.split(",");
	for(var i=0;i<arrid.length;i++)
	{
		if(arrid[i] !== "")
		{
			if(typeof(eval("document.all."+arrid[i]))!= "undefined") 
			{
				try {
					document.getElementById(arrid[i]).className = clsname;
				}catch(err){}
			}
		}
	}
}

function showDiv(obj)
{
    savid=obj.alt;
    var p = getIE(obj);
    
    var l = p["left"];
    var t = p["top"];
    setTimeout("_showDiv('" + obj.alt + "'," + l + "," + t + ")",500);
}
function HidDiv()
{
    savid="";
    setTimeout("if(viw==0)apDiv2.style.display = 'none'",1500);
    viw=0;
}