﻿        var xmlHttp;
        var domname;
        function createXMLHttpRequest(){
            if(window.ActiveXObject){
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            else if(window.XMLHttpRequest){
                xmlHttp = new XMLHttpRequest();
            }
        }
        function startRequest(DomName,page){
            
            domname = DomName;
            createXMLHttpRequest();
            try{
                    xmlHttp.onreadystatechange = handleStateChange;
                    //xmlHttp.open("GET",page,true);
                    xmlHttp.open("GET",page,false);
                    xmlHttp.setRequestHeader("If-Modified-Since","0");
                    xmlHttp.send(null); 
                }catch(exception){
                    alert("您要访问的资源不存在!");
                }
        }
        function handleStateChange(){ 


            if(xmlHttp.readyState == 4){ 
                if (xmlHttp.status == 200 || xmlHttp.status == 0){
                    document.getElementById(domname).innerHTML=xmlHttp.responseText;
                    
                }
            }
             
        }
        
        function Request(strName)
        {
            //获取当前的Url地址
            var strHref =document.location.href;
            //document.getElementById("searchInput").value=strHref;
            var intPos = strHref.indexOf("?");
            var strRight = strHref.substr(intPos + 1);

            var arrTmp = strRight.split("&");
            for(var i = 0; i < arrTmp.length; i++)
            {
                var arrTemp = arrTmp[i].split("=");

                if(arrTemp[0].toUpperCase() == strName.toUpperCase()) return arrTemp[1];
            }
            return "";
        }

