function myalert() {
    alert('hello!');
}

function show_hide (obj){
   if (document.getElementById(obj).style.display == "none"){
     document.getElementById(obj).style.display = "block";
   } else {
     document.getElementById(obj).style.display = "none" ;
   }
  
}
function confirmdel() {
	if(confirm("Are you sure you want to delete the current registrant?"))
	return true;
	else
	return false;
}
function checkEmailAddress(email)
{
	for (var i = 0; i < email.length; i++)
	{
		var chr = email.charAt(i);

		if (!(((chr >= 'a') && (chr <= 'z')) || ((chr >= 'A') && (chr <= 'Z')) ||
			(chr == '.') || (chr == '@') || (chr == '_') || (chr == '-') ||
			((chr >= '0') && (chr <= '9'))))
		{
			alert("Invalid Email address '" + email + "'.");
			return false;
		}
	}
	if ((email == "") || (email.indexOf('@', 0) == -1) ||
		(email.indexOf('@', 0) == 0) || (email.indexOf('.', 0) == -1) ||
		(email.indexOf('.', 0) == (email.length - 1)) ||
		(email.indexOf('@', 0) == (email.length - 2)) ||
		(email.charAt(0) == '.') || (email.charAt(email.length - 1) == '.'))
	{
		alert("Invalid Email address '" + email + "'.");
		return false;
	}
	// Added by Riz... 241201 checking for invalid emails due to '.' placement
	var temp = email.substring(email.indexOf('@', 0) + 1, email.length);

	if (temp.length > 2)
	{
		if (temp.indexOf('.', 1) == -1)
		{
			alert("Invalid Email address '" + email + "'.");
			return false;
		}
		else
		{
			if (temp.indexOf('.', 1) == temp.length - 1)
			{
				alert("Invalid Email address '" + email + "'.");
				return false;
			}
		}
	}
	else
	{
		alert("Invalid Email address '" + email + "'.");
		return false;
	}

	var charIndex = email.indexOf('@', 0);
	if (email.indexOf('@', charIndex + 1) != -1)
	{
		alert("Invalid Email address '" + email + "'.");
		return false;
	}
	else
	{
		charIndex = email.indexOf('@', 0);
		if (email.charAt(charIndex - 1) == '.')
		{
			alert("Invalid Email address '" + email + "'.");
			return false;
		}
	}
	// This case checks that 2 dots can't be consective
	var previousChar;
	var currentChar;

	for (var i = 0; i < email.length; i++)
	{
		currentChar = email.charAt(i);
		if (currentChar == '.')
		{
			if (currentChar == previousChar)
			{
				alert("Invalid Email address '" + email + "'.");
				return false;
			}
		}
		previousChar = currentChar;
	}
	return true;
}