// JavaScript Document

function its_a_letter_digit(character) {

    var lowercase_letters = "abcdefghijklmnopqrstuvwxyz-αβγδεζηθικλμνξοπρστςυφχψωάέίήόώύ "
    var uppercase_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"

    // If it's not in the lowercase_letters string or the
    // uppercase_letters string, then it's not a letter, 
    // so return false
    
    if (lowercase_letters.indexOf(character) == -1 &&
        uppercase_letters.indexOf(character) == -1) {
        return false
    }
    
    // Otherwise, it's a letter, so return true
    return true
}


function its_alphanumeric(string_value) {

    // Run through each character in the string
    for (var counter = 0; counter < string_value.length; counter++) {
        
        // Get the current character
        current_char = string_value.charAt(counter)
        
        // If it's not a letter, return false
        if (!its_a_letter_digit(current_char)) {
            return false
        }
    }
    
    // Otherwise, the string has nothing but
    // alphabetic characters, so return true
    return true
}





function its_a_letter(character) {

    var lowercase_letters = "abcdefghijklmnopqrstuvwxyz-αβγδεζηθικλμνξοπρστςυφχψωάέίήόώύ "
    var uppercase_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"

    // If it's not in the lowercase_letters string or the
    // uppercase_letters string, then it's not a letter, 
    // so return false
    
    if (lowercase_letters.indexOf(character) == -1 &&
        uppercase_letters.indexOf(character) == -1) {
        return false
    }
    
    // Otherwise, it's a letter, so return true
    return true
}

function its_alphabetic(string_value) {

    // Run through each character in the string
    for (var counter = 0; counter < string_value.length; counter++) {
        
        // Get the current character
        current_char = string_value.charAt(counter)
        
        // If it's not a letter, return false
        if (!its_a_letter(current_char)) {
            return false
        }
    }
    
    // Otherwise, the string has nothing but
    // alphabetic characters, so return true
    return true
}

function its_a_digit(character) {

    var digit_characters = "0123456789"

    // If it's not in the digit_characters string,
    // then it's not a digit so return false
    
    if (digit_characters.indexOf(character) == -1) {
        return false
    }
    
    // Otherwise, it's a digit, so return true
    return true
}

function its_integer(string_value) {

    // Run through each character in the string
    for (var counter = 0; counter < string_value.length; counter++) {
        
        // Get the current character
        current_char = string_value.charAt(counter)
        
        // If it's not a digit, return false
        if (!its_a_digit(current_char)) {
            return false
        }
    }
    
    // Otherwise, the string has nothing but
    // digits, so return true
    return true
}

function its_sum(string_value) {

    // Run through each character in the string
    for (var counter = 0; counter < string_value.length; counter++) {
        
        // Get the current character
        current_char = string_value.charAt(counter)
        
        // If it's not a digit, return false
        if (!its_a_digit(current_char)) {
            return false
        }
		if(counter==0 && current_char=='0'){
			return false
		}
		
    }
    
    // Otherwise, the string has nothing but
    // digits, so return true
    return true
}


function its_a_telephone_digit(character) {

    var digit_characters = "0123456789- "

    // If it's not in the digit_characters string,
    // then it's not a digit so return false
    
    if (digit_characters.indexOf(character) == -1) {
        return false
    }
    
    // Otherwise, it's a digit, so return true
    return true
}

function its_telephone(string_value) {

    // Run through each character in the string
    for (var counter = 0; counter < string_value.length; counter++) {
        
        // Get the current character
        current_char = string_value.charAt(counter)
        
        // If it's not a digit, return false
        if (!its_a_telephone_digit(current_char)) {
            return false
        }
    }
    
    // Otherwise, the string has nothing but
    // digits, so return true
    return true
}