var xmlHttp;
function createXMLHttp(){
    if (window.ActiveXObject) {
        try {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e1) {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
    }
    else if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    }
}
function doXMLHttp(objname,sendurl){
    createXMLHttp(); //建立xmlHttp 对象
    if (xmlHttp){
        xmlHttp.onreadystatechange=function(){
	    if(xmlHttp.readyState==4)
		{
		if(xmlHttp.status==200){
		    document.getElementById(objname).innerHTML=xmlHttp.responseText;
			}else{
			document.getElementById(objname).innerHTML='获取数据失败';
			}
		}
	}
        xmlHttp.open("get",sendurl,true); //传送方式 读取的页面 异步与否
        xmlHttp.send(null);
    }
    else
        {
            document.getElementById(objname).innerHTML='不支持ajax,无法完成此操作';
        }
}

function doClick_down(o){
	 o.className="select";
	 var j;
	 var id;
	 var e;
	 for(var i=1;i<=2;i++){
	   id ="down"+i;
	   j = document.getElementById(id);
	   e = document.getElementById("d_con"+i);
	   if(id != o.id){
	   	 j.className="";
	   	 e.style.display = "none";
		 doXMLHttp("d_con1","../top.asp?id=1&typeid="+typeid+"&sortid="+sortid+"&softid="+softid);
	   }else{
		e.style.display = "block";
		doXMLHttp("d_con2","../top.asp?id=2&typeid="+typeid+"&sortid="+sortid+"&softid="+softid);
	   }
	 } 
}

function doclick(divid,softid,sid){
    doXMLHttp("k"+divid,"../error.asp?softid="+softid+"&sid="+sid);
}
//以上新加
window.onload = function(){
  if(softid==0){
  document.getElementById("down2").className="";
  document.getElementById("d_con2").style.display = "none";
  }
  doXMLHttp("d_con1","../top.asp?id=1&typeid="+typeid+"&sortid="+sortid+"&softid="+softid);
}