function myEmailValidation(obj, BlankWarning)
{
	addlen = obj.value.length;
	invalidchar = 0;
	usernamelength = 0;
	ampcount = 0;
	ampposition = 0;
	domainlength = 0;
	domaindotcount = 0;
	lastdomaindot = 0;
	 if((addlen < 1)&&(BlankWarning==1))
	 {
	 	return confirm("Are you sure that you wish to completely remove your e-Mail address from the system?\n\nClick\"OK\" to remove or \"Cancel\" to return.");
	 }else if(addlen < 1)
	 {
	 	return;
	 }
	 
	 for(i = 0;i < addlen;i++)	
	 {
	 	thischar = obj.value.substring(i,i+1);  
		if (/^\w|-|\.|@$/.test(thischar))	
		{
			if (ampcount == 0 && thischar != "@")	
			{
				usernamelength++;
			}
			if (thischar == "@")	
			{
				ampcount++;
				ampposition = i;
			}
			if (ampcount == 1 && thischar != "@")	
			{
				domainlength++;
			}
			if (ampcount == 1 && thischar == ".")	
			{
				if (i == ampposition+1 || i == lastdomaindot+1)	
				{
					invalidchar++;
				}
				domaindotcount++;
				lastdomaindot = i;
			}
		}
		else	
		{
			invalidchar++;
		}
	}
	if (!(invalidchar == 0 && usernamelength >= 1 && ampcount == 1 && ampposition != 0 && domaindotcount >= 1 && lastdomaindot+3 <= addlen && lastdomaindot+5 >= addlen && domainlength >= 4))
	{
		alert("You have entered an invalid email address.\nPlease enter a valid address.");
		obj.focus();
		return false;
	}else
	return true;
}
function emptyFieldValidation(obj, displayText)
{
	addlen = obj.value.length;
	 if(addlen < 1)
	 {
		alert(displayText + " is a required field.")
		obj.focus();
	 	return false;
	 }
}
function deleteThis(id, YearID, GroupID)
{
	if(confirm("Are you sure that you want to delete this person?\nClick OK to delete or Cancel to return")==true)
	{
		document.location="dn_ClerkshipStudentList.asp?ID=" + id + "&YearID=" + YearID + "&GroupID=" + GroupID;
	}
}
function CheckPWLength(obj)
{
	addlen = obj.value.length;
	 if(!(addlen > 0))
	 {
		alert("Passwords must be at least 1 character long.")
		obj.focus();
	 	return false;
	 }
}
function CheckPWMatch(obj1,obj2, obj3)
{
	pw1 = obj1.value;
	pw2 = obj2.value;
	pw1len = obj1.value.length;
	pw2len = obj2.value.length;
	oldlen = obj3.value.length;
	if (pw1len > 0 && pw2len > 0 && oldlen==0)
	{
		alert("Please enter your old password.");
		obj3.select();
		obj3.focus();
	 	return false;
	}
	 if(!(pw1==pw2))
	 {
		alert("Passwords do not match.")
		obj1.select()
		obj1.focus();
	 	return false;
	 }
}