

//Use the following variable to specify 
//the number of random words

var NoofWho = 50

var who = new BuildArray(NoofWho)

//Use the following variables to 
//define your random words:

who[1] = "policeman"
who[2] = "teacher"
who[3] = "manager"
who[4] = "cab driver"
who[5] = "lorry driver"
who[6] = "teenager"
who[7] = "grandmother"
who[8] = "grandfather"
who[9] = "housewife"
who[10] = "nurse"
who[11] = "doctor"
who[12] = "pharmacist"
who[13] = "milkman"
who[14] = "estate agent"
who[15] = "author"
who[16] = "headmistress"
who[17] = "headmaster"
who[18] = "cook"
who[19] = "shop assistant"
who[20] = "debt collector"
who[21] = "bouncer"
who[22] = "disc jockey"
who[23] = "actor"
who[24] = "actress"
who[25] = "father"
who[26] = "mother"
who[27] = "child"
who[28] = "pawnbroker"
who[29] = "jockey"
who[30] = "scientist"
who[31] = "night porter"
who[32] = "geologist"
who[33] = "architect"
who[34] = "surveyor"
who[35] = "inspector"
who[36] = "archaeologist"
who[37] = "historian"
who[38] = "professor"
who[39] = "president"
who[40] = "politician"
who[41] = "vicar"
who[42] = "bishop"
who[43] = "interior designer"
who[44] = "hypnotist"
who[45] = "mercenary"
who[46] = "soldier"
who[47] = "funeral director"
who[48] = "midwife"
who[49] = "tour guide"
who[50] = "psychologist"
who[51] = "singer"

function BuildArray(size){
    this.length = size
    for (var i = 1; i <= size; i++){
        this[i] = null}
    return this
}

function PickRandomWho(frm) {
    // Generate a random number between 1 and NoofWho
    var rnd = Math.ceil(Math.random() * NoofWho)

    // Display the word inside the text box
    frm.WhoBox.value = who[rnd]
}

