function send (a, b)
{
eml = a +  "@" + b;
return eml;
}

function send2 (a, b)
{
document.write (send(a, b));
}

function send3 (a, b, c)
{
eml = "mailto:" + send(a, b);
if (c != "") eml += "?subject=" + c;
window.location.href = eml;
}

function show_menu2(elem){
	tr = document.getElementById(elem);
		if (navigator.appName.indexOf('Explorer') != -1) {
			if (tr.style.display == 'none')
				tr.style.display = 'inline';
			else
				tr.style.display = 'none';
		} else {
			if (tr.style.display == 'none')
				tr.style.display = 'table-row';
			else
				tr.style.display = 'none';
		}
}

function ch_region(region){
	document.location.href=region;
}

function set_region(region){
	document.location.href="/set_cookie.php?region="+region;
}

function show_description(elem){
	e = document.getElementById(elem);
	if (e.style.display == 'none')
		e.style.display = 'block';
	else
		e.style.display = 'none';
}

function validateForm(form)
	{
		
		for(i=0; i<document.all.length; i++)
		{
        	if(document.all[i].className == "required" && document.all[i].value == "")
			{
                alert("Вы не заполнили одно или более обязательных полей формы.");
				document.all[i].focus();
     			return false;
       		}
	   }

		if (document.getElementById('email'))
		{
			elem=document.getElementById('email');
			var mt = String(elem.value).match(/\w+([-\+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
			if (mt)
			{
				elem.value = mt[0];
			}
			else
			{
				alert ("Неверный формат поля 'Почта'\n");
				elem.focus();
				return false;
			}
		}

		if (document.getElementById('password'))
		{
			if (document.getElementById('s_password').value!=document.getElementById('s_cpassword').value)
			{
				alert ('Поля "Пароль" и "Подтверждение пароля" не совпадают');
				document.getElementById('s_password').focus();
				return false;
			}
		}
		return true;
	}