function changeSel(slctEl,sbmtEl) {
  numWords = slctEl.selectedIndex+1;
  sbmtEl.value = "count the "+numWords+"-word phrases";
}

bushWords = new Array("wrong war at the wrong place at the wrong time:2","a free Iraq will be a major defeat:2",
 "central part of the war on terror:2","the world is safer without Saddam Hussein:2","help is on the way, but:2",
 "looked at the same intelligence:3","the war on terror:8","weapons of mass destruction:6","think he was misleading:3",
 "Kim Jong Il:7","it's hard work:7","I don't think:7","the American people:6","my opponent says:4","Osama bin Laden:4",
 "my opponent:19","I believe:10","hard work:11","the wrong:15","my administration:6","wrong war:6");
kerryWords = new Array("I'm going to do it in four years:2","I ask you to give me the opportunity:2",
 "go to war as a last resort:4","without a plan to win the peace:2","a plan to win the peace:3",
 "we can do a better job:2","the United States:19","president of the United States:4",
 "the British, French and Germans:2","weapons of mass destruction:6","have a plan to:4","and I'm going to:4",
 "and we're going to:4","percent of the casualties:3","United States:19","Saddam Hussein:12");

function changeWords(whoOff) {
  document.getElementById(whoOff+"Balloon").style.display="none";
  var coin = Math.round(Math.random());
  var who = (coin==1) ? "bush" : "kerry";
  var phraseBank = (coin==1) ? bushWords : kerryWords;
  var phraseIndex = Math.floor(Math.random()*phraseBank.length);
  var wordInfo = phraseBank[phraseIndex].split(":");
  var phrase = wordInfo[0];
  var num = wordInfo[1];
  var time = (num>1) ? "times" : "time";
  var html = "<p>\""+phrase+"\"</p><p class='count'>(said "+num+" "+time+")</p>";
  document.getElementById(who+"Balloon").style.display="block";
  document.getElementById(who+"Words").innerHTML = html;
  window.setTimeout("changeWords('"+who+"')",2000);
}

function start() {
  changeWords("kerry");
}

window.onload = start;
