// 
//	TYGR Productions Interactive Statistics
//	
//	This file contains JavaScript support functions for TYGR Productions' Interactive Statistics.  The code contained herein
//  is NOT in the public domain.  This file is provided for download to personal computers and is only authorized for personal 
//  use in conjuction with TYGR Productions' Interactive Statistics.  Copying or reposting this file in whole or in part on 
//  any web server or other network server, or reusing any portion of the code is not allowed without express written consent 
//  of the author.  Any commercial use is strictly prohibited.
//	
//	Copyright (c) 2005, 2006 by Jon T. Camp.  All rights reserved.
// 
var aTableData = [];
var bDefaultFormat = false;
var bDivideRows = false;
var bIE = false;
var bNetscape = false;
var bWeightedRanking = false;
var cFavoriteTeam = "";
var cFavoriteTeamCookieName = "tygrStatFavoriteTeam";
var cStatCookieName = "tygrStatFormat";
var cWeightingCookieName = "tygrStatWeighting";
var docbody;
var nDefaultProfileIndex = 0;
var toolTipData = new Object();

function initTable(tableData) 
{
	buildHeader(tableData);
	buildTable(tableData);
	calcRank(tableData);
	loadTable(tableData);
}

function srcElementFromEvent(ev) 
{
	if (bIE) return ev.srcElement;
	else return ev.target;
}

function tableDataFromId(cId) 
{
	for (var i = 0; i < aTableData.length; i++) 
	{ 
		if (aTableData[i].Table.id == cId) return aTableData[i];
	}
	
	return null;
}
