function updateSubdomainFromRestaurant (f)
{
	var s = document.getElementById('subdomain');
	
	var check = document.getElementById('subdomain_edited');
	
	if(s.value.length==0) 
	{
		check.value = 0;
	}
	
	if(check.value == 1) return;
	
	s.value = f.value;
	checkSubdomain(s);
}

function updateSubdomain (f)
{
	document.getElementById('subdomain_edited').value = 1;
	checkSubdomain (f);
}

function checkSubdomain (f)
{
	var str = f.value;
	
	str = str.toLowerCase();
	str = str.replace(/[^a-z0-9]/g, "");
	
	f.value = str;

	document.getElementById('subdomainInfo').innerHTML = "check...";

	xajax_checkSubdomainAjax(str);
}