function checkrequired(which) {

	if (which.contactDate.value != "")
	{
		//alert("Test");
		
		return (false);
	}
	
	var pass=true;
	if (document.images) {
		for (i=0;i<which.length;i++) {
			var tempobj=which.elements[i];
			if (tempobj.name.substring(0,8)=="required") {
				if (((tempobj.type=="text"||tempobj.type=="textarea")&&
				   tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
				   tempobj.selectedIndex==0)) {
					pass=false;
					break;
			        }
			}			
		}
	}	
	if (!pass) {
		shortFieldName=tempobj.name.substring(8,30).toUpperCase();
		alert("Please make sure the "+shortFieldName+" field was properly completed.");
		return false;
	}
	else
		return true;
}



    function ValidateEmail(valor) 
    {
	    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor))
		    return true;
	    else
		    return false;
    }

	function ValidateDataSmall(FirstName,LastName,Email,Comment,contactDate)
	{
	    //debugger;
		if (contactDate && contactDate.value != "")
		{						
			return (false);
		}
		
		if ((FirstName.value == "") || (FirstName.value == FirstName.defaultValue))
		{
			alert('Please, enter your first name.');
			FirstName.focus();
			return (false);
		}
		
		if ((LastName.value == "") || (LastName.value == LastName.defaultValue))
		{
			alert('Please, enter your last name.');
			LastName.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 SaveSmallContact()
	{
		
		var FirstName=document.getElementById('FirstName');
		var LastName=document.getElementById('LastName');
		var Email=document.getElementById('Email');
		var Comment=document.getElementById('Comment');	
		var contactDate=document.getElementById('contactDate');		
		
		//alert('a');
		if (ValidateDataSmall(FirstName,LastName,Email,Comment,contactDate)==true)
			window.location.href="/saveSmallContact.aspx?FirstName="+FirstName.value+"&LastName="+LastName.value+"&Email="+Email.value+"&Comment="+Comment.value;
		
	}
