//////////////////ajax封装

var req; 
var xmlDoc,xmlHttpRequest;
var ajaxExcetpion;
///////////调用的URL（以GET方式组装的参数)，回调方法callback
///////////返回:成功返回true,失败返回false;
function ajaxCallByGet(url,callback,win_self)
{
if (window.XMLHttpRequest) {
	            win_self.req = new XMLHttpRequest();
		            if (req.overrideMimeType){
		         	req.overrideMimeType('text/xml');
			            }	
         } else if (window.ActiveXObject) {
            if (xmlHttpRequest) {
              win_self.req= new ActiveXObject(xmlHttpRequest);
            }else {
	               var versions = ["Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP","MSXML.XMLHTTP",
                        "Microsoft.XMLHTTP"];
               for (var i = 0; i < versions.length ; i++) {
                 try {
                     win_self.req = new ActiveXObject(versions[i]);
                     if (win_self.req) {
                        xmlHttpRequest = versions[i];
                        ajaxExcetpion = null;
						break;
                    }
                }
                catch (objException) {
                	ajaxExcetpion = objException;
                } ;
            }
            ;
        }
    }
    
	if(ajaxExcetpion){
	  return false;		
	}
    if(req){ 
	        		
		 req.open("GET", url, true); 
		 req.onreadystatechange = callback; 
		 req.send(null); 
	}
     return true;
}


/*
 * Returns an new XMLHttpRequest object, or false if the browser
 * doesn't support it
 */
function newXMLHttpRequest() {

  	var xmlreq = false;
	
	if (window.XMLHttpRequest) {
		xmlreq = new XMLHttpRequest();
		if (xmlreq.overrideMimeType){
			xmlreq.overrideMimeType('text/xml');
		}	
    } else if (window.ActiveXObject) {
     	if (xmlHttpRequest) {
    		xmlreq= new ActiveXObject(xmlHttpRequest);
      	}else {
	     	var versions = ["MSXML.XMLHTTP",
                        "Microsoft.XMLHTTP","Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP"];
          	for (var i = 0; i < versions.length ; i++) {
          		try {
                 	xmlreq = new ActiveXObject(versions[i]);
                  	if (xmlreq) {
                        xmlHttpRequest = versions[i];
                        ajaxExcetpion = null;
						break;
                    }
                }
                catch (objException) {
                	ajaxExcetpion = objException;
       			} 
       			
     		}
            
        }
    }

return xmlreq;
}


	/*
	* Returns a function that waits for the specified XMLHttpRequest
	* to complete, then passes it XML response to the given handler function.
  * req - The XMLHttpRequest whose state is changing
  * responseXmlHandler - Function to pass the XML response to
  */
 function getReadyStateHandler(req, responseXmlHandler) {

   // Return an anonymous function that listens to the XMLHttpRequest instance
   return function () {

     // If the request's status is "complete"
     if (req.readyState == 4) {
       
       // Check that we received a successful response from the server
       if (req.status == 200) {

         // Pass the XML payload of the response to the handler function.
         responseXmlHandler(req);

       } else {

         // An HTTP problem has occurred
         alert("HTTP error "+req.status+": "+req.statusText);
       }
     }
   }
 }


function test()
{ 
  alert("test");
}