<!--//


function validEmail(str)
{
	var emailReg = new RegExp('^\\s*[\\-\\\'\\w\\x2d_.][\\-\\\'\\w\\x2d_.]*\\@[\\w][\\-\\w]*\\.[\\w][\\-\\w\\.]*\\s*$','');
	var ret = (emailReg.test(str)) ? true : false;
	return ret;
}

function validation()
{
	
	//reset all colour backgrounds to white (they change colour if the req validation)
	document.forms[0].FORM_NAME.style.background = '#FFFFFF';
	document.forms[0].FORM_ADDRESS.style.background = '#FFFFFF';
	document.forms[0].FORM_CITY.style.background = '#FFFFFF';
	document.forms[0].FORM_REGION.style.background = '#FFFFFF';
	document.forms[0].FORM_POSTCODE.style.background = '#FFFFFF';

	document.forms[0].FORM_ENTRY.style.background = '#FFFFFF';
	document.forms[0].FORM_ACCEPTANCE.style.background = '#FFFFFF';
	document.forms[0].FORM_TEL.style.background = '#FFFFFF';
	document.forms[0].FORM_AUSTL.style.background = '#FFFFFF';
	//alert('in here')

	var message='';
	var highlightcol = '#FFFF99'

	if(document.forms[0].FORM_NAME.value=='')
	{
		message = message + 'Please enter your NAME.\n';
		document.forms[0].FORM_NAME.style.background = highlightcol;
	}

	if(document.forms[0].FORM_TEL.value=='')
	{
		message = message + 'Please enter your TELEPHONE NUMBER.\n';
		document.forms[0].FORM_TEL.style.background = highlightcol;
	}
	
	
	
	if(document.forms[0].FORM_ADDRESS.value=='')
	{
		message = message + 'Please enter your COMPANY ADDRESS.\n';
		document.forms[0].FORM_ADDRESS.style.background = highlightcol;
	}

	if(document.forms[0].FORM_CITY.value=='')
	{
		message = message + 'Please enter your CITY.\n';
		document.forms[0].FORM_CITY.style.background = highlightcol;
	}

	if(document.forms[0].FORM_REGION.value=='')
	{
		message = message + 'Please enter your STATE / REGION.\n';
		document.forms[0].FORM_REGION.style.background = highlightcol;
	}

	if(document.forms[0].FORM_POSTCODE.value=='')
	{
		message = message + 'Please enter your POSTCODE / ZIP.\n';
		document.forms[0].FORM_POSTCODE.style.background = highlightcol;
	}

		
	
	


	if(document.forms[0].FORM_ENTRY.value == '')
	{
		message = message + 'Please enter your competition entry in 20 words or less.\n';
		document.forms[0].FORM_ENTRY.style.background = highlightcol;
	}
	if(document.forms[0].FORM_AUSTL.value=='')
	{
		message = message + 'Please enter the last three digits of the AUST L Number from your Key-Sun Zinke Suncare product.\n';
		document.forms[0].FORM_AUSTL.style.background = highlightcol;
	}
	

	
	if(document.forms[0].FORM_ACCEPTANCE.value=='')
	{
		message = message + 'Please indicate whether you accept the terms and conditions or not.\n';
		document.forms[0].FORM_ACCEPTANCE.style.background = 'red';

	}

	if(document.forms[0].FORM_ACCEPTANCE.value=='NO')
		{
		message = message + 'You cannot enter the competition if you do not accept the terms and conditions.\n';
		}

	
	if(message == '')
	{
		document.forms[0].submit();
	}
	else
	{
		message = "The form could not be submitted as some of the required information is missing\nThe required fields are highlighted\nPlease complete and submit again - Thank you\n\n"+message	

		alert(message);
	}
}
//-->