function getCups() {
  return parseFloat(document.facts.cups.value);
}

var descriptionArray = new Array ("It is considered the best variety of coffee.\nArabica production represents 80% of the world's \ncoffee trade, however, only 10% of this meets \nspeciality coffee standards.", "Robusta beans usually grow at lower elevations; \nthey possess a woody, astringent flavor.  They are \nused when a lower price or additional caffeine is \ndesired. Robusta coffee has twice the amount of \ncaffeine than Arabica coffee."
);

function changeDescription() {
  document.facts.description.value = descriptionArray[document.facts.typecoffee.selectedIndex];
}

function numberbeans() {
  if(document.facts.beans[0].checked) {
	alert("Sorry, try Again!");
  } else if (document.facts.beans[1].checked) {
	alert("Sorry, try Again!");
  } else if (document.facts.beans[2].checked) {
	alert("Congratulations!!! Correct Answer");
  } else if (document.facts.beans[3].checked) {
	alert("Sorry, try Again!");
  }
}

function setDay(cafday) {
  document.facts.day.value = cafday;
}

function setWeek(cafweek) {
  document.facts.week.value = cafweek;
}

function setMonth(cafmonth) {
  document.facts.month.value = cafmonth;
}

function setYear(cafyear) {
  document.facts.year.value = cafyear;
}

function calculateCaf() {
  var daycaf;
  var weekcaf;
  var monthcaf;
  var yearcaf;

  daycaf = getCups() * 150;
  weekcaf = daycaf * 7;
  monthcaf = weekcaf * 4;
  yearcaf = monthcaf * 12;

  setDay(daycaf);
  setWeek(weekcaf);
  setMonth(monthcaf);
  setYear(yearcaf);
}

function coffeeholic() {
  if (document.facts.voltaire[0].checked) {
	alert("Correct Answer! Voltaire was a true coffeeholic!");
  }
}

function wrongcoffeeholic() {
  if (document.facts.voltaire[1].checked) {
	alert("Sorry, try again");
  }
}

function arabRight() {
  if (document.facts.arab[0].checked) {
	alert("Correct answer! Its amazing how important coffee was in the past.");
  }
}

function arabWrong() {
  if (document.facts.arab[1].checked) {
	alert("Sorry, try again");
  }
}

function brazil() {
  if (document.facts.country[0].checked) {
	alert("It's not Brazil!");
  }
}

function japan() {
  if (document.facts.country[1].checked) {
	alert("You're right!");
  }
}

function indonesia() {
  if (document.facts.country[2].checked) {
	alert("It's not Indonesia!");
  }
}

function ethiopia() {
  if (document.facts.country[3].checked) {
	alert("It's not Ethiopia");
  }
}