<!--

	var httpRequest;

	function getRequest()
	{
		if (window.XMLHttpRequest) 
		{
			httpRequest = new XMLHttpRequest(); 
		}
		else if (window.ActiveXObject) 
		{
			httpRequest = new ActiveXObject('Msxml2.XMLHTTP'); 
		}
		
		return httpRequest; 
	}

	function check_domain()
	{
		request  = 'dom/domain.php';
		request += (document.getElementById('domain')) ? '?domain='+document.getElementById('domain').value : "";
		
		httpRequest = getRequest();
		httpRequest.open('GET', request, true);
		
		httpRequest.onreadystatechange = function (evt) 
		{
			if (httpRequest.readyState == 4) 
			{
				returnValue     = httpRequest.responseText;
				//alert(returnValue);
				document.getElementById('domain_output').innerHTML = returnValue;
			} 
		};
		httpRequest.send(null); 
	}
	
	var domain_default_text = "Enter your name here.";
	
	function domain_type()
	{
		if (domain.value == domain_default_text || domain.value == "")
		{
			domain.value = "";
			domain.style.color = "#000000";
			document.getElementById('domain_text').innerHTML = "";
		}
		else
		{
			domain_sample();
		}
	}
		
	function domain_sample()
	{	
		domain = document.getElementById('domain').value;
		domain = domain.replace(/[^a-z0-9-]+/gi,"");
		domain = domain.replace(/^(www)/gi,"");
		domain = domain.replace(/(com|org|net)$/gi, ".$1");
		domain = (!domain.match(/\./i) && domain != "") ? domain + ".com" : domain;
		domain = domain.toLowerCase();
		
		if (domain != "")
		{
			document.getElementById('domain_text').innerHTML = "<span style='margin-left: 10px; font-size: 11px; color: #909090'>Sample:&nbsp;www.<span style='color: #3D7000;'>"+domain+"</span></span>";
		}
		else
		{
			document.getElementById('domain_text').innerHTML = "";
		}
	}
		
	function domain_blur()
	{
		if (domain.value == domain_default_text || domain.value == "")
		{
			domain.value = domain_default_text;
			domain.style.color = "#9D9D9D";
		}
	}
	
	function domain_focus()
	{
		domain = document.getElementById('domain');
		dform  = document.getElementById('domain_form');
		
		dform.action = "javascript:;";
		dform.onsubmit = domain_form_check;
		
		if (document.getElementById('d_taken')) document.getElementById('d_continue').style.display = 'none';
		if (document.getElementById('d_taken')) document.getElementById('d_taken').style.display = 'none';
		if (document.getElementById('d_check')) document.getElementById('d_check').style.display = '';
		
		if (domain)
		{
			if (domain.value == domain_default_text)
			{
				domain.value = "";
				domain.style.color = "#000000";
			}
			else if (domain.value != "")
			{
				domain.select();
			}
		}
	}
	
	function domain_form_check()
	{
		document.getElementById('d_check').style.display='none'; 
		document.getElementById('d_checking').style.display=''; 
		check_domain();
	}
	
//-->