// JavaScript Document
var xmlhttp;
function ajaxcreate(){
     if (window.ActiveXObject) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    }
}
function checknum(){
   ajaxcreate(); 
   userid=document.getElementById("uid").value;
    var url="fun/ajaxmsg.php?uid="+userid+"&rnd="+Math.random();
   xmlhttp.onreadystatechange=getmsgnum;
   xmlhttp.open("GET",url,true);
   xmlhttp.send(null);
}

function getmsgnum(){
  if(xmlhttp.readyState==4){
	    
   if(xmlhttp.status==200){
      count=document.getElementById("msgnum");
	  msg=document.getElementById("newmsg").innerHTML;
      //新消息的值
	  count.style.cssText="color:#ff0000;"
      count.innerHTML=xmlhttp.responseText
	  msg2=document.getElementById("newmsg");
	  // 左侧列表的未读留言
	// if(count2=document.getElementById("muns")){
	// count2.style.cssText="color:#ff0000;"
    // count2.innerHTML=xmlhttp.responseText
	// }
	 //首页的未读询盘数
		 
	 	  
	       if(msg<msg2.innerHTML){
			// alert("你有新的消息，请注意查收！");
			 }
	  }
   }
}

