// JavaScript Document
function coPassord()
{
  var tbID=document.getElementById("tbID").value;
  var o_pass=document.getElementById("o_pass").value;
  var cstr = "tbID=" + tbID + "&o_pass=" + o_pass;
  xmlHttp=Create_Ajax();
  var url="management.php?act=check";
      url=url+"&sid="+Math.random();
	xmlHttp.open("POST",url,false);
	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");   
	xmlHttp.send(cstr);
    document.getElementById("old").innerHTML=xmlHttp.responseText;
}
//change password
function change()
{
    var tbID=document.getElementById("tbID").value;
	var n_pass=document.getElementById("n_pass").value;
    var c_pass=document.getElementById("c_pass").value;
	var check=document.getElementById("old").innerHTML;
	if(check.substr(15,5)=="right"){
		if(n_pass==c_pass){
		  var cstrr = "tbID=" + tbID + "&n_pass=" + n_pass;
		  xmlHttp=Create_Ajax();
		  var url="management.php?act=change";
			  url=url+"&sid="+Math.random();
			xmlHttp.open("POST",url,false);
			xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");   
			xmlHttp.send(cstrr);
			if(xmlHttp.responseText=="Changed"){
			  window.close();
			  window.returnValue= "Password Changed Successful!";//这是子窗品的返回值
			}else{
			  alert("Password Changed Unsuccessful!");
			}
		}else{
		   alert("You input a different confirm password!");
		}
	}else{
	  alert("You havn`t verified old password!");
	}
}