
function checkAccount(account){
  var strSoap='<?xml version="1.0" encoding="UTF-8"?>\n\n<SOAP-ENV:Envelope'
    +' xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"'
    +' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
    +' xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
    +' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
    +'<SOAP-ENV:Body>'
    +'<CheckAccount xmlns="http://www.bfor.cn/">'
    +'<Account>'+account+'</Account>'
    +'</CheckAccount>'
    +'</SOAP-ENV:Body>'
    +'</SOAP-ENV:Envelope>';

  var loader=new net.ContentLoader(
    "BlogService.asmx",
    checkResponse,
    spacesErrorHandler,
    "POST",
    strSoap,
    "text/xml",
    {
      Man:"POST http://www.bfor.cn/CheckAccount HTTP/1.1",
      MessageType:"CALL"
    },
    true
  );
}

function checkUsername(username){
  var strSoap='<?xml version="1.0" encoding="UTF-8"?>\n\n<SOAP-ENV:Envelope'
    +' xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"'
    +' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
    +' xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
    +' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
    +'<SOAP-ENV:Body>'
    +'<CheckUsername xmlns="http://www.bfor.cn/">'
    +'<username>'+username+'</username>'
    +'</CheckUsername>'
    +'</SOAP-ENV:Body>'
    +'</SOAP-ENV:Envelope>';

  var loader=new net.ContentLoader(
    "BlogService.asmx",
    checkResponse,
    spacesErrorHandler,
    "POST",
    strSoap,
    "text/xml",
    {
      Man:"POST http://www.bfor.cn/CheckUsername HTTP/1.1",
      MessageType:"CALL"
    },
    true
  );
}
function checkResponse()
{
var root =this.req.responseXML;  
if(!root)
root=GetXMLDoc(this.req.responseText);
var msg;
if(root.childNodes[1]&&root.childNodes[1].text)
msg=root.childNodes[1].text;
 else
msg=root.childNodes[0].textContent;
_error_msg_show(msg);
}
function GetXMLDoc(str)
{
if(str==null&&str.trim()=='')
return null;
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.loadXML(str);
return new Feed(xmlDoc);
}

function spacesErrorHandler(){
  alert("error contacting i-favourite!");
}


