
    function replace(texto,s1,s2){
	    return texto.split(s1).join(s2);
    }

	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(Name,Email,Comment,contactDate)
	{
		if (contactDate.value != "")
		{						
			return (false);
		}
		
		if (Name.value == "")
		{
			alert('Please, enter your full name.');
			Name.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 (Comment.value == "")
		{
			alert('Please, enter your comments.');
			Comment.focus();
			return (false);
		}
		
		return true;
	}

	function OnSubmit(){
		
		var Name=document.getElementById('Name');
		var Email=document.getElementById('Email');
		var Comment=document.getElementById('Comment');	
		var contactDate=document.getElementById('contactDate');
		var chkSingUp=document.getElementById('chkSingUp');
		
		Name.value = replace(Name.value,' ', '_');
		
		if (ValidateDataSmall(Name,Email,Comment,contactDate)==true)
			window.location.href="/savesmallform.aspx?Name="+Name.value+"&Email="+Email.value+"&Comment="+Comment.value+"&SingUpNewsletter="+chkSingUp.checked;
		
	}