var driverFeat = new Array( 0 );
driverFeat[0] = "Stirling Moss:Stirling Moss:Jack Brabham:Jim Clark:Graham Hill:Jim Clark:Graham Hill:Jack Brabham:Graham Hill:Mario Andretti:Jochen Rindt:Jacky Ickx:Jackie Stewart:Jackie Stewart:Ronnie Peterson:Carlos Reutemann:Niki Lauda:Clay Regazzoni:James Hunt:Niki Lauda:James Hunt:Carlos Reutemann:Mario Andretti:Gilles Villeneuve:Alan Jones:Nelson Piquet:Bruno Giacomelli:Riccardo Patrese:Carlos Reutemann:Andrea de Cesaris:Alain Prost:Alain Prost:Patrick Tambay:René Arnoux:Nelson Piquet:Nigel Mansell:Ayrton Senna:Ayrton Senna:Nigel Mansell:Ayrton Senna:Ayrton Senna:Gerhard Berger:Ayrton Senna:Michael Schumacher:Michael Schumacher:Michael Schumacher:Kimi Räikkönen:Rubens Barrichello:Jarno Trulli:Michael Schumacher:Lewis Hamilton:TBD:TBD";
driverFeat[1] = "Bruce McLaren:Stirling Moss:Innes Ireland:Jim Clark:Graham Hill:Graham Hill:Graham Hill:Jim Clark:Jim Clark:Jackie Stewart:Jochen Rindt:Emerson Fittipaldi:François Cevert:Jackie Stewart:Ronnie Peterson:Carlos Reutemann:Niki Lauda:Clay Regazzoni:James Hunt:Mario Andretti:James Hunt:Carlos Reutemann:Carlos Reutemann:Gilles Villeneuve:Gilles Villeneuve:Nelson Piquet:Alan Jones:Alan Jones:Alan Jones:Niki Lauda:John Watson:Michele Alboreto:John Watson:Michele Alboreto:Nelson Piquet:Keke Rosberg:Keke Rosberg:Ayrton Senna:Ayrton Senna:Ayrton Senna:Alain Prost:Ayrton Senna:Ayrton Senna:Michael Schumacher:Mika Häkkinen:Rubens Barrichello:Michael Schumacher:Michael Schumacher:Michael Schumacher:Michael Schumacher:Lewis Hamilton:TBD:TBD";
driverFeat[2] = "Maurice Trintignant:Jack Brabham:Jack Brabham:Jim Clark:Jim Clark:Jim Clark:Graham Hill:John Surtees:Graham Hill:Jackie Stewart:Jochen Rindt:Jacky Ickx:Jacky Ickx:Jackie Stewart:James Hunt:Carlos Pace:Emerson Fittipaldi:Clay Regazzoni:James Hunt:Niki Lauda:Ronnie Peterson:Alan Jones:Jean-Pierre Jarier:Gilles Villeneuve:Nelson Piquet:Nelson Piquet:Alan Jones:Alan Jones:Didier Pironi:Niki Lauda:Alain Prost:Michele Alboreto:Niki Lauda:John Watson:Derek Warwick:Niki Lauda:Ayrton Senna:Nelson Piquet:Ayrton Senna:Alain Prost:Ayrton Senna:Gerhard Berger:Jean Alesi:David Coulthard:Juan Pablo Montoya:Rubens Barrichello:Michael Schumacher:Rubens Barrichello:Michael Schumacher:Michael Schumacher:Kimi Räikkönen:TBD:TBD";

function getItem (theRace)
{
   var priorities1 = new Array( 0 );
   priorities1 = split( driverFeat[0], ':' );
   var priorities2 = new Array( 1 );
   priorities2 = split( driverFeat[1], ':' );
   var priorities3 = new Array( 2 );
   priorities3 = split( driverFeat[2], ':' );

   if( priorities1[theRace] == 'invalid' )
   {
      alert( "That is not a valid race" );
   }
   else
   {
      document.forms['feats'].pole.value = priorities1[theRace];
      document.getElementById('pole').style.backgroundColor = "#ffcccc";
      document.forms['feats'].win.value = priorities2[theRace];
      document.getElementById('win').style.backgroundColor = "#ffcccc";
      document.forms['feats'].fastlap.value = priorities3[theRace];
      document.getElementById('fastlap').style.backgroundColor = "#ffcccc";
   }
}

function split( string, delimiter )
{
   var words = new Array( 0 );
   var start = 0;
   var end = 0;

   for( var i=0; i<string.length; i++ )
   {
      if( (string.charAt( i ) == delimiter) || (i == string.length-1) )
          {
             if( i == string.length-1 )
                 { end = i+1; }
             else
                 { end = i; }
             words[words.length] = string.substring( start, end );
             start = i+1;
          }
   }
   return words;
}

function getAccount()
{
   if (document.forms['feats'].theRace[1].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1959_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[2].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1960_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[3].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1961_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[4].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1962_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[5].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1963_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[6].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1964_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[7].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1965_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[8].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1966_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[9].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1967_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[10].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1968_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[11].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1969_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[12].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1970_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[13].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1971_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[14].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1972_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[15].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1973_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[16].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1974_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[17].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1975_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[18].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1976_United_States_Grand_Prix_West";
   } else
   if (document.forms['feats'].theRace[19].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1976_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[20].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1977_United_States_Grand_Prix_West";
   } else
   if (document.forms['feats'].theRace[21].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1977_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[22].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1978_United_States_Grand_Prix_West";
   } else
   if (document.forms['feats'].theRace[23].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1978_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[24].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1979_United_States_Grand_Prix_West";
   } else
   if (document.forms['feats'].theRace[25].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1979_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[26].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1980_United_States_Grand_Prix_West";
   } else
   if (document.forms['feats'].theRace[27].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1980_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[28].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1981_United_States_Grand_Prix_West";
   } else
   if (document.forms['feats'].theRace[29].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1981_Las_Vegas_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[30].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1982_United_States_Grand_Prix_West";
   } else
   if (document.forms['feats'].theRace[31].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1982_United_States_Grand_Prix_East";
   } else
   if (document.forms['feats'].theRace[32].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1982_Las_Vegas_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[33].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1983_United_States_Grand_Prix_West";
   } else
   if (document.forms['feats'].theRace[34].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1983_United_States_Grand_Prix_East";
   } else
   if (document.forms['feats'].theRace[35].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1984_United_States_Grand_Prix_East";
   } else
   if (document.forms['feats'].theRace[36].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1984_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[37].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1985_United_States_Grand_Prix_East";
   } else
   if (document.forms['feats'].theRace[38].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1986_United_States_Grand_Prix_East";
   } else
   if (document.forms['feats'].theRace[39].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1987_United_States_Grand_Prix_East";
   } else
   if (document.forms['feats'].theRace[40].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1988_United_States_Grand_Prix_East";
   } else
   if (document.forms['feats'].theRace[41].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1989_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[42].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1990_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[43].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/1991_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[44].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/2000_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[45].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/2001_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[46].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/2002_United_States_Grand_Prix";
   } else
   if (document.forms['feats'].theRace[47].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/2003_United_States_Grand_Prix";
   }
   if (document.forms['feats'].theRace[48].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/2004_United_States_Grand_Prix";
   }
   if (document.forms['feats'].theRace[49].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/2005_United_States_Grand_Prix";
   }
   if (document.forms['feats'].theRace[50].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/2006_United_States_Grand_Prix";
   }
   if (document.forms['feats'].theRace[51].selected) {
      window.location.href = "http://en.wikipedia.org/wiki/2007_United_States_Grand_Prix";
   }
   if (document.forms['feats'].theRace[52].selected) {
      window.location.href = "austin.html";
   }
   if (document.forms['feats'].theRace[53].selected) {
      window.location.href = "newjersey.html";
   }
}

function startQuiz(theURL){
   var ItsTheWindow;
   ItsTheWindow = window.open(theURL,"Quiz","scrollbars=yes,menubar=no,toolbar=no,links=no,status=no,height=300,width=440,resizable=no");
   ItsTheWindow.focus();
}

