function changeCase(frmObj) {
var index;
var tmpStr;
var tmpChar;
var preString;
var postString;
var strlen;
tmpStr = frmObj.value.toLowerCase();
strLen = tmpStr.length;
if (strLen > 0)  {
for (index = 0; index < strLen; index++)  {
if (index == 0)  {
tmpChar = tmpStr.substring(0,1).toUpperCase();
postString = tmpStr.substring(1,strLen);
tmpStr = tmpChar + postString;
}
else {
tmpChar = tmpStr.substring(index, index+1);
if (tmpChar == " " && index < (strLen-1))  {
tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
preString = tmpStr.substring(0, index+1);
postString = tmpStr.substring(index+2,strLen);
tmpStr = preString + tmpChar + postString;
         }
      }
   }
}
frmObj.value = tmpStr;
}


	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("This Form Requires Valid Email Addresses to Function.")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("This Form Requires Valid Email Addresses to Function.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("This Form Requires Valid Email Addresses to Function.")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("This Form Requires Valid Email Addresses to Function.")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("This Form Requires Valid Email Addresses to Function.")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("This Form Requires Valid Email Addresses to Function.")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("This Form Requires Valid Email Addresses to Function.")
		    return false
		 }

 		 return true					
	}

function check_required(){
	var emailID=document.theForm.email;
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("This Form Requires Valid Email Addresses to Function.");
		emailID.focus();
		return false;
	}
	if (echeck(emailID.value)==false){
		emailID.value="";
		emailID.focus();
		return false;
	}

	var refemailID=document.theForm.user3;
	
	if ((refemailID.value==null)||(refemailID.value=="")){
		alert("This Form Requires Valid Email Addresses to Function.");
		refemailID.focus();
		return false;
	}
	if (echeck(refemailID.value)==false){
		refemailID.value="";
		refemailID.focus();
		return false;
	}	
	
	
if ( document.theForm.fname.value == "" ) {
alert('You did not enter an answer for the required field \'First Name\'! \n\nYou must do this before your information can be sent.');
document.theForm.fname.focus();
return false;
}

if ( document.theForm.user1.value == "" ) {
alert('You did not enter an answer for the required field \'First Name\'! \n\nYou must do this before your information can be sent.');
document.theForm.user1.focus();
return false;
}

if ( document.theForm.user3.value == "" ) {
alert('You did not enter an answer for the required field \'Your Email Address\'! \n\nYou must do this before your information can be sent.');
document.theForm.user3.focus();
return false;
}

changeCase(document.theForm.fname);
changeCase(document.theForm.lname);
changeCase(document.theForm.user1);
changeCase(document.theForm.user2);
document.theForm.submitButton.value = "Processing. Please Wait ...";
document.theForm.submitButton.disabled = true;
return true;
}