<!--
function init_form()
{
	document.forms[0].gmt_offset.value = "0";
	document.forms[0].username.focus();
	
	new_validation_image();
}

function new_validation_image()
{
	if(document.getElementById)
	{
		document.getElementById("validation_image").src = "./securimage_show.php?" + Math.random();
	} else {
		alert("Your browser does not support reloading the image this way.\nSubmit the form and a new image will be loaded.");
	}
}


function checkemail(strng)
{
	var temp = new String(strng);
	var index = temp.indexOf("@");

	if (index > 0) {
		var pindex = temp.indexOf(".",index);

		if ((pindex > index + 1) && (temp.length > pindex + 1)) {
			return true;
		}
	}
	
	return false;
}

function validate_form(form)
{
	if (form.username.value == "") {
		alert("You did not enter a username. \n \nPlease enter a username.");
		form.username.focus();
		return false;
	}
	
	if (form.username.value.length >= 20) {
		alert("The username you have entered is too long. \n \nPlease use less than 20 characters.");
		form.username.focus();
		return false;
	}
	
	if (form.password.value == "") {
		alert("You did not enter a password. \n \nPlease enter a password.");
		form.password.focus();
		return false;
	}
	
	if (form.confirm_password.value == "") {
		alert("You did not confirm your password. \n \nPlease confirm your password.");
		form.confirm_password.focus();
		return false;
	}
	
	if (form.password.value != form.confirm_password.value) {
		alert("Your confirmation password is different to your password. \n \nPlease re-confirm your password.");
		form.confirm_password.focus();
		return false;
	}
	
	if (form.email_address.value == "" || checkemail(form.email_address.value) == false) {
		alert("You did not enter a valid e-mail address. \n \nPlease enter a valid e-mail address. eg, yourname@yourdomain.com");
		form.email_address.focus();
		return false;
	}
	
	if (form.email_address.value.length > 255) {
		alert("The e-mail address you have entered is too long. \n \nPlease use less than 255 characters.");
		form.email_address.focus();
		return false;
	}
	
	if (form.gmt_offset.value == "" || isNaN(form.gmt_offset.value)) {
		alert("The value entered for the GMT Offset is not numeric. \n \nPlease enter a number.");
		form.gmt_offset.focus();
		return false;
	}
	
	if (form.validation_word.value.length != 7) {
		alert("The validation word must be 7 characters. \n \nPlease enter the correct validation word.");
		form.validation_word.focus();
		return false;
	}
	
	return true;
}
//-->
