﻿    
    var kcid="2";
    var type="2";
    
        function getData(kc)
        {
            kcid=kc;
            AjaxXML( );
        }
        function getData2(tp)
        {   
//////            if(tp==1)
//////            {
//////                src01.style.backgroundColor ="#ffffff";
//////                src01.style.color ="#ff0000";
//////                
//////                src02.style.backgroundColor ="#a3dbff";
//////                src02.style.color ="#ffffff";
//////                
//////                src03.style.backgroundColor ="#a3dbff";
//////                src03.style.color ="#ffffff";
//////            }
//////            else if(tp==2)
//////            {
//////                src01.style.backgroundColor ="#a3dbff";
//////                src01.style.color ="#ffffff";
//////                
//////                src02.style.backgroundColor ="#ffffff";
//////                src02.style.color ="#ff0000";
//////                
//////                src03.style.backgroundColor ="#a3dbff";
//////                src03.style.color ="#ffffff";                
//////            }
//////            else if(tp==3)
//////            {
//////                src01.style.backgroundColor ="#a3dbff";
//////                src01.style.color ="#ffffff";
//////                
//////                src02.style.backgroundColor ="#a3dbff";
//////                src02.style.color ="#ffffff";
//////                
//////                src03.style.backgroundColor ="#ffffff";
//////                src03.style.color ="#ff0000";
//////                
//////                //src03.style.color= "#000000";                                
//////            }    
                     
            type = tp;
            AjaxXML( );
        }
        
    function AjaxXML()
    {        
        var xmlhttp;
                        
        //判断浏览器支持的异步对象
        if(window.XMLHttpRequest)
        {
            //alert("火狐+IE7");
            xmlhttp = new XMLHttpRequest();
        }
        else if(window.ActiveXObject)
        {
            //alert("IE6");
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        else
        {
            //alert("该浏览器不支持");
            return;
        }
        
        //监听
        xmlhttp.onreadystatechange=function()
        {   
            if(xmlhttp.readyState==4)
            {   
                if(xmlhttp.responseText=="")
                {
                   
                }
                else
                {
                    Addto_Div(xmlhttp.responseText); 
                    //document.getElementById("t1").innerHTML = xmlhttp.responseText;
                }
            }
        }        
        //发送请求
        document.getElementById("addr").innerHTML ="http://www.sourcetr.net/kc.aspx?kcid="+ kcid;
        xmlhttp.open("GET","kc_getdata.aspx?type=" +type+"&kcid="+kcid , true); //type=1课程简价 type=2培训大纲 type=3相关作品
        xmlhttp.send(null);        
    }

    function Addto_Div(str)
    {   //str：       
        var my_str = str.split("///ww///");
        var item;
        
        //str="标题//副标题//内容" 
        //标题
        document.getElementById("kctitle").innerHTML =my_str[0];
        //大标题
        document.getElementById("kctitle").innerHTML =my_str[2];
        //副标题
        document.getElementById("kc_fu_title").innerHTML =my_str[1];        
        //内容
        document.getElementById("con_detail1").innerHTML =my_str[3];
                              
    }
                
   // AjaxXML();
    
