﻿function createXMLHttpRequest(){
	if (window.XMLHttpRequest) {//Mozilla
		XMLHttpReq=new XMLHttpRequest();
	}
	else if (window.ActiveXObject) {//IE 浏览器
	     try {
			    XMLHttpReq=new ActiveXObject("Msxml2.XMLHTTP");
	     } catch (e) {
		        try{
					XMLHttpReq=new ActiveXObject("Micrsost.XMLHTTP");
				} catch(e){}
	    }
    }
}

   function loadMessage(id,shopid){//发送请求函数
	       createXMLHttpRequest();	 
		   XMLHttpReq.onreadystatechange= processMessage;//指定响应函数 
		   XMLHttpReq.open("get","/pub/writemsg.asp?shopid="+shopid+"&productid="+id+"&rnum=" + Math.random(),true);
	       XMLHttpReq.send(null);//发送请求  
	}
	
	function goPage(id,page,wshopid){//发送请求函数,进行分页函数.
	           createXMLHttpRequest();		  
		   XMLHttpReq.onreadystatechange= processMessage;//指定响应函数 
		   XMLHttpReq.open("get","/pub/writemsg.asp?shopid="+wshopid+"&productid="+id+"&page="+page+"&rnum=" + Math.random(),true);
	       XMLHttpReq.send(null);//发送请求  
	}

    function processMessage() {//处理返回信息函数	       
	       if (XMLHttpReq.readyState==4){//判断对象状态，4为完成请求。
			
		       if(XMLHttpReq.status==200){//信息已经成功返回，开始处理信息,200为处理正常
			        var msg=XMLHttpReq.responseText;
					//alert(msg)
					document.getElementById("web_notemessage").innerHTML =msg;
					
			   } else {//处理不正常
				   window.alert('调用留言回复页面出现异常错误！');
				   }
       }
   }
  
  
	

