var ajax=false;
 		
//创建一个ajaxuest对象
function createajax(){
   if(window.XMLHttpRequest)//Mozilla 
   { 
 		 ajax = new XMLHttpRequest();
 	 }
 	 else if(window.ActiveXObject)
 	 	{
 			 try{  
 			    	ajax = new ActiveXObject("Msxml2.XMLHTTP");
 		      }catch(e){
 								     try{
 									         ajax = new ActiveXObject("Microsoft.XMLHTTP");
 									      }catch(e){}
 						        }
 		}
}
////发送get请求
function sendget(tourl,proc)
{
  createajax();	
  ajax.open("GET",tourl,true);
  ajax.onreadystatechange=proc;   //指定响应的函数
  ajax.send(null);  //发送请求
}
 		
////发送post请求 		
function sendpost(tourl,proc)
{	
  createajax();
  ajax.onreadystatechange=proc; 
  ajax.open("POST",tourl,true);	
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 	
  ajax.send(null);  //发送请求
}