// JavaScript Document
var xmlhttpm;
function ajaxcreatem(){
     if (window.ActiveXObject) {
        xmlhttpm = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (window.XMLHttpRequest) {
        xmlhttpm = new XMLHttpRequest();
    }
}

function gotosales(userid,chatid)
{
   saleid=document.getElementById("saler").value;
   
   if(saleid==''){
	   return false;
	   }else{
		ajaxcreatem();    
		var url="selectsaler.php?uid="+userid+"&chatid="+chatid+"&salerid="+saleid+"&rnd="+Math.random();
        xmlhttpm.onreadystatechange=salaerstate;
        xmlhttpm.open("GET",url,true);
        xmlhttpm.send(null);   
	   }
  
}


function salaerstate(){
  if(xmlhttpm.readyState==4){
	    
   if(xmlhttpm.status==200){
	 
      if(xmlhttpm.responseText=="yes"){  
	      alert("操作成功!")
	  }else{
		   alert("错误!请重新转外贸员") 
		  }
     }
   }
}