function echeck(formname,fieldname,fieldtitle,suppressAlert) {

	var fullfield = document.forms[formname].elements[fieldname];
	var str = fullfield.value;
	
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	
	if (str.indexOf(at)==-1){
		if (!suppressAlert)
	 		alert('Please enter a valid ' + fieldtitle);
	   return false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		if (!suppressAlert)
	 		alert('Please enter a valid ' + fieldtitle);
	   return false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		if (!suppressAlert)
	 		alert('Please enter a valid ' + fieldtitle);
		return false;
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		if (!suppressAlert)
	 		alert('Please enter a valid ' + fieldtitle);
		return false;
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		if (!suppressAlert)
	 		alert('Please enter a valid ' + fieldtitle);
		return false;
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		if (!suppressAlert)
	 		alert('Please enter a valid ' + fieldtitle);
		return false;
	 }
	
	 if (str.indexOf(" ")!=-1){
		if (!suppressAlert)
	 		alert('Please enter a valid ' + fieldtitle);
		return false;
	 }

	 return true;					
}





function fieldcheck(formname,fieldname,fieldtitle,suppressAlert) {
	var fullfield = document.forms[formname].elements[fieldname];
	if ((fullfield.value==null)||(fullfield.value=="")||(fullfield.value=="undefined")){
		if (!suppressAlert)
			alert('Please enter the ' + fieldtitle);
		// fullfield.focus();
		return false;
	}
	return true;
}






function radiocheck(formname,fieldname,fieldtitle,suppressAlert) {
	var fullfield = document.forms[formname].elements[fieldname];
	
	var checkbox_choices = 0;
	for (counter = 0; counter < fullfield.length; counter++) {
		if (fullfield[counter].checked)
			checkbox_choices = checkbox_choices + 1;
	}
	
	if (checkbox_choices == 0){
		if (!suppressAlert)
			alert('Please enter the ' + fieldtitle);
		// fullfield.focus();
		return false;
	}
	return true;
}






function PassCheck(formname,passfield,confirmfield,suppressAlert) {

	var fullpassfield = document.forms[formname].elements[passfield];
	var fullconfirmfield = document.forms[formname].elements[confirmfield];
	
	if (fullpassfield.value!=fullconfirmfield.value) {
		if (!suppressAlert)
			alert('Please re-type your Password and Password Confirmation.');
		fullpassfield.focus();
		return false;
	}
	return true;
}

