//function createxmlhttp()
//{
//    xmlhttpobj = false;
//    try{//创建对象，一个一个的试，哎，要是能统一标准都好。。
//        xmlhttpobj = new XMLHttpRequest;
//    }catch(e){
//        try{
//            xmlhttpobj=new ActiveXObject("MSXML2.XMLHTTP");
//        }catch(e2){
//            try{
//                xmlhttpobj=new ActiveXObject("Microsoft.XMLHTTP");
//            }catch(e3){
//                xmlhttpobj = false;
//            }
//        }
//    }
//    return xmlhttpobj; 
//}

function createxmlhttp()
{

if(window.ActiveXObject){
xmlhttpobj = new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.ActiveXObject){
xmlhttpobj = new ActiveXObject("Msxml2.XMLHTTP.4.0");
}else if(window.ActiveXObject){
xmlhttpobj = new ActiveXObject("Msxml2.XMLHTTP");
}else if(window.XMLHttpRequest){
xmlhttpobj = new XMLHttpRequest();
}

return xmlhttpobj; 
}

function getclass(i,v){
    if(v==0){
        document.getElementById("subclass"+i).innerHTML="";
        return;
    }
	document.getElementById("subprolist"+i).innerHTML="";
    var xmlhttpobj = createxmlhttp();
    if(xmlhttpobj){//如果创建对象xmlhttpobj成功
        xmlhttpobj.open('get',"getclass.asp?pcate="+v+"&i="+i+"&number="+Math.random(),true);//get方法 加个随机数。
        xmlhttpobj.send(null);
        xmlhttpobj.onreadystatechange=function(){//客户端监控函数
            if(xmlhttpobj.readystate==4){//服务器处理请求完成
                if(xmlhttpobj.status==200){
                    //alert('ok');
                    var html = xmlhttpobj.responseText;//获得返回值
                    document.getElementById("subclass"+i).innerHTML=html;
                }else{
                    document.getElementById("subclass"+i).innerHTML="Loading...";
                }
            }else{
                document.getElementById("subclass"+i).innerHTML="Loading...";//服务器处理中
            }
        }    
    }
}
function getprolist(i,v){
    if(v==0){
        document.getElementById("subprolist"+i).innerHTML="";
        return;
    }
    var xmlhttpobj = createxmlhttp();
    if(xmlhttpobj){//如果创建对象xmlhttpobj成功
        xmlhttpobj.open('get',"getprolist.asp?cate="+v+"&number="+Math.random(),true);//get方法 加个随机数。
        xmlhttpobj.send(null);
        xmlhttpobj.onreadystatechange=function(){//客户端监控函数
            if(xmlhttpobj.readystate==4){//服务器处理请求完成
                if(xmlhttpobj.status==200){
                    //alert('ok');
                    var html = xmlhttpobj.responseText;//获得返回值
                    document.getElementById("subprolist"+i).innerHTML=html;
                }else{
                    document.getElementById("subprolist"+i).innerHTML="Loading...";
                }
            }else{
                document.getElementById("subprolist"+i).innerHTML="Loading...";//服务器处理中
            }
        }    
    }
}