// JavaScript Document

function printquotes() {
	var obj = document.getElementById('quotestarget');
	var randomnumber=0;
	if (!obj) return;
	var oldvars = new Array(-1,-1,-1);

	var str = "<h2>Quotes</h2>";
	var i =0;
	while(i<2) {
		randomnumber=Math.floor(Math.random()*(quotes.length/2))
		
		if( randomnumber != oldvars[0] && randomnumber != oldvars[1]) {
			str += "<div id='quotetext'>" + quotes[randomnumber*2+1] + "</div>" + 
					"<div id='quoteperson'><em>--- " + quotes[randomnumber*2] + "</em></div>";
			i++;
			oldvars[i] = randomnumber;
		}
	}
	obj.innerHTML = str;
}

// code to workaround children mouseover firing multiple times

function containsDOM (container, containee) {
  var isParent = false;
  do {
    if ((isParent = container == containee))
      break;
    containee = containee.parentNode;
  }
  while (containee != null);
  return isParent;
}

function checkMouseEnter (element, evt) {
  if (element.contains && evt.fromElement) {
    return !element.contains(evt.fromElement);
  }
  else if (evt.relatedTarget) {
    return !containsDOM(element, evt.relatedTarget);
  }
}



	var quotes = new Array(
			"Brian Tracy", "Just as your car runs more smoothly and requires less energy to go faster and farther when the wheels are in perfect alignment, you perform better when your thoughts, feelings, emotions, goals, and values are in balance.",
			"Oprah Winfrey", "Right now you are one choice away from a new beginning.",
			"Bud Bilanich", "Personal responsibility is the root of all personal and professional success.",
			"Earl Nightingale", "All you have got to do is plant that seed in your mind, care for it, work steadily toward your goal, and it will become a reality.",
			"Karen Casey", "Change Your Mind and Your Life Will Follow",
			"Walt Disney", "Our greatest natural resource is the minds of our children.",
			"Robin Klaus, Chairman, Club One Fitness Centers.", "As our population ages the fields of physical fitness and brain fitness will naturally merge and, as this happens, a whole new field of valued added services will emerge for our members. High quality market reports such as SharpBrains' are crucial to the success of this merger",
			"Picabo Street", "When someone tells me the is only one way to do things, it always lights a fire under my butt. My instant reaction is, I'm gonna prove you wrong.",
			"Lou Brock", "Show me a guy whos afraid to look bad, and I'll show you a guy you can beat every time.",
			"Muhammad Ali, American Boxer", "Champions aren't made in the gyms. Champions are made from something they have deep inside them -- a desire, a dream, a vision.",
			"Carl Lewis", "My thoughts before a big race are usually pretty simple. I tell myself: Get out of the blocks, run your race, stay relaxed. If you run your race, you'll win... channel your energy. Focus.",
			"Michael Jordan", "I've missed more than 9000 shots in my career. I've lost almost 300 games. 26 times, I've been trusted to take the game winning shot and missed. I've failed over and over and over again in my life. And that is why I succeed.",
			"Emmitt Smith, American Football Player", "For me, winning isn't something that happens suddenly on the field when the whistle blows and the crowds roar. Winning is something that builds physically and mentally every day that you train and every night that you dream.",
			"Jan McKeithen", "If you cannot win, make the one ahead of you break the record.",
			"Terry Orlick", "In sports, mental imagery is used primarily to help you get the best out of yourself in training and competition. The developing athletes who make the fastest progress and those who ultimately become their best make extensive use of mental imagery. They use it daily as a means of directing what will happen in training, and as a way of pre-experiencing their best competition performances.",
			"Michael Jordan", "Talent wins games, but team work and intelligence wins championships.",
			"Theodore M. Hesburgh", "The very essence of leadership is that you have to have vision. You can't blow an uncertain trumpet.",
			"James Crook", "A man who wants to lead the orchestra must turn his back on the crowd.",
			"Knute Rockne", "Make the present good, and the past will take care of itself.",
			"Vince Lombardi", "The harder you work, the harder it is to surrender.",
			"Dick Vermeil", "If you don't invest very much, then defeat doesn't hurt very much and winning is not very exciting.",
			"Tommy Lasorda", "The difference between the impossible and the possible lies in a man's determination.",
			"Gordie Howe", "You find that you have peace of mind and can enjoy yourself, get more sleep, rest when you know that it was a one hundred percent effort that you gave - win or lose.",
			"Mike Ditka", "You are never a loser until you quit trying.",
			"T. Alan Armstrong", "Champions do not become champions when they win the event, but in the hours, weeks, months and years they spend preparing for it. The victorious performance itself is merely the demonstration of their championship character.",
			"Joe Paterno", "The will to win is important, but the will to prepare is vital.",
			"Michael Jordan", "You have to expect things of yourself before you can do them.",
			"Will Rogers", "Even if you are on the right track, you'll get run over if you just sit there.",
			"Paavo Nurmi", "Mind is everything: muscle--pieces of rubber. All that I am, I am because of my mind.",
			"Lance Armstrong", "Pain is temporary. It may last a minute, or an hour, or a day, or a year, but eventually it will subside and something else will take its place. If I quit, however, it lasts forever.",
			"Arthur Ashe", "Regardless of how you feel inside, always try to look like a winner. Even if you are behind, a sustained look of control and confidence can give you a mental edge that results in victory.",
			"Michael Phelps", "You can't put a limit on anything. The more you dream, the farther you get.",
			"Wayne Gretzky", "You miss 100% of the shots you never take."

	);
				   

