﻿
                     /**
             * 方法 1 ：创建对象
             */
             var xmlHttp;
            function createXMLHttpRequest() {
              if (window.ActiveXObject) {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
              }
              else if (window.XMLHttpRequest) {
                xmlHttp = new XMLHttpRequest();
              }
            }

            /**
             * 方法 2 ：事件处理方法
             */
            function PlaceList(currentIndex,condtion){
             //alert("1");
              //创建对象
              createXMLHttpRequest();

              // 构造地址
              var url="Ashx/AjaxPlace.ashx?currentIndex="+currentIndex+"&condtion="+condtion+"&dateTime="+new Date().getTime()+"";
            //alert("2");
              //提交给服务器
              xmlHttp.open("GET",url,true);
              xmlHttp.onreadystatechange=callback;
              xmlHttp.send(null);
            }
            function PlaceListTab(currentIndex,condtion){
              //alert(condtion);
              //创建对象
              createXMLHttpRequest();

              // 构造地址
              var url="Ashx/AjaxPlace.ashx?currentIndex="+currentIndex+"&tab="+condtion+"&dateTime="+new Date().getTime()+"";
            //alert("2");
              //提交给服务器
              xmlHttp.open("GET",url,true);
              xmlHttp.onreadystatechange=callback;
              xmlHttp.send(null);
            }

            /**
             * 方法 3 ：响应
             */
            function callback(){
              if(xmlHttp.readyState==4){
                //alert("4");
                //alert(xmlHttp.status);
                if(xmlHttp.status==200){
                 // alert("ok");
                  document.getElementById("PlaceListItems").innerHTML=xmlHttp.responseText;
                  
                }
              }
            }
            /**
             * 方法 4 ：事件处理方法
             */
            function PlaceListByTab(currentIndex,condtion,tab){
             // alert("1");
              //创建对象
              createXMLHttpRequest();
              // 构造地址
              var url="Ashx/AjaxPlace.ashx?currentIndex="+currentIndex+"&condtion="+condtion+"&tab="+tab+"&dateTime="+new Date().getTime()+"";
            //alert("2");
              //提交给服务器
              xmlHttp.open("GET",url,true);
              xmlHttp.onreadystatechange=callback;
              xmlHttp.send(null);
            }
             
            
            //5、事件处理方法 --参数第几页、学校或普通、地区()
            function PlaceListByBorough(currentIndex,place,borough){
             // alert("1");
              //创建对象
              createXMLHttpRequest();
              // 构造地址
              var url="Ashx/AjaxPlace.ashx?currentIndex="+currentIndex+"&condtion="+place+"&borough="+borough+"&dateTime="+new Date().getTime()+"";
            //alert("2");
              //提交给服务器
              xmlHttp.open("GET",url,true);
              xmlHttp.onreadystatechange=callback;
              xmlHttp.send(null);
            }
            
            //6、事件处理方法 --参数第几页、学校或普通、查询()
            function PlaceListBySearch(searchStr){
              //alert(searchStr);
              //创建对象
              createXMLHttpRequest();
              // 构造地址
              var url="Ashx/AjaxPlace.ashx?currentIndex=1&search="+searchStr+"&dateTime="+new Date().getTime()+"";
            //alert("2");
              //提交给服务器
              xmlHttp.open("GET",url,true);
              xmlHttp.onreadystatechange=callback;
              xmlHttp.send(null);
            } 
             function PlaceListByPage(currentIndex){
              //创建对象
              createXMLHttpRequest();
              // 构造地址
              var url="Ashx/AjaxPlace.ashx?currentIndex="+currentIndex+"&dateTime="+new Date().getTime()+"";
            //alert("2");
              //提交给服务器
              xmlHttp.open("GET",url,true);
              xmlHttp.onreadystatechange=callback;
              xmlHttp.send(null);
            } 
           
           function cloesPlace()
            {
                document.getElementById('light').style.display='none';
                document.getElementById('fade').style.display='none';
}