
	function clearText(thefield) {
	  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
	} 
	function replaceText(thefield) {
	  if (thefield.value=="") { thefield.value = thefield.defaultValue }
	}
	
	
	
	function ValidateEmail(valor) 
    {
	    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor))
		    return true;
	    else
		    return false;
    }

	function ValidateDataSmall(FirstName,Email,Comment,contactDate,procedureSmall)
	{
		if (contactDate.value != "")
		{						
			return (false);
		}
		
		if ((FirstName.value == "") || (FirstName.value == FirstName.defaultValue))
		{
			alert('Please, enter your first name.');
			FirstName.focus();
			return (false);
		}
		
		if ((procedureSmall.value == "") || (procedureSmall.value == 'Procedure Type'))
		{
			alert('Please, select a procedure.');
			procedureSmall.focus();
			return (false);
		}
		
		
		if ((Email.value == "") || (Email.value == Email.defaultValue))
		{
			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 ==Comment.defaultValue ))
		{
			alert('Please, enter your comments.');
			Comment.focus();
			return (false);
		}
		
		return true;
	}

	function OnSubmit(){
		
		var FirstName=document.getElementById('FirstName');		
		var Email=document.getElementById('Email');
		var procedureSmall = document.getElementById('procedureSmall');
		var Comment=document.getElementById('Comment');	
		var contactDate=document.getElementById('contactDate');
		var chkSingUp=document.getElementById('chkSingUp');
		
		
		if (ValidateDataSmall(FirstName,Email,Comment,contactDate,procedureSmall)==true)
			window.location.href="/SaveSmallContact.aspx?FirstName="+FirstName.value+"&Email="+Email.value+"&ProcedureSmall="+procedureSmall.value+"&Comment="+Comment.value+"&SingUpNewsletter="+chkSingUp.checked;
		
	}