//validiate formfn = 'document.' + fn + '.';var TxtMsg = '';var TxtErrCount = 0;var RadioMsg = '';var RadioErrCount = 0;var PullMsg = '';var PullErrCount = 0;var CheckMsg = '';var CheckErrCount = 0;var firstElement = null;var AllErrCount = 0;var AllErrType = null;	function textCheck (f_element) {		s = eval(fn + f_element +'.value');		for(var i=0; i< s.length; i++){		var a = s.charAt(i);		if ((a != ' ') && (a != '\n') && (a != '\t')) return false;		}	return true; }function typeValidate (fieldName, type, fieldLabel) {	if ((type == 'text') || (type == 'textArea')){		if ( textCheck(fieldName) ) {			AllErrCount += 1;TxtErrCount += 1;			if (TxtErrCount == 1){TxtMsg += fieldLabel }else{TxtMsg += ', ' + fieldLabel;}			if (AllErrCount == 1){firstElement = fieldName; AllErrType ='text';}			return false;		}	}	else if(type == 'check'){		selected = false;		cfield = fieldName.split("::");		for (i=0; i<cfield.length; i++){			if (eval(fn + cfield[i]  + '.checked')){			selected = true;			tempName = eval(fn + cfield[i]);			alert(tempName);			return true;			}		}						if (selected == false){			AllErrCount += 1;CheckErrCount += 1;			if (CheckErrCount == 1){CheckMsg += fieldLabel }else{CheckMsg += ', ' + fieldLabel;}			//if (AllErrCount == 1){firstElement = tempName; AllErrType ='check';}			return false;		}	}	else if(type == 'pull'){		selected = false;		for (i=0; i<eval(fn + fieldName +'.length'); i++){			if ((eval(fn + fieldName + '[' + i + ']'  + '.selected')) && (eval(fn + fieldName + '[' + i + ']'  + '.value') != '')){			selected = true;			return true;			}		}		if (selected == false){			AllErrCount += 1;PullErrCount += 1;			if (PullErrCount == 1){PullMsg += fieldLabel }else{PullMsg += ', ' + fieldLabel;}			if (PullErrCount == 1){firstElement = fieldName; AllErrType ='pull';}			return false;		}		}	else if(type == 'radio'){		selected = false;		for (i=0; i<eval(fn + fieldName +'.length'); i++){			if (eval(fn + fieldName + '[' + i + ']'  + '.checked')){			selected = true;			return true;			}		}		if (selected == false){			AllErrCount += 1;RadioErrCount += 1;			if (RadioErrCount == 1){RadioMsg += fieldLabel }else{RadioMsg += ', ' + fieldLabel;}			if (AllErrCount == 1){firstElement = fieldName; AllErrType ='radio';}			return false;		}		}	else if (type == 'email'){		var objRegExp  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;		var s = eval(fn + fieldName +'.value');		if (s != ''){			if (! objRegExp.test(s)){			AllErrCount += 1;TxtErrCount += 1;			if (TxtErrCount == 1){TxtMsg += fieldLabel + ' (not valid)' }else{TxtMsg += ', ' + fieldLabel + ' (not valid)';}			if (AllErrCount == 1){firstElement = fieldName; AllErrType ='text';}			return false; 			}		}		else{			AllErrCount += 1;TxtErrCount += 1;			if (TxtErrCount == 1){TxtMsg += fieldLabel + ' (not valid)' }else{TxtMsg += ', ' + fieldLabel + ' (not valid)';}			if (AllErrCount == 1){firstElement = fieldName; AllErrType ='text';}			return false; 		}				return true;			}	}function validate(){	AllErrCount = 0;	firstElement = null;	AllErrType = null;	TxtMsg = '';   TxtErrCount = 0;	RadioMsg = ''; RadioErrCount = 0;	PullMsg = '';  PullErrCount = 0;	CheckMsg = ''; CheckErrCount = 0;	required();			if (TxtErrCount == 1){ TxtMsg = 'You forgot to fill in the \n' + TxtMsg + ' field.\n\n';}	else if (TxtErrCount >= 2){ TxtMsg ='You forgot to fill in these \ntext fields:  \n-------------------------\n' + TxtMsg + '.\n\n';}		if (CheckErrCount == 1){ CheckMsg = 'Please make a selection from the \n' + CheckMsg + ' checkboxes.\n\n';}	else if (CheckErrCount >= 2){ CheckMsg ='You forgot make selections from \nthese checkboxes:  \n------------------------\n' + CheckMsg + '.\n\n';}		if (PullErrCount == 1){ PullMsg = 'Please make a selection from the \n' + PullMsg + ' pulldown.\n\n';}	else if (PullErrCount >= 2){ PullMsg ='You forgot make selections from \nthese pulldown boxes:  \n------------------------\n' + PullMsg + '.\n\n';}	if (RadioErrCount == 1){ RadioMsg = 'Please make a selection from the \n' + RadioMsg + ' radio button group.\n\n';}	else if (RadioErrCount >= 2){ RadioMsg ='You forgot make selections from \nthese radio button groups:  \n------------------------\n' + RadioMsg + '.\n\n';}			if (TxtErrCount || RadioErrCount || PullErrCount || CheckErrCount){ 		alert(TxtMsg + RadioMsg + PullMsg + CheckMsg);		if (AllErrType == 'text'){		eval(fn + firstElement +'.focus()');		eval(fn + firstElement +'.select()');		}		if (AllErrType == 'radio'){		eval(fn + firstElement + '[0]' +'.focus()');		}				if (AllErrType == 'check'){				//eval(fn + firstElement  +'.focus()');		//document.Contact.checkbox1.focus();		//eval(fn + firstElement +'.focus();');		//eval(fn + firstElement +'.select()');		}		return false;	}	return true;}			    