function createRequestObject(){
	try{
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}catch(ex){
		//either this is not IE, or it is a version of IE which does not support XMLHTTP
		var notIECompatibleXMLHTTP=true;
	}

	if(notIECompatibleXMLHTTP==true){
		try{
			request_o = new XMLHttpRequest();
		}catch(ex){
			//we can't use AJAX because this browser is not compatible.
			request_o = false;
		}
	}
	return request_o;
}

var http = createRequestObject();

function getGrade(which, divName, again){

//	for(i = 0; i < document.forms.length; i++){
//			document.forms[i].submit.disabled = true;
//	}
	http.abort();
	http.open('post', 'ajaxTeam.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getTeamCopyGrade(which, divName, again){

	http.abort();
	http.open('post', 'ajaxTeamCopyGrade.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGradesSeason(which, divName, again){

	http.abort();
	http.open('post', 'ajaxGradeSeason.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGradesSeasonCopy(which, divName, again){

	http.abort();
	http.open('post', 'ajaxGradeSeasonCopy.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which+'&arg2='+again+'&arg3='+divName);	
	http.onreadystatechange = function(){
		if(again == 'true'){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGradesSeasonTo(which, divName, again){
	http.abort();
	http.open('post', 'ajaxGradeSeasonTo.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGradesSeasonGrade(which, divName){
//	for(i = 0; i < document.forms.length; i++){
//			document.forms[i].submit.disabled = true;
//	}
	http.abort();
	http.open('post', 'ajaxGradeCopy.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		changeSelect(divName, which);
	}
}

function getGradesSeasonGradeTo(which, divName){
//	for(i = 0; i < document.forms.length; i++){
//			document.forms[i].submit.disabled = true;
//	}
	http.abort();
	http.open('post', 'ajaxGradeCopyTo.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGradesSeasonSubs(which, divName, again){

	http.abort();
	http.open('post', 'ajaxGradeSeasonSubs.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1=' + which + '&arg2=' + again + '&arg3=' + divName);	
	http.onreadystatechange = function(){
		if(again == 'true'){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getHomeTeamDraw(which, divName, again){

	http.abort();
	http.open('post', 'ajaxHomeTeamDraw.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getHomeTeamDraw2(which, divName, again){

	http.abort();
	http.open('post', 'administrate/ajaxHomeTeamDraw2.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGradeTeams(which, divName, again){

	http.abort();
	http.open('post', 'ajaxTeamTeam.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGameGrade(which, divName, again){
	// called to alter home team (homeTeamID) on game.php
	// called to alter home team (homeTeamID) on multiple.php

	http.abort();
	http.open('post', 'ajaxGameTeam.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGameGradeResult(gradeID, divName){
	//called by results.php to get games (and first result) for grade base on gradeID

	http.abort();
	http.open('post', 'administrate/ajaxGameResult.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gradeID);	
	http.onreadystatechange = function(){
		changeSelect(divName);	
	}
}

function getTeamPlayers(teamID, divName, again){
	//called by runs.php to get new players based on teamID
//	for(i = 0; i < document.forms.length; i++){
//			document.forms[i].submit.disabled = true;
//	}

	http.abort();
	http.open('post', 'ajaxTeamPlayers.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+teamID);	
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, teamID);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGradeDraw(gradeID, divName){

	http.abort();
	http.open('post', 'administrate/ajaxDraw.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gradeID);	

	http.onreadystatechange = function(){
		changeSelect(divName);	
	}
}

function getDrawTeam(teamID, divName){

	http.abort();
	http.open('post', 'administrate/ajaxDrawTeam.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+teamID);	

	http.onreadystatechange = function(){
		changeSelect(divName);	
	}
}

function getTable(which, divName){

	http.abort();
	http.open('post', 'administrate/ajaxTable.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getResult(gameID, gradeID, divName){
	// called from results.php to get current selected game result
	// called from results.php to get current selected multiple result

	http.abort();
	http.open('post', 'administrate/ajaxResult.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gameID+'&arg2='+gradeID);	

	http.onreadystatechange = function(){
		changeSelect(divName);
	}

}

function getGradeBowl(which, divName, again){
	// called by bowling.php to get homeTeams for bowling

	http.abort();
	http.open('post', 'administrate/ajaxBowling.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGradeBatt(which, divName, again){
	// called by batting.php to get homeTeams for batting

	http.abort();
	http.open('post', 'administrate/ajaxBatting.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getBowling(gradeID, divName){
	// called from bowling.php after hometeam is altered

	http.abort();
	http.open('post', 'administrate/ajaxBowlingAve.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gradeID);	

	http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getBatting(which, divName){

	http.abort();
	http.open('post', 'administrate/ajaxBattingAve.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getHomePlayerCopy(which, divName, again){

	http.abort();
	http.open('post', 'ajaxHomeTeam.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getHomeTeamGrade(gradeID, divName, again){
	// called by teamPoints.php to get home teams based on gradeID
	// called by player.php to get home teams based on gradeID
	// called by wickets.php to get home teams based on gradeID
	// called by homeTeam.php to get home teams based on gradeID

	http.abort();
	http.open('post', 'ajaxHomeTeam.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gradeID);
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, gradeID);
		}else{
			changeSelect(divName);	
		}
	}
}

function getHomeTeamWicketsEdit(gradeID, divName, again){
	// called by wickets.php to get home teams based on gradeID

	http.abort();
	http.open('post', 'ajaxHomeTeamWicketsEdit.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gradeID);
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, gradeID);
		}else{
			changeSelect(divName);	
		}
	}
}

function getHomeTeamRuns(gradeID, divName, again){
	// called by runs.php to get home teams based on gradeID

	http.abort();
	http.open('post', 'ajaxHomeTeamRuns.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gradeID);
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, gradeID);
		}else{
			changeSelect(divName);	
		}
	}
}

function getHomeTeamWickets(gradeID, divName, again){
	// called by wickets.php to get home teams based on gradeID

	http.abort();
	http.open('post', 'ajaxHomeTeamWickets.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gradeID);
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, gradeID);
		}else{
			changeSelect(divName);	
		}
	}
}

function getHomeTeamResult(gradeID, divName, again){
	// called by runs.php to get home teams based on gradeID

	http.abort();
	http.open('post', 'ajaxHomeTeamResult.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gradeID);	
	http.onreadystatechange = function(){
		if(again){
			// called by runs.php to get games based on gradeID
			changeSelect(divName, gradeID);
		}else{
			changeSelect(divName);	
		}
	}
}

function getGameTeam(homeTeamID, divName){
	// called by runs.php to get games for homeTeamID/season
	// called by wickets.php to get games for homeTeamID/season

	http.abort();
	http.open('post', 'ajaxGameResults.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+homeTeamID);	

	http.onreadystatechange = function(){
		changeSelect2(divName, homeTeamID);
	}
}

function getGameTeamWickets(homeTeamID, divName){
	// called by wickets.php to get games for homeTeamID/season

	http.abort();
	http.open('post', 'ajaxGameWicketsResults.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+homeTeamID);	

	http.onreadystatechange = function(){
		changeSelect2(divName, homeTeamID);
	}
}

function getTeamGrade(which, divName){
	// called to alter opposition (teamID) on game.php

	http.abort();
	http.open('post', 'ajaxTeam.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	
	http.onreadystatechange = function(){
			changeSelect(divName);	
	}
}

function getHomeTeamCopy(which, divName, again){

	http.abort();
	http.open('post', 'ajaxHomeTeamCopy.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);
		}
	}
}

function getHomeTeamCopyFrom(which, divName, again){

	http.abort();
	http.open('post', 'ajaxHomeTeamFromCopy.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);
		}
	}
}

function getHomeTeamSubs(which, divName, again, first){

	http.abort();
	http.open('post', 'ajaxHomeTeamSubs.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	if (first) {
		http.send('arg1=' + which + '&arg2=' + first);
	} else {
		http.send('arg1=' + which);	
	}
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which, first);
		}else{
			changeSelect(divName);
		}
	}
}

function getHomeTeamCopyGrade(which, divName){

	http.abort();
	http.open('post', 'ajaxHomeTeamCopyGrade.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getHomeTeamCopyTo(which, divName, again, what){
//alert(which + ' ' + divName + ' ' + again + ' ' + what)
	http.abort();
	http.open('post', 'ajaxHomeTeamCopyTo.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1=' + which + '&arg2=' + what);	
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);
		}
	}
}

function getHomeTeamCopy2(which, divName, again, whatID){

	http.abort();
	http.open('post', 'ajaxHomeTeamCopy2.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1=' + which + '&arg2=' + whatID);
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);
		}
	}
}

function getHomeTeamCopy3(which, divName, seasonID){

	http.abort();
	http.open('post', 'ajaxHomeTeamCopy3.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which+'&arg2='+seasonID);	
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getHomeTeamCopyTo2(which, divName, again){

	http.abort();
	http.open('post', 'ajaxHomeTeamCopyTo2.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);
		}
	}
}

function getHomeTeamGradeCopy(which, divName, again){

	http.abort();
	http.open('post', 'ajaxHomeTeamGradeCopy.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);
		}
	}
}

function getTeamCopy(which, divName, seasonID){

	http.abort();
	http.open('post', 'ajaxTeamCopy.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which+'&arg2='+seasonID);	
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		changeSelect(divName);
	}
	/* Send the data. We use something other than null when we are sending using the POST
		method. */
}

function getTeamBatt(gradeID, teamID, divName){

	http.abort();
	http.open('post', 'administrate/ajaxTeamBatt.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gradeID+'&arg2='+teamID);	

	http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getTeamBowl(gradeID, teamID, divName){

	http.abort();
	http.open('post', 'administrate/ajaxTeamBowl.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+gradeID+'&arg2='+teamID);	
	http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getPlayerCopy(which, divName){

	http.abort();
	http.open('post', 'ajaxPlayerCopy.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getPlayerCopy2(which, divName, fromSeasonID){
	http.abort();
	http.open('post', 'ajaxPlayerCopy2.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which+'&arg2='+fromSeasonID);	

http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getPlayerGradeCopy(which, divName){
	http.abort();
	http.open('post', 'ajaxPlayerGradeCopy.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1=' + which + '&arg2=' + whichIs);	

	http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getPlayerCopyGrade(which, divName, whichIs){
//alert(which + ' : ' + divName + ' : ' + whichIs);

	http.abort();
	http.open('post', 'ajaxPlayerCopyGrade.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which + '&arg2=' + whichIs);	

	http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getPlayerSubs(which, divName, first){

	http.abort();
	http.open('post', 'ajaxPlayerSubs.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	if (first) {
		http.send('arg1=' + which + '&arg2=' + first);
	} else {
		http.send('arg1=' + which);
	}
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = function(){
		changeSelect(divName);
	}
}

function getGame(homeTeamID, divName, again, what){
	// called by runs.php to get games for homeTeamID/season
	// called by wickets.php to get games for homeTeamID/season
//alert(homeTeamID + ', ' + divName + ', ' + again + ', ' + what)
	http.abort();
	http.open('post', 'ajaxGame.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+homeTeamID + '&arg2=' + what);	

	http.onreadystatechange = function(){
		if(again){
      changeSelect(divName, homeTeamID, what);
		}else{
			changeSelect(divName);	
		}
	}
}

function getPlayer(which, divName, again, divName2, again2){

	http.abort();
	http.open('post', 'ajaxPlayer.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		if(again){
			changeSelect(divName, which);
		}else{
			changeSelect(divName);	
		}
	}
}

function getPlayersTeam(which, divName){

	http.abort();
	http.open('post', 'ajaxPlayerTeam.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		changeSelect(divName);	
	}
}

function getPlayersHomeTeam(which, divName){

	http.abort();
	http.open('post', 'ajaxPlayerHomeTeam.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+which);	

	http.onreadystatechange = function(){
		changeSelect(divName);	
	}
}

function get11Batting(homeTeamID, divName){

	http.abort();
	http.open('post', 'ajax11Batting.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+homeTeamID);	

	http.onreadystatechange = function(){
		changeSelect(divName);	
	}
}

function get11BattingRuns(homeTeamID, divName){

	http.abort();
	http.open('post', 'ajax11BattingRuns.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+homeTeamID);	

	http.onreadystatechange = function(){
		changeSelect(divName);	
	}
}

function get11Bowling(homeTeamID, divName){

	http.abort();
	http.open('post', 'ajax11Bowling.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+homeTeamID);	

	http.onreadystatechange = function(){
		changeSelect(divName);	
	}
}

function get11BowlingWickets(homeTeamID, divName){

	http.abort();
	http.open('post', 'ajax11BowlingWickets.php');
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send('arg1='+homeTeamID);	

	http.onreadystatechange = function(){
		changeSelect(divName);	
	}
}

function changeSelect(elementName, which, what){
	/* Make sure that the transaction has finished. The XMLHttpRequest object 
		has a property called readyState with several states:
		0: Uninitialized
		1: Loading
		2: Loaded
		3: Interactive
		4: Finished */
	// http.status == 200 added, test this too.
	if(http.readyState == 4 && http.status == 200){ 
		//Finished loading the response
		var response = http.responseText;

//		alert(elementName + "\r" + response);
		document.getElementById(elementName).innerHTML = response;
//		for(i = 0; i < document.forms.length; i++){
//				document.forms[i].submitme.disabled = false;
//		}
		if(which){
			setTimeout("otherCall(" + which + ", '" + elementName + "', '" + what + "')", 750);
		}
	}
}

function changeSelect2(elementName, which){
	// http.status == 200 added, test this too.
	if(http.readyState == 4 && http.status == 200){ 
		//Finished loading the response
		var response = http.responseText;
//alert(elementName + ' ' + which);
		document.getElementById(elementName).innerHTML = response;
//		alert(elementName + "\r" + response);
//		for(i = 0; i < document.forms.length; i++){
//				document.forms[i].submitme.disabled = false;
//		}
		setTimeout("nextCall(" + which + ", '" + elementName + "')", 750);
	}
}

function nextCall(which, elementName){
	get11BattingRuns(which, 'players'); // which === homeTeamID
}
function otherCall(which, elementName, what){
	if(elementName == 'players'){
		getGame(which, 'games');
	}else if(elementName == 'playersEdit'){
		getGame(which, 'gamesEdit', false, 'homeTeamID');
	}else if(elementName == 'gameHomeTeam'){
		getTeamGrade(which, 'opposition');
	}else if(elementName == 'multipleHomeTeam'){
		getTeamGrade(which, 'opposition');
	}else if(elementName == 'homeTeam'){
		getGame(which, 'games', true);
	}else if(elementName == 'homeTeamBowl'){
		getGame(which, 'gamesBowl', true);
	}else if(elementName == 'homeTeamEdit'){
		getGame(which, 'gamesEdit', true);
	}else if(elementName == 'homeTeamBowling'){
		getBowling(which, 'bowling');
	}else if(elementName == 'homeTeamBatt'){
		getBatting(which, 'batting');
	}else if(elementName == 'chooseResult'){
		getResult(which, what, 'showResult');
	}else if(elementName == 'games'){
		get11Batting(which, 'players'); // which === gradeID
	}else if(elementName == 'gamesRuns'){
		get11BattingRuns(which, 'players'); // which === homeTeamID
	}else if(elementName == 'gamesBowl' && what == 'homeTeamID'){
		get11BowlingWickets(which, 'players'); // which === homeTeamID
	}else if(elementName == 'gamesBowl' && what != 'homeTeamID'){
		get11Bowling(which, 'players'); // which === gradeID
	}else if(elementName == 'gamesEdit' && what != 'homeTeamID'){
		getPlayersTeam(which, 'playersEdit'); // which === gradeID
	}else if(elementName == 'gamesEdit' && what == 'homeTeamID'){
		getPlayersHomeTeam(which, 'playersEdit'); // which === homeTeamID
	}else if(elementName == 'grades'){
		getHomeTeamCopy2(which, 'homeTeamCopyFrom', true, 'seasonID');
	}else if(elementName == 'gradesTo'){
		// update homeTeams from season & grade
		getHomeTeamCopyTo(which, 'homeTeamCopyTo', true, 'seasonID'); // which is seasonID
	}else if(elementName == 'homeTeamCopyFrom'){
		getPlayerCopy(which, 'playerCopy');
	}else if(elementName == 'homeTeamGradeCopy'){
		getPlayerCopy(which, 'playerGradeCopy');
	}else if(elementName == 'fromGrade'){
		getHomeTeamCopy(which, 'homeTeamCopy');
	}else if(elementName == 'fromGradeOpp'){
		getTeamCopy(which, 'teamCopy', which);
	}else if(elementName == 'homeTeamDraw'){
		getTeamGrade(which, 'opposition');
	}else if(elementName == 'showTeams'){
		getGradeDraw(which, 'showDraw');
	}else if(elementName == 'homeTeamCopyGrade'){
		getPlayerCopyGrade(which, 'playerGradeCopy', 'gradeID');
	}else if(elementName == 'gradesSubs'){ // which === subsSeasonID
		getHomeTeamSubs(which, 'homeTeamSubs', 'true', 'subsSeasonID');
	}else if(elementName == 'homeTeamSubs' && what == 'subsSeasonID'){ // which === subsSeasonID
		getPlayerSubs(which, 'playerSubs', 'subsSeasonID');
	}else if(elementName == 'homeTeamSubs' && what == 'gradeID'){ // which === gradeID
		getPlayerSubs(which, 'playerSubs', 'gradeID');
	}
}