function changeme(formfield)
{
	formfield.style.background = "#FFFF99"
}
function revertme(formfield)
{
	formfield.style.background = "#FFFFFF"
}

function validate(form)
{
	var myfields = new Array(form.name,form.title,form.email,form.phone,form.address,form.suburb,form.state,form.post_code)
	var mynames = new Array("Full Name","Title","Email Address","Phone","Address","Suburb","State","Post Code")
	
	var counter=0;
	var msg="Please fill in the following fields :\n\n";
	
	for (var i=0; i < myfields.length; i++)
	{
		if (myfields[i].type == "text")
		{
			if (myfields[i].value == "")
			{
				counter=1;
				msg=msg + mynames[i] + "\n";
			}
		}
		else if (myfields[i].type == "select-one") // delete this is drop down menus are not present in the form (this fixes the mozilla problem of not recognising the drop down menus when validating)
		{
			if (myfields[i].options[0].selected)
			{
				counter=1;
				msg=msg + mynames[i] + "\n";
			}
		}		
	}
	
	if(counter==1)
	{
		alert(msg);
		return false;
	}
	
	else
	{
		return checkemail(form);
	}

}


function checkemail(form)
{
	var str=form.email.value
	var filter=/^.+@.+\..{2,3}$/
	
	if (filter.test(str))
	{
		testresults=true
	}
	
	else
	{
		alert("Please input a valid email address!")
		testresults=false
	}
	
	return (testresults)
}



