var ray=
{
validate:function()
	{
	var fname=this.getID('fname'); // Get firstname field
	var lname=this.getID('lname'); // Get lastname field
	var phone=this.getID('phone'); // Get phone field
	var email=this.getID('email'); // Get email field
	var message=''; // Initialize message var
	
	if(fname.value=='') // If first name not given
		{
		message='- First Name field is mandatory\n'; // Let them know we need it
		fname.focus(); // Set the focus on the firstname textbox
		}
	if(lname.value=='') // If last name not given
		{
		message+='- Last Name field is mandatory\n'; // Let them know we need it
		lname.focus(); // Set the focus on the firstname textbox
		}
	if(phone.value=='') // If phone not given
		{
		message+='- Phone field is mandatory\n'; // Let them know we need it
		phone.focus(); // Set the focus on the firstname textbox
		}
	if(email.value=='') // If email field not given
		{
		message+='- Email field is mandatory\n'; // Let them know we need it
		email.focus(); // Set the focus on email textbox
		}
		
	else if(!email.value.match(/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/)) // If they're trying to hack us
		{
		message+='- Email address is invalid\n'; // Let them know we hate that
		email.focus(); // Set the focus on email textbox	
		}
	
	if(message!='') // If the message var has something to say
		{			
		alert(message); // Let the user know their mistakes
		return false; // Don't submit the form
		} // End of the if statement
	}, // End of validate method/property of ray object
getID:function(el){return document.getElementById(el);} // return's the element's ID
} // End of ray object