	var Try = {
		these: function() {
			var returnValue;

			for (var i = 0, length = arguments.length; i < length; i++) {
				var lambda = arguments[i];
				try {
					returnValue = lambda();
					break;
				} catch (e) { }
			}

			return returnValue;
		}
	};

	var xmlHttp;

	function creatXMLHttpRequest() {
		return Try.these(
			function() {return new XMLHttpRequest()},
			function() {return new ActiveXObject('Msxml2.XMLHTTP')},
			function() {return new ActiveXObject('Microsoft.XMLHTTP')}
			) || false;
	}

	function startRequest() {
		document.getElementById('result').style.cssText = "";
		document.getElementById('resultText').innerHTML = "Loading...";

		var queryString;
		var domain = document.getElementById('domain').value;
		queryString = "domain=" + domain;
		xmlHttp=creatXMLHttpRequest();
		xmlHttp.open("POST","/whois/custom/?action=do","true");
		xmlHttp.onreadystatechange = handleStateChange;
		xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
		xmlHttp.send(queryString);
	}

	function handleStateChange() {
		if(xmlHttp.readyState == 1) {
			document.getElementById('result').style.cssText = "";
			document.getElementById('resultText').innerHTML = "<img src=\"/i/rotation.gif\" width=\"32\" height=\"32\" />";
		}
		if(xmlHttp.readyState == 4) {
			if(xmlHttp.status == 200) {
				document.getElementById('result').style.cssText = "";
				var allcon =  xmlHttp.responseText;
				document.getElementById('resultText').innerHTML = allcon;
			}
		}
	}
