function ezin_domain_ext_fnc()
{
	var sel  = document.getElementById('ezin_domain_ext_id');
	var item = document.getElementById('ezin_registration_types');
	if (sel.options[sel.selectedIndex].value == 'sk') {
		item.style.visibility = 'visible';
	} else {
		item.style.visibility = 'hidden';
	}
}

function trim(str)
{
	while (str.substring(0, 1) == " "
			|| str.substring(0, 1) == "\n"
			|| str.substring(0, 1) == "\r")
	{
		str = str.substring(1, str.length);
	}
	while (str.substring(str.length - 1, str.length) == " "
			|| str.substring(str.length - 1, str.length) == "\n"
			|| str.substring(str.length - 1, str.length) == "\r")
	{
		str = str.substring(0, str.length - 1);
	}
	return str;
}

function form_control(theForm, lang)
{
	if (trim(theForm.ezin_company.value) == "") {
		alert(lang == "SK" ? "Prosím zadajte meno." : "Please enter name.");
		theForm.ezin_company.focus();
		return false;
	}
	if (trim(theForm.ezin_address1.value) == "") {
		alert(lang == "SK" ? "Prosím zadajte adresu." : "Please enter address.");
		theForm.ezin_address1.focus();
		return false;
	}
	if (trim(theForm.ezin_city.value) == "") {
		alert(lang == "SK" ? "Prosím zadajte mesto." : "Please enter city.");
		theForm.ezin_city.focus();
		return false;
	}
	if (trim(theForm.ezin_zip.value) == "") {
		alert(lang == "SK" ? "Prosím zadajte PSÈ." : "Please enter ZIP code.");
		theForm.ezin_zip.focus();
		return false;
	}
	if (trim(theForm.ezin_country.value) == "") {
		alert(lang == "SK" ? "Prosím zadajte krajinu." : "Please enter country.");
		theForm.ezin_country.focus();
		return false;
	}
	if (trim(theForm.ezin_contact.value) == "") {
		alert(lang == "SK" ? "Prosím zadajte kontaktnú osobu." : "Please enter contact person.");
		theForm.ezin_contact.focus();
		return false;
	}
	if (trim(theForm.ezin_phone.value) == "") {
		alert(lang == "SK" ? "Prosím zadajte telefón." : "Please enter phone number.");
		theForm.ezin_phone.focus();
		return false;
	}
	if (trim(theForm.ezin_email.value) == "") {
		alert(lang == "SK" ? "Prosím zadajte e-mail." : "Please enter e-mail.");
		theForm.ezin_email.focus();
		return false;
	}
	if (trim(theForm.ezin_domain.value) == "") {
		alert(lang == "SK" ? "Prosím zadajte doménu." : "Please enter domain.");
		theForm.ezin_domain.focus();
		return false;
	}
	var match_services = /^.*http.*http.*http.*$/im.test(theForm.ezin_services.value);
	var match_notes    = /^.*http.*http.*http.*$/im.test(theForm.ezin_references_notes.value);
	if (match_services || match_notes || trim(theForm.ezin_product.options[theForm.ezin_product.selectedIndex].value) == '') {
		theForm.ezin_antispam.value = '';
	}

	return true;
}


