﻿// JScript 文件
var xmlHttp;
function Course()
{ 
    var lid=document.getElementById("ddllanguage").value;    
    //alert(lid);
    //document.getElementById("course").innerHTML=lid;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
      {
      alert ("您的浏览器不支持AJAX！");
      return;
      } 
    var url="searchCourse.aspx";
    url=url+"?lid="+lid+"&date="+new Date();
    xmlHttp.onreadystatechange=stateChanged;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    function stateChanged()
    { 
        if (xmlHttp.readyState==4)//xmlHttp.responseText
        { 
            document.getElementById("course").innerHTML=xmlHttp.responseText;
        }
    }
}

function GetXmlHttpObject()
{
    var xmlHttp=null;
    try
      {
      // Firefox, Opera 8.0+, Safari
      xmlHttp=new XMLHttpRequest();
      }
    catch (e)
      {
      // Internet Explorer
      try
        {
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
      catch (e)
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
  }
return xmlHttp;
}

function getCoursetype()
{
    var lid=document.getElementById("applyddllanguage").value;    
    //alert(lid);
    //document.getElementById("applycoursetype").innerHTML=lid;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
    {
        alert ("您的浏览器不支持AJAX！");
        return;
    } 
    var url="action/coursetype.aspx";
    url=url+"?lid="+lid+"&date="+new Date();
    xmlHttp.onreadystatechange=stateChanged;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    function stateChanged()
    { 
        if (xmlHttp.readyState==4)//xmlHttp.responseText
        { 
            document.getElementById("applycoursetype").innerHTML=xmlHttp.responseText;
            document.getElementById("applycourse").innerHTML="";
        }
    }
}

function getCourse()
{
    var cid=document.getElementById("applyddlcoursetype").value;    
    //alert(cid);
    //document.getElementById("applycourse").innerHTML=cid;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
    {
        alert ("您的浏览器不支持AJAX！");
        return;
    } 
    var url="action/course.aspx";
    url=url+"?cid="+cid+"&date="+new Date();
    xmlHttp.onreadystatechange=stateChanged;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    function stateChanged()
    { 
        if (xmlHttp.readyState==4)//xmlHttp.responseText
        { 
            document.getElementById("applycourse").innerHTML=xmlHttp.responseText;
        }
    }
}
