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 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;
	}
	
function show_img(img, img_width, img_height){
	window.open(img, 1,'scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,left=50,top=50, width='+img_width+', height='+img_height);
}

function deleteCart( catalogID )
{
  var form = document.basket;
  form.elements['id_catalog'].value = catalogID;
  form.elements['basket_action'].value = 'delete';
  form.submit();
}

function recalcOrder()
{
  var form = document.basket;
  form.elements['basket_action'].value = 'recalc';
  form.submit();
}
