var quoteArray = [
"\"I have no use for bodyguards, but I have very specific use for two highly trained certified public accountants.\"<br />Elvis Presley", 

"\"Never call an accountant a credit to his profession - a good accountant is a debit to his profession.\"<br />Charles Lyell", 

"\"My problem lies in reconciling my gross habits with my net income.\"<br />Errol Flynn", 

"\"The safest way to double your money is to fold it over and put it in your pocket.\"<br />Kin Hubbard", 

"\"Money is better than poverty, if only for financial reasons.\"<br />Woody Allen", 

"\"I'm spending a year dead for tax reasons.\"<br />Douglas Adams", 

"\"Annual income twenty pounds, annual expenditure nineteen six, result happiness. Annual income twenty pounds, annual expenditure twenty pound ought and six, result misery.\"<br />Charles Dickens [in David Copperfield]", 

"\"Lack of money is no obstacle. Lack of an idea is an obstacle.\"<br />Ken Hakuta", 

"\"In order to get a loan you must first prove you don't need it.\"<br />Murphy's Law: John's Collateral Corollary", 

"\"He that is of the opinion money will do everything may well be suspected of doing everything for money.\"<br />Benjamin Franklin", 

"\"Save a little money each month and at the end of the year you'll be surprised at how little you have.\"<br />Ernest Haskins", 

"\"Money frees you from doing things you dislike. Since I dislike doing nearly everything, money is handy.\"<br />Groucho Marx", 

"\"If you can count your money, you don't have a billion dollars.\"<br />J. Paul Getty", 

"\"I have enough money to last me the rest of my life, unless I buy something.\"<br />Jackie Mason", 

"\"Wealth is any income that is at least one hundred dollars a year more than the income of one's wife's sister's husband.\"<br />H. L. Mencken", 

"\"Every morning I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.\"<br />Robert Orben", 

"\"When a person with money meets a person with experience, the person with the experience winds up with the money and the person with the money winds up with the experience.\"<br />Harvey MacKay", 

"\"Money is something you have to make in case you don't die.\"<br />Max Asnas"];

function randInt(min, max) {
	// use floor since it's more random: http://thepenry.net/jsrandom.php
	return Math.floor(Math.random()*(max-min+1)+min);
}

function Set_Cookie( name, value, expires, path, domain, secure ) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	
	/*
	if the expires variable is set, make the correct
	expires time, the current script below will set
	it for x number of days, to make it for hours,
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires ) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}
function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ ) {
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );

		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name ) {
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 ) {
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found ) {
		return null;
	}
}


function initThisPage() {
	// get quote cookie to see which one we used last
	var quoteIndexCookie = Get_Cookie("quote_index");
	var maxIndex = (quoteArray.length - 1);
	var newIndex = 0;
	var qEl = document.getElementById("maincontentquotebox");
	if (quoteIndexCookie) {
		quoteIndexCookie = parseInt(quoteIndexCookie);
		newIndex = quoteIndexCookie + 1;
		if (newIndex > maxIndex) {
			newIndex = 0;
		}
	} else {
		newIndex = randInt(0, maxIndex);
	}
	qEl.innerHTML = quoteArray[newIndex];
	Set_Cookie("quote_index", newIndex, 365, "/", "", "");
}

function makeLongBG() {
	var cont = document.getElementById("containerdiv");
	var textb = document.getElementById("maincontenttextbox");
	var newHeight = parseInt(textb.clientHeight,10);
	if (isNaN(newHeight)) return;
	newHeight = (newHeight + 99 + 41);
	if (newHeight < 700) {
		newHeight = 700;
	}
	cont.style.height = newHeight + "px";
	var foot = document.getElementById("maincontentfooterdiv");
	foot.style.top = (newHeight - 41) + "px";
	foot.style.display = "block";
}
