//以下是提交等待的AJAX
function createXMLHttpRequest(){
     if(window.XMLHttpRequest){ //Mozilla
      XMLHttpReq=new XMLHttpRequest();
      }
      else if(window.ActiveXObject){
       try{
        XMLHttpReq=new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e){
         try{
          XMLHttpReq=new ActiveXObject("Microsoft.XMLHTTP");
          }catch(e){}
          }
         }
        }
   //发送请求函数
   function send(url){
    createXMLHttpRequest();
    XMLHttpReq.open("get",url,true);
    XMLHttpReq.onreadystatechange=proce;   //指定响应的函数
    XMLHttpReq.send(null); //发送请求
    }
   function proce(){
    if(XMLHttpReq.readyState==4){ //对象状态
     if(XMLHttpReq.status==200){//信息已成功返回，开始处理信息
      var xmlDoc=XMLHttpReq.responseText;
      document.write(xmlDoc);
     }else{
     }}}

//结束提交等待的AJAX

// JavaScript Document
function SG(url, method,csa) {//初始化、指定处理函数、发送请求的函数
    var rstr;
    var ajax = false;
    //开始初始化XMLHttpRequest对象
    if(window.XMLHttpRequest) { //Mozilla 浏览器
          ajax = new XMLHttpRequest();
          if (ajax.overrideMimeType) {//设置MiME类别
                ajax.overrideMimeType("text/xml");
          }
    }
    else if (window.ActiveXObject) { // IE浏览器
          try {
                ajax = new ActiveXObject("Msxml2.XMLHTTP");
          } catch (e) {
                try {
                    ajax = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
          }
    }
    if (!ajax) { // 异常，创建对象实例失败
          window.alert("不能创建XMLHttpRequest对象实例.");
          return false;
    }
    ajax.onreadystatechange = function ()
    {
          if (ajax.readyState == 4) { // 判断对象状态
                if (ajax.status == 200) { // 信息已经成功返回，开始处理信息
                    rstr = ajax.responseText;
//                     return (ajax.responseText);
                }
                else { //页面不正常
                    alert("您所请求的页面有异常。");
                }
          }

    }
    // 确定发送请求的方式和URL以及是否同步执行下段代码


 //var dname = document.getElementById("dname").value
// var getstr="?dname="+dname
    url=url+csa;

    ajax.open(method, url, false);
    ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    //alert(phone);
    ajax.send(null);
    return rstr;
}

function show(url,cs)
{
info.innerHTML = SG(url,'get',cs);
document.form1.dname.value=""
document.form1.dname.focus()


//info.innerHTML="中华人民共和国华人民共和国华人民国"
}



function showjs(url,cs)
{

info.innerHTML = SG(url,'get',cs);
//document.form1.tname.value=""
//document.form1.tname.focus()
//alert("ok")

}



function showkcmain(url,cs)
{
info.innerHTML = SG(url,'get',cs);
}

function showinfoa(url,cs)
{
infoa.innerHTML = SG(url,'get',cs);
}
function showinfob(url,cs)
{
infob.innerHTML = SG(url,'get',cs);
}




function showdiv(url,cs)
{
//alert("ok")
div1.innerHTML = SG(url,'get',cs);
//document.form1.tname.value=""
//document.form1.tname.focus()
//alert("ok")

}

function ashow(url,cs)
{
info.innerHTML = SG(url,'get',cs);
}

function bshow(url,cs)
{
infob.innerHTML = SG(url,'get',cs);
}

function cshow(url,cs)
{
infoc.innerHTML = SG(url,'get',cs);
}




function ednj(url,cs)
{
showimage.innerHTML = SG(url,'get',cs);
}

function ednjkc(url,cs)
{
showkc.innerHTML = SG(url,'get',cs);
}






