// JavaScript include file for random Quote
//
//  usage in the HEAD area:
//          <script language="JavaScript" type="text/javascript" src="quote.js"></script>
//
//  usage in the BODY area:
//          <script language="JavaScript" type="text/javascript"><!--
//              document.write( getQuote() );
//	    //--></script>
//

// fill this array with whatever quotes you want.
//
var Quotes = new Array();
Quotes[Quotes.length++] = "Fact: Hitler put a thousand Marks on the late MacShimidh's head, outraged by stories of his audacity, marching with his piper, Bill Millin and telling his men to walk, not run, across bridges. Lovat long survived WWII.";
Quotes[Quotes.length++] = "Fact: Facsimile machines were invented by Scottish physicist Alexander Bain, in 1842";
Quotes[Quotes.length++] = "Fact: Thomas Henderson, (1798-1844) of Dundee became the first person to measure the distance between earth and a star, in this case Alpha Centauri.";
Quotes[Quotes.length++] = "Fact: The raincoat was first patented by chemist Charles MacIntosh of Glasgow, Scotland";
Quotes[Quotes.length++] = "Elvis presley (1935-1977) changed popular music and descended from Andrew Presley, who had come to America from Scotland two centuries before him.";
Quotes[Quotes.length++] = "Fact: The Bank of England was founded by William Paterson, of Dumfries, Scotland.";
Quotes[Quotes.length++] = "Fact: William Paterson, who was born on a farm at Tinwald, Dumfriesshire, in the year 1658, founded the Bank of England in 1694.";
Quotes[Quotes.length++] = "Fact: John Law of Lauriston founded the Bank of France.";
Quotes[Quotes.length++] = "Tyres Were Invented by John Boyd Dunlop of Dreghorn, Scotland";
Quotes[Quotes.length++] = "John Boyd Dunlop patented his pneumatic tyre in 1888. He was a vetinary surgeon, but his interest in inventions led him to develop the tyres for his son's bicycle. He lived long enough to see his invention become the foundation for a huge industry around the world.";
Quotes[Quotes.length++] = "Fact: Adhesive stamps were invented by James Chalmers of Dundee, Scotland.";
Quotes[Quotes.length++] = "Of the signers of America's Declaration of Independence, 38 percent were of Scottish descent, versus only 6.7 percent representation of Scots in the general colonial population in 1790.";
Quotes[Quotes.length++] = "Fact: Penicillin was discovered by Alexander Fleming of Darvel, Scotland in 1928. This drug has saved more lives than the number lost in all the wars of history.";
Quotes[Quotes.length++] = "Fact: The Television was an invention of John Logie Baird of Helensburgh, Scotland.";
Quotes[Quotes.length++] = "Fact: Adhesive postage stamps were invented by Scot James Chalmers.";
Quotes[Quotes.length++] = "Fact: James Simpson, an Edinburgh physician, was the first doctor to use anaesthetics to relieve the pain of surgery in the mid 19th Century.";
Quotes[Quotes.length++] = "Fact: In the mid 19th Century, a Scottish scientist managed to produce some tiny artificial diamonds by a secret process that has never been duplicated.";
Quotes[Quotes.length++] = "Fact: Patrick Bell won the prize from the Highland and Agricultural Society in 1790 for a reaping machine - long before the better known machine of Cyrus McCormick patented in 1834.";
Quotes[Quotes.length++] = "Fact: The &quot;Buick&quot; car is named after David Dunbar Buick, a Scot who immigrated to the U.S. in 1856.";
Quotes[Quotes.length++] = "Fact: Thomas Graham (1805 - 1869) is called the &quot;Father of colloid chemistry&quot; He was born in Glasgow and educated at Glasgow University. He also formulated &quot;Graham's Law&quot; on the diffusion of gases.";
Quotes[Quotes.length++] = "Fact: The first person to publish the idea that consuming citrus fruits would prevent scurvy, then a plague on board sailing ships, was an Edinburgh man.";
Quotes[Quotes.length++] = "Fax Machines: Invented by a blacksmith in Dumfries in the early 19th Century. This was not the same electronic process used today, but was a functional technique. Some years later, Napoleon used a similar process to send messages to his commanders all over France.";
Quotes[Quotes.length++] = "Fact: First cloned mammal: Dolly the sheep, in Edinburgh, 1997.";
Quotes[Quotes.length++] = "Halloween began in Scotland as a tradition of wearing a disguise so the ghouls will think you're one of them, and you'll get home safely on Halloween. In the Victorian era, it evolved into a fun night for children. There was never any &quot;tricking&quot;. You only got a treat if you did your turn first, by singing a song, playing a tune on a mouthorgan or recited a poem.";
Quotes[Quotes.length++] = "This literary form <b><em>Historical Novel</em></b> was &quot;invented&quot; by Sir Walter Scott, author of &quot;Ivanhoe&quot;, &quot;Rob Roy&quot; and many other historical novels. ";
Quotes[Quotes.length++] = "Engineer Thomas Telford is famous for building more than 1200 bridges, many of them using cast iron. Other major achievements of his include the Caledonian Canal, the Menai suspension bridge, and the London to Holyhead road. As a road builder he ranked second only to McAdam. Telford founded the Institute of Civil Engineers.";
Quotes[Quotes.length++] = "Fact: The Kelvin scale of temperature is named after the scientist, Lord Kelvin (William Thomson), professor at Glasgow University, who was a pioneer in the field of thermodynamics.";
Quotes[Quotes.length++] = "Fact: Natural logarithms were invented by the Edinburgh mathematician, John Napier, Laird of Merchiston, in the late 1500s.";
Quotes[Quotes.length++] = "The story goes that a Dundee businessman imported a shipload of oranges from Spain that were found to be too bitter to sell as fruit. He turned them into an orange preserve which proved to be popular - marmalade.";
Quotes[Quotes.length++] = "Fact: Since the rainiest spot in Europe is found in the Scottish highlands, it is not surprising that The &quot;Macintosh&quot; technique for waterproofing clothing was developed there.";
Quotes[Quotes.length++] = "Fact: John Loudon McAdam devised the macadamized road in which the underlying soil is protected by a light protective layer that is waterproof and cambered to divert rainwater to the sides.";
Quotes[Quotes.length++] = "Fact: James Young was a chemist who made his fortune as the first to market paraffin as a lighting and heating oil.";
Quotes[Quotes.length++] = "Fact: Sir Hugh Dalrymple (Lord Drummore) (1700 - 1753) Invented hollow-pipe drainage. This innovation allowed the drying of water-logged land, bringing large areas into agricultural production.";
Quotes[Quotes.length++] = "Fact: James Harrison, who emigrated to Australia from Scotland, invented a cooling system for a brewery in Bendigo, in 1851. He had noticed that ether had a cooling effect on metals, and so he pumped it through pipes. As the ether evaporated it took heat from its surroundings to provide the latent heat of evaporation. His idea was used in the first refrigerated ship, the SS Strathleven, which carried a cargo of meat from Australia to England, a voyage of several months, in 1876. Refrigeration was a major force in the economic development of both Australia and New Zealand.";
Quotes[Quotes.length++] = "Fact: George Cleghorn (1716 - 1794) was the army surgeon who discovered that quinine bark acted as a cure for Malaria.";
Quotes[Quotes.length++] = "Fact: Invented by the engineer and manufacturer of steam engines and machine tools, James Nasmyth, in 1839. The steam-hammer made it possible to forge much larger items than before.";
Quotes[Quotes.length++] = "Fact: Until the invention of the stereotype in 1727 printing type had to be reset if a second printing was to be made. It was not economic to keep the type standing for prolonged periods of time. William Ged, a goldsmith in Edinburgh, took a plaster mould of the type and then cast the whole page in metal.";
Quotes[Quotes.length++] = "Fact: Alexander Graham Bell was born in Edinburgh and lived there until his family emigrated to Canada when he was 18. He patented the telephone in 1876 and now there are more than 500 million of them spanning the globe. He revolutionized world communications.";
Quotes[Quotes.length++] = "Fact: Sir James Dewar (1842 - 1923) invented the dewar flask to keep liquids cool in the laboratory. The idea became the domestic thermos flask, which keeps hot liquids hot as well as cold things cold by isolating them from their surroundings, thus reducing the flow of heat. His scientific career was noted for his pioneer work on low temperature physics and vacuum techniques. He was the first to liquify hydrogen.";
Quotes[Quotes.length++] = "Fact: Sir William Fairbairn (1789 - 1874) was born in Kelso, in southern Scotland. An engineer, he developed the idea of using tubular steel, which was much stronger than solid steel, as a construction material.";
Quotes[Quotes.length++] = "Fact: Adam Ferguson (1723 - 1816) Born in Logierait, Perthshire, he became Professor of Moral Philosophy at Edinburgh. He introduced the method of studying humankind in groups and is father of the subject now called &quot;Sociology&quot;.";
Quotes[Quotes.length++] = "Fact: Patrick Ferguson (1744 - 1780) Born in Pitfour, Aberdeenshire, Ferguson invented the breech-loading rifle, which was capable of firing seven shots per minute. With the help of this weapon, the Americans were defeated at the Battle of Brandywine (1777). He was killed at the Battle of King's Mountain in South Carolina, USA.";
Quotes[Quotes.length++] = "Fact: Sir Arthur Conan Doyle was a medical student in Edinburgh. The character of Sherlock Holmes was based on one of the professors of Medicine at the University.";
Quotes[Quotes.length++] = "Toad of Toad Hall ... and Mole, Ratty, Badger and Otter. &quot;The Wind in the Willows&quot; was written by Edinburgh writer Kenneth Grahame.";
Quotes[Quotes.length++] = "Long John Silver -- The pirate villain of the famous novel &quot;Treasure Island&quot; written by Edinburgh's Robert Louis Stevenson.";
Quotes[Quotes.length++] = "Jekyll and Hyde -- The mad doctor and his alter-ego of the famous novel written by Edinburgh's Robert Louis Stevenson. He claimed that each chapter came to him in nightly instalments while he dreamed.";
Quotes[Quotes.length++] = "Fact: Around 1815 William Nicol (lecturer of natural philosophy at the University of Edinburgh) had used Canada balsam to cement pieces of fossil wood or minerals onto a glass plate and then ground the sample down to slices so fine you could see through them with a microscope and discover all kinds of good stuff--like bubbles in crystals, which told you something of the way the minerals had been formed, or the cell patterns that showed what kind of plant the sample had come from. Prior to this, paleobotany (... the morphology of fossil plants) was a subject virtually untouched, except for some earlier research by another Scotsman.";
Quotes[Quotes.length++] = "Whisky -- be sure you don't spell this with an 'e' or it's not Scotch.";
Quotes[Quotes.length++] = "Fact: The US Navy was founded by John Paul Jones, a Scotsman. Read about his exploits in any US history book.";
Quotes[Quotes.length++] = "Fact: Adam Smith, author of the book &quot;The Wealth of Nations&quot; was a Scot. This book is the first study and analysis of how commerce and free trade create the wealth of a country. He is buried in Greyfriars churchyard, near Edinburgh Castle.";
Quotes[Quotes.length++] = "Fact: The Cloud Chamber was invented by Charles Thomson Rees Wilson (1869 - 1959) an eminent Edinburgh scientist.";
Quotes[Quotes.length++] = "<A HREF='http://www.scottish-inventions.org.uk/'>www.scottish-inventions.org.uk/</A> has lots of information on Scottish inventors and inventions.";
Quotes[Quotes.length++] = "Fact: William Symington born Lanarkshire, was the first man to propel a boat by steam.";
Quotes[Quotes.length++] = "Fact: Alexander Fleming, born in Ayrshire, Scotland, discovered penicillin.";
Quotes[Quotes.length++] = "Fact: Kirkpatrick MacMillan, born Thorhill, Scotland invented the bicycle.";
Quotes[Quotes.length++] = "Fact: Patrick Ferguson, born Scotland, invented the breech-loading rifle.";
Quotes[Quotes.length++] = "Fact: John Chalmers, born Dundee, invented the adhesive stamp.";
Quotes[Quotes.length++] = "Fact: James Watt, born Greenock, Scotland, invented the modern steam engine.";
Quotes[Quotes.length++] = "Fact: James Simpson, born Bathgate, was the first man to use chloroform.";
Quotes[Quotes.length++] = "Fact: John Loudon MacAdam, born Ayr, invented tarmac road surface.";
Quotes[Quotes.length++] = "Fact: Charles MacIntosh, born Glasgow, patented the raincoat.";
Quotes[Quotes.length++] = "Fact: Mrs Keiller, born Dundee, invented marmalade.";
Quotes[Quotes.length++] = "Fact: Alexander Graham Bell, born in Edinburgh, invented the telephone.";
Quotes[Quotes.length++] = "Fact: John Boyd Dunlop, born Scotland, patented the pneumatic tyre.";
Quotes[Quotes.length++] = "Fact: John Logie Baird, born Helensburgh, invented the television.";
Quotes[Quotes.length++] = "Fact: John Williams, born Glasgow, developed the vaccine against smallpox.";
var long_quote = "<table width='50%'><tr><td>";
long_quote += "<p align='center'><font size='+1'><strong>Wha's Like Us?  Damn few and they're a' deid!</strong></font></p>";
long_quote += "<p>The average Englishman, in the home he calls his castle, slips into his national costume - a shabby raincoat - patented by  Chemist Charles MacIntosh from Glasgow, Scotland. Enroute to his office he strides along the English land, surfaced by John MacAdam of Ayr, Scotland.</p>";
long_quote += "<p>He drives an English car fitted with tires invented by John Boyd Dunlop, Veterinary Surgeon of Dreghorn, Scotland. </p>";
long_quote += "<p>At the office, he receives a the mail bearing adhesive stamps invented by John Chalmers, Bookseller and Printer of Dundee, Scotland. </p>";
long_quote += "<p>During the day he uses the telephone invented by Alexander Graham Bell, born in Edinburgh, Scotland.  </p>";
long_quote += "<p>At home in the evening his daughter pedals her bicycle invented by Kirkpatrick MacMillan, Blacksmith of Thornhill, Dumfriesshire, Scotland.  </p>";
long_quote += "<p>He watches the news on TV, an invention of John Logie Baird of Helensburgh, Scotland and hears an item about the U. S. Navy founded by John Paul Jones of Kirkbean, Scotland. </p>";
long_quote += "<p>Nowhere can an Englishman turn to escape the ingenuity of the Scots. </p>";
long_quote += "<p>He has by now been reminded too much of Scotland and in desperation he picks up the Bible, only to find that the first man mentioned in the good book is a Scot - King James VI - who authorized its translation. </p>";
long_quote += "<p>He could take to drink but the Scots make the best in the world. </p>";
long_quote += "<p>He could take a rifle and end it all, but the breech-loading rifle was invented by Captain Patrick Ferguson of Pitfours, Scotland. </p>";
long_quote += "<p>If he escaped death, he could find himself on an operating table injected with Penicillin, discovered by Sir Alexander Fleming of Darvel, Scotland, and given Chloroform, an anesthetic discovered by Sir James Young Simpson, Obstetrician and Gynecologist of Bathgate, Scotland. </p>";
long_quote += "<p>Out of the anesthetic he would find no comfort in learning that he was as safe as the Bank of England founded by William Paterson of Dumfries, Scotland. </p>";
long_quote += "<p>Perhaps his only remaining hope would be to get a transfusion of guid Scottish blood which would entitle him to ask - </p>";
long_quote += "<p align='center'><strong>&quot;Wha's Like Us?&quot;</strong></p>";
long_quote += "</td></tr></table>";
Quotes[Quotes.length++] = long_quote;
Quotes[Quotes.length++] = "ROSEANNA CUNNINGHAM: The first Scottish Member of Parliment to have her own personal <a href='http://www.almac.co.uk/personal/roseanna/'>Web Site</a> !";
Quotes[Quotes.length++] = "<a href='http://www.quine.org.uk/'>Quine</a> is a non-profit site which endeavours to provide a space in which it is possible to highlight the activities, interests and concerns of Scottish women in all walks of life.";
Quotes[Quotes.length++] = "Fact: Thomas Nelson of Glasgow invented the rotary stereo press.";
Quotes[Quotes.length++] = "Fact: The first edition of Encyclopedia Britannica was published in Edinburgh in 1771.";
Quotes[Quotes.length++] = "Fact: BAILEY BRIDGES: Invented during the 39/45 war by Sir Donald Bailey.";
Quotes[Quotes.length++] = "Fact: BLEACHING POWDER: Also invented by Charles MacKintosh.";
Quotes[Quotes.length++] = "Fact: Sir John Leslie made the first artificial ice in Edinburgh in 1810.";
Quotes[Quotes.length++] = "Fact: Sir James Y. Simpson, born in Bathgate in 1811, was the first doctor to use chloroform in surgery and developed the use of anaesethics.";
Quotes[Quotes.length++] = "The hot blast furnace method of treating iron, which revolutionised the British iron industry, was invented by John Neilson, manager of the Glasgow Gas Works.";
Quotes[Quotes.length++] = "Fact: Although an American, Thomas Edison, improved the gramaphone and made it a commercial possibility, it's prototype, the phonautograph was invented by Leo Scott, in 1856.";
Quotes[Quotes.length++] = "Fact: Joseph Wilson Swan, of Glasgow, patented the first carbon incandescent lamp in 1878.";
Quotes[Quotes.length++] = "Fact: Britain's first Savings Bank was started by the Reverend D. Henry Duncan of Dumfriesshire in 1810.";
Quotes[Quotes.length++] = "Fact: The first man to evolve a British political economy was Adam Smith of Kirkcaldy, who wrote The Wealth of Nations in 1776.";
Quotes[Quotes.length++] = "Fact: The first threshing machine was invented by Andrew Meikle.";
Quotes[Quotes.length++] = "Fact: The first practical reaper was invented in 1827 by the Reverend Patrick Bell of Carmyllie.";
Quotes[Quotes.length++] = "Fact: John Small, a Dalkeith farmer, invented the swing plough in 1750.";
Quotes[Quotes.length++] = "Fact: The first circulating library was established in Edinburgh by Allan Ramsay.";
Quotes[Quotes.length++] = "GOLF: First played in Scotland, but the man to blame for it is unknown.";
Quotes[Quotes.length++] = "Fact: John Loudon Macadam, born in Ayr, in 1756, invented the method of waterproofing a road surface that is known today as macadamising.";
Quotes[Quotes.length++] = "Fact: David Livingston (1813-1873), missionary and explorer who discovered the Victoria Falls in Africa.";
Quotes[Quotes.length++] = "A passage in &quot;The Old Lords of Lovat and Beaufort&quot; by Archibald MacDonald (1934) reads as follows: <blockquote>&quot;[Simon Fraser] without any territorial designation, appears witnessing a charter of the lands in the barony of Urquart, granted in 1345 to Sir Patrick de Chisholm, constable of the castle, by John, Earl of Moray.&quot;</blockquote>";
Quotes[Quotes.length++] = "In 1906, Isabel Fraser brought seeds of the &quot;Macaque Peach&quot; from China to New Zealand.  The fruit were also called &quot;Strange Fruit&quot; or &quot;Chinese Gooseberry&quot;.  In 1959, one seller came up with a new name, and by 1974 it was official.  The &quot;Macaque Peach&quot; is now called the &quot;Kiwifruit&quot;.";

// return a different quote each day
//
function qotd()
{
    var now = new Date;
    var num = parseInt( '' + (now.getTime() / 86400000) );	// # days since epoch
    return '<center><b>' + getQuote(num) + '</b></center>';
}

// return a ranton quote
//
function getQuote() {
    // if they ask for a specific one, try to give it to them
    //
    var num = 0;
    if (getQuote.arguments.length >= 1) {
	num = parseInt( getQuote.arguments[0] ) % Quotes.length;
    } else {
	// pick a (sufficiently) random one
	//
//      var now = new Date;
//      num = now.getMilliseconds() % Quotes.length;

	//	use irand to avoid walking on refresh
	//
	num = irand( Quotes.length );
    }
    while ((num >= Quotes.length) || ("" == Quotes[num]))
	num = irand( Quotes.length );
    return Quotes[num];
}

// random number generator based on:
//
//  Stephen K. Park and Keith W. Miller. RANDOM NUMBER GENERATORS:
//  GOOD ONES ARE HARD TO FIND. Communications of the ACM,
//  New York, NY.,October 1988 p.1192
//
function irand() {
    // ensure seed not zero
    while (irand.seed == 0) { var now = new Date; irand.seed = now.getSeconds() % irand.prime; }

    // progress seed through sequence
    irand.seed = (irand.seed * irand.root) % irand.prime;

    // usage: i = irand();      // range 1..2147483646
    //        i = irand(10);    // range 0..9
    //        i = irand(5,9);   // range 5..9
    // poor usage:
    //        i = irand(9,5);   // range 9..11  // ((5-9)+1)==-3; N%(-3) in 0..2, +9 maps to 9..11
    // broken usage:
    //        i = irand(8,7);   // divide by zero  // ((7-8)+1)==0; N%(0) divide by zero
    //
    if (irand.arguments.length == 0) return irand.seed;
    if (irand.arguments.length == 1) return irand.seed % irand.arguments[0];
    return (irand.seed % ((irand.arguments[1] - irand.arguments[0]) + 1)) + irand.arguments[0];
}
irand.prime = 2147483647;   // Park's Miller modified minimal standard
irand.root  = 48271;	 // prime modulus m-multiplicative linear congruential generator
irand.seed  = 0;
