// JavaScript Document
<!--
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Please enter a valid email address.")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter a valid email address.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter a valid email address.")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid email address.")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid email address.")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid email address.")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please enter a valid email address.")
		    return false
		 }

 		 return true					
	}

function validateThis(theForm)
{

  if (theForm.regusername.value == "")
  {
    alert("Please enter a value for the \"Username\" field.");
    theForm.regusername.focus();
    return (false);
  }

  if (theForm.regusername.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Username\" field.");
    theForm.regusername.focus();
    return (false);
  }

  if (theForm.regusername.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"Username\" field.");
    theForm.regusername.focus();
    return (false);
  }

  if (theForm.regemail.value == "")
  {
    alert("Please enter a value for the \"Email Address\" field.");
    theForm.regemail.focus();
    return (false);
  }

  if (theForm.regemail.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Email Address\" field.");
    theForm.regemail.focus();
    return (false);
  }

  if (theForm.regemail.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"Email Address\" field.");
    theForm.regemail.focus();
    return (false);
  }
  
 if (echeck(theForm.regemail.value)==false){
		theForm.regemail.value="";
		theForm.regemail.focus();
		return (false);
	} 
	
    if (theForm.regemail.value != theForm.regemail2.value)
  {
    alert("Both \"Email Address\" fields must contain the same address.");
    theForm.regemail2.focus();
    return (false);
  }

  return (true);
}
//-->