//创建请求
var xmlHttp;
function createXMLHttpRequest(){
 if (window.ActiveXObject){
  xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
 } else if (window.XMLHttpRequest){
  xmlHttp = new XMLHttpRequest();
 }
}
//获取留言
function getpic(id,p){
 createXMLHttpRequest();
 xmlHttp.open("GET","getpic.asp?id="+id+"&p="+p+"&nocache="+new Date().getTime(),false);
 xmlHttp.onreadystatechange=function(){
  if (xmlHttp.readyState==4 && xmlHttp.status==200) {
    if(xmlHttp.responseText=="") {
     document.getElementById("pic").innerHTML = "暂无图片";//ajax.asp中标记输出的div的ID
    } else {
     document.getElementById("pic").innerHTML = xmlHttp.responseText;
    }
  }
 }
 xmlHttp.send();
}



//获得id
function getid(){
 var idlen;
 var id;
 idlen=document.URL.lastIndexOf("=")+1;
 id=document.URL.substring(idlen);
 return id;
 }
