function OnSubmit(){		
		
		var txtFullName=getElement('txtFullName');
		var txtEmail=getElement('txtEmail');
		var txtPhone=getElement('txtPhone');
		var txtComments=getElement('txtComments');	
//		var chkSingUp=document.getElementById('chkSingUp');
		var contactDate=getElement('contactDate');
		var hdnContactFormID=getElement('hdnContactFormID');
		var hdnContactFormType=getElement('hdnContactFormType');		
		var Language=getElement('txtLanguage');
		
		if (ValidateSmallContact(txtFullName, txtEmail, txtPhone, txtComments, contactDate)==true)
			window.location.href="/savesmallform.aspx?txtFullName="+txtFullName.value+"&txtEmail="+txtEmail.value+"&txtPhone="+txtPhone.value+"&txtComments="+txtComments.value+"&hdnContactFormID="+hdnContactFormID.value+"&hdnContactFormType="+hdnContactFormType.value+"&txtLanguage="+Language.value;
//			window.location.href="savesmallform.aspx?txtFullName="+txtFullName.value+"&txtEmail="+txtEmail.value+"&txtComments="+txtComments.value+"&chkSingUp="+chkSingUp.checked+"&hdnContactFormID="+hdnContactFormID.value+"&hdnContactFormType="+hdnContactFormType.value+"&txtLanguage="+Language.value;

	}

function ValidateSmallContact(FullName, Email, Phone, Comment, contactDate)
{
	if (contactDate.value != "")
	{
		return false;
	}

	FullName.value=trim(FullName.value);
  	Email.value=trim(Email.value);
	Phone.value=trim(Phone.value);
  	Comment.value=trim(Comment.value);
	
	if (FullName.value == "")
	{
		alert('Please, enter your full name.');
		FullName.focus();
		return false;
	}
	
	if (Email.value == "")
	{
		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 (Phone.value == "")
	{
		alert('Mobile Number is required.');
		Phone.focus();
		return false;
	}
	else
	{
		if(!ValidatePhone(Phone.value))
		{
			alert("Please, enter a valid cell phone number.");
			Phone.focus();
			return false;
		}
	}
	
	if (Comment.value == "")
	{
		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 trim(myString)
   {
 return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')
   }

function ValidatePhone(incoming)
{
	var ValidChars = "0123456789.()- ";
	var IsCorrect=true;
	var Char;

	for (cont = 0; cont < incoming.length && IsCorrect == true; cont++) 
	{ 
		Char = incoming.charAt(cont); 
		if (ValidChars.indexOf(Char) == -1) 
			return false;
	}
	return true;
}