// DAILY QUOTE ARRAYS

// GET DATE OBJECT/DAY OF MONTH
var dToday = new Date();
var theDay = dToday.getDate();

/* QUOTES ARRAY */
var quote = new Array(); 
  quote[1] = "&quot;Where talent is a dwarf, self-esteem is a giant.&quot;"
  quote[2] = "&quot;Here is the test to find whether your mission on Earth is finished: if you're alive, it isn't.&quot;"
  quote[3] = "&quot;The tragedy of life is not that it ends so soon, but that we wait so long to begin it.&quot;"
  quote[4] = "&quot;Everyone has a talent. What is rare is the courage to nurture it in solitude and to follow the talent to the dark places where it leads.&quot;"
  quote[5] = "&quot;Acting is a masochistic form of exhibitionism. It is not quite the occupation of an adult.&quot;"
  quote[6] = "&quot;A successful person is one who can lay a firm foundation with the bricks that others throw at him.&quot;"
  quote[7] = "&quot;Music is God's gift to man, the only art of Heaven given to earth, the only art of earth we take to Heaven.&quot;"
  quote[8] = "&quot;Life beats down and crushes the soul and art reminds you that you have one.&quot;"
  quote[9] = "&quot;It requires wisdom to understand wisdom: the music is nothing if the audience is deaf.&quot;"
  quote[10] = "&quot;You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions.&quot;"
  quote[11] = "&quot;Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.&quot;"
  quote[12] = "&quot;What you do speaks so loudly that I cannot hear what you say.&quot;"
  quote[13] = "&quot;Among those whom I like or admire, I can find no common denominator, but among those whom I love, I can: all of them make me laugh.&quot;"
  quote[14] = "&quot;If all the world's a stage, I want to operate the trap door.&quot;"
  quote[15] = "&quot;When I stand before God at the end of my life, I would hope that I would not have a single bit of talent left and could say, 'I used everything you gave me.'&quot;"
  quote[16] = "&quot;Who the hell wants to hear actors talk?&quot;"
  quote[17] = "&quot;Stand upright,<br>speak thy thoughts,<br>declare<br>The truth thou hast,<br>that all may share;<br>Be bold,<br>proclaim it everywhere:<br>They only live who dare.&quot;"
  quote[18] = "&quot;To laugh often and much; to win the respect of intelligent people and the affection of children; to earn the appreciation of honest critics and endure the betrayal of false friends; to appreciate beauty, to find the best in others; to leave the world a little better; whether by a healthy child, a garden patch or a redeemed social condition; to know even one life has breathed easier because you have lived. This is the meaning of success.&quot;"
  quote[19] = "&quot;My life has a superb cast but I can't figure out the plot.&quot;"
  quote[20] = "&quot;Our character is what we do when we think no one is looking.&quot;"
  quote[21] = "&quot;Do not the most moving moments of our lives find us without words?&quot;"
  quote[22] = "&quot;Use what talent you possess: the woods would be very silent if no birds sang except those that sang best.&quot;"
  quote[23] = "&quot;Those who bring sunshine to the lives of others cannot keep it from themselves.&quot;"
  quote[24] = "&quot;I look to the future because that's where I'm going to spend the rest of my life.&quot;"
  quote[25] = "&quot;Diplomacy is the art of saying &quot;Nice Doggie!&quot; till you can find a rock.&quot;"
  quote[26] = "&quot;When your work speaks for itself, don’t interrupt.&quot;"
  quote[27] = "&quot;Learning how to operate a soul figures to take time.&quot;"
  quote[28] = "&quot;Diamonds are nothing more than chunks of coal that stuck to their jobs.&quot;"
  quote[29] = "&quot;Finally, in conclusion, let me say just this.&quot;"
  quote[30] = "&quot;Wit is educated insolence.&quot;"
  quote[31] = "&quot;Art is not a pastime but a priesthood.&quot;"

var credit = new Array();
	credit[1] = "J. Petit-Senn"
	credit[2] = "Richard Bach"
	credit[3] = "W.M. Lewis"
	credit[4] = "Erica Jong"
	credit[5] = "Sir Laurence Olivier"
	credit[6] = "David Brink"
	credit[7] = "Walter Savage Landor"
	credit[8] = "Stella Adler"
	credit[9] = "Walter Lippman"
	credit[10] = "Mahfouz Naguib"
	credit[11] = "Mark Twain"
	credit[12] = "Ralph Waldo Emerson"
	credit[13] = "W.H. Auden"
	credit[14] = "Paul Beatty"
	credit[15] = "Erma Bombeck"
	credit[16] = "H. M. Warner, founder of Warner Brothers, in 1927"
	credit[17] = "Lewis Morris"
	credit[18] = "Ralph Waldo Emerson"
	credit[19] = "Ashleigh Brilliant"
	credit[20] = "H. Jackson Brown, Jr."
	credit[21] = "Marcel Marceau"
	credit[22] = "Henry Van Dyke"
	credit[23] = "James Barrie"
	credit[24] = "George Burns"
	credit[25] = "Wynn Catlin"
	credit[26] = "Henry J. Kaiser"
	credit[27] = "Timothy Leary"
	credit[28] = "Malcolm Stevenson Forbes"
	credit[29] = "Peter Sellers"
	credit[30] = "Aristotle"
	credit[31] = "Jean Cocteau"




$(document).ready(function() {
// INIT
	$('#registerFrame').hide();
// NEWSBANNER
	$("#newsBannerText").text("");
// DAILY QUOTE
	$("#dailyQuote").html(quote[theDay]);
	$("#dailyCredit").text("- "+credit[theDay]);
	
// REGISTRATION FORM

// Form field examples	
	$('#regName').example('Enter your name');
	$('#regEmail').example('Enter your email');
// Toggle form visibility	
	$('a.registerBtn').click(function() {
        var id = $(this).attr('id');
     $('#registerFrame').toggle(500);
     return false;
     });


jQuery('a[@href^="http://"]').attr('target', '_blank');


// Registration form

$("#submit").click(function(){					   				   
		$(".error").hide();
		$("#regEmail").css("background-color", "#ffffff");
		$("#regName").css("background-color", "#ffffff");
		var hasError = false;
		var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
		
		var regEmailVal = $("#regEmail").val();
		if(regEmailVal == '' || regEmailVal == 'Enter your email') {
			$("#regEmail").css("background-color", "#ffff00");
			$("#regEmail").after('<span class="error">&nbsp;&laquo;</span>');
			hasError = true;
		} else if(!emailReg.test(regEmailVal)) {	
			$("#regEmail").css("background-color", "#ffff00");
			$("#regEmail").after('<span class="error">&nbsp;&laquo;</span>');
			hasError = true;
		}
		
		
		var regNameVal = $("#regName").val();
		if(regNameVal == '' || regNameVal == 'Enter your name') {
			$("#regName").css("background-color", "#ffff00");
			$("#regName").after('<span class="error">&nbsp;&laquo;</span>');
			hasError = true;
		}
		
		
		if(hasError == false) {
			$(this).hide();
			$('#sendingEmail').show();
			
			$.post("http://www.jamie-land.com/forms/sendemail.php",
   				{ emailFrom: regEmailVal, fromName: regNameVal },
   					function(data){
						$("#registerForm").slideUp("normal", function() {				   
							$("#updates_btn").hide();
							$("#registerForm").before('<p style="margin-left:10px;font-weight:bold;">Got it - thanks!</p>');							
							$("#regName").val("");
							$("#regEmail").val("");											
						});
   					}
				 );
		}
		
		return false;
	});	

});


