function checkDomain(domain,tilde){
  var range = arguments[2] ? '&range=' + arguments[2] : '';
  var opt = {
    method: 'post',
    postBody: 'domain=' + domain + '.' + tilde + range,
    onSuccess: function(t) {
        switch (t.responseText) {
          case '100': domain_is_available(tilde); break;
          case '101': domain_is_not_available(tilde); break;
          case '102': 
            domain_errors(tilde);
            break;
          case '': domain_errors(tilde); break;
        }
    },
    on404: function(t) {
      domain_errors(tilde);
    },
    onFailure: function(t) {
      domain_errors(tilde);
    }
  }
  new Ajax.Request('EasyDomainBatch2.php', opt);
}

