function ValidateDataSmall(FullName, Email, ddlHearAboutUs, Comment,contactDate)
{
	if ((FullName.value == "") || (FullName.value == "FirstName"))
	{
		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 == "EmailAddress"))
	{
		alert('Please, enter your email.');
		Email.focus();
		return (false);
	}
	else
	{
		if(!ValidateEmail(Email.value))
		{
			alert("Please check the emails address.");
			Email.focus();
			return false;
		}
	}
	
	var dropdownIndex = ddlHearAboutUs.selectedIndex;
	//alert(dropdownIndex);
	if( dropdownIndex == "0" )
	{
		alert("Please select how you heard about us.");
		ddlHearAboutUs.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 getElement(name)
	{
	    var object = null;
	    var tbSmallContact=document.getElementById('tbSmallContact'); 
	    for (var i=0; i<tbSmallContact.rows.length; i++)
        {
            for (var j=0; j<tbSmallContact.rows[i].cells.length; j++)
            {
                for (var k=0; k<tbSmallContact.rows[i].cells[j].childNodes.length; k++)
                {                
                    if(tbSmallContact.rows[i].cells[j].childNodes[k].id == name)
                    {
                       object = tbSmallContact.rows[i].cells[j].childNodes[k];
                       return object;
                    }
                }
            }
           
        }    
	}
	
	function HasNumbers(valor) 
    	{
     		if (/[0-9]/.test(valor))
            		return true;
        	else
            		return false;
    	}

function OnSubmit(){
	
		var txtFullName=getElement('txtFullName');
		var txtEmail=getElement('txtEmail');
		var ddlHearAboutUs=getElement('ddlHearAboutUs');
		var txtComments=getElement('txtComments');	
		var contactDate=getElement('contactDate');
		var hdnContactFormID=getElement('hdnContactFormID');
		var hdnContactFormType=getElement('hdnContactFormType');
		
		
		if (ValidateDataSmall(txtFullName,txtEmail, ddlHearAboutUs, txtComments, contactDate)==true)
			window.location.href="savesmallform.aspx?txtFullName="+txtFullName.value+"&txtEmail="+txtEmail.value+"&ddlHearAboutUs="+ddlHearAboutUs.value+"&txtComments="+txtComments.value+"&hdnContactFormID="+hdnContactFormID.value+"&hdnContactFormType="+hdnContactFormType.value;
		
	}