// Define the poems
// There are 3 poems in this example so need 3 new arrays inside the main one.
// The poem titles are kept in the same arrays as the poems

var poems = new Array(new Array(), new Array(), new Array());

// Add the poem lines to the array
// NOTE Arrays start at 0

poems[0][0]= "Title - Poem 1" + "<br>";
poems[0][1]= "poem1, line 1";
poems[0][2]= "poem1, line 2";
poems[0][3]= "poem1, line 3";
poems[0][4]= "poem1, line 4";
poems[0][5]= "poem1, line 5";
poems[0][6]= "poem1, line 6";
poems[0][7]= "poem1, line 7";
poems[0][8]= "poem1, line 8";

poems[1][0]= "Title - Poem 2" + "<br>";
poems[1][1]= "poem2, line 1";
poems[1][2]= "poem2, line 2";
poems[1][3]= "poem2, line 3";
poems[1][4]= "poem2, line 4";
poems[1][5]= "poem2, line 5";
poems[1][6]= "poem2, line 6";
poems[1][7]= "poem2, line 7";
poems[1][8]= "poem2, line 8";
poems[1][9]= "poem2, line 9";

poems[2][0]= "Title - Poem 3" + "<br>";
poems[2][1]= "poem3, line 1";
poems[2][2]= "poem3, line 2";
poems[2][3]= "poem3, line 3";
poems[2][4]= "poem3, line 4";
poems[2][5]= "poem3, line 5";
poems[2][6]= "poem3, line 6";
poems[2][7]= "poem3, line 7";
poems[2][8]= "poem3, line 8";
poems[2][9]= "poem3, line 9";
poems[2][10]= "poem3, line 10";

// Define the variables
// NOTE - There are 3 poems, but need one less than this in the PoemNum equation
// If you use 4 poems then change the 2 for a 3 and so on.

var count=0;
var poemNum=Math.round(Math.random() * 2);

// Write the poems to the HTML page
for (count=0;count<poems[poemNum].length;count++){
document.write(poems[poemNum][count] + "<br>");
}
