function checkform(objForm) {

if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion<7) return;

for (var m=0; m < objForm.elements.length; m++) {
		if (objForm.elements[m].className.indexOf('VALIDATE')!=-1){
			elemToTest=objForm.elements[m].className;
			if (elemToTest.match(/VALIDATE (\S+)/)) {
				elemType = elemToTest.match(/VALIDATE (\S+)/)[1]
				if (elemType == 'ValidateTEXT') {
					obj = eval("objForm." + objForm.elements[m].name);
					if (isFilled(obj) == false) {
						alert("Please check that the form is complete.");
						//obj.select();
						return false;
					}
				}

				if (elemType == 'ValidateEMAIL') {
					obj = eval("objForm." + objForm.elements[m].name);
					if (isEmail(obj) == false) {
						alert("Please check that you have entered a valid email address.");
						obj.select();
						return false;
					}
				}
				if (elemType == 'ValidateNUMBER') {
					obj = eval("objForm." + objForm.elements[m].name);
					if (isNaN(obj.value) == true) {
						alert("Please check that you have entered a valid number.");
						obj.select();
						return false;
					}
				}
				if (elemType == 'ValidateSELECT') {
					obj = eval("objForm." + objForm.elements[m].name);
					if (isFilled(obj) == false) {
						alert("Please check that you have selected a valid option.");
						return false;
					}
				}
			}

		}
	}
		return true;
}


//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\

function isEmail(elm) {
	if (elm.value.indexOf("@") + "" != "-1" && elm.value.indexOf(".") + "" != "-1" && elm.value != "")
		return true;
	else return false;
}

function isFilled(elm) {
	if (elm.value == "" || elm.value == null)
		return false;
	else return true;
}


//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\

function checkAnswers(thing) {
	for(n=0; n<thing.length; n++) {
		objEle = eval('document.forms[0].question_' +thing[n].value +'_answer');
		if (objEle.tagName != 'TEXTAREA' && !checkRadio(objEle)) {
			return false;
		}
	}
	return true;
}

function checkRadio(obj) {
	var bCheck = false;
	for(i=0; i<obj.length; i++) {
		if (obj[i].checked) {
			bCheck = true;
		}
	}
	if (bCheck == false) {
		alert ("Please ensure you have completed the form");
		return false;
	}
	return true;
}