<!--
function checkRadio(objelement, objform){
	 var radiogroup = objform.elements[objelement];
	 var isok = false;

	 // required element
	 if (radiogroup.length) {
		var checkedRadioButton = -1;
		for (var radioIndex = 0; radioIndex < radiogroup.length; radioIndex++) {
		   if (radiogroup[radioIndex].checked == true) {
			  checkedRadioButton = radioIndex;
			  break;
		   }
		}
		if (checkedRadioButton > -1 ) {
		   isok = true;
		}
	 }
	 radiogroup = null;
	 return isok;
}
//-->
<!--
function isValid(field, additionalchars) {
var valid = "	ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" + additionalchars + "\£/!?<>@#{}*&$:;.,'-+()`" +  " ";
var ok = "yes";
var temp;
for (var i=0; i<field.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if ((valid.value.indexOf(temp) == "-1")&&((temp!="\n")||(temp!="\r")||(temp!="\f"))) ok = "no";
}
if (ok == "no") {
	alert("Invalid entry!  Only characters and numbers are accepted!");
	field.focus();
	field.select();
	return false;
   }

}
//-->
<!--
function isValidPassword(field, additionalchars) {
var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" + additionalchars;// + "\£/!?<>@#{}*&$:;.,'-+()`" +  " ";
var ok = "yes";
var temp;
for (var i=0; i<field.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if ((valid.value.indexOf(temp) == "-1")&&((temp!="\n")||(temp!="\r")||(temp!="\f"))) ok = "yes";
}
if (ok == "no") {
	alert("Invalid entry!  Only characters and numbers are accepted!");
	field.focus();
	field.select();
	return false;
   }
   else {
   return true;
   }

}
//-->
<!--*******************************************************************
//Function isValidReturn(field, addititionalchars)
//Created : 09/02/2000
//Written By : Nathan Brown
//Current Version : 1.0
//Brief Description : Validates object 'field' for charcters and numbers and 
//			any additional characters that are entered in the 				
//			string 'additionalchars'.
//***********************************************************************//-->
<!--
function isValidReturn(field, additionalchars) {
var valid = "	ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" + "/\£!*%&$?<>@#{}:;.,'-+()`" + " " + additionalchars;
var ok = "yes";
var temp;

for (var i=0; i<field.value.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if ((valid.indexOf(temp) == "-1")&&((temp!="\n")||(temp!="\r")||(temp!="\f"))) ok = "no";
	}
if (field.value=="") ok="no";

if (ok == "no") {
	field.focus();
	field.select();
 
	return false;
   }
else{return true;}
}
//-->
<!--*******************************************************************
//Function isValidOnly(field, chars)
//Created : 09/02/2000
//Written By : Nathan Brown
//Current Version : 1.0
//Brief Description : Validates onject 'field' for charcters and numbers specified
//			in the string 'chars' field.
//***********************************************************************//-->
<!--
function isValidOnly(field, chars) {
var valid = chars;
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
	alert("Invalid entry!  Only characters and numbers are accepted!");
	field.focus();
	field.select();
   }
}

//-->
<!--*******************************************************************
//Function isvalidnumber(field, chars)
//Created : 09/02/2000
//Written By : Nathan Brown
//Current Version : 1.0
//Brief Description : Validates onject 'field' for charcters and numbers specified
//			in the string 'chars' field.
//***********************************************************************//-->
<!--
function isvalidnumber(field, name) {
var valid = "0123456789.-";
var ok = "yes";
var temp;
if (field.value=="") ok="no";
for (var i=0; i<field.value.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
	alert("Sorry, the field " + name + " requires a number");
	field.focus();
	field.select();
	return false;
   }
else
{	return true;}
}

//-->
<!--*******************************************************************
//Function isValidEmail(element)
//Created : 09/02/2000
//Written By : Nathan Brown
//Current Version : 1.0
//Brief Description : Validates the value in the object 'element' for '@' and '.'
//***********************************************************************//-->
<!--
function isValidEmail(element)
{
	return true;
	if (element.value.indexOf("@") == -1 || 	 form.email.value.indexOf(".") == -1) 
			{
				//alert("Please include a proper email address.");
				return False;
			}
}



//-->
<!--*******************************************************************
//Function isValidDate(datestr)
//Created : 09/02/2000
//Written By : Nathan Brown
//Current Version : 1.0
//Brief Description : Validates string 'datestr' for the standard date format.
//***********************************************************************//-->
<!--
function isValidDate(dateStr) {
// Checks for the following valid date formats:
// DD/MM/YY   DD/MM/YYYY   DD-MM-YY   DD-MM-YYYY
// Also separates date into  day, month, and year variables

var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;
// To require a 4 digit year entry, use this line instead:

//	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;

	var matchArray = dateStr.match(datePat); // is the format ok?

	if (matchArray == null) 
		{
			alert("Date is not in a valid format. (dd/mm/yy)")
			return false;
		}

	day = matchArray[1];
	month = matchArray[3]; // parse date into variables
	year = matchArray[4];

	if (month < 1 || month > 12) 
		{ // check month range
			alert("Month must be between 1 and 12.");
			return false;
		}
	
	if (day < 1 || day > 31) 
		{
			alert("Day must be between 1 and 31.");
			return false;
		}
	
	if ((month==4 || month==6 || month==9 || month==11) && day==31) 
		{
			alert("Month "+month+" doesn't have 31 days!")
			return false
		}
	
	if (month == 2) 
		{ // check for february 29th
			var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
			if (day>29 || (day==29 && !isleap)) 
				{
					alert("February " + year + " doesn't have " + day + " days!");
					return false;
				}
		}
	return true;  // date is valid
}

//***********************************************************************
//Function checkfieldchar(elm, Name)
//Created : 07/03/2000
//Written By : Nathan Brown
//Current Version : 1.0
//Brief Description : if the field is not empty the function checks the characters used
// only returns false if an invalid character is entered.
//therefore should only be used on non-critical fields
//***********************************************************************

function checkfieldchar(elm, Name)
{
//	if (elm.value>"")
//		{
//		if (!isValidReturn(elm,""))
//			{
//			alert("There is an illegal character in " + Name);
//			return  false;
//			}
//		else
//			{
//			return  true;
//			}
//		}
//	else
//		{
		return  true;
//		}

}

function checkpasswordchar(elm, Name)
{
	if (!elm.value=="")
		{
		if (!isValidPassword(elm,""))
			{

			return  false;
			}
		else
			{
			return  true;
			}
		}
	else
		{
		return  false;
		}

}

function checkemail(elm, Name)
{
	if (elm.value>"")
		{
		return isValidEmail(elm);
		}
	else
		{
		return  false;
		}

}
//***********************************************************************
//Function checkfield(elm, Name)
//Created : 07/03/2000
//Written By : Nathan Brown
//Current Version : 1.0
//Brief Description : if the field is empty or the is an illegal character then return false
//for use on critical fields
//***********************************************************************
function checkfield(elm, Name)
{
	if (elm.value>"")
		{
			elm.focus();
			return  true;
		}
	else
		{
		//alert("Please enter a " + Name + ".");
		return  false;
		}

}

//***********************************************************************
//Function checkdate(elm, Name)
//Created : 07/03/2000
//Written By : Nathan Brown
//Current Version : 1.0
//Brief Description : checks the date and checks if empty. either return false
//***********************************************************************
function checkdate(elm, Name)
{
	var datestr = elm.value;
	if (datestr >"")
		{
		if (!isValidDate(datestr ))
			{
			alert("Please enter a valid Date into " + Name + ".(dd/mm/yyyy)");
			elm.focus();
			return  false;
			}
		else
			{
			return  true;
			}
		}
	else
		{
		alert("Please enter a valid Date into " + Name + ".(dd/mm/yyyy)");
		elm.focus();
		return  false;
		}
}
//***********************************************************************
//Function checkdatechar(elm, Name)
//Created : 07/03/2000
//Written By : Nathan Brown
//Current Version : 1.0
//Brief Description : checks if date is of a valid format only if not empty
// returns true if empty, so not good for critical dates
//***********************************************************************
function checkdatechar(elm, Name)
{	return true;
	var datestr = elm.value;
	if (datestr >"")
		{
		if (!isValidDate(datestr ))
			{
			alert("Please enter a valid Date into " + Name + ".(dd/mm/yyyy)");
			elm.focus();
			return  false;
			}
		else
			{
			return  true;
			}
		}
	else
		{
		return  true;
		}
}

//***********************************************************************
//Function doConfirm(whichURL)
//Created : 21/03/2000
//Written By : Rye
//Current Version : 1.0
//Brief Description : Passes the correct deletion URL, brings up
// a confirm dialogue box, and on user confim, redirects to the URL
//***********************************************************************
function doConfirm(whichURL)
	{
	if (!confirm("Are you sure you want to delete this record?"))
		//alert("No")
		var doNothing = 0;
	else
		//alert("Yes")
		this.location.href = whichURL; 
	}
function doConfirmCommand(strText, strCommand)
	{
	if (!confirm(strText))
		//alert("No")
		var doNothing = 0;
	else
		//alert("Yes")
		eval(strCommand); 
	}


// End -->
