{
        function enlevespace(champ)
{
if (champ.charAt(0) == " ")
	{
	do {champ=champ.substr(1)}
	while (champ.charAt(0) == " ")
	}
return champ;
}

function valform(theForm)
{
theForm.name.style.backgroundColor='#fff';
theForm.sname.style.backgroundColor='#fff';
theForm.city.style.backgroundColor='#fff';
theForm.email.style.backgroundColor='#fff';
theForm.message.style.backgroundColor='#fff';


	theForm.name.value = enlevespace(theForm.name.value);
	if (theForm.name.value == "") 
	{	alert("Please enter a name.\nПожалуйста введите имя.");
        theForm.name.style.backgroundColor='#ffcccc';
		theForm.name.focus();
		return (false);
	}
	theForm.sname.value = enlevespace(theForm.sname.value);
	if (theForm.sname.value == "") 
	{	alert("Please enter a surname.\nПожалуйста введите фамилию.");
        theForm.sname.style.backgroundColor='#ffcccc';
		theForm.sname.focus();
		return (false);
	}
	
	theForm.city.value = enlevespace(theForm.city.value);
	if (theForm.city.value == "") 
	{	alert("Please enter a city.\nПожалуйста введите город.");
        theForm.city.style.backgroundColor='#ffcccc';
		theForm.city.focus();
		return (false);
	}
	theForm.email.value = enlevespace(theForm.email.value);
	if (theForm.email.value == "") {alert("Please enter an email.\nПожалуйста введите email"); theForm.email.style.backgroundColor='#ffcccc'; theForm.email.focus(); return (false); }
	else {
		var str=theForm.email.value
 		var expregmail=/^.+@.+\..{2,3}$/
 		if (expregmail.test(str))
 		{}
 		else { alert("The e-mail is invalid\nemail не соответствует формату."); theForm.email.style.backgroundColor='#ffcccc'; theForm.email.focus(); return false;}
 		if (theForm.email.value.indexOf("'") !== -1) { alert("Please do not put the apostrophe in the email.\nПожалуйста не пишите посторонние символы в поле \"электронная почта\"."); theForm.email.style.backgroundColor='#ffcccc'; theForm.email.focus(); return (false); }
	}
	theForm.message.value = enlevespace(theForm.message.value);
	if (theForm.message.value == "") 
	{	alert("Please enter a message.\nПожалуйста введите текст вашего сообщения");
        theForm.message.style.backgroundColor='#ffcccc';
		theForm.message.focus();
		return (false);
	}
	theForm.focus();
	return(true);
}

function valform_comm(theForm)
{
theForm.message.style.backgroundColor='#fff';
theForm.name.style.backgroundColor='#fff';
theForm.email.style.backgroundColor='#fff';

	theForm.message.value = enlevespace(theForm.message.value);
	if (theForm.message.value == "") 
	{	alert("Please enter a message.\nПожалуйста введите текст вашего сообщения");
        theForm.message.style.backgroundColor='#ffcccc';
		theForm.message.focus();
		return (false);
	}

	theForm.name.value = enlevespace(theForm.name.value);
	if (theForm.name.value == "") 
	{	alert("Please enter a name.\nПожалуйста введите имя.");
        theForm.name.style.backgroundColor='#ffcccc';
		theForm.name.focus();
		return (false);
	}
	
	theForm.email.value = enlevespace(theForm.email.value);
	if (theForm.email.value == "") {alert("Please enter an email.\nПожалуйста введите email"); theForm.email.style.backgroundColor='#ffcccc'; theForm.email.focus(); return (false); }
	else {
		var str=theForm.email.value
 		var expregmail=/^.+@.+\..{2,3}$/
 		if (expregmail.test(str))
 		{}
 		else { alert("The e-mail is invalid\nemail не соответствует формату."); theForm.email.style.backgroundColor='#ffcccc'; theForm.email.focus(); return false;}
 		if (theForm.email.value.indexOf("'") !== -1) { alert("Please do not put the apostrophe in the email.\nПожалуйста не пишите посторонние символы в поле \"электронная почта\"."); theForm.email.style.backgroundColor='#ffcccc'; theForm.email.focus(); return (false); }
	}

	theForm.focus();
	return(true);
}

}
//-->
