
function httpObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}


function sachDomain() {
	myid = document.myform.DomainName.value;
	
	if (myid != "") {
		var notify = "<i>...processing, pls wait...</i>";
		document.getElementById('sachloc').innerHTML = notify;
	}	
	else {
		
		return;
	}

	myid = replaceJack(myid);
	http22 = httpObject();
	http22.open("GET", 'http://www.alcapelhost.com/domain_sach.php?id='+myid);
    	http22.onreadystatechange = receiveState;
    	http22.send(null);
}


function receiveState() {
	
        if (http22.readyState == 4 && http22.status == 200) {
		
		hola = http22.responseText.split("^");			
		if (hola != "") {
			element2 = hola[1];
			element3 = hola[2];
			if (element2 == "success") {
				document.getElementById('sachloc').innerHTML = element3;
			}				
			else {
				document.getElementById('sachloc').innerHTML =  'Error!';				
				return;
			}
		}
		else {
			document.getElementById('sachloc').innerHTML =  'Error!';				
			return;
		}
        }
	else {
		
		return;
	}

}

function replaceJack(type_sent) {
	var tex;
	rExp = /\www./g;
	tex = type_sent.replace(rExp,"");
	return tex;
}
