window.onload = initAll;// this file is used in memberlogin.phpfunction initAll() {	var reminderdiv = document.getElementById("pwreminder");		reminderdiv.onclick = showreminderdiv;		document.forms[0].onsubmit = precheckData1;	document.forms[1].onsubmit = precheckData2;	}function showreminderdiv() {	// toggles div display	var showdivvar = document.getElementById("reminderdiv").style;	if (showdivvar.display == "block") {		showdivvar.display = "none";	}	else {		showdivvar.display = "block";	}	return(false);}function precheckData1() {	var allTags = document.getElementsByTagName("input");	for (var i=0; i<2; i++) {		allTags[i].className = "reqd";	}	for (var i=2; i<allTags.length; i++) {		allTags[i].className = "";	}	return checkData();	}function precheckData2() {	var allTags = document.getElementsByTagName("input");	for (var i=0; i<2; i++) {		allTags[i].className = "";	}	for (var i=2; i<allTags.length; i++) {		allTags[i].className = "reqd";	}	return checkData();	}function checkData() {	var allGood = true;	var allTags = document.getElementsByTagName("input");	for (var i=0; i<allTags.length; i++) {		if (!validTag(allTags[i])) {			allGood = false;			}	}	return allGood;		function validTag(thisTag) {	// is inside validForm function to be able to pass information		var outClass = "";		var allClasses = thisTag.className.split(" ");		for (var j=0; j<allClasses.length; j++) {			outClass +=validBasedOnClass(allClasses[j]) + " ";			}				thisTag.className = outClass;				if (outClass.indexOf("invalid") > -1) {	// invalid = error is in that string			thisTag.focus();	// forces to be in focus, puts cursor into field			if (thisTag.nodeName == "INPUT") {				thisTag.select();				}			return false;		}		return true;						function validBasedOnClass(thisClass) {			var classBack = "";				switch(thisClass) {				case "":				case "invalid":					break;				case "reqd":	// this input field is required class					if (allGood && thisTag.value == "") {						classBack = "invalid ";						}					classBack += thisClass;					break;				case "email":					if (allGood && !validEmail(thisTag.value)) {						classBack = "invalid ";	// not valid email address						}					classBack +=thisClass;					break;				default:					classBack += thisClass;			}			return classBack;		}				function validEmail(email) {	// checks whether email addr is valid, does not check for all problems			var invalidChars = " /:,;";						if (email == "") {				return false;				}			for (var k=0; k<invalidChars.length; k++) {				var badChar = invalidChars.charAt(k);				if (email.indexOf(badChar) > -1) {	// if invalid chars are in there return false					return false;					}			}			var atPos = email.indexOf("@",1);	// is @ after the first character?			if (atPos == -1) {				return false;				}			if (email.indexOf("@",atPos+1) != -1) {	// is there more than one @ in there?				return false;				}			var periodPos = email.indexOf(".",atPos);			if (periodPos == -1) {				return false;				}			if (periodPos+3 > email.length) {	// position of . needs to be not at end but at least 2 chars before end				return false;				}			return true;					}	}}