// by spdl@mosaic.ca - 2000

//return True if string is a valid email adress
//return False if string is an invalid email adress	
function eVal(Email) {

    var check = 0;
	
	beta = new String(Email);
	var len = beta.length;
	
	
	// E-mail address must have at least 5 characters (a@a.de)
	if (len <= 5) { check = 1 } 
	
	// Make sure that there is a '@' but only one '@'
	var regEx = /@/gi;
	var gamma = beta.match(regEx) 
	
	if (gamma != null) {
		if (gamma.length != 1) { check = 1}
	}
	else { check = 1; }
	
	// make sure that there is a point in the address
	// make sure there is a '.' after the '@'
	var regEx2 = /./g;
	var delta = beta.match(regEx2);
	if (gamma == null) { check = 1; }
	
	if (beta.lastIndexOf("@") + 1 > beta.lastIndexOf(".")) { check = 1; }
	
	// Make sure that there is no , (comma) in the address
	var regEx = /,/gi;
	var gamma = beta.match(regEx) 
	
	if (gamma != null) { check = 1}
	
	// Last Letter can't be a point
	if (len == beta.lastIndexOf(".")+1) { check = 1; }
	
	// No comma is allowed in e-mail address
	var regEx3 = /,/gi;
	var gamma = beta.match(regEx3) 
	// There is a comma
	if (gamma != null) {
		check = 1
	}
	if (check == 0) { return true; }
	
}



<!--
// by spdl@mosaic.ca - 2001

// couple of functions that can be used 
// to check Forms on the client side

// the var check must be initialized (set to 0)
// if check stays 0 everything is fine
// Otherwise set check to 1.
	
function IsOneChecked(_Form) {
	
	var internCheck = 0;
	var len = document.myForm.length;
    for (x=0;x<len;x++) {
		if (document.myForm[x].name = _Form) {
			if (document.myForm[x].checked == 1){ internCheck++;}
		}
	}
	
	if (internCheck == 0) {
		check = 1;
	}
	else {check = 0; }
}

	// Example: MustBeFilledIn(1,"Password");
function MustBeFilledIn(gNum,_Fields) {
	var check =0;
	// Split up String into Array
	var gNum = gNum
	var a = 0;
	var FieldNames = new Array();
	for (x=0;x<gNum-1;x++) {
		var num = _Fields.indexOf(",", a)
		FieldNames[x] = _Fields.slice(a, num)
		a = num+1
	}
	FieldNames[gNum-1] = _Fields.slice(a, _Fields.length)
	// Split up into Array -- end
	
	// Check
    for (x=0;x<FieldNames.length;x++) {
		if (document.myForm[FieldNames[x]].value == ""){ check = x+1;break; }
	}
	
	return check
	
}

function MustBeSelected(gNum,_Fields) {
	
	// Split up String into Array
	var gNum = gNum
	var a = 0;
	var FieldNames = new Array();
	for (x=0;x<gNum-1;x++) {
		var num = _Fields.indexOf(",", a)
		FieldNames[x] = _Fields.slice(a, num)
		a = num+1
	}
	FieldNames[gNum-1] = _Fields.slice(a, _Fields.length)
	// Split up into Array -- end
	
	// Check
    for (x=0;x<FieldNames.length;x++) {
	var len = document.myForm[FieldNames[x]].options.length
		for (y=0;y<len;y++) {
			if (document.myForm[FieldNames[x]].options[y].selected == 1){ 
				if (document.myForm[FieldNames[x]].options[y].value == ""){check = x+1;break;}
			}
		}
	}
	// Check
	
}
// -->


//document.myForm['mySection'].options[2].value