// JavaScript Document
var xmlhttp;
function ajaxcreate(){
     if (window.ActiveXObject) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    }
}
function modifykeyrank(keyidn,rankn){
   ajaxcreate();
   var rankvalue=document.getElementById(rankn).value
   var wordid=document.getElementById(keyidn).value
   var url="dokeyrank.php?keyid="+wordid+"&value="+rankvalue+"&rnd="+Math.random();
   xmlhttp.onreadystatechange=modifykeyrankstate;
   xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}

function modifykeyrankstate(){
   if(xmlhttp.readyState==4){
      if(xmlhttp.status==200){
		if(xmlhttp.responseText=='0'){
		 alert("error!");
		 // document.getElementById(rankn).value= xmlhttp.responseText	
		}
	  }
   }
}