 /*
Yes, I wrote this code, but with a little "input" from http://www.w3schools.com/js/default.asp - thanks for all the great information!
webmaster@djsteiner.com
*/

var question="Did You Know? "

function randomFact()
{

var rfact=(Math.floor(Math.random()*51));

switch (rfact)
{
case 0:
  var fact="A dogs heart beats between 70 and 120 times a minute, compared with a human heart which beats 70 to 80 times a minute.";
  break;
case 1:
  var fact="A female carries her young about 60 days before the puppies are born.";
  break;
case 2:
  var fact="A dogs normal body temperature is 100.5 to 102.5 degrees Fahrenheit.";
  break;
case 3:
  var fact="An adult dog has 42 teeth.";
  break;
case 4:
  var fact="It is a myth that dogs are color blind. They can actually see in color, just not as vividly as humans. It is akin to our vision at dusk.";
  break;
case 5:
  var fact="If never spayed or neutered, a female dog, her mate, and their puppies could produce over 66,000 dogs in 6 years.";
  break;
case 6:
  var fact="The only sweat glands a dog has are between the paw pads.";
  break;
case 7:
  var fact="A dogs smell is more than 100,000 times stronger than that of a humans.";
  break;
case 8:
  var fact="Chocolate contains a substance known as theobromine, similar to caffeine, which can kill dogs or at the very least make them violently ill.";
  break;
case 9:
  var fact="A dogs sense of hearing is more than ten times more acute than a humans.";
  break;
case 10:
  var fact="The average dog can run about 19 mph. Greyhounds are the fastest dogs on Earth and can run at speeds of 45 mph.";
  break;
case 11:
  var fact="Puppies acquire a full mouth of permanent teeth between four and seven months old.";
  break;
case 12:
  var fact="The U.S. has the highest dog population in the world.";
  break;
case 13:
  var fact="It has been established that people who own pets live longer, have less stress, and have fewer heart attacks.";
  break;
case 14:
  var fact="A dogs whiskers are touch-sensitive hairs called vibrissae. They are found on the muzzle, above the eyes and below the jaws, and can actually sense tiny changes in airflow.";
  break;
case 15:
  var fact="Dogs can smell about 1,000 times better than humans. While humans have 5 million smell-detecting cells, dogs have more than 220 million. The part of the brain that interprets smell is also four times larger in dogs than in humans.";
  break;
case 16:
  var fact="Irish Wolfhounds are the tallest dogs among all breeds.";
  break;
case 17:
  var fact="In the middle ages, Rottweiler's were used to hunt boar.";
  break;
case 18:
  var fact="The American Kennel Club says that Cocker Spaniels are the smallest member of the sporting dog family.";
  break;
case 19:
  var fact="The phrase 'Dog Days of Summer' comes from an ancient Roman belief. It was believed that the Dog star, Sirius, gave off a lot of heat and caused higher temperatures during the months of June, July, and August.";
  break;
case 20:
  var fact="To keep themselves warm in the winter, dogs sometimes curl up with their tail covering their nose.";
  break;
case 21:
  var fact="Lassie was the first animal named to the Animal Hall of Fame in 1969.";
  break;
case 22:
  var fact="Television's original Lassie was a male dog.";
  break;
case 23:
  var fact="Dogs have three eyelids. The third lid, called a nictitating membrane or 'haw,' keeps the eye lubricated and protected.";
  break;
case 24:
  var fact="A dog’s shoulder blades are unattached to the rest of the skeleton to allow greater flexibility for running.";
  break;
case 25:
  var fact="Puppies are sometimes rejected by their mother if they are born by cesarean and cleaned up before being given back to her.";
  break;
case 26:
  var fact="The phrase 'raining cats and dogs' originated in seventeenth-century England. During heavy rainstorms, many homeless animals would drown and float down the streets, giving the appearance that it had actually rained cats and dogs.";
  break;
case 27:
  var fact="The American Kennel Club, the most influential dog club in the United States, was founded in 1884.";
  break;
case 28:
  var fact="The name of the dog on the Cracker Jacks box is Bingo. The Taco Bell Chihuahua is a rescued dog named Gidget.";
  break;
case 29:
  var fact="Laiki, a Russian stray, was the first living mammal to orbit the Earth, in the Soviet Sputnik spacecraft in 1957. Though she died in space, her daughter Pushnika had four puppies with President John F. Kennedy’s terrier, Charlie.";
  break;
case 30:
  var fact="A puppy is born blind, deaf, and toothless.";
  break;
case 31:
  var fact="The Basenji is the world’s only barkless dog.";
  break;
case 32:
  var fact="A dog can locate the source of a sound in 1/600 of a second and can hear sounds four times farther away than a human can.";
  break;
case 33:
  var fact="Touch is the first sense the dog develops. The entire body, including the paws, is covered with touch-sensitive nerve endings.";
  break;
case 34:
  var fact="Dog nose prints are as unique as human finger prints and can be used to identify them.";
  break;
case 35:
  var fact="Petting dogs is proven to lower blood pressure of dog owners.";
  break;
case 36:
  var fact="A person standing still 300 yards away is almost invisible to a dog. But a dog can easily identify its owner standing a mile away if the owner is waving his arms.";
  break;
case 37:
  var fact="Dogs with big, square heads and large ears (like the Saint Bernard) are the best at hearing subsonic sounds.";
  break;
case 38:
  var fact="Dogs like sweets a lot more than cats do. While cats have around only 473 taste buds, dogs have about 1,700 taste buds. Humans have approximately 9,000.";
  break;
case 39:
  var fact="Male dogs will raise their legs while urinating to aim higher on a tree or lamppost because they want to leave a message that they are tall and intimidating. Some wild dogs in Africa try to run up tree trunks while they are urinating to appear to be very large.";
  break;
case 40:
  var fact="Different smells in a dogs urine can tell other dogs whether the dog leaving the message is female or male, old or young, sick or healthy, happy or angry.";
  break;
case 41:
  var fact="All dogs can be traced back 40 million years ago to a weasel-like animal called the Miacis which dwelled in trees and dens. The Miacis later evolved into the Tomarctus, a direct forbear of the genus Canis, which includes the wolf and jackal as well as the dog.";
  break;
case 42:
  var fact="During the Middle Ages, Great Danes and Mastiffs were sometimes suited with armor and spiked collars to enter a battle or to defend supply caravans.";
  break;
case 43:
  var fact="The shape of a dog’s face suggests how long it will live. Dogs with sharp, pointed faces that look more like wolves typically live longer. Dogs with very flat faces, such as bulldogs, often have shorter lives.";
  break;
case 44:
  var fact="During the Middle Ages, mixed breeds of peasants’ dogs were required to wear blocks around their necks to keep them from breeding with noble hunting dogs. Purebred dogs were very expensive and hunting became the province of the rich.";
  break;
case 45:
  var fact="Weird dog laws include allowing police officers in Palding, Ohio, to bite a dog to quiet it. In Ventura County, California, cats and dogs are not allowed to have sex without a permit.";
  break;
case 46:
  var fact="Hollywood’s first and arguably best canine superstar was Rin Tin Tin, a five-day-old German Shepherd found wounded in battle in WWI France and adopted by an American soldier, Lee Duncan. He would sign his own contracts with his paw print.";
  break;
case 47:
  var fact="Dogs have lived with humans for over 14,000 years. Cats have lived with people for only 7,000 years.";
  break;
case 48:
  var fact="Zorba, an English mastiff, is the biggest dog ever recorded. He weighed 343 pounds and measured 8 feet, 3 inches from his nose to his tail.";
  break;
case 49:
  var fact="Some dogs can smell dead bodies under water, where termites are hiding, and natural gas buried under 40 feet of dirt. They can even detect cancer that is too small to be detected by a doctor and can find lung cancer by sniffing a person’s breath.";
  break;
case 50:
  var fact="The Beagle and Collie are the nosiest dogs, while the Akbash Dog and the Basenji are the quietest.";
  break;
default:
  var fact="In the middle ages, Rottweiler's were used to hunt boar.";
}

document.getElementById('factoid').innerHTML=question.bold().fontcolor("#FFFF00") + fact.fontcolor("#FFFFFF");
t=setTimeout('randomFact()',12000);
}


// NEXT FACT COUNTDOWN TIMER

c=12

function timedCount()
{

if (c<=10 && c>=3)
{
var nextfact="Next fact in " + c + " seconds";
}
else
{
var nextfact=" ";
}

document.getElementById('countdown').innerHTML=nextfact;
c=c-1;
c=checkTimer(c)
t=setTimeout("timedCount()",1000);
}

function checkTimer(x)
{

if (x==0)
{
x=12;
}
return x;

}


