function OnSubmit()
{
	var txtFullName = document.getElementById('txtFullName');
	var txtEmail = document.getElementById('txtEmail');
	var txtComments = document.getElementById('txtComments');	
	var contactDate = document.getElementById('contactDate');	
	var hdnContactFormID = document.getElementById('hdnContactFormID');
	var hdnContactFormType = document.getElementById('hdnContactFormType');

	if (ValidateDataSmall(txtFullName, txtEmail, txtComments, contactDate)==true)
	window.location.href="savesmallform.aspx?txtFullName="+txtFullName.value+"&txtEmail="+txtEmail.value+"&txtComments="+txtComments.value+"&hdnContactFormID="+hdnContactFormID.value+"&hdnContactFormType="+hdnContactFormType.value;
}

function ValidateDataSmall(FullName, Email, Comment,contactDate)
{	
	if (contactDate.value != "")
	{
		return false;
	}
	
	FullName.value=trim(FullName.value);
  	Email.value=trim(Email.value);
  	Comment.value=trim(Comment.value);
	
	if ((FullName.value == "") || (FullName.value == 'Name'))
	{
		alert('Please, enter your full name.');
		FullName.focus();
		return false;
	}
	else
	{
		if(HasNumbers(FullName.value))
		{
			alert('Name contains numbers, please remove them.');
			FullName.focus();
			return (false);
		}
	}
	
	if ((Email.value == "") || (Email.value == 'Email'))
	{
		alert('Please, enter your email.');
		Email.focus();
		return false;
	}
	else
	{
		if(!ValidateEmail(Email.value))
		{
			alert("Please check the emails address");
			Email.focus();
			return false;
		}
	}
		
	if ((Comment.value == "") || (Comment.value == 'Comments'))
	{
		alert('Please, enter your comments.');
		Comment.focus();
		return false;
	}
	return true;
}


function ValidateEmail(valor)
{
	if (/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(valor))
	return true;
	else
	return false;
}

function HasNumbers(valor) 
{
    if (/[0-9]/.test(valor))
            return true;
    else
            return false;
}

function trim(myString)
{
 return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')
}

