<!--
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function identify(){
	document.forms[0].email.value = document.forms[0].Email_Address.value;
}

function checkrequest(){
	//Verify fields completed for About face request form
	oktogo = true;
	msg = " ";
	document.forms[0].email.value = document.forms[0].Email_Address.value;//copy their address to emailfield
	if (document.forms[0].Email_Address.value=="") { 
		msg = '- your email address.\n';
	} else {
		test = document.forms[0].Email_Address.value;
		if (test.indexOf('@') < 1 || test.indexOf('.') < 1) { 
			msg = '- a valid email address.\n';
		}
	}
	if (document.forms[0].Contact_Name.value=="") msg += '- your full name.\n';
	
	if (document.forms[0].Request[0].checked) {
		if (document.forms[0].Postal_Address.value=="" || document.forms[0].Postal_Postcode.value=="") msg += '- full postal address for package delivery.\n';
	}
	if (document.forms[0].Request[1].checked) {
		if (document.forms[0].Contact_Phone.value=="") msg += '- daytime telephone number.\n';
		if (document.forms[0].Group_objectives.value=="") msg += '- goals to achieve during training.\n';
	}
	if (!document.forms[0].Request[1].checked && !document.forms[0].Request[0].checked ) {
		msg = '\n- Guidance on how we might assist.\n\n\n Would you like to book or receive a copy of the programme?\n';
	}

	if (msg != " ") { 
		alert ('To assist with your enquiry, we require:\n\n' + msg);
		oktogo = false;
	}
	return oktogo;
}

function checkform(){
	//Verify fields completed for Contact form
	oktogo = true;
	msg = " ";
	document.forms[0].email.value = document.forms[0].Email_Address.value;//copy their address to emailfield
	if (document.forms[0].Email_Address.value=="") { 
		msg = '- your email address.\n';
	} else {
		test = document.forms[0].Email_Address.value;
		if (test.indexOf('@') < 1 || test.indexOf('.') < 1) { 
			msg = '- a valid email address.\n';
		}
		else if (document.forms[0].Email_Address.value != document.forms[0].Email_Address2.value){
		msg ='- that the email addresses you entered match.\n';
		}
	}
	if (document.forms[0].FirstName.value=="" || document.forms[0].LastName.value=="") msg += '- your full name.\n';
	
	if (msg != " ") { 
		alert ('To assist with your enquiry, we require:\n\n' + msg);
		oktogo = false;
	}
	return oktogo;
}



function checkenrol(){
	oktogo = true;
	msg = "Oops, you forgot to tell us when you want to come!\nChoose a Date for:\n\n";
	msg2 =" ";
	msg3 = " ";
	document.forms[0].email.value = document.forms[0].Email_Address.value;

	for (x=1;x<=3;x++){
		dateset = eval('d.forms[0].CourseDate' + x + '.options.selectedIndex');
		courseset = eval('d.forms[0].Course' + x + '.options.selectedIndex');
		var coursename = courselist[courseset][1];
		if (courseset != 0 && dateset == 0){
			msg2 += '- ' + courselist[courseset][1] + '\n';
			oktogo = false;
			}
		//Check if message is supplied for 'Forever' courses
		if ((coursename == 'Mosaic Madness - Forever' || coursename == 'Art for Strictly Beginners - Forever') && document.forms[0].message.value.length==0){
			msg3 += "- a message to Nola with your preferred starting date for your Forever class.\n";
			oktogo = false;
		}		
	}	
	if (msg2 != " "){
		msg += msg2;
		msg2 = " ";
	}
	else { msg = "";
	}

	if (document.forms[0].Email_Address.value=="") { 
		msg2 = '- your email address.\n';
		oktogo = false;
	} else {
		test = document.forms[0].Email_Address.value;
		if (test.indexOf('@') < 1 || test.indexOf('.') < 1) { 
			msg2 = '- a valid email address.\n';
			oktogo = false;
		}
		else if (document.forms[0].Email_Address.value != document.forms[0].Email_Address2.value){
		msg2 ='- that the email addresses you entered match.\n';
		oktogo = false;
		}
	}
	//Check giftvoucher requirements
	if (document.forms[0].giftvoucher.checked && ( (document.forms[0].giftvoucher_name.value=="")||(document.forms[0].giftvoucher_address.value==""))) {
		msg2 += '- the name you would like gift voucher made out to.\n - the address where you would like us to send the gift voucher.\n';
		oktogo = false;
	}
	
	if (!document.forms[0].giftvoucher.checked && ( (document.forms[0].giftvoucher_name.value!="")||(document.forms[0].giftvoucher_address.value!=""))) {
		msg2 += '- the checkbox beside "This is for a gift voucher" to be checked.\n';
		oktogo = false;
	}
		
	if (document.forms[0].Contact_Name.value=="") {
		msg2 += '- your full name.\n';
		oktogo = false;
	}
	
	if (msg2 != " " || msg3 != " "){
		msg += '\nAlso to complete the registration, we require:\n\n';
		if (msg2 != " ") {
			msg += msg2;
		}
		if (msg3 != "") {
			msg += msg3;
		}
		msg2 = " ";
	}

	if (!oktogo) alert(msg);
	
	return oktogo;
}

//-->

