var quotes = new Array(
	new Array("Everything should be made as simple as possible, but not one bit simpler.", "Albert Einstein (1879-1955)", ""),
	new Array("Go confidently in the direction of your dreams! Live the life you've imagined. As you simplify your life, the laws of the universe will be simpler.", "Henry David Thoreau (1817-1862)", ""),
	new Array("Simplicity is the peak of civilization.", "Jessie Sampter", ""),
	new Array("Manifest plainness, Embrace simplicity, Reduce selfishness, Have few desires.", "Lao-tzu (604-531 BC)", ""),
	new Array("A complex system that works is invariably found to have evolved from a simple system that works.", "John Gaule", ""),
	new Array("Whether you believe you can do a thing or not, you are right.", "Henry Ford", ""),
	new Array("What are dreams for anyways without the guts to live your life that way?", "Greg Attonito", "http://www.bouncingsouls.com"),
	new Array("Do it.", "Nike", "http://www.nike.com"),
	new Array("Do it, and do it now!", "Ezra Taft Benson", "http://www.lds.org"),
	new Array("Make your goals specific, and put them in writing. Your goals must be so clear that it would be possible for a stranger to look at your situation objectively and give you an absolute 'yes' or 'no' response as to whether you've accomplished each goal or not. If you cannot define your destination precisely, how will you know when you've arrived?", "Steve Pavlina", "http://www.stevepavlina.com"),
	new Array("The universe is waiting on you, not the other way around, and it's going to keep waiting until you finally make up your mind.", "Steve Pavlina", "http://www.stevepavlina.com"),
	new Array("Waiting for clarity is like being a sculptor staring at a piece of marble, waiting for the statue within to cast off the unneeded pieces. Do not wait for clarity to spontaneously materialize -- grab a chisel and get busy!", "Steve Pavlina", "http://www.stevepavlina.com")
);

function showQuotes()
{
	quote = quotes[Math.floor(Math.random()*quotes.length)];
	quoteToShow = '"'+quote[0]+'" <span id="author">&#151; ';
	if (quote[2].replace(/(^\s+|\s+$)/, '') != '')
		quoteToShow += '<a href="'+quote[2]+'" target="_blank">'+quote[1]+'';
	else
		quoteToShow += quote[1];
	quoteToShow += "</span>";
	
	$("#quotes").fadeOut(300, function(){$(this).html(quoteToShow)}).fadeIn(300);
	setTimeout('showQuotes()', 10000);
}

$(document).ready(function($){
	$("h1#logo").hover(
		function()
		{
			$(this).addClass('logo-hover');
		},
		function()
		{
			$(this).removeClass('logo-hover');
		}
	);
	$("h1#logo").click(function(){ location.href = '/'; });
	
	var defaultNewGoalTxt = "Enter your One Simple Goal";
	if ($("input[type='text']#goal_data").val() == '')
  	$("input[type='text']#goal_data").val(defaultNewGoalTxt);
	
	$("input[type='text']#goal_data").focus(function(){
		if ($(this).val() == defaultNewGoalTxt)
		{			
			$(this).removeClass('tip-text');
			$(this).val('');
		}
	});
	
	$("input[type='text']#goal_data").blur(function(){
		if ($(this).val().replace(/(^\s+|\s+$)/g, '') == '')
		{
			$(this).addClass('tip-text');
			$(this).val(defaultNewGoalTxt);
		}
	});
	

	$("body#goals-new select#goal_is_public").change(function(){
		if ($(this).val() == "0")
			$("#post-to-networks").hide();
		else
			$("#post-to-networks").show();
	});
	
	showQuotes();
});

