function generateRumour()
{
   var teams = [
   "Anaheim Ducks",
   "Atlanta Thrashers",
   "Boston Bruins",
   "Buffalo Sabres",
   "Calgary Flames",
   "Carolina Hurricanes",
   "Chicago Blackhawks",
   "Colorado Avalanche",
   "Columbus Blue Jackets",
   "Dallas Stars",
   "Detroit Red Wings",
   "Edmonton Oilers",
   "Florida Panthers",
   "Los Angeles Kings",
   "Minnesota Wild",
   "Montreal Canadiens",
   "Nashville Predators",
   "New Jersey Devils",
   "New York Rangers",
   "New York Islanders",
   "Ottawa Senators",
   "Philadelphia Flyers",
   "Pittsburgh Penguins",
   "Phoenix Coyotes",
   "San Jose Sharks",
   "St. Louis Blues",
   "Tampa Bay Lightning",
   "Toronto Maple Leafs",
   "Vancouver Canucks",
   "Washington Capitals"]

   var numTeams = teams.length;
   var teamIDs  = getIDs(numTeams); 
   
   var fromID = teamIDs[0];
   var toID   = teamIDs[1];
 
   var tradeFrom = teams[fromID];
   var tradeTo   = teams[toID];
 
   var fromPlayers = getPlayers(fromID);
   var toPlayers   = getPlayers(toID);

   var playerNum   = Math.floor(fromPlayers.length * Math.random());
   var playerName  = fromPlayers[playerNum];

   var extras = getExtras();

   var numTradeItems = Math.floor(3 * Math.random()) + 1;
   var sendString = "";
   for (var i=0; i<=numTradeItems; i++)
   {
       var thisNum = (i == 0) ? Math.floor(toPlayers.length * Math.random()) : Math.floor((toPlayers.length + 2) * Math.random());
       if (thisNum >= toPlayers.length)
       {
           var thisExtraID = Math.floor(extras.length * Math.random());
           var thisItem    = extras[thisExtraID];
           extras[thisExtraID] = "";
       }
       else
       {
           var thisItem = toPlayers[thisNum];
           toPlayers[thisNum] = "";
       }

       if (thisItem == "") { continue; }

       if (i == 0) { sendString += thisItem; }
       else if (i == numTradeItems) { sendString += ' and ' + thisItem; }
       else { sendString += ', ' + thisItem; }
   }

   var fromParts = playerName.split(" ");
   var firstName = fromParts[1];
   var lastName  = fromParts[2];
   var toTeamParts = tradeTo.split(" ");
   var toName = (toTeamParts[0] == "Columbus") ? "Blue Jackets" : toTeamParts[toTeamParts.length - 1];
   var eNum = Math.floor(5 * Math.random()) + 1;

   var rumourTitle = '<h3>' + 
                     lastName + ' to ' + toName + '? (e' + eNum+ ')' + 
                     '</h3>'              
        
   var rumourBody = 'According to my sources within the ' +
                    tradeFrom + ' organization, the ' + tradeTo + 
                    ' are willing to part with ' + sendString + 
                    ' to obtain the services of ' + playerName +
                    '.' + ' Remember, you heard it here first!<br/>';
                    

   document.getElementById('rumour').innerHTML = rumourTitle + rumourBody + '<br/>';
}

function getIDs(num)
{ 
   var tradeFromID = Math.floor(num * Math.random());
   var tradeToID   = Math.floor(num * Math.random());

   if (tradeFromID == tradeToID) { [tradeFromID, tradeToID] = getIDs(num); }
   
   return [tradeFromID, tradeToID]
}

function getExtras()
{
   var extras = [
   "a 1st round pick",
   "a 2nd round pick",
   "a 3rd round pick",
   "a 4th round pick",
   "a 5th round pick",
   "a 6th round pick",
   "a 7th round pick",
   "an 8th round pick",
   "a bag of pucks",
   "a rusty zamboni",
   "a bucket of fried chicken",
   "a Gary Bettman bobblehead"];

   return extras;
}

function getPlayers(teamID)
{
   var players = [[
      "G Jean-Sebastian Gigure",
      "D Scott Niedermayer",
      "RW Corey Perry",
      "C Ryan Getzlaf"],[
      "RW Brian Little",
      "LW Ilya Kovalchuk",
      "C Nik Antropov",
      "C Evander Kane"],[
      "C Patrice Bergeron",
      "RW Michael Ryder",
      "LW Milan Lucic",
      "LW Marco Sturm"],[
      "C Tim Connolly",
      "D Teppo Numminen",
      "G Ryan Miller",
      "LW Thomas Vanek"],[
      "C Oli Jokinen",
      "RW Jarome Iginla",
      "G Mikka Kiprusoff",
      "D Dion Phaneuf"],[
      "C Eric Staal",
      "LW Eric Cole",
      "D Joni Pitkanen",
      "LW Ray Whitney"],[
      "RW Patrick Kane",
      "G Cristobal Huet",
      "D Duncan Keith",
      "C Jonathan Toews"],[
      "C Matt Duchene",
      "RW Milan Hejduk",
      "C Paul Stastny",
      "LW Wojtek Wolski"],[
      "D Mike Commodore",
      "LW Kristian Huselius",
      "LW Rick Nash",
      "G Steve Mason"],[
      "LW Loui Eriksson",
      "LW Brenden Morrow",
      "G Marty Turco",
      "C Brad Richards"],[
      "C Pavel Datsyuk",
      "D Nicklas Lidstrom",
      "G Chris Osgood",
      "C Henrik Zetterberg"],[
      "RW Ales Hemsky",
      "LW Dustin Penner",
      "D Sheldon Souray",
      "D Lubomir Visnovsky"],[
      "C Nathan Horton",
      "RW Michael Frolik",
      "LW Stephen Weiss",
      "G Tomas Vokoun"],[
      "LW Dustin Brown",
      "LW Ryan Smyth",
      "C Anze Kopitar",
      "D Drew Doughty"],[
      "G Niklas Backstrom",
      "RW Martin Havlat",
      "C Mikko Koivu",
      "D Marek Zidlicky"],[
      "LW Mike Cammalleri",
      "C Scott Gomez",
      "G Carey Price",
      "D Andrei Markov"],[
      "LW Steve Sullivan",
      "C David Legwand",
      "D Ryan Suter",
      "D Shea Weber"],[
      "G Martin Brodeur",
      "LW Patrik Elias",
      "C Travis Zajac",
      "LW Zach Parise"],[
      "C Chris Drury",
      "G Henrik Lundqvist",
      "D Wade Redden",
      "RW Marian Gaborik"],[
      "G Rick DiPietro",
      "C John Tavares",
      "RW Trent Hunter",
      "RW Kyle Okposo"],[
      "RW Daniel Alfredsson",
      "LW Milan Michalek",
      "C Jason Spezza",
      "G Pascal Leclaire"],[
      "C Danny Briere",
      "C Jeff Carter",
      "RW Simon Giroux",
      "C Mike Richards"],[
      "C Sidney Crosby",
      "G Marc-Andre Fleury",
      "D Sergei Gonchar",
      "C Evgeni Malkin"],[
      "G Ilya Bryzgalov",
      "C Matthew Lombardi",
      "D Ed Jovanovski",
      "RW Shane Doan"],[
      "D Rob Blake",
      "LW Danny Heatley",
      "D Dan Boyle",
      "C Joe Thornton"],[
      "RW Brad Boyes",
      "C Andy McDonald",
      "D Erik Johnson",
      "G Chris Mason"],[
      "D Victor Hedman",
      "C Vincent Lecavalier",
      "LW Ryan Malone",
      "C Steven Stamkos"],[
      "RW Phil Kessel",
      "D Tomas Kaberle",
      "LW Alexei Ponikarovsky",
      "G Vesa Toskala"],[
      "LW Alex Burrows",
      "G Roberto Luongo",
      "LW Daniel Sedin",
      "C Henrik Sedin"],[
      "C Nicklas Backstrom",
      "D Mike Green",
      "LW Alexander Ovechkin",
      "RW Alexander Semin"]];
 
      return players[teamID];
}