// Define and initialize the primary data array.
// For example, index 3a means 3rd round, 1st match.
// Create 3a.txt file to store summary for this match.
// Visiting team is listed first, home team is last.
// The team name syntax must be consistent throughout.
// Enter team match scores when results are reported.
// Use score 0.0 for both if match has not been played.
// Tables for standings and schedule will be generated.
// The last field can be used for special marks, or for
// example the match date, these appear on the schedule.
// Blank team name is used for an empty placeholder.
var sched = new Array()
sched['1a']=new Array("FERMI",5.5,"JJCCC",0.5,"")
sched['1b']=new Array("STCCC",2.0,"WMBAT",4.0,"")
sched['1c']=new Array("DGCC",5.0,"DRGNS",1.0,"")
sched['1d']=new Array("ROOKS",2.0,"PAWNS",4.0,"")
sched['1e']=new Array("MLXAC",1.5,"TYROS",4.5,"")
sched['2a']=new Array("WMBAT",4.0,"FERMI",1.0,"")
sched['2b']=new Array("PAWNS",0.5,"STCCC",5.5,"")
sched['2c']=new Array("TYROS",0.0,"JJCCC",0.0,"")
sched['2d']=new Array("DGCC",6.0,"MLXAC",0.0,"")
sched['2e']=new Array("DRGNS",3.5,"ROOKS",2.5,"")
sched['3a']=new Array("DRGNS",2.5,"FERMI",3.5,"")
sched['3b']=new Array("STCCC",4.5,"ROOKS",1.5,"")
sched['3c']=new Array("DGCC",5.0,"JJCCC",1.0,"")
sched['3d']=new Array("MLXAC",1.5,"WMBAT",4.5,"")
sched['3e']=new Array("PAWNS",5.0,"TYROS",1.0,"")
sched['4a']=new Array("ROOKS",3.0,"FERMI",3.0,"")
sched['4b']=new Array("STCCC",5.0,"MLXAC",1.0,"")
sched['4c']=new Array("JJCCC",0.0,"DRGNS",0.0,"")
sched['4d']=new Array("PAWNS",1.0,"DGCC",5.0,"")
sched['4e']=new Array("TYROS",3.0,"WMBAT",3.0,"")
sched['5a']=new Array("FERMI",1.5,"STCCC",4.5,"")
sched['5b']=new Array("JJCCC",0.5,"WMBAT",5.5,"")
sched['5c']=new Array("PAWNS",2.5,"MLXAC",3.5,"")
sched['5d']=new Array("DGCC",3.5,"ROOKS",2.5,"")
sched['5e']=new Array("DRGNS",3.0,"TYROS",3.0,"")
sched['6a']=new Array("DGCC",0.0,"FERMI",0.0,"")
sched['6b']=new Array("TYROS",0.0,"STCCC",0.0,"")
sched['6c']=new Array("JJCCC",0.0,"PAWNS",0.0,"")
sched['6d']=new Array("DRGNS",0.0,"MLXAC",0.0,"")
sched['6e']=new Array("WMBAT",0.0,"ROOKS",0.0,"")
sched['7a']=new Array("MLXAC",0.0,"FERMI",0.0,"")
sched['7b']=new Array("STCCC",0.0,"DRGNS",0.0,"")
sched['7c']=new Array("ROOKS",0.0,"JJCCC",0.0,"")
sched['7d']=new Array("TYROS",0.0,"DGCC",0.0,"")
sched['7e']=new Array("PAWNS",0.0,"WMBAT",0.0,"")
sched['8a']=new Array("FERMI",0.0,"PAWNS",0.0,"")
sched['8b']=new Array("STCCC",0.0,"DGCC",0.0,"")
sched['8c']=new Array("MLXAC",0.0,"JJCCC",0.0,"")
sched['8d']=new Array("WMBAT",0.0,"DRGNS",0.0,"")
sched['8e']=new Array("ROOKS",0.0,"TYROS",0.0,"")
sched['9a']=new Array("FERMI",0.0,"TYROS",0.0,"")
sched['9b']=new Array("JJCCC",0.0,"STCCC",0.0,"")
sched['9c']=new Array("ROOKS",0.0,"MLXAC",0.0,"")
sched['9d']=new Array("WMBAT",0.0,"DGCC",0.0,"")
sched['9e']=new Array("DRGNS",0.0,"PAWNS",0.0,"")

// Enter the play-by date for each scheduled round
var playby = new Array("9/30","10/21","11/11","12/02","1/13","2/10","3/2","3/23","4/13")

// Designate the team with the bye for each round (optional).
// Also used to create links to the respective team rosters.
// Therefore all teams should be listed here in some order.
var byes = new
Array("FERMI","DGCC","MLXAC","ROOKS","PAWNS","TYROS","DRGNS","STCCC","WMBAT","JJCCC")

// Define the labels used for the schedule table.
// Replace Roster with Bye if odd number of teams.
var labels = new
Array("Rnd","Play By","Roster","(A)","(B)","(C)","(D)","(E)")

// Define the team name syntax, order doesn't matter.
// Suggest using order of finish from previous season.
var teams = new Array()
teams[0] = "DGCC"
teams[1] = "STCCC"
teams[2] = "PAWNS"
teams[3] = "FERMI"
teams[4] = "ROOKS"
teams[5] = "TYROS"
teams[6] = "DRGNS"
teams[7] = "MLXAC"
teams[8] = "WMBAT"
teams[9] = "JJCCC"


// Reverse map team names to the index used above.
// Very important to make sure these are aligned.
var keys = new Array()
keys["DGCC"] = 0
keys["STCCC"] = 1
keys["PAWNS"] = 2
keys["FERMI"] = 3
keys["ROOKS"] = 4
keys["TYROS"] = 5
keys["DRGNS"] = 6
keys["MLXAC"] = 7
keys["WMBAT"] = 8
keys["JJCCC"] = 9

// Define and enter extra comments for each team (optional)
// These are displayed as part of the team standings.
// The order of this array matches the team indices.
var notes = new Array()
notes[0] = " "
notes[1] = " "
notes[2] = " "
notes[3] = " "
notes[4] = " "
notes[5] = " "
notes[6] = " "
notes[7] = " "
notes[8] = " "
notes[9] = " "
notes[10] = " "
notes[11] = " "

// Enter script name to display all match reports.
// The order of this array matches the team indices.
// This requires the perf ratings to be published.
// Not used anymore
var mrep = new Array()
mrep[0]="./DGCC.html"
mrep[1]="./STCCC.html"
mrep[2]="./FERMI.html"
mrep[3]="./TYROS.html"
mrep[4]="./DRGNS.html"
mrep[5]="./PAWNS.html"
mrep[6]="./molex.html"
mrep[7]="./ROOKS.html"
mrep[8]="./stxav.html"
mrep[9]="./mdway.html"
mrep[10]="./WMBAT.html"
mrep[11]="./jjccc.html"

// This represents the default ordering of teams.
// Values used here correspond to the team index.
// These will be re-ordered by function revsort()
// before displaying the divisional standings.
var idx = new Array(0,1,2,3,4,5,6,7,8,9)

// Define and initialize arrays for team statistics.
// Performance ratings must be entered as published.
// At the beginning of the season, use 0 for the PR's.
// The order of these arrays match the team indices.
// Number of entries must match the number of teams.
var perf = new Array(0,0,0,0,0,0,0,0,0,0) // performance rating
var wins = new Array(0,0,0,0,0,0,0,0,0,0) // team wins
var loss = new Array(0,0,0,0,0,0,0,0,0,0) // team losses
var draw = new Array(0,0,0,0,0,0,0,0,0,0) // team draws
var gpts = new Array(0,0,0,0,0,0,0,0,0,0) // game points
var mpts = new Array(0,0,0,0,0,0,0,0,0,0) // match points
var prct = new Array(0,0,0,0,0,0,0,0,0,0) // winning percentage
var usat = new Array(0,0,0,0,0,0,0,0,0,0) // team usat
var tbrk = new Array(0,0,0,0,0,0,0,0,0,0) // team tie-break

// Enter cicl links for team roster and player results.
// The order of this array must match team byes above.
var links = new Array()
links[0]="http://www.chicagochessleague.org/cgi-bin/cicl/ParseRates.cgi?Team=FERMI"
links[1]="http://www.chicagochessleague.org/cgi-bin/cicl/ParseRates.cgi?Team=DGCC"
links[2]="http://www.chicagochessleague.org/cgi-bin/cicl/ParseRates.cgi?Team=BPMX"
links[3]="http://www.chicagochessleague.org/cgi-bin/cicl/ParseRates.cgi?Team=ROOKS"
links[4]="http://www.chicagochessleague.org/cgi-bin/cicl/ParseRates.cgi?Team=PAWNS"
links[5]="http://www.chicagochessleague.org/cgi-bin/cicl/ParseRates.cgi?Team=TYROS"
links[6]="http://www.chicagochessleague.org/cgi-bin/cicl/ParseRates.cgi?Team=DRGNS"
links[7]="http://www.chicagochessleague.org/cgi-bin/cicl/ParseRates.cgi?Team=STCCC"
links[8]="http://www.chicagochessleague.org/cgi-bin/cicl/ParseRates.cgi?Team=WMBAT"
links[9]="http://www.chicagochessleague.org/cgi-bin/cicl/ParseRates.cgi?Team=JJCCC"

// Define and enter links to team logos
// Set to null string if no logo exists.
// The order must match team byes above.
var logo2 = new Array()
logo2[0]="./logo2/FERMI.jpg"
logo2[1]="./logo2/DGCC.jpg"
logo2[2]="./logo2/kk.gif"
logo2[3]="./logo2/ROOKS.jpg"
logo2[4]="./logo2/PAWNS.jpg"
logo2[5]="./logo2/alu.jpg"
logo2[6]="./logo2/alu.jpg"
logo2[7]="./logo2/STCCC.jpg"
logo2[8]="./logo2/WMBAT.jpg"
logo2[9]="./logo2/PAWNS.jpg"

