<!-- hide script from non-script enabled browsers

var reminder_submitted = false;

// function to check reminder data is correct before submitting
function CheckReminder()
{
  	if ( reminder_submitted )
	{
		alert ( "Your reminder request has already been submitted. Please wait..." );
		return false;
	}

  	// initialise variables
	var errorMsg = "";

	// check for a name
	if (document.reminder_form.reminder_name.value == "")
	{
		errorMsg += "\n Reminder Name \t- Enter a name for this reminder";
	}
	// check for a supplier cashback
	if (document.reminder_form.cashback_id.value == "")
	{
		errorMsg += "\n Mobile Retailer \t- Select the retailer you ordered from";
	}
	// check start date
	var day = document.reminder_form.start_day.value;
//	// javascript months start at 0 (0-11 instead of 1-12)
	var month =	document.reminder_form.start_month.value - 1;
	var year = document.reminder_form.start_year.value;
	var theDate = new Date(year,month,day);
	if ( (day != theDate.getDate()) || (month != theDate.getMonth())
			|| (year != theDate.getFullYear()) )
	{
		errorMsg += "\n Date Connected \t- Select a valid contract start date";
	}
	// check for an email address
	if (document.reminder_form.email_addr.value == "")
	{
		errorMsg += "\n Email Address \t- Enter your email address";
	}
	// check for a valid email address
	else if ((document.reminder_form.email_addr.value.indexOf("@",0) == -1)
			|| (document.reminder_form.email_addr.value.indexOf(".",0) == -1))
	{
		errorMsg += "\n Email Address \t- Enter a valid email address";
	}

	// if there is a problem with the email then display the error(s)
	if (errorMsg != "")
	{
		msg = "____________________________________________\n\n";
		msg += " The reminder could not be setup because of a problem.\n";
		msg += " Please correct the following and then re-send.\n";
		msg += "___________________________________________\n";

		// display the error
		errorMsg += alert(msg + errorMsg + "\n\n");
	}
	else
	{
		// confirm email is correct
		reminder_submitted = confirm('Please check and confirm your email address is:\n\n ' + document.reminder_form.email_addr.value);
	}
	// return result
	return reminder_submitted;
}
// end script hiding -->
