// Validate email addresses
function isEmail(elm)
{
	if(elm.value.indexOf("@") != "-1" && elm.value.indexOf(".") != "-1")
	{
		return true;
	}
	else
	{
		return false;
	}
}

// Validate the form
function isReady(form)
{
	// Validate user's name
	if (form.txtName.value == false)
	{
		document.all.idItemsmarked.style.color="#FE0E9E";
		document.all.idName.style.color="#FE0E9E";
		document.all.formError.innerText="Please enter your name";
		form.txtName.focus();
		return false;
	}
	
	// Validate user's email address
	if (isEmail(form.txtEmail) == false)
	{
		document.all.idItemsmarked.style.color="#FE0E9E";
		document.all.idEmail.style.color="#FE0E9E";
		document.all.formError.innerText="Please enter a valid email address";
		form.txtEmail.focus();
		return false;
	}
	
	// Validate user's website url
	if (form.txtURL.value == false)
	{
		document.all.idItemsmarked.style.color="#FE0E9E";
		document.all.formError.innerText="Please enter your website URL";
		document.all.idURL.style.color="#FE0E9E";
		form.txtURL.focus();
		return false;
	}
	
	return true;
}
