<!----------------------------------------------------------------------------------------------------------------->  
<!--------EMAIL AND CHECK IF PHONE AND ZIP IS NUMBER                   -------------------------------------------->  
<!----------------------------------------------------------------------------------------------------------------->  



function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}


function isDigit(c)
{   
 return ((c >= "0") && (c <= "9"))
}

function isNoInt(field)
{ 
  var i, c;
  var s = field.value;
 for (i = 0; i < s.length; i++)
  { // Check if current character is number.
   c = s.charAt(i);
   if (isDigit(c)) 
    {
    //field.focus();
      return false;
    }
  }
 
 return true;
}

function checkRadioGroup(theForm,theGroupname) {
var theElements = theForm.getElementsByTagName("input")
for (var i = 0; i < theElements.length; i++) {
if (theElements[i].type == 'radio' && theElements[i].name == theGroupname && theElements[i].checked)
return true
}
return false
}



//=================================================================================================================================================================

function checkStatus(theForm) {     

<!----------------------------------------------------------------------------------------------------------------->  
<!--------if the user selects other check if the text fields are empty -------------------------------------------->  
<!----------------------------------------------------------------------------------------------------------------->  
 
  	checkEmpty= "";
	checkNoInt= "";
  	checkInt= "";
	checkBoxes= "";
 	
	<!----------------------------------------------------------------------------------------------------------------->  
if (!checkRadioGroup (theForm,'appln'))
		{
		checkEmpty = "\n- Please select your application";
		}
	
	<!----------------------------------------------------------------------------------------------------------------->  
	
	if(theForm.zip.value=="")
	{
	checkEmpty += "\n- Zip Code";
	}
	
	if (isNoInt(theForm.zip))
     {
	 	checkInt = "\n- Zip Code ";
	 }
	
	<!----------------------------------------------------------------------------------------------------------------->  


	<!----------------------------------------------------------------------------------------------------------------->  


	if(theForm.dob_month.value=="")
	{
	checkEmpty += "\n- Date of Birth - Month";
	}
	
	if(theForm.dob_day.value=="")
	{
	checkEmpty += "\n- Date of Birth - Day";
	}
	
	if(theForm.dob_year.value=="")
	{
	checkEmpty += "\n- Date of Birth - Year";
	}
		
	<!----------------------------------------------------------------------------------------------------------------->  

		if(theForm.email.value=="")
	{
	checkEmpty += "\n- Email Address";
	}
	
//=======================================================================================================================================================================
	 
	  
		if(checkEmpty>""){
		alert("Please Enter/Select a value for the following fields :\t\t\t\n-------------------" +checkEmpty+"\n ")
		return false
	  }
	  
	  if(checkNoInt>""){
		alert("Following Fields cannot contain any Numeric Values :\t\t\t\n-----------------------------------------------" +checkNoInt+ "\n ")
		return false
	  }
	 
	 if(checkInt>""){
		alert("Following Fields can contain Numeric Values only :\t\t\t\n-------------------------------------------------" +checkInt+ "\n ")
		return false
	  }
	
	 
//======================================================================================================================================================================	 
 
	
	if (theForm.zip.value.length < 5 || theForm.zip.value.length > 5 )	
		 { 																		
		 alert(" Please Enter 5 digit Zip Code.");  
		  theForm.zip.focus(); 				 
		return false; 								
		} 

	if (!isEmailAddr(theForm.email.value))
	  {
		alert("Please enter a complete email address in the form: yourname@yourdomain.com");
		theForm.email.focus();
		return false;
	  }
//======================================================================================================================================================================

}

//======================================================================================================================================================================