function ELKLoginValidate(){
    var email = document.ELKLogin.email.value;
    var password = document.ELKLogin.password.value;

    if(trim(email) == ""){
	alert("The email address is required. Please enter the email address that you have registered for Voice Terminal service");
	document.ELKLogin.email.focus();
	return false;
    }

    if(!checkEmail(email)){
	alert("Invalid email address.  Please enter again.");
	document.ELKLogin.email.focus();
	return false;
    }

    if(trim(password) == ""){
	alert("The password is required.  Please enter your mailbox password!");
	document.ELKLogin.password.focus();
	return false;
    }

    return true;
}

function APLoginValidate(){
    var phone = document.APLogin.phoneAccessCode.value;
    var pin =  document.APLogin.PIN.value;

    if(trim(phone) == ""){
	alert("10 digit account number is required to access your Voice Terminal account information.  Please enter your account number!");
	document.APLogin.phoneAccessCode.focus();
	return false;
    }

    if (trim(phone).length != 10){
	alert("Invalid account number. Please re-enter the account number.");
	document.APLogin.phoneAccessCode.focus();
	return false;
    }
	
    for (i=0; i < phone.length; i++){
	if (isNaN(phone.charAt(i))){
            alert("Invalid account number! Please enter only digits!");
            document.APLogin.phoneAccessCode.focus();
            return false;
	}
    }
	
    if(trim(pin) == ""){
	alert("The PIN is required to access your Voice Terminal account information.  Please enter your PIN number!");
	document.APLogin.PIN.focus();
	return false;
    }

    if (trim(pin).length != 4){
	alert("Invalid PIN. Please re-enter your PIN.");
	document.APLogin.PIN.value = "";
	document.APLogin.PIN.focus();
	return false;
    }
	
    for (i=0; i < pin.length; i++){
	if (isNaN(pin.charAt(i))){
            alert("Invalid PIN. Please enter only digits!");
            document.APLogin.PIN.value = "";
            document.APLogin.PIN.focus();
            return false;
	}
    }

    return true;
}
