// JavaScript Document

/* 
  ================================================
  PVII Uberlink Script
  Copyright (c) 2006 Project Seven Development
  www.projectseven.com
  Version: 1.0.0
  ================================================
*/
function P7_Uberlink(cl,d){
	var m,ob,tA,h=document.location.href;
	if(document.getElementById){
	ob=(d)?document.getElementById(d):document;
	if(ob){
	tA=ob.getElementsByTagName('A');
	for(m=0;m<tA.length;m++){
	if(tA[m].href==h){
	tA[m].className=cl;
}}}}}

// This is to make the columns equal height
// by Paul@YellowPencil.com and Scott@YellowPencil.com
// feel free to delete all comments except for the above credit

function setTall() {
	if (document.getElementById) {
		// the divs array contains references to each column's div element.  
		// Replace 'center' 'right' and 'left' with your own.  
		// Or remove the last one entirely if you've got 2 columns.  Or add another if you've got 4!
		var divs = new Array(document.getElementById('right'), document.getElementById('left'));
		
		// Let's determine the maximum height out of all columns specified
		var maxHeight = 0;
		for (var i = 0; i < divs.length; i++) {
			if (divs[i].offsetHeight > maxHeight) maxHeight = divs[i].offsetHeight;
		}
		
		// Let's set all columns to that maximum height
		for (var i = 0; i < divs.length; i++) {
			divs[i].style.height = maxHeight + 'px';

			// Now, if the browser's in standards-compliant mode, the height property
			// sets the height excluding padding, so we figure the padding out by subtracting the
			// old maxHeight from the new offsetHeight, and compensate!  So it works in Safari AND in IE 5.x
			if (divs[i].offsetHeight > maxHeight) {
				divs[i].style.height = (maxHeight - (divs[i].offsetHeight - maxHeight)) + 'px';
			}
		}
	}
}





window.onload = function() {
	P7_Uberlink('uberlink','menu');
	setTall();
}

window.onresize = function() {
	setTall();
}



// This script is (c) copyright 2006 Jim Tucek under the
// GNU General Public License (http://www.gnu.org/licenses/gpl.html)
// For more information, visit www.jracademy.com/~jtucek/email/ 
// Leave the above comments alone!

if(!addresses) var addresses = new Array();
addresses.push("493 299 411 130 61 97 58 49 377 421 463 371 79 49 349 463 424 361 349 75 61 215 424 196 349");


var decryption_cache = new Array();

function decrypt_string(crypted_string,n,decryption_key,just_email_address) {
	var cache_index = "'"+crypted_string+","+just_email_address+"'";

	if(decryption_cache[cache_index])					// If this string has already been decrypted, just
		return decryption_cache[cache_index];				// return the cached version.

	if(addresses[crypted_string])						// Is crypted_string an index into the addresses array
		var crypted_string = addresses[crypted_string];			// or an actual string of numbers?

	if(!crypted_string.length)						// Make sure the string is actually a string
		return "Error, not a valid index.";

	if(n == 0 || decryption_key == 0) {					// If the decryption key and n are not passed to the
		var numbers = crypted_string.split(' ');			// function, assume they are stored as the first two
		n = numbers[0];	decryption_key = numbers[1];			// numbers in crypted string.
		numbers[0] = ""; numbers[1] = "";				// Remove them from the crypted string and continue
		crypted_string = numbers.join(" ").substr(2);
	}

	var decrypted_string = '';
	var crypted_characters = crypted_string.split(' ');

	for(var i in crypted_characters) {
		var current_character = crypted_characters[i];
		var decrypted_character = exponentialModulo(current_character,n,decryption_key);
		if(just_email_address && i < 7)				// Skip 'mailto:' part
			continue;
		if(just_email_address && decrypted_character == 63)	// Stop at '?subject=....'
			break;
		decrypted_string += String.fromCharCode(decrypted_character);
	}
	
	decryption_cache[cache_index] = decrypted_string;			// Cache this string for any future calls

	return decrypted_string;
}

function decrypt_and_email(crypted_string,n,decryption_key) {
	if(!n || !decryption_key) { n = 0; decryption_key = 0; }
	if(!crypted_string) crypted_string = 0;

	var decrypted_string = decrypt_string(crypted_string,n,decryption_key,false);
	parent.location = decrypted_string;
}

function decrypt_and_echo(crypted_string,n,decryption_key) {
	if(!n || !decryption_key) { n = 0; decryption_key = 0; }
	if(!crypted_string) crypted_string = 0;

	var decrypted_string = decrypt_string(crypted_string,n,decryption_key,true);
	document.write(decrypted_string);
	return true;
}

// Finds base^exponent % y for large values of (base^exponent)
function exponentialModulo(base,exponent,y) {
	if (y % 2 == 0) {
		answer = 1;
		for(var i = 1; i <= y/2; i++) {
			temp = (base*base) % exponent;
			answer = (temp*answer) % exponent;
		}
	} else {
		answer = base;
		for(var i = 1; i <= y/2; i++) {
			temp = (base*base) % exponent;
			answer = (temp*answer) % exponent;
		}
	}
	return answer;
}


//Quotes from Oscar Wilde

quoteList = new Array();
	
	quoteList[0] = "A man can be happy with any woman as long as he does not love her.";
	quoteList[1] = "Always forgive your enemies; nothing annoys them so much.";
	quoteList[2] = "America had often been discovered before Columbus, but it had always been hushed up.";
	quoteList[3] = "America is the only country that went from barbarism to decadence without civilization in between.";
	quoteList[4] = "Arguments are to be avoided; they are always vulgar and often convincing.";
	quoteList[5] = "Biography lends to death a new terror.";
	quoteList[6] = "Consistency is the last refuge of the unimaginative.";
	quoteList[7] = "Fashion is a form of ugliness so intolerable that we have to alter it every six months.";
	quoteList[8] = "I always like to know everything about my new friends, and nothing about my old ones.";
	quoteList[9] = "I am not young enough to know everything.";
	quoteList[10] = "I think that God in creating Man somewhat overestimated his ability.";
	quoteList[11] = "One is tempted to define man as a rational animal who always loses his temper when he is called upon to act in accordance with the dictates of reason."; 
	quoteList[12] = "I was working on the proof of one of my poems all the morning, and took out a comma. In the afternoon I put it back again.";
	quoteList[13] = "Illusion is the first of all pleasures.";
	quoteList[14] = "It is a very sad thing that nowadays there is so little useless information.";
	quoteList[15] = "Morality, like art, means drawing a line someplace.";
	quoteList[16] = "Most modern calendars mar the sweet simplicity of our lives by reminding us that each day that passes is the anniversary of some perfectly uninteresting event.";
	quoteList[17] = "Music makes one feel so romantic - at least it always gets on one's nerves - which is the same thing nowadays.";
	quoteList[18] = "One can survive everything, nowadays, except death, and live down everything except a good reputation.";
	quoteList[19] = "One should always play fairly when one has the winning cards.";
	quoteList[20] = "Selfishness is not living as one wishes to live, it is asking others to live as one wishes to live.";
	quoteList[21] = "Seriousness is the only refuge of the shallow.";
	quoteList[22] = "The only thing to do with good advice is pass it on. It is never any use to oneself.";
	quoteList[23] = "The true mystery of the world is the visible, not the invisible.";
	quoteList[24] = "To disagree with three-fourths of the British public is one of the first requisites of sanity.";
	quoteList[25] = "Whenever people agree with me I always feel I must be wrong.";
	quoteList[26] = "Why was I born with such contemporaries?";
	quoteList[27] = "One should absorb the colour of life, but one should never remember its details. Details are always vulgar.";
	quoteList[28] = "When the gods wish to punish us, they answer our prayers.";
	quoteList[29] = "Only dull people are brilliant at breakfast.";
	quoteList[30] = "Most people are other people. Their thoughts are someone else's opinions, their lives a mimicry, their passions a quotation.";
	quoteList[31] = "Work is the curse of the drinking classes.";
	quoteList[32] = "One's real life is often the life that one does not lead.";
	quoteList[33] = "I can resist anything but temptation.";
	quoteList[34] = "It is absurd to divide people into good and bad. People are either charming or tedious.";
	quoteList[35] = "Life is far too important a thing ever to talk seriously about.";
	quoteList[36] = "Experience is the name everyone gives to their mistakes.";
	quoteList[37] = "Scandal is gossip made tedious by morality.";
	quoteList[38] = "We are all in the gutter, but some of us are looking at the stars.";
	quoteList[39] = "What is a cynic? A man who knows the price of everything and the value of nothing.";
	quoteList[40] = "The aim of life is self-development. To realize one's nature perfectly - that is what each of us is here for. ";
	quoteList[41] = "Only the shallow know themselves.";
	quoteList[42] = "We have really everything in common with America nowadays except, of course, language.";
	quoteList[43] = "But what is the difference between literature and journalism? ...Journalism is unreadable and literature is not read. That is all";
	quoteList[44] = "It is only an auctioneer who can equally and impartially admire all schools of art";
	quoteList[45] = "The public is wonderfully tolerant. It forgives everything except genius.";
	quoteList[46] = "A little sincerity is a dangerous thing, and a great deal of it is absolutely fatal.";
	quoteList[47] = "The truth is rarely pure and never simple.";
	quoteList[48] = "To lose one parent, Mr Worthing, may be regarded as a misfortune; to lose both looks like carelessness.";
	quoteList[49] = "Thirty-five is a very attractive age. London society is full of women of the very highest birth who have, of their own free choice, remained thirty-five for years. ";
	quoteList[50] = "It is better to have a permanent income than to be fascinating.";
	quoteList[51] = "A man cannot be too careful in the choice of his enemies.";
	quoteList[52] = "Children begin by loving their parents; as they grow older they judge them; sometimes they forgive them.";
	quoteList[53] = "I adore simple pleasures. They are the last refuge of the complex.";
	quoteList[54] = "I can believe anything, provided that it is quite incredible.";
	quoteList[55] = "I choose my friends for their good looks, my acquaintances for their good characters, and my enemies for their good intellects.";
	quoteList[56] = "I like persons better than principles, and I like persons with no principles better than anything else in the world.";
	quoteList[57] = "I love acting. It is so much more real than life.";
	quoteList[58] = "Nowadays most people die of a sort of creeping common sense, and discover when it is too late that the only things one never regrets are one's mistakes.";
	quoteList[59] = "One can always be kind to people about whom one cares nothing.";
	quoteList[60] = "Perhaps, after all, America never has been discovered. I myself would say that it had merely been detected.";
	quoteList[61] = "The advantage of the emotions is that they lead us astray, and the advantage of science is that it is not emotional.";
	quoteList[62] = "The basis of optimism is sheer terror.";
	quoteList[63] = "The only way to get rid of a temptation is to yield to it.";
	quoteList[64] = "The only way to get rid of a temptation is to yield to it. Resist it, and your soul grows sick with longing for the things it has forbidden to itself.";
	quoteList[65] = "There are many things that we would throw away if we were not afraid that others might pick them up.";
	quoteList[66] = "There is a luxury in self-reproach. When we blame ourselves, we feel that no one else has a right to blame us. It is the confession, not the priest, that gives us absolution.";
	quoteList[67] = "To get back my youth I would do anything in the world, except take exercise, get up early, or be respectable.";
	quoteList[68] = "When a woman marries again, it is because she detested her first husband. When a man marries again, it is because he adored his first wife. Women try their luck; men risk theirs.";
	quoteList[69] = "Whenever a man does a thoroughly stupid thing, it is always from the noblest motives.";
	quoteList[70] = "Women love us for our defects. If we have enough of them, they will forgive us everything, even our intellects.";
	quoteList[71] = "There is no such thing as a moral or an immoral book. Books are well written or badly written.";
	quoteList[72] = "Anybody can sympathise with the sufferings of a friend, but it requires a very fine nature to sympathise with a friend's success.";
	quoteList[73] = "I suppose that I shall have to die beyond my means.";
	
	
	
	//randomization
	var now = new Date();
	var secs = now.getSeconds();
	var raw_random_number = Math.random(now);
	var random_number = Math.round(raw_random_number * (quoteList.length));

	if (random_number == quoteList.length){random_number = 0}
	
	
	//set quote
	var quote = quoteList[random_number];
	
//open new window
function wo(wourl) {
newWin=window.open(wourl,'abstract','menubar=no,toolbar=no,width=400,height=400');
newWin.focus();
}