﻿// JavaScript Document

// Get a random number
function rand ( n )
{
  return ( Math.floor ( Math.random ( ) * n + 1 ) );
}

// Store some random quotations

var random_quotes = new Array ( );
random_quotes[0] = "‘The path of the warrior is lifelong. Yet mastery is often simply staying the path.’";
random_quotes[1] = "‘A smooth sea never made a skilful mariner’";
random_quotes[2] = "‘From every tiny bud springs a tree of many branches. Every castle commences with the laying of the first stone. Every journey begins with just one step’";
random_quotes[3] = "‘It’s good to have an end to journey toward but it’s the journey that matters, in the end.’";
random_quotes[4] = "‘Given enough time, any one may master the physical. Given enough knowledge, any one may become wise. It is the true warrior who can master both and surpass the result.’";
random_quotes[5] = "‘In order to be walked on, you have to be lying down.’";
random_quotes[6] = "‘Courage is not the absence of fear, but rather the judgement that something else is more important than fear.’";
random_quotes[7] = "‘The greater the obstacle, the more glory in overcoming it.’";
random_quotes[8] = "‘Defeat is not defeat unless accepted as a reality in your own mind.’";
random_quotes[9] = "‘Every man is the architect of his own fortune.’";
random_quotes[10] = "‘What counts is not necessarily the size of the dog in the fight - it's the size of the fight in the dog.’"; 
random_quotes[11] = "‘Whether you think you can or you can’t… you’re right’"; 
random_quotes[12] = "‘The Way of the Warrior is not to destroy and kill but to foster life.’"; 
random_quotes[13] = "‘Failure is the key to success. Each mistake teaches us something’";
random_quotes[14] = "‘Practice a thousand hours and you learn self discipline. Practice ten thousand hours and you learn about yourself.’"; 

var random_author = new Array ( );
random_author[0] = "Richard Strozzi Hecker";
random_author[1] = "Anonymous";
random_author[2] = "Lao Tzu.";
random_author[3] = "Ursula K. LeGuin.";
random_author[4] = "Tien T’ai.";
random_author[5] = "Brian Weir.";
random_author[6] = "Ambrose Hollingworth Redmoon.";
random_author[7] = "Moliere.";
random_author[8] = "Bruce Lee.";
random_author[9] = "Sallust.";
random_author[10] = "Dwight D. Eisenhower.";
random_author[11] = "Henry Ford.";
random_author[12] = "Morihei Ueshiba, the founder of Aikido.";
random_author[13] = "Morihei Ueshiba";
random_author[14] = "Myamoto Musashi.";


// Pick a random quote from the list,
// and set the 'random-quote' paragraph content to that quote

function pick_quote ( )
{
    
  var randomNumber = rand(10)-1;

  document.getElementById("random-quote").innerHTML = random_quotes[randomNumber];
  document.getElementById("random-author").innerHTML = random_author[randomNumber];
}
