// Copyright 1996 - Tomer and Yehuda Shiran
// This example will appear in our forthcoming book on JavaScript.
// Feel free to "steal" this code provided that you leave this notice as is.
// Additional examples from the book can be found at http://www.geocities.com/SiliconValley/9000/
// For more information contact Tomer or Yehuda Shiran <yshiran@iil.intel.com>
function getMessage() {
	// create array of murphy laws
	var ar = new Array(20)
	ar[0] = "1: Anything that can go wrong will go wrong."
	ar[1] = "2: If there is a worse time for something to go wrong, it will happen then."
	ar[2] = "3: If anything simply cannot go wrong, it will anyway."
	ar[3] = "4: If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong."
	ar[4] = "5: If you perceive that there are four possible ways in which a procedure can go wrong, and circumvent these, then a fifth way, unprepared for, will promptly develop."
	ar[5] = "6: Everything takes longer than you think."
	ar[6] = "7: If everything seems to be going well, you have obviously overlooked something."
	ar[7] = "8: Nothing is as easy as it looks."
	ar[8] = "9: Left to themselves, things tend to go from bad to worse."
	ar[9] = "10: Nature always sides with the hidden flaw."
	ar[10] = "11: Mother nature is a bitch."
	ar[11] = "12: It is impossible to make anything foolproof because fools are so ingenious."
	ar[12] = "13: Whenever you set out to do something, something else must be done first."
	ar[13] = "14: Every solution breeds new problems."
	ar[14] = "15: Trust everybody ... then cut the cards."
	ar[15] = "16: Two wrongs are only the beginning."
	ar[16] = "17: If at first you don't succeed, destroy all evidence that you tried."
	ar[17] = "18: To succeed in politics, it is often necessary to rise above your principles."
	ar[18] = "19: Exceptions prove the rule ... and wreck the budget."
	ar[19] = "20: Success always occurs in private, and failure in full view."
	ar[20] = "O'Tooles observation: Murphy was an optimist!"

	var now = new Date()
	var sec = now.getSeconds()
	alert("Murphy's Law:\r" + ar[sec % 21])
}
