function addDelPlayer(typeGame, isHasEmptyOption) {
	if(typeGame == '1x1') delPlayer();
	if(typeGame == '2x2') addPlayer(isHasEmptyOption);
	return false; 
}

function addPlayer(isHasEmptyOption) {
	var team; 
	var addText; 
	
	team = $("#team1");
	addText = getPlayerText('1', isHasEmptyOption);
	team.append(addText);
	
	team = $("#team2");
	addText = getPlayerText('2', isHasEmptyOption);
	team.append(addText);
	
	return false;
}

function delPlayer() {
	$("#d1").remove();	
	$("#d2").remove();	
	
	return false;	
}

function getPlayerText(teamId, isHasEmptyOption) {
	var options = (isHasEmptyOption ? '<option value="-1"></option>' : "") + imbaText[2];
	var addText = '</dl><dl id="d' + teamId + '"><dt><label for="player' + teamId + '_2">' + imbaText[0] + '</label></dt><dd><input name="player' + teamId + '_2" id="player' + teamId + '_2"/></dd><dt><label for="race' + teamId + '_2">&nbsp;' + imbaText[1] + '&nbsp;</label></dt><dd><select name="race' + teamId + '_2" id="race' + teamId + '_2">' + options + '</select></dd>';
	return addText; 
}

function ShowHideWinnerChbx(id) {
	if(id.indexOf("1") > 0) 
		 id2 = "d" + id.replace("1", "2");
	else id2 = "d" + id.replace("2", "1");
	
	if($("#"+id).attr('checked')) 
		 $("#"+id2).hide();
	else $("#"+id2).show();
	
	return false;
}

function clearDate() {	
	$("#date").attr("value", "");
	return false;	
}