// (c) 2005-2007 - Martin Gonzalez Rodriguez

function create() {
}

function random(n)  {
	var js_mult1=3141
	var js_mult2=5821
	var js_m1=100000000
	var js_m2=10000
	var js_iseed=0
	var js_iseed1=0
	var js_iseed2=0

	if (js_iseed == 0)  {
		now = new Date()
		js_iseed = now.getHours() + now.getMinutes() * 60 + now.getSeconds() * 3600
	}

	js_iseed1 = js_iseed / js_m2
	js_iseed2 = js_iseed % js_m2
	var tmp = (((js_iseed2 * js_mult1 + js_iseed1 * js_mult2) % js_m2) * js_m2 + (js_iseed2 *
js_mult2)) % js_m1
	js_iseed = (tmp + 1) % js_m1
	return (Math.floor((js_iseed/js_m1) * n))
}

function showQuote (language)
{
	var numberOfQuotes = 33     //number or quotes to display 

	quotes = new Array()
	for(var i=0; i<numberOfQuotes; i++) { quotes[i] = new create(); }

quotes[0].quote = "Piensa... y que no te cojan!"
quotes[0].author = "Def con Dos"
quotes[0].language = "es"

quotes[1].quote = "El buen rollo sepulta el espiritu critico."
quotes[1].author = "s(I)b"
quotes[1].language = "es"

quotes[2].quote = "Todo se puede corregir. Depende del entusiasmo, de tener una verdad en las manos y una valiente y honrada decision"
quotes[2].author = "Cesar Manrique"
quotes[2].language = "es"

quotes[3].quote = "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former"
quotes[3].author = "Albert Einstein"
quotes[3].language = "en"

quotes[4].quote = "I find that the harder I work, the more luck I seem to have"
quotes[4].author = "Thomas Jefferson"
quotes[4].language = "en"

quotes[5].quote = "In theory, there is no difference between theory and practice. But, in practice, there is"
quotes[5].author = "Jan L.A. van de Snepscheut"
quotes[5].language = "en"

quotes[6].quote = "Education is one of the few things a person is willing to pay for and not get"
quotes[6].author = "William Lowe Bryan"
quotes[6].language = "en"

quotes[7].quote = "The power of accurate observation is frequently called cynicism by those who don't have it"
quotes[7].author = "George Bernard Shaw"
quotes[7].language = "en"

quotes[8].quote = "Never interrupt your enemy when he is making a mistake"
quotes[8].author = "Napoleon Bonaparte"
quotes[8].language = "en"

quotes[9].quote = "Maybe this world is another planet's Hell"
quotes[9].author = "Aldous Huxley"
quotes[9].language = "en"

quotes[10].quote = "Education is a progressive discovery of our own ignorance"
quotes[10].author = "Will Durant"
quotes[10].language = "en"

quotes[11].quote = "Copy from one, it's plagiarism; copy from two, it's research"
quotes[11].author = "Wilson Mizner"
quotes[11].language = "en"

quotes[12].quote = "The average person thinks he isn't."
quotes[12].author = "Larry Lorenzoni"
quotes[12].language = "en"

quotes[13].quote = "En la estupidez siempre ha estado el enemigo, organizado, sobrio y aburrido"
quotes[13].author = "Def con Dos"
quotes[13].language = "es"

quotes[14].quote = "Great spirits have often encountered violent opposition from weak minds"
quotes[14].author = "Albert Einstein"
quotes[14].language = "en"

quotes[15].quote = "I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forego their use"
quotes[15].author = "Galileo Galilei"
quotes[15].language = "en"

quotes[16].quote = "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
quotes[16].author = "Albert Einstein"
quotes[16].language = "en"

quotes[17].quote = "The only thing that interferes with my learning is my education"
quotes[17].author = "Albert Einstein"
quotes[17].language = "en"

quotes[18].quote = "Everything should be made as simple as possible, but not simpler"
quotes[18].author = "Albert Einstein"
quotes[18].language = "en"

quotes[19].quote = "The most incomprehensible thing about the world is that it is comprehensible"
quotes[19].author = "Albert Einstein"
quotes[19].language = "en"

quotes[20].quote = "Shoot for the moon, even if you miss you will land among the stars"
quotes[20].author = "Anon"
quotes[20].language = "en"

quotes[21].quote = "Alguien dice dos y dos son cuatro, llega un ignorante y corrige, son seis. Al final llega un imbecil y dice, vamos a dialogar y llegar a un acuerdo."
quotes[21].author = "Anon"
quotes[21].language = "es"

quotes[22].quote = "Shoot for the moon, even if you miss you will land among the stars"
quotes[22].author = "Anon"
quotes[22].language = "en"

quotes[23].quote = "You say Heretic like it was a Bad Thing!"
quotes[23].author = "Anon"
quotes[23].language = "en"

quotes[24].quote = "If god wanted people to believe in him, then why did he invent Logic?"
quotes[24].author = "Anon"
quotes[24].language = "en"

quotes[25].quote = "If we were made in God's image, when why aren't humans invisible too?"
quotes[25].author = "Anon"
quotes[25].language = "en"

quotes[26].quote = "Jesus saves you... from thinking for yourself"
quotes[26].author = "Anon"
quotes[26].language = "en"

quotes[27].quote = "Los especialistas son aquellas personas que saben cada vez más sobre menos, hasta que finalmente saben todo sobre nada y nada sobre todo"
quotes[27].author = "Danny Kaye"
quotes[27].language = "es"

quotes[28].quote = "A picture may say a thousand words, but often they're the wrong words (...) It's true that a picture is worth a thousand words. But which thousand?"
quotes[28].author = "Louis Rosenfeld and Peter Morville"
quotes[28].language = "en"

quotes[29].quote = "Religions are like fireflies. They require darkness in order to shine"
quotes[29].author = "Arthur Schopenhauer"
quotes[29].language = "en"

quotes[30].quote = "Señor Dinero invita a Santa Estupidez"
quotes[30].author = "Fe de Ratas"
quotes[30].language = "es"

quotes[31].quote = "If you pick up a starving dog and make him prosperous, he will not bite you. This is the principal difference between a dog and a man"
quotes[31].author = "Mark Twain"
quotes[31].language = "en"

quotes[32].quote = "Cuando lo creas todo perdido, no olvides que aún te queda el futuro, tu cerebro, tu voluntad y dos manos para cambiar tu destino."
quotes[32].author = "Wernher von Braun"
quotes[32].language = "es"




/*


Sí, he propuesto a mi madre que intentase manejar la aplicación para ver cómo se desenvuelve. Si es usable para ella, lo será para la gran mayoría de personas sin conocimientos informáticos (que son los usuarios finales del sistema). (...)  Una ama de casa no tiene porqué asistir a un evento para amas de casa... puede asistir a uno de muestras de perros o a uno de cómo constuir un reactor nuclear. Poder es querer.

quotes[1].quote = "Siempre estamos oyendo disculpas, inconvenientes, aprobaciones anteriores, leyes caducas y un sin fin de aparentes tropiezos que parecen imposibles de corregir, con tal de no parar esa barbaridad que se nos viene encima. Todo se puede corregir. Depende del entusiasmo, de tener una verdad en las manos y una valiente y honrada decisión"
quotes[1].author = "César Manrique (Momento de Parar), 1985"
quotes[1].language = "es"
*/

	var n = random(numberOfQuotes)
	
	var output = ''; /* = '<p>n inicial: ' + n + '.</p>'*/
	n = (n >= numberOfQuotes) ? n-numberOfQuotes : n


	var quote = quotes[n]
	/*output += '<p>Selected Quote number: ' + n + '.</p>'
	
	if (language == quotes[n].language)
		output += '<p>Coinciden en idioma</p>'
	else
		output += '<p>NO COINCIDEN</p>'
		*/
	output += '<blockquote><p><cite' 
	if (language != quotes[n].language)
		output += ' lang="' + quotes[n].language + '"'
	output += '>'
	
	output += quotes[n].quote + '</cite> (' + quotes[n].author + ') </p></blockquote>'

	document.write (output)
}

showQuote ("es")

