/*OK*/
//===================================================================
// ****** start with toc functions
//-------------------------------------------------------------------
function doUVolleyIndoorToC(objToCId,objToCDoc,objToC,objToCUId,objCompStatus,objMenuStatus)
{	if ((typeof(parent.MainMsgHeadFrame.document.MainMsgHeadForm)!="object") || (typeof(parent.MainMenuFrame.document.MainMenuForm)!="object") || (typeof(parent.MainToCFrame.document.MainToCForm)!="object") || (typeof(parent.MainToCUFrame.document.MainToCUForm)!="object") || (typeof(parent.MainScreenFrame.document.MainScreenForm)!="object"))
		{window.setTimeout("doUVolleyIndoorToC('" +objToC +"')",1500);
		return;
		}

	var MainMsgHeadE = parent.MainMsgHeadFrame.document.MainMsgHeadForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainToCE = parent.MainToCFrame.document.MainToCForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	switch (objToC)
		{case "UVolleyIndoorWork":
			doMainMsgHeadDoMenuHome(MainMsgHeadE.SASport.value);
			doMainMenuDoMenuHome(MainMenuE.SASport.value);
//			doMainToCDoMenuHome(MainToCE.SASport.value);
			doMainToCUDoMenuHome(MainToCUE.SASport.value);

			MainScreenE.SWAction.value = "WORK";
			MainScreenE.ToCDocTaken.value = "";
			MainScreenE.ToCIdTaken.value = "";
			doMainScreenFSubmit();
			break;

		case "AssoPublicShortNames":
			doMainMsgHeadAssoDataShow(objToCDoc);
			doMainToCUDoMenuHome(MainToCUE.SASport.value);

			MainMenuE.SWAction.value = "XASSOPUBLICSHORTNAME";
			MainMenuE.ToCDocTaken.value = objToCDoc;
			MainMenuE.ToCIdTaken.value = objToCId;
			doMainMenuFSubmit();

			MainScreenE.SWAction.value = "XASSOPUBLICSHORTNAME";
			MainScreenE.ToCDocTaken.value = objToCDoc;
			MainScreenE.ToCIdTaken.value = objToCId;
			doMainScreenFSubmit();
			break;

		case "CompStart":
			doMainMsgHeadAssoDataShow(objToCDoc);
			doMainToCUDoMenuHome(MainToCUE.SASport.value);

			doMainScreenAssoDataShow(objToCId,objToCDoc);

			MainMenuE.SWAction.value = "COMPSTART";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			doMainMenuFSubmit();
			break;

		case "CompDataStart":
			doMainMsgHeadAssoDataShow(objToCDoc);

			MainToCUE.SWAction.value = "COMPDATASTART";
			MainToCUE.ToCIdTaken.value = objToCId;
			MainToCUE.ToCDocTaken.value = objToCDoc;
			MainToCUE.ToCUCompId.value = objToCUId;
			doMainToCUFSubmit();

			if ((objToCId.indexOf("XHum_") > -1) && (objToCDoc.indexOf("XHum_") > -1))
				{
				MainScreenE.ToCDocTaken.value = objToCDoc;
				MainScreenE.SWAction.value = "XHUMM";
				doMainScreenFSubmit();

				MainMenuE.SWAction.value = "COMPSTART";
				doMainMenuFSubmit();


//				doSAXHumDataUpd(objToCDoc,"XHUMM");
				}
			else
				{doMainScreenAssoDataShow(objToCId,objToCDoc);

				MainMenuE.SWAction.value = "COMPSTART";
				MainMenuE.ToCIdTaken.value = objToCId;
				MainMenuE.ToCDocTaken.value = objToCDoc;
				doMainMenuFSubmit();
				}
			break;

		case "CompDefault":
			var strAssoDoc = objToCId +".xml";
			doMainMsgHeadAssoDataShow(strAssoDoc);

			MainToCUE.SWAction.value = "COMPDATAUPD";
			MainToCUE.ToCIdTaken.value = objToCId;
			MainToCUE.ToCDocTaken.value = objToCDoc;
			MainToCUE.ToCUCompId.value = objToCUId;
			doMainToCUFSubmit();

//			doMainScreenAssoDataShow(objToCId,objToCDoc);
			MainScreenE.SWAction.value = "COMPDATAUPD";
			MainScreenE.ToCIdTaken.value = objToCId;
			MainScreenE.ToCDocTaken.value = objToCDoc;
			MainScreenE.ToCUCompId.value = objToCUId;
			doMainScreenFSubmit();

			MainMenuE.SWAction.value = "COMPDATAUPD";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			doMainMenuFSubmit();
			break;

		case "CompInWork":
			doMainMsgHeadAssoDataShow(objToCDoc);

			MainToCUE.SWAction.value = "XCOMPDATAINWORK";
			MainToCUE.ToCIdTaken.value = objToCId;
			MainToCUE.ToCDocTaken.value = objToCDoc;
			MainToCUE.ToCUCompId.value = objToCUId;
			doMainToCUFSubmit();

			doMainScreenAssoDataShow(objToCId,objToCDoc);

			MainMenuE.SWAction.value = "XCOMPDATAINWORK";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			doMainMenuFSubmit();
			break;

		case "TeamStart":
			doMainMsgHeadAssoDataShow(objToCDoc);

			if (MainScreenE.User.value == "")
				{doMainMenuDoMenuHome(MainMenuE.SASport.value);
				}
			else
				{MainMenuE.SWAction.value = "XTEAMSTART";
				MainMenuE.ToCIdTaken.value = objToCId;
				MainMenuE.ToCDocTaken.value = objToCDoc;
				doMainMenuFSubmit();
				}

			doMainScreenAssoDataShow(objToCId,objToCDoc)
			doMainToCUDoMenuHome(MainToCUE.SASport.value);
			break;

		case "TeamDataStart":
			doMainMsgHeadAssoDataShow(objToCDoc);

			MainToCUE.SWAction.value = "TEAMDATASTART";
			MainToCUE.ToCIdTaken.value = objToCId;
			MainToCUE.ToCDocTaken.value = objToCDoc;
			MainToCUE.ToCUCompId.value = objToCUId;
			doMainToCUFSubmit();

			doMainScreenAssoDataShow(objToCId,objToCDoc);

			if (MainScreenE.User.value == "")
				{doMainMenuDoMenuHome(MainMenuE.SASport.value);
				}
			else
				{MainMenuE.SWAction.value = "XTEAMSTART";
				MainMenuE.ToCIdTaken.value = objToCId;
				MainMenuE.ToCDocTaken.value = objToCDoc;
				doMainMenuFSubmit();
				}
			break;

		case "TeamInWork":
			doMainMsgHeadAssoDataShow(objToCDoc);

			MainToCUE.SWAction.value = "TEAMDATAINWORK";
			MainToCUE.ToCIdTaken.value = objToCId;
			MainToCUE.ToCDocTaken.value = objToCDoc;
			MainToCUE.ToCUCompId.value = objToCUId;
			doMainToCUFSubmit();

			doMainScreenAssoDataShow(objToCId,objToCDoc);

			MainMenuE.SWAction.value = "TEAMDATAINWORK";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			doMainMenuFSubmit();
			break;

		case "TeamStatusReason":
			doMainMsgHeadAssoDataShow(objToCDoc);

			MainToCUE.SWAction.value = "TEAMDATASTATUSREASON";
			MainToCUE.ToCIdTaken.value = objToCId;
			MainToCUE.ToCDocTaken.value = objToCDoc;
			MainToCUE.ToCUCompId.value = objToCUId;
			doMainToCUFSubmit();

			doMainScreenAssoDataShow(objToCId,objToCDoc);

			MainMenuE.SWAction.value = "TEAMDATASTATUSREASON";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			doMainMenuFSubmit();
			break;

		case "XTermShowAll":
			doMainMsgHeadAssoDataShow(objToCDoc);
			doMainToCUDoMenuHome(MainScreenE.SASport.value);

			MainScreenE.SWAction.value = "XTERMSHOWALL";
			MainScreenE.ToCIdTaken.value = objToCId;
			MainScreenE.ToCDocTaken.value = objToCDoc;
			MainScreenE.ToCUCompId.value = objToCUId;
			doMainScreenFSubmit();

			MainMenuE.SWAction.value = "XTERMSHOWALL";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			doMainMenuFSubmit();
			break;

		case "XTermShowRef":
			doMainMsgHeadAssoDataShow(objToCDoc);
			doMainToCUDoMenuHome(MainScreenE.SASport.value);

			MainScreenE.SWAction.value = "XTERMSHOWREF";
			MainScreenE.ToCIdTaken.value = objToCId;
			MainScreenE.ToCDocTaken.value = objToCDoc;
			MainScreenE.ToCUCompId.value = objToCUId;
			doMainScreenFSubmit();

			MainMenuE.SWAction.value = "XTERMSHOWREF";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			doMainMenuFSubmit();
			break;

		case "XTermShowGame":
			doMainMsgHeadAssoDataShow(objToCDoc);
			doMainToCUDoMenuHome(MainScreenE.SASport.value);

			MainScreenE.SWAction.value = "XTERMSHOWGAME";
			MainScreenE.ToCIdTaken.value = objToCId;
			MainScreenE.ToCDocTaken.value = objToCDoc;
			MainScreenE.ToCUCompId.value = objToCUId;
			doMainScreenFSubmit();

			MainMenuE.SWAction.value = "XTERMSHOWGAME";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			doMainMenuFSubmit();
			break;
		}
}

//===================================================================
// ****** start with users navigation in menu and tocumenu
//-------------------------------------------------------------------

function doUVolleyIndoorMenuBack(objMenu)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	MainMenuE.SWAction.value = objMenu;
/*
	switch (objMenu)
		{case "COMPDATASTART":
			MainMenuE.ToCDocTaken.value = MainMenuE.ToCIdTaken.value +".xml";
			break;
		}
*/
	doMainMenuFSubmit();
}

function doUVolleyIndoorToCUBack(objMenu)
{	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	MainToCUE.SWAction.value = objMenu;
/*
	switch (objMenu)
		{case "COMPDATASTART":
			MainMenuE.ToCDocTaken.value = MainMenuE.ToCIdTaken.value +".xml";
			break;
		}
*/
	doMainToCUFSubmit();
}

//===================================================================
// ****** start with screen functions
//-------------------------------------------------------------------
function doUVolleyIndoorScreenBack(objScreen)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = objScreen;

	switch (objScreen)
		{case "XASSODATASHOW":
			MainScreenE.ToCDocTaken.value = MainScreenE.ToCIdTaken.value +".xml";
			break;
		}

	doMainScreenFSubmit();
}

/*OK*/
function doUVolleyIndoorScreenMenu(objScreenMenu)
{	var MainMsgHeadE = parent.MainMsgHeadFrame.document.MainMsgHeadForm.elements;
	var MainToCE = parent.MainToCFrame.document.MainToCForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	switch (objScreenMenu)
		{case "AssoLicencesGeneralDateTimeSave":
			MainScreenE.SWAction.value = "ASSOLICENCESGENERALDATETIMESAVE";
			doMainScreenFSubmit();
			break;

		case "AssoLicencesDetailsDateTimeSave":
			MainScreenE.SWAction.value = "ASSOLICENCESDETAILSDATETIMESAVE";
			doMainScreenFSubmit();
			break;
		}
}

/*OK*/
function doUVolleyIndoorTeamDataValidity(objTeamData)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm;
	var intJ;

	if ((objTeamData == "V1") || (objTeamData == "V2") || (objTeamData == "S1") || (objTeamData == "S2"))
		{return true;
		}

	if ((isNaN(objTeamData) == true) || (objTeamData.indexOf(".") > -1) || (objTeamData.indexOf(" ") > -1) || (objTeamData == ""))
		{return false;
		}

	intJ = 0;
	while (intJ<MainScreenE["TeamData"].length)
		{if (MainScreenE.TeamData[intJ].value == parseInt(objTeamData))
			{return true;
			}

// Comp050802		intJ = intJ +3;
		intJ = intJ +4;																// Comp050802
		}

	return false;
}

/*OK*/
function doUVolleyIndoorSubScreenMenu(objSubScreenMenu)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	switch (objSubScreenMenu)
		{case "AssoAsc":
			MainScreenE.SASortParam.value = "ASSOASC";
			break;
		case "AssoDesc":
			MainScreenE.SASortParam.value = "ASSODESC";
			break;
		case "LNameAsc":
			MainScreenE.SASortParam.value = "LNAMEASC";
			break;
		case "LNameDesc":
			MainScreenE.SASortParam.value = "LNAMEDESC";
			break;
		case "LicenceAsc":
			MainScreenE.SASortParam.value = "LICENCEASC";
			break;
		case "LicenceDesc":
			MainScreenE.SASortParam.value = "LICENCEDESC";
			break;
		case "ActionSummaryAsc":
			MainScreenE.SASortParam.value = "ACTIONSUMMARYASC";
			break;
		case "ActionSummaryDesc":
			MainScreenE.SASortParam.value = "ACTIONSUMMARYDESC";
			break;
		}

//	MainScreenE.MainMenuTaken.value = "Referees";
	doMainScreenFSubmit();
}
//=============================================================================================
// ****** end of users navigation in menu and tocumenu
//---------------------------------------------------------------------------------------------


//===================================================================
// ****** start with associations functions
//-------------------------------------------------------------------
// ******	delete association
function doUVolleyIndoorXAssoDelete(objOfficialAsso)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCE = parent.MainToCFrame.document.MainToCForm.elements;

	doMainMsgHeadAssoDataShow(objOfficialAsso);
	doMainMenuDoMenuHome(MainScreenE.SASport.value);

	doSAToCNavigateDelAsso(MainScreenE.ToCDocTaken.value);
	MainToCE.FrameReady.value = "";
	parent.MainToCFrame.setTimeout("doMainToCFSubmit();",2000);
	doMainToCUDoMenuHome(MainScreenE.SASport.value);

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();
	MainScreenE.SWAction.value = "XASSODELETE";
	doMainScreenFSubmit();
}

// ------------------------------------------------------------------
/*OK*/
function doUVolleyIndoorXAssoLicencesGeneral(ToCIdTaken)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainMsgHeadE = parent.MainMsgHeadFrame.document.MainMsgHeadForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	doMainMsgHeadAssoDataShow(ToCIdTaken +".xml");

	MainMenuE.SWAction.value = "ASSOLICENCESGENERALUPD";
	MainMenuE.ToCIdTaken.value = ToCIdTaken;
	MainMenuE.ToCDocTaken.value = ToCIdTaken +".xml";
	doMainMenuFSubmit();

	doMainToCUDoMenuHome(MainToCUE.SASport.value);

	MainScreenE.SWAction.value = "ASSOLICENCESGENERALUPD";
	MainScreenE.ToCIdTaken.value = ToCIdTaken;
	MainScreenE.ToCDocTaken.value = ToCIdTaken +".xml";
	doMainScreenFSubmit();
}

/*OK*/
function doUVolleyIndoorXAssoLicencesDetail(ToCIdTaken)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainMsgHeadE = parent.MainMsgHeadFrame.document.MainMsgHeadForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	doMainMsgHeadAssoDataShow(ToCIdTaken +".xml");

	MainMenuE.SWAction.value = "ASSOLICENCESDETAILUPD";
	MainMenuE.ToCIdTaken.value = ToCIdTaken;
	MainMenuE.ToCDocTaken.value = ToCIdTaken +".xml";
	doMainMenuFSubmit();

	doMainToCUDoMenuHome(MainToCUE.SASport.value);

	MainScreenE.SWAction.value = "ASSOLICENCESDETAILUPD";
	MainScreenE.ToCIdTaken.value = ToCIdTaken;
	MainScreenE.ToCDocTaken.value = ToCIdTaken +".xml";
	doMainScreenFSubmit();
}

//-------------------------------------------------------------------
// ******	update asso location data
/*OK*/
function doUVolleyIndoorXAssoLocationDataUpd(ToCIdTaken)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainMsgHeadE = parent.MainMsgHeadFrame.document.MainMsgHeadForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	doMainMsgHeadAssoDataShow(ToCIdTaken +".xml");

	MainMenuE.SWAction.value = "XASSOLOCATIONDATAUPD";
	MainMenuE.ToCIdTaken.value = ToCIdTaken;
	MainMenuE.ToCDocTaken.value = ToCIdTaken +".xml";
	doMainMenuFSubmit();

	doMainToCUDoMenuHome(MainToCUE.SASport.value);

	MainScreenE.SWAction.value = "XASSOLOCATIONDATAUPD";
	MainScreenE.ToCIdTaken.value = ToCIdTaken;
	MainScreenE.ToCDocTaken.value = ToCIdTaken +".xml";
	doMainScreenFSubmit();
}

//-------------------------------------------------------------------
// ******	replace display in associations location data for existing data
/*OK*/
function doUVolleyIndoorXAssoLocationDataUpdMenuUpd(obj1,obj1Browse,obj2,obj2Browse,obj3,obj3Browse,obj4,obj4Browse)
{	var str1 = document.getElementById(obj1).style.display;
	var str1Browse = document.getElementById(obj1Browse).style.display;

	if ((str1 == "none") && (str1Browse == "none"))
		{if (document.getElementById(obj1).value == "")
			{document.getElementById(obj1).value = document.getElementById(obj1Browse).value;
			document.getElementById(obj2).value = document.getElementById(obj2Browse).value;
			document.getElementById(obj3).value = document.getElementById(obj3Browse).value;
			document.getElementById(obj4).value = document.getElementById(obj4Browse).value;
			}
		document.getElementById(obj1).style.display = "block";
		document.getElementById(obj2).style.display = "block";
		document.getElementById(obj3).style.display = "block";
		document.getElementById(obj4).style.display = "block";
		}
	else
		{if (str1 == "none")
			{document.getElementById(obj1).style.display = "block";
			document.getElementById(obj2).style.display = "block";
			document.getElementById(obj3).style.display = "block";
			document.getElementById(obj4).style.display = "block";
			document.getElementById(obj1Browse).style.display = "none";
			document.getElementById(obj2Browse).style.display = "none";
			document.getElementById(obj3Browse).style.display = "none";
			document.getElementById(obj4Browse).style.display = "none";
			}
		}
}

//-------------------------------------------------------------------
// ******	replace display in associations location data for existing data
/*OK*/
function doUVolleyIndoorXAssoLocationDataUpdMenuDel(obj1,obj1Browse,obj2,obj2Browse,obj3,obj3Browse,obj4,obj4Browse)
{	var str1 = document.getElementById(obj1).style.display;
	var str1Browse = document.getElementById(obj1Browse).style.display;

	if ((str1 == "block") || (str1Browse == "block"))
		{document.getElementById(obj1).style.display = "none";
		document.getElementById(obj2).style.display = "none";
		document.getElementById(obj3).style.display = "none";
		document.getElementById(obj4).style.display = "none";
		if (document.getElementById(obj1).value != "")
			{document.getElementById(obj1Browse).value = document.getElementById(obj1).value;
			}
		if (document.getElementById(obj2).value != "")
			{document.getElementById(obj2Browse).value = document.getElementById(obj2).value;
			}
		if (document.getElementById(obj3).value != "")
			{document.getElementById(obj3Browse).value = document.getElementById(obj3).value;
			}
		if (document.getElementById(obj4).value != "")
			{document.getElementById(obj4Browse).value = document.getElementById(obj4).value;
			}
		document.getElementById(obj1).value = "";
		document.getElementById(obj2).value = "";
		document.getElementById(obj3).value = "";
		document.getElementById(obj4).value = "";
		document.getElementById(obj1Browse).style.display = "none";
		document.getElementById(obj2Browse).style.display = "none";
		document.getElementById(obj3Browse).style.display = "none";
		document.getElementById(obj4Browse).style.display = "none";
		}
	else
		{document.getElementById(obj1).style.display = "none";
		document.getElementById(obj2).style.display = "none";
		document.getElementById(obj3).style.display = "none";
		document.getElementById(obj4).style.display = "none";
		document.getElementById(obj1).value = document.getElementById(obj1Browse).value;
		document.getElementById(obj2).value = document.getElementById(obj2Browse).value;
		document.getElementById(obj3).value = document.getElementById(obj3Browse).value;
		document.getElementById(obj4).value = document.getElementById(obj4Browse).value;
		document.getElementById(obj1Browse).style.display = "block";
		document.getElementById(obj2Browse).style.display = "block";
		document.getElementById(obj3Browse).style.display = "block";
		document.getElementById(obj4Browse).style.display = "block";
		}
}

//-------------------------------------------------------------------
// ******	handle display in associations location data for new data
/*OK*/
function doUVolleyIndoorXAssoLocationDataNewMenuNew(obj1,obj2,obj3,obj4,obj5,obj6)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intI,strMenuNew,strMenuNewDel,strName,strStreet,strPostcode,strCity;
// ------------------------------------------------------------------
// search for an empty location
	for (intI=0; intI<MainScreenE.LocationId.length; intI++)
		{if (MainScreenE.LocationId[intI].value.indexOf("New") > -1)
			{strName = MainScreenE.LocationId[intI].value +"Name";
			strStreet = MainScreenE.LocationId[intI].value +"Street";
			strPostcode = MainScreenE.LocationId[intI].value +"Postcode";
			strCity = MainScreenE.LocationId[intI].value +"City";

			if ((document.getElementById(strName).value == "") && (document.getElementById(strName).style.display == "block") && (document.getElementById(strStreet).value == "") && (document.getElementById(strPostcode).value == "") && (document.getElementById(strCity).value == ""))
				{return;
				}
			}
		}
// ------------------------------------------------------------------
// handle selected location
	document.getElementById(obj1).style.display = "none";
	document.getElementById(obj2).style.display = "block";
	document.getElementById(obj3).style.display = "block";
	document.getElementById(obj4).style.display = "block";
	document.getElementById(obj5).style.display = "block";
	document.getElementById(obj6).style.display = "block";
// ------------------------------------------------------------------
// check new location values
	for (intI=0; intI<MainScreenE.LocationId.length; intI++)
		{if (MainScreenE.LocationId[intI].value.indexOf("New") > -1)
			{strMenuNew = "Menu" + MainScreenE.LocationId[intI].value;
			strMenuNewDel = "Menu" + MainScreenE.LocationId[intI].value +"Del";
			strName = MainScreenE.LocationId[intI].value +"Name";
			strStreet = MainScreenE.LocationId[intI].value +"Street";
			strPostcode = MainScreenE.LocationId[intI].value +"Postcode";
			strCity = MainScreenE.LocationId[intI].value +"City";

			if (document.getElementById(strName).style.display == "none")
				{document.getElementById(strMenuNew).style.display = "block";
				intI = MainScreenE.LocationId.length;
				}
			}
		}
}

//-------------------------------------------------------------------
// ******	handle display in associations location data for new data
/*OK*/
function doUVolleyIndoorXAssoLocationDataNewMenuDel(obj1,obj2,obj3,obj4)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intI,strMenuNew,strMenuNewDel,strName,strStreet,strPostcode,strCity,swNew;

	document.getElementById(obj1).value = "";
	document.getElementById(obj2).value = "";
	document.getElementById(obj3).value = "";
	document.getElementById(obj4).value = "";
// ------------------------------------------------------------------
// check new location values
	swNew = "N";
	for (intI=0; intI<MainScreenE.LocationId.length; intI++)
		{if (MainScreenE.LocationId[intI].value.indexOf("New") > -1)
			{strMenuNew = "Menu" + MainScreenE.LocationId[intI].value;
			strMenuNewDel = "Menu" + MainScreenE.LocationId[intI].value +"Del";
			strName = MainScreenE.LocationId[intI].value +"Name";
			strStreet = MainScreenE.LocationId[intI].value +"Street";
			strPostcode = MainScreenE.LocationId[intI].value +"Postcode";
			strCity = MainScreenE.LocationId[intI].value +"City";

			if ((document.getElementById(strName).value == "") && (document.getElementById(strStreet).value == "") && (document.getElementById(strPostcode).value == "") && (document.getElementById(strCity).value == ""))
				{document.getElementById(strMenuNew).style.display = "none";
				document.getElementById(strMenuNewDel).style.display = "none";
				document.getElementById(strName).style.display = "none";
				document.getElementById(strStreet).style.display = "none";
				document.getElementById(strPostcode).style.display = "none";
				document.getElementById(strCity).style.display = "none";

				if (swNew == "N")
					{swNew = "Y";
					document.getElementById(strMenuNew).style.display = "block";
					}
				}
			}
		}
}

//-------------------------------------------------------------------
// ******	save associations location data
/*OK*/
function doUVolleyIndoorXAssoLocationDataSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intI,strName,strStreet,strPostcode,strCity,strX;
// ------------------------------------------------------------------
// check location values
	for (intI=0; intI<MainScreenE.LocationId.length; intI++)
		{strName = MainScreenE.LocationId[intI].value +"Name";
		strStreet = MainScreenE.LocationId[intI].value +"Street";
		strPostcode = MainScreenE.LocationId[intI].value +"Postcode";
		strCity = MainScreenE.LocationId[intI].value +"City";

		if ((parent.MainScreenFrame.document.getElementById(strName).value != "") || (parent.MainScreenFrame.document.getElementById(strStreet).value != "") || (parent.MainScreenFrame.document.getElementById(strPostcode).value != "") || (parent.MainScreenFrame.document.getElementById(strCity).value != ""))
			{if (parent.MainScreenFrame.document.getElementById(strName).value == "")
				{parent.MainScreenFrame.document.getElementById(strName).focus();
				alert ("Name Halle fehlerhaft");
				return;
				}
			else
				{strX = parent.MainScreenFrame.document.getElementById(strName).value;
				parent.MainScreenFrame.document.getElementById(strName).value = strX.replace(/,/g," ");
				}

			if (parent.MainScreenFrame.document.getElementById(strStreet).value == "")
				{parent.MainScreenFrame.document.getElementById(strStreet).focus();
				alert ("Strasse/Nummer fehlerhaft");
				return;
				}
			else
				{strX = parent.MainScreenFrame.document.getElementById(strStreet).value;
				parent.MainScreenFrame.document.getElementById(strStreet).value = strX.replace(/,/g," ");
				}

			if (parent.MainScreenFrame.document.getElementById(strPostcode).value == "")
				{parent.MainScreenFrame.document.getElementById(strPostcode).focus();
				alert ("Postleitzahl fehlerhaft");
				return;
				}
			else
				{strX = parent.MainScreenFrame.document.getElementById(strPostcode).value;
				parent.MainScreenFrame.document.getElementById(strPostcode).value = strX.replace(/,/g," ");
				}

			if (parent.MainScreenFrame.document.getElementById(strCity).value == "")
				{parent.MainScreenFrame.document.getElementById(strCity).focus();
				alert ("Ort/Stadt fehlerhaft");
				return;
				}
			else
				{strX = parent.MainScreenFrame.document.getElementById(strCity).value;
				parent.MainScreenFrame.document.getElementById(strCity).value = strX.replace(/,/g," ");
				}
			}
		else
			// ------------------------------------------------------------------
			// check if any location in use shall be deleted
			{strX = MainScreenE.LocationId[intI].value;

			if (typeof(MainScreenE[strX]) == "object")
				{parent.MainScreenFrame.document.getElementById(strName +'Browse').style.display = "block";
				parent.MainScreenFrame.document.getElementById(strName).value = parent.MainScreenFrame.document.getElementById(strName +'Browse').value;
				parent.MainScreenFrame.document.getElementById(strStreet +'Browse').style.display = "block";
				parent.MainScreenFrame.document.getElementById(strStreet).value = parent.MainScreenFrame.document.getElementById(strStreet +'Browse').value;
				parent.MainScreenFrame.document.getElementById(strPostcode +'Browse').style.display = "block";
				parent.MainScreenFrame.document.getElementById(strPostcode).value = parent.MainScreenFrame.document.getElementById(strPostcode +'Browse').value;
				parent.MainScreenFrame.document.getElementById(strCity +'Browse').style.display = "block";
				parent.MainScreenFrame.document.getElementById(strCity).value = parent.MainScreenFrame.document.getElementById(strCity +'Browse').value;
				alert (MainScreenE[strX].value);
				return;
				}
			}
		}

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();
	MainScreenE.SWAction.value = "XASSOLOCATIONDATASAVE";
	doMainScreenFSubmit();
}

// ------------------------------------------------------------------
//	*****	handle ticker data
function doUVolleyIndoorXAssoTickerData(ToCIdTaken)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainMsgHeadE = parent.MainMsgHeadFrame.document.MainMsgHeadForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	doMainMsgHeadAssoDataShow(ToCIdTaken +".xml");

	MainMenuE.SWAction.value = "ASSOTICKERDATA";
	MainMenuE.ToCIdTaken.value = ToCIdTaken;
	MainMenuE.ToCDocTaken.value = ToCIdTaken +".xml";
	doMainMenuFSubmit();

	doMainToCUDoMenuHome(MainToCUE.SASport.value);

	MainScreenE.SWAction.value = "ASSOTICKERDATA";
	MainScreenE.ToCIdTaken.value = ToCIdTaken;
	MainScreenE.ToCDocTaken.value = ToCIdTaken +".xml";
	doMainScreenFSubmit();
}

// ******	update associations ticker parms
/*OK*/
function doUVolleyIndoorXAssoTickerDataUpd()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var intI,intJ;

	if (typeof(MainScreenE.AssoTickerCheckbox.length) == "number")
		{intJ=0;

		for (intI=0; intI<MainScreenE.AssoTickerCheckbox.length; intI++)
			{if (MainScreenE.AssoTickerCheckbox[intI].checked == true)
				{if (intJ<2)
					{intJ++;
					MainScreenE.HashCompDocUpd[intI].value = MainScreenE.HashCompDoc[intI].value;
					}
				else
					{MainScreenE.AssoTickerCheckbox[intI].checked = false;
					MainScreenE.HashCompDocUpd[intI].value = "";
					}
				}
			else
				{MainScreenE.HashCompDocUpd[intI].value = "";
				}
			}
		}
	else
		{if (MainScreenE.AssoTickerCheckbox.checked == true)
			{MainScreenE.HashCompDocUpd.value = MainScreenE.HashCompDoc.value;
			}
		else
			{MainScreenE.HashCompDocUpd.value = "";
			}
		}
}


// ******	save associations ticker
/*OK*/
function doUVolleyIndoorXAssoTickerDataSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

//	alert ("!" + MainScreenE.ToCDocTaken.value + "!" + DataType + "!");

	MainScreenE.SWAction.value = "ASSOTICKERDATASAVE";
	doMainScreenFSubmit();
}
//---------------------------------------------------------------------------------------------
// ****** end of associations functions
//=============================================================================================


//=============================================================================================
// ****** start with human functions
//---------------------------------------------------------------------------------------------
/*OK*/
function doUVolleyIndoorXHumDataMRefListActive()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	MainScreenE.SWAction.value = "XHUMDATAMREFLISTACTIVE";
	doMainScreenFSubmit();

	MainMenuE.ToCUHumanId.value = MainToCUE.ToCUHumanId.value;
	MainMenuE.SWAction.value = 'XHUMDATAMREFLISTACTIVE';
	doMainMenuFSubmit();
}

/*OK*/
function doUVolleyIndoorXHumDataMRefListTemp()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	MainScreenE.SWAction.value = "XHUMDATAMREFLISTTEMP";
	doMainScreenFSubmit();

	MainMenuE.ToCUHumanId.value = MainToCUE.ToCUHumanId.value;
	MainMenuE.SWAction.value = 'XHUMDATAMREFLISTTEMP';
	doMainMenuFSubmit();
}
//=============================================================================================
// ****** end of human functions
//---------------------------------------------------------------------------------------------


//=============================================================================================
// ****** start of referee functions
//---------------------------------------------------------------------------------------------
/*OK*/
function doUVolleyIndoorXHumRefereeOthers(objXHumRefereeOthers)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var intI = MainScreenE[objXHumRefereeOthers].length;
	var strX = MainScreenE[objXHumRefereeOthers][intI -2].value;

	if (isNaN(strX) == true)
		{
		MainScreenE[objXHumRefereeOthers][intI -2].value = MainScreenE[objXHumRefereeOthers][intI -1].value;
		MainScreenE[objXHumRefereeOthers][intI -2].focus();
		alert ("Falsche Eingabe - Inhalt war nicht numerisch"); /*NOTOK*/
		}
}

/*OK*/
function doUVolleyIndoorXHumDataRHistAssUpd(objV1BKUP,objV1,objV2,objV3,objSum)
{	if (doSAisNaN(document.getElementById(objV1).value) == false)
		{var strX = document.getElementById(objV1).value;
		document.getElementById(objV1).value = objV1BKUP;
		document.getElementById(objV1).focus();
		alert ("Eingabe fehlerhaft - Inhalt " +strX +" nicht numerisch");
		return;
		}
	else
		{document.getElementById(objSum).value = Math.abs(document.getElementById(objV1).value) +Math.abs(document.getElementById(objV2).value) +Math.abs(document.getElementById(objV3).value);
		}
}

/*OK*/
function doUVolleyIndoorXHumDataMRefActionSumSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XHUMDATAMREFACTIONSUMSAVE";
	doMainScreenFSubmit();
}
//=============================================================================================
// ****** end of referee functions
//---------------------------------------------------------------------------------------------


//===================================================================
// ****** start with competition functions
//-------------------------------------------------------------------
// ******	show contact humans and locations
/*OK*/
function doUVolleyIndoorXCompListContactsAndLocations()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XCOMPLISTCONTACTSANDLOCATIONS";
	doMainScreenFSubmit();
}

// ******	create a new competition
/*OK*/
function doUVolleyIndoorXCompNew()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

//	doMainToCUDoMenuHome(MainToCUE.SASport.value);
	MainScreenE.SWAction.value = "COMPNEW";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPNEW";
	doMainMenuFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	delete a competition
/*OK*/
function doUVolleyIndoorXCompDelete()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	MainMenuE.SWAction.value = "COMPSTART";
	doMainMenuFSubmit();
	MainScreenE.SWAction.value = "COMPDELETE";
	doMainScreenFSubmit();
	parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);
}

//---------------------------------------------------------------------------------------------
// ******	archive a competition
/*OK*/
function doUVolleyIndoorXCompArchive()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	MainScreenE.SWAction.value = "COMPARCHIVE";
	doMainScreenFSubmit();
	parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);
}

//---------------------------------------------------------------------------------------------
// ******	work with fields of a competition
/*OK*/
function doUVolleyIndoorXCompData(objToCUDetailDoc,objToCUDetailKind,objToCUArchive)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	if ((MainToCUE.ToCDocTaken.value.indexOf("XAsso_") > -1) && (MainToCUE.ToCIdTaken.value.indexOf("XAsso_") > -1))
		{MainMenuE.SWAction.value = "COMPDATASHOW";
		MainMenuE.ToCIdTaken.value = MainToCUE.ToCIdTaken.value;
		MainMenuE.ToCDocTaken.value = objToCUDetailDoc;
		MainMenuE.ToCUArchive.value = objToCUArchive;
		MainMenuE.ToCUCompId.value = MainToCUE.ToCUCompId.value;
		doMainMenuFSubmit();
		}

	MainScreenE.SWAction.value = "COMPDATASHOW";
	MainScreenE.CompKind.value = objToCUDetailKind;
	MainScreenE.ToCIdTaken.value = MainToCUE.ToCIdTaken.value;
	MainScreenE.ToCDocTaken.value = objToCUDetailDoc;
	MainScreenE.ToCUArchive.value = objToCUArchive;
	doMainScreenFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	work with fields of competition default document
/*OK*/
function doUVolleyIndoorXCompSaveDefault()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();

	MainScreenE.SWAction.value = "COMPDATASAVE";
	doMainScreenFSubmit();
}

//-------------------------------------------------------------------
// ******	work with fields of a competition
/*OK*/
function doUVolleyIndoorXCompDataSave()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	//----------------------------------------------------------------
	// ******	check genus of competition
	if (typeof(MainScreenE.CompSex) == "object")
		{if (MainScreenE.CompSex.value == "")
			{alert ("Geschlecht auswaehlen");
			return;
			}
		}
	//----------------------------------------------------------------
	// ******	check name of competition
	if (typeof(MainScreenE.CompNameP1) == "object")
		{if (MainScreenE.CompNameP1.value == "")
			{alert ("Bewerb Name fehlerhaft");
			return;
			}
		}
	if (typeof(MainScreenE.CompName) == "object")
		{if (MainScreenE.CompName.value == "")
			{alert ("Bewerb Name fehlerhaft");
			return;
			}
		}
	//----------------------------------------------------------------
	// ******	check priority of competition
	if (typeof(MainScreenE.CompPrtyOpts) == "object")
		{if (MainScreenE.CompPrtyOpts.options.selectedIndex == -1)
			{alert ("Spielklasse auswaehlen");
			return;
			}
		}
	//----------------------------------------------------------------
	// ******	check kind of competition
	if (typeof(MainScreenE.CompKindOpts) == "object")
		{if (MainScreenE.CompKindOpts.options.selectedIndex == -1)
			{alert ("Abschnitt auswaehlen");
			return;
			}
		}
	//----------------------------------------------------------------
	// ******	check mode of competition
	if (typeof(MainScreenE.CompModeOpts) == "object")
		{if (MainScreenE.CompModeOpts.options.selectedIndex == -1)
			{alert ("Modus auswaehlen");
			return;
			}
		}
	//----------------------------------------------------------------
	// ******	check licence of competition
	if (typeof(MainScreenE.CompLicenceOpts) == "object")
		{if (MainScreenE.CompLicenceOpts.options.selectedIndex == -1)
			{alert ("Lizenzgebuehr auswaehlen");
			return;
			}
		}
	//----------------------------------------------------------------
	// ******	check officials email of competition
	if (typeof(MainScreenE.CompOfficialEmail) == "object")
		{if (MainScreenE.CompOfficialEmail.value == "")
			{alert ("eMail Wettspielreferat fehlerhaft");
			return;
			}
		}

	MainScreenE.FrameReady.value = "";
//	MainMenuE.FrameReady.value = "";
//	MainToCUE.FrameReady.value = "";
//	doMainProcessInWorkWindow();

	MainScreenE.SWAction.value = "COMPDATASAVE";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPDATAUPD";
//	doMainMenuFSubmit();
	MainMenuFSubmitCheck = window.setInterval("doMainMenuFSubmitCheck()",500);
//	parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);
	MainToCUFSubmitCheck = window.setInterval("doMainToCUFSubmitCheck()",500);
}

//-------------------------------------------------------------------
// ******	work with fields of a 16 grid competition
/*OK*/
function doUVolleyIndoorXCompDataSaveR16()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;
	//----------------------------------------------------------------
	//***** start with round 1
	if (doSARC = doSATimeSaveValidity("R16Rd1TimeHH","R16Rd1TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Rd1Game1DateDD","R16Rd1Game1DateMM","R16Rd1Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Rd1Game2DateDD","R16Rd1Game2DateMM","R16Rd1Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Rd1Game3DateDD","R16Rd1Game3DateMM","R16Rd1Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Rd1") == false)
		{return;
		}
	//----------------------------------------------------------------
	//***** start with round 2
	if (doSARC = doSATimeSaveValidity("R16Rd2TimeHH","R16Rd2TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Rd2Game1DateDD","R16Rd2Game1DateMM","R16Rd2Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Rd2Game2DateDD","R16Rd2Game2DateMM","R16Rd2Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Rd2Game3DateDD","R16Rd2Game3DateMM","R16Rd2Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Rd2") == false)
		{return;
		}
	//----------------------------------------------------------------
	//***** start with round 3
	if (doSARC = doSATimeSaveValidity("R16Rd3TimeHH","R16Rd3TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Rd3Game1DateDD","R16Rd3Game1DateMM","R16Rd3Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Rd3Game2DateDD","R16Rd3Game2DateMM","R16Rd3Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Rd3Game3DateDD","R16Rd3Game3DateMM","R16Rd3Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Rd3") == false)
		{return;
		}
	//----------------------------------------------------------------
	//***** start with place 1
	if (doSARC = doSATimeSaveValidity("R16Pl1TimeHH","R16Pl1TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl1Game1DateDD","R16Pl1Game1DateMM","R16Pl1Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl1Game2DateDD","R16Pl1Game2DateMM","R16Pl1Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl1Game3DateDD","R16Pl1Game3DateMM","R16Pl1Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Pl1") == false)
		{return;
		}
	//----------------------------------------------------------------
	//***** start with place 3
	if (doSARC = doSATimeSaveValidity("R16Pl3TimeHH","R16Pl3TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl3Game1DateDD","R16Pl3Game1DateMM","R16Pl3Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl3Game2DateDD","R16Pl3Game2DateMM","R16Pl3Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl3Game3DateDD","R16Pl3Game3DateMM","R16Pl3Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Pl3") == false)
		{return;
		}
	//----------------------------------------------------------------
	//***** start with place 5
	if (doSARC = doSATimeSaveValidity("R16Pl5TimeHH","R16Pl5TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl5Game1DateDD","R16Pl5Game1DateMM","R16Pl5Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl5Game2DateDD","R16Pl5Game2DateMM","R16Pl5Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl5Game3DateDD","R16Pl5Game3DateMM","R16Pl5Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Pl5") == false)
		{return;
		}
	//----------------------------------------------------------------
	//***** start with place 7
	if (doSARC = doSATimeSaveValidity("R16Pl7TimeHH","R16Pl7TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl7Game1DateDD","R16Pl7Game1DateMM","R16Pl7Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl7Game2DateDD","R16Pl7Game2DateMM","R16Pl7Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl7Game3DateDD","R16Pl7Game3DateMM","R16Pl7Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Pl7") == false)
		{return;
		}
	//----------------------------------------------------------------
	//***** start with place 9
	if (doSARC = doSATimeSaveValidity("R16Pl9TimeHH","R16Pl9TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl9Game1DateDD","R16Pl9Game1DateMM","R16Pl9Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl9Game2DateDD","R16Pl9Game2DateMM","R16Pl9Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl9Game3DateDD","R16Pl9Game3DateMM","R16Pl9Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Pl9") == false)
		{return;
		}
	//----------------------------------------------------------------
	//***** start with place 11
	if (doSARC = doSATimeSaveValidity("R16Pl11TimeHH","R16Pl11TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl11Game1DateDD","R16Pl11Game1DateMM","R16Pl11Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl11Game2DateDD","R16Pl11Game2DateMM","R16Pl11Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl11Game3DateDD","R16Pl11Game3DateMM","R16Pl11Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Pl11") == false)
		{return;
		}
	//----------------------------------------------------------------
	//***** start with place 13
	if (doSARC = doSATimeSaveValidity("R16Pl13TimeHH","R16Pl13TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl13Game1DateDD","R16Pl13Game1DateMM","R16Pl13Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl13Game2DateDD","R16Pl13Game2DateMM","R16Pl13Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl13Game3DateDD","R16Pl13Game3DateMM","R16Pl13Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Pl13") == false)
		{return;
		}
	//----------------------------------------------------------------
	//***** start with place 15
	if (doSARC = doSATimeSaveValidity("R16Pl15TimeHH","R16Pl15TimeMM") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl15Game1DateDD","R16Pl15Game1DateMM","R16Pl15Game1DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl15Game2DateDD","R16Pl15Game2DateMM","R16Pl15Game2DateYYYY") == false)
		{return;
		}
	if (doSARC = doSADateSaveValidity("R16Pl15Game3DateDD","R16Pl15Game3DateMM","R16Pl15Game3DateYYYY") == false)
		{return;
		}
	if (doSARC = doUVolleyIndoorXCompSaveR16Validity("R16Pl15") == false)
		{return;
		}

//	alert("return");
//	return;
	MainScreenE.FrameReady.value = "";
//	MainMenuE.FrameReady.value = "";
//	MainToCUE.FrameReady.value = "";
//	doMainProcessInWorkWindow();

	MainScreenE.SWAction.value = "COMPDATASAVE";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPDATASHOW";
//	doMainMenuFSubmit();
	MainMenuFSubmitCheck = window.setInterval("doMainMenuFSubmitCheck()",500);
//	parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);
	MainToCUFSubmitCheck = window.setInterval("doMainToCUFSubmitCheck()",500);
}

//---------------------------------------------------------------------------------------------
// ******	verify data of raster
/*OK*/
function doUVolleyIndoorXCompSaveR16Validity(strVerify)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var objRadio = strVerify +"Radio";
	var objTimeHH = strVerify +"TimeHH";
	var objGame1DateDD = strVerify +"Game1DateDD";
	var objGame2DateDD = strVerify +"Game2DateDD";
	var objGame3DateDD = strVerify +"Game3DateDD";
	var strMsg = "";

	if (MainScreenE[objTimeHH].value == "HH")
		{if (MainScreenE[objGame1DateDD].value != "DD")
			{MainScreenE[objTimeHH].focus();
			strMsg = " - Uhrzeit bzw. Datum Spiel 1 falsch";
			}
		else
			{if (MainScreenE[objGame2DateDD].value != "DD")
				{MainScreenE[objTimeHH].focus();
				strMsg = " - Uhrzeit bzw. Datum Spiel 2 falsch";
				}
			else
				{if (MainScreenE[objGame3DateDD].value != "DD")
					{MainScreenE[objTimeHH].focus();
					strMsg = " - Uhrzeit bzw. Datum Spiel 3 falsch";
					}
				}
			}
		}
	else
		{if (MainScreenE[objGame1DateDD].value == "DD")
			{if ((MainScreenE[objGame2DateDD].value != "DD") || (MainScreenE[objGame3DateDD].value != "DD"))
				{MainScreenE[objGame1DateDD].focus();
				strMsg = " - Datum Spiel 1 falsch";
				}
			}
		else
			{if (MainScreenE[objGame2DateDD].value == "DD")
				{MainScreenE[objGame2DateDD].focus();
				strMsg = " - Datum Spiel 2 falsch";
				}
			else
				{if ((MainScreenE[objGame3DateDD].value == "DD") && (MainScreenE[objRadio][2].checked == true) || (MainScreenE[objGame3DateDD].value != "DD") && (MainScreenE[objRadio][2].checked == false))
					{MainScreenE[objGame3DateDD].focus();
					strMsg = " - Best off ... bzw. Datum Spiel 3 falsch";
					}
				}
			}
		}

	if (strMsg != "")
		{switch (strVerify)
			{case "R16Rd1":
				strMsg = "Runde 1" +strMsg
				break;
			case "R16Rd2":
				strMsg = "Runde 2" +strMsg
				break;
			case "R16Rd3":
				strMsg = "Runde 3" +strMsg
				break;
			case "R16Pl1":
				strMsg = "Platz 1" +strMsg
				break;
			case "R16Pl3":
				strMsg = "Platz 3" +strMsg
				break;
			case "R16Pl5":
				strMsg = "Platz 5" +strMsg
				break;
			case "R16Pl7":
				strMsg = "Platz 7" +strMsg
				break;
			case "R16Pl9":
				strMsg = "Platz 9" +strMsg
				break;
			case "R16Pl11":
				strMsg = "Platz 11" +strMsg
				break;
			case "R16Pl13":
				strMsg = "Platz 13" +strMsg
				break;
			case "R16Pl15":
				strMsg = "Platz 15" +strMsg
				break;
			}

		alert (strMsg);
		return false;
		}
	else
		{return true;
		}
}

//---------------------------------------------------------------------------------------------
// ******	update competition data
/*OK*/
function doUVolleyIndoorXCompDataUpd()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainMenuE.SWAction.value = "COMPDATAUPD";
	doMainMenuFSubmit();
	MainScreenE.SWAction.value = "COMPDATAUPD";
	doMainScreenFSubmit();
//	parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);
}

//-------------------------------------------------------------------
/*OK*/
function doUVolleyIndoorXCompDataUpdR16(objR16,strR16)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	switch (objR16)
		{case "R16Rd1Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Rd1Game3DateDD","DD");
				doSAResetField("R16Rd1Game3DateMM","MM");
				doSAResetField("R16Rd1Game3DateYYYY","YYYY");
				}
			break;

		case "R16Rd1TimeHH":
			MainScreenE.R16Rd2TimeHH.value = strR16;
			MainScreenE.R16Rd3TimeHH.value = strR16;
			MainScreenE.R16Pl1TimeHH.value = strR16;
			MainScreenE.R16Pl3TimeHH.value = strR16;
			MainScreenE.R16Pl5TimeHH.value = strR16;
			MainScreenE.R16Pl7TimeHH.value = strR16;
			MainScreenE.R16Pl9TimeHH.value = strR16;
			MainScreenE.R16Pl11TimeHH.value = strR16;
			MainScreenE.R16Pl13TimeHH.value = strR16;
			MainScreenE.R16Pl15TimeHH.value = strR16;
			break;

		case "R16Rd1TimeMM":
			MainScreenE.R16Rd2TimeMM.value = strR16;
			MainScreenE.R16Rd3TimeMM.value = strR16;
			MainScreenE.R16Pl1TimeMM.value = strR16;
			MainScreenE.R16Pl3TimeMM.value = strR16;
			MainScreenE.R16Pl5TimeMM.value = strR16;
			MainScreenE.R16Pl7TimeMM.value = strR16;
			MainScreenE.R16Pl9TimeMM.value = strR16;
			MainScreenE.R16Pl11TimeMM.value = strR16;
			MainScreenE.R16Pl13TimeMM.value = strR16;
			MainScreenE.R16Pl15TimeMM.value = strR16;
			break;

		case "R16Rd2Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Rd2Game3DateDD","DD");
				doSAResetField("R16Rd2Game3DateMM","MM");
				doSAResetField("R16Rd2Game3DateYYYY","YYYY");
				}
			break;

		case "R16Rd3Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Rd3Game3DateDD","DD");
				doSAResetField("R16Rd3Game3DateMM","MM");
				doSAResetField("R16Rd3Game3DateYYYY","YYYY");
				}
			break;

		case "R16Pl1Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Pl1Game3DateDD","DD");
				doSAResetField("R16Pl1Game3DateMM","MM");
				doSAResetField("R16Pl1Game3DateYYYY","YYYY");

				if (MainScreenE.BestOfPlaceAllYNCheckbox.checked == true)
					{doSAResetField("R16Pl3Game3DateDD","DD");
					doSAResetField("R16Pl3Game3DateMM","MM");
					doSAResetField("R16Pl3Game3DateYYYY","YYYY");
					doSAResetField("R16Pl5Game3DateDD","DD");
					doSAResetField("R16Pl5Game3DateMM","MM");
					doSAResetField("R16Pl5Game3DateYYYY","YYYY");
					doSAResetField("R16Pl7Game3DateDD","DD");
					doSAResetField("R16Pl7Game3DateMM","MM");
					doSAResetField("R16Pl7Game3DateYYYY","YYYY");
					doSAResetField("R16Pl9Game3DateDD","DD");
					doSAResetField("R16Pl9Game3DateMM","MM");
					doSAResetField("R16Pl9Game3DateYYYY","YYYY");
					doSAResetField("R16Pl11Game3DateDD","DD");
					doSAResetField("R16Pl11Game3DateMM","MM");
					doSAResetField("R16Pl11Game3DateYYYY","YYYY");
					doSAResetField("R16Pl13Game3DateDD","DD");
					doSAResetField("R16Pl13Game3DateMM","MM");
					doSAResetField("R16Pl13Game3DateYYYY","YYYY");
					doSAResetField("R16Pl15Game3DateDD","DD");
					doSAResetField("R16Pl15Game3DateMM","MM");
					doSAResetField("R16Pl15Game3DateYYYY","YYYY");
					}
				}

			if (MainScreenE.BestOfPlaceAllYNCheckbox.checked == true)
				{switch (strR16)
					{case "BestOf2GS":
						MainScreenE.R16Pl3Radio[0].checked = true;
						MainScreenE.R16Pl5Radio[0].checked = true;
						MainScreenE.R16Pl7Radio[0].checked = true;
						MainScreenE.R16Pl9Radio[0].checked = true;
						MainScreenE.R16Pl11Radio[0].checked = true;
						MainScreenE.R16Pl13Radio[0].checked = true;
						MainScreenE.R16Pl15Radio[0].checked = true;
						break;

					case "BestOf2GSSetEq":
						MainScreenE.R16Pl3Radio[1].checked = true;
						MainScreenE.R16Pl5Radio[1].checked = true;
						MainScreenE.R16Pl7Radio[1].checked = true;
						MainScreenE.R16Pl9Radio[1].checked = true;
						MainScreenE.R16Pl11Radio[1].checked = true;
						MainScreenE.R16Pl13Radio[1].checked = true;
						MainScreenE.R16Pl15Radio[1].checked = true;
						break;

					case "BestOf3":
						MainScreenE.R16Pl3Radio[2].checked = true;
						MainScreenE.R16Pl5Radio[2].checked = true;
						MainScreenE.R16Pl7Radio[2].checked = true;
						MainScreenE.R16Pl9Radio[2].checked = true;
						MainScreenE.R16Pl11Radio[2].checked = true;
						MainScreenE.R16Pl13Radio[2].checked = true;
						MainScreenE.R16Pl15Radio[2].checked = true;
						break;
					}

					MainScreenE.R16Pl3Mode.value = strR16;
					MainScreenE.R16Pl5Mode.value = strR16;
					MainScreenE.R16Pl7Mode.value = strR16;
					MainScreenE.R16Pl9Mode.value = strR16;
					MainScreenE.R16Pl11Mode.value = strR16;
					MainScreenE.R16Pl13Mode.value = strR16;
					MainScreenE.R16Pl15Mode.value = strR16;
				}
			break;

		case "R16Pl1Game1DateDD":
			MainScreenE.R16Pl3Game1DateDD.value = strR16;
			MainScreenE.R16Pl5Game1DateDD.value = strR16;
			MainScreenE.R16Pl7Game1DateDD.value = strR16;
			MainScreenE.R16Pl9Game1DateDD.value = strR16;
			MainScreenE.R16Pl11Game1DateDD.value = strR16;
			MainScreenE.R16Pl13Game1DateDD.value = strR16;
			MainScreenE.R16Pl15Game1DateDD.value = strR16;
			break;

		case "R16Pl1Game1DateMM":
			MainScreenE.R16Pl3Game1DateMM.value = strR16;
			MainScreenE.R16Pl5Game1DateMM.value = strR16;
			MainScreenE.R16Pl7Game1DateMM.value = strR16;
			MainScreenE.R16Pl9Game1DateMM.value = strR16;
			MainScreenE.R16Pl11Game1DateMM.value = strR16;
			MainScreenE.R16Pl13Game1DateMM.value = strR16;
			MainScreenE.R16Pl15Game1DateMM.value = strR16;
			break;

		case "R16Pl1Game1DateYYYY":
			MainScreenE.R16Pl3Game1DateYYYY.value = strR16;
			MainScreenE.R16Pl5Game1DateYYYY.value = strR16;
			MainScreenE.R16Pl7Game1DateYYYY.value = strR16;
			MainScreenE.R16Pl9Game1DateYYYY.value = strR16;
			MainScreenE.R16Pl11Game1DateYYYY.value = strR16;
			MainScreenE.R16Pl13Game1DateYYYY.value = strR16;
			MainScreenE.R16Pl15Game1DateYYYY.value = strR16;
			break;

		case "R16Pl1Game2DateDD":
			MainScreenE.R16Pl3Game2DateDD.value = strR16;
			MainScreenE.R16Pl5Game2DateDD.value = strR16;
			MainScreenE.R16Pl7Game2DateDD.value = strR16;
			MainScreenE.R16Pl9Game2DateDD.value = strR16;
			MainScreenE.R16Pl11Game2DateDD.value = strR16;
			MainScreenE.R16Pl13Game2DateDD.value = strR16;
			MainScreenE.R16Pl15Game2DateDD.value = strR16;
			break;

		case "R16Pl1Game2DateMM":
			MainScreenE.R16Pl3Game2DateMM.value = strR16;
			MainScreenE.R16Pl5Game2DateMM.value = strR16;
			MainScreenE.R16Pl7Game2DateMM.value = strR16;
			MainScreenE.R16Pl9Game2DateMM.value = strR16;
			MainScreenE.R16Pl11Game2DateMM.value = strR16;
			MainScreenE.R16Pl13Game2DateMM.value = strR16;
			MainScreenE.R16Pl15Game2DateMM.value = strR16;
			break;

		case "R16Pl1Game2DateYYYY":
			MainScreenE.R16Pl3Game2DateYYYY.value = strR16;
			MainScreenE.R16Pl5Game2DateYYYY.value = strR16;
			MainScreenE.R16Pl7Game2DateYYYY.value = strR16;
			MainScreenE.R16Pl9Game2DateYYYY.value = strR16;
			MainScreenE.R16Pl11Game2DateYYYY.value = strR16;
			MainScreenE.R16Pl13Game2DateYYYY.value = strR16;
			MainScreenE.R16Pl15Game2DateYYYY.value = strR16;
			break;

		case "R16Pl1Game3DateDD":
			MainScreenE.R16Pl3Game3DateDD.value = strR16;
			MainScreenE.R16Pl5Game3DateDD.value = strR16;
			MainScreenE.R16Pl7Game3DateDD.value = strR16;
			MainScreenE.R16Pl9Game3DateDD.value = strR16;
			MainScreenE.R16Pl11Game3DateDD.value = strR16;
			MainScreenE.R16Pl13Game3DateDD.value = strR16;
			MainScreenE.R16Pl15Game3DateDD.value = strR16;
			break;

		case "R16Pl1Game3DateMM":
			MainScreenE.R16Pl3Game3DateMM.value = strR16;
			MainScreenE.R16Pl5Game3DateMM.value = strR16;
			MainScreenE.R16Pl7Game3DateMM.value = strR16;
			MainScreenE.R16Pl9Game3DateMM.value = strR16;
			MainScreenE.R16Pl11Game3DateMM.value = strR16;
			MainScreenE.R16Pl13Game3DateMM.value = strR16;
			MainScreenE.R16Pl15Game3DateMM.value = strR16;
			break;

		case "R16Pl1Game3DateYYYY":
			MainScreenE.R16Pl3Game3DateYYYY.value = strR16;
			MainScreenE.R16Pl5Game3DateYYYY.value = strR16;
			MainScreenE.R16Pl7Game3DateYYYY.value = strR16;
			MainScreenE.R16Pl9Game3DateYYYY.value = strR16;
			MainScreenE.R16Pl11Game3DateYYYY.value = strR16;
			MainScreenE.R16Pl13Game3DateYYYY.value = strR16;
			MainScreenE.R16Pl15Game3DateYYYY.value = strR16;
			break;

		case "R16Pl3Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Pl3Game3DateDD","DD");
				doSAResetField("R16Pl3Game3DateMM","MM");
				doSAResetField("R16Pl3Game3DateYYYY","YYYY");
				}
			break;

		case "R16Pl5Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Pl5Game3DateDD","DD");
				doSAResetField("R16Pl5Game3DateMM","MM");
				doSAResetField("R16Pl5Game3DateYYYY","YYYY");
				}
			break;

		case "R16Pl7Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Pl7Game3DateDD","DD");
				doSAResetField("R16Pl7Game3DateMM","MM");
				doSAResetField("R16Pl7Game3DateYYYY","YYYY");
				}
			break;

		case "R16Pl9Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Pl9Game3DateDD","DD");
				doSAResetField("R16Pl9Game3DateMM","MM");
				doSAResetField("R16Pl9Game3DateYYYY","YYYY");
				}
			break;

		case "R16Pl11Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Pl11Game3DateDD","DD");
				doSAResetField("R16Pl11Game3DateMM","MM");
				doSAResetField("R16Pl11Game3DateYYYY","YYYY");
				}
			break;

		case "R16Pl13Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Pl13Game3DateDD","DD");
				doSAResetField("R16Pl13Game3DateMM","MM");
				doSAResetField("R16Pl13Game3DateYYYY","YYYY");
				}
			break;

		case "R16Pl15Radio":
			if (strR16.indexOf("BestOf2") > -1)
				{doSAResetField("R16Pl15Game3DateDD","DD");
				doSAResetField("R16Pl15Game3DateMM","MM");
				doSAResetField("R16Pl15Game3DateYYYY","YYYY");
				}
			break;
		}
}

//---------------------------------------------------------------------------------------------
// ******	set date/time of this round - Comp050802
/*OK*/
function doUVolleyIndoorXCompGameNewDateTime()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var objDD,objMM,objYYYY,objXDays,objXDate;

	objDD = Math.abs(MainScreenE.RdData[MainScreenE.RdData.length -36].value);
	objMM = Math.abs(MainScreenE.RdData[MainScreenE.RdData.length -35].value);
	objYYYY = Math.abs(MainScreenE.RdData[MainScreenE.RdData.length -34].value);
	objXDays = 7;
/*
	objDD = doDateDDPlusXDays(objDD,objMM,objYYYY,objXDays)

	if (Math.abs(objDD) < Math.abs(MainScreenE.RdData[MainScreenE.RdData.length -36].value))
		{if (Math.abs(objMM) == 12)
			{objMM =1;
			objYYYY = Math.abs(objYYYY) +1;
			}
		else
			{objMM = Math.abs(objMM) +1;
			}
		}

	var strX = Math.abs(objYYYY/4);
	var strY = Math.round(strX);
	if ((strX == strY) && (Math.abs(objMM) == 3))
		{if (Math.abs(objDD) == 1)
			{objDD =29;
			objMM =2;
			}
		else
			{if (Math.abs(objDD) <9)
				{objDD = Math.abs(objDD) -1;
				}
			}
		}

	if (Math.abs(objDD) < 10)
		{MainScreenE.RdData[MainScreenE.RdData.length -17].value = "0" +objDD;
		}
	else
		{MainScreenE.RdData[MainScreenE.RdData.length -17].value = objDD;
		}

	if (Math.abs(objMM) < 10)
		{MainScreenE.RdData[MainScreenE.RdData.length -16].value = "0" +objMM;
		}
	else
		{MainScreenE.RdData[MainScreenE.RdData.length -16].value = objMM;
		}

	MainScreenE.RdData[MainScreenE.RdData.length -15].value = objYYYY;
*/

	objXDate = doDateDDPlusXDays(objDD,objMM,objYYYY,objXDays);

	MainScreenE.RdData[MainScreenE.RdData.length -17].value = objXDate.substr(0,2);
	MainScreenE.RdData[MainScreenE.RdData.length -16].value = objXDate.substr(3,2);
	MainScreenE.RdData[MainScreenE.RdData.length -15].value = objXDate.substr(6,4);

	MainScreenE.RdData[MainScreenE.RdData.length -14].value = MainScreenE.RdData[MainScreenE.RdData.length -33].value;
	MainScreenE.RdData[MainScreenE.RdData.length -13].value = MainScreenE.RdData[MainScreenE.RdData.length -32].value;
}

//-------------------------------------------------------------------
// ******	set date/time of this round
/*OK*/
function doUVolleyIndoorXCompGameNewUpdDateTime(objPlusDD)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var objDD,objMM,objYYYY,objXDays,objXDate;

	objDD = Math.abs(MainScreenE.RdDataUpd[0].value);
	objMM = Math.abs(MainScreenE.RdDataUpd[1].value);
	objYYYY = Math.abs(MainScreenE.RdDataUpd[2].value);
	objXDays = objPlusDD;

	objXDate = doDateDDPlusXDays(objDD,objMM,objYYYY,objXDays);

	MainScreenE.RDateDDupd.value = objXDate.substr(0,2);
	MainScreenE.RDateMMupd.value = objXDate.substr(3,2);
	MainScreenE.RDateYYYYupd.value = objXDate.substr(6,4);

	MainScreenE.RTimeHHupd.value = MainScreenE.RdDataUpd[3].value;
	MainScreenE.RTimeMMupd.value = MainScreenE.RdDataUpd[4].value;
}

//-------------------------------------------------------------------
// ******	set date/time of this round
/*OK*/
function doUVolleyIndoorXCompGameNewUpdMode()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.RModeupd.value = MainScreenE.CompModeOpts.options[MainScreenE.CompModeOpts.options.selectedIndex].value;
}

//---------------------------------------------------------------------------------------------
// ******	actualize competition name with users input
/*OK*/
function doUVolleyIndoorXCompNameAct()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var strCompSex,strCompSexShort;

	switch (MainScreenE.CompSex.value)
		{case "f":
			strCompSex = "Damen";
			strCompSexShort = "D";
			break;
		case "m":
			strCompSex = "Herren";
			strCompSexShort = "H";
			break;
		default:
			strCompSex = "Mixed";
			strCompSexShort = "X";
			break;
		}

//	CompName0704 Begin
	if (MainScreenE.CompNameP1.value == "")
		{MainScreenE.CompNameP1.value = strCompSex;
		}
	else
		{MainScreenE.CompNameP1.value = MainScreenE.CompNameP1.value.replace(/Damen/,strCompSex);
		MainScreenE.CompNameP1.value = MainScreenE.CompNameP1.value.replace(/Herren/,strCompSex);
		MainScreenE.CompNameP1.value = MainScreenE.CompNameP1.value.replace(/Mixed/,strCompSex);
		}
// CompName0704 End

	var strCompNameP1 = MainScreenE.CompNameP1.value;
/*
	if (MainScreenE.CompShortName.value!="")
		{var strCompShortName = MainScreenE.CompShortName.value.toUpperCase();
		}
	else
		{var strCompShortName = "";
		}
*/
//	CompName0704 MainScreenE.CompName.value = strCompNameP1 +" " +strCompSex +" (" +strCompShortName +strCompSexShort +")";
//	MainScreenE.CompName.value = strCompNameP1 +" " +" (" +strCompShortName +strCompSexShort +")";
	MainScreenE.CompName.value = strCompNameP1 +" " +" (" +strCompSexShort +")";
}


//---------------------------------------------------------------------------------------------
// ******	actualize competition mode if kind is final4
/*OK*/
function doUVolleyIndoorXCompModeAct()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (typeof(MainScreenE.CompKindOpts) == "object")
		{if (MainScreenE.CompKindOpts.options[MainScreenE.CompKindOpts.options.selectedIndex].value == "R16")
			{for (intI=0; intI<MainScreenE.CompModeOpts.length; intI++)
				{if (MainScreenE.CompModeOpts.options[intI].text == "M12")
					{MainScreenE.CompModeOpts.options[intI].selected = true;
					intI = MainScreenE.CompModeOpts.length;
					}
				}
			MainScreenE.CompTableServiceRadio[1].checked = true;
			MainScreenE.CompTableService.value = "R";
			}

		if (MainScreenE.CompKindOpts.options[MainScreenE.CompKindOpts.options.selectedIndex].value == "FIN4")
			{for (intI=0; intI<MainScreenE.CompModeOpts.length; intI++)
				{if (MainScreenE.CompModeOpts.options[intI].text == "M1234FIN4")
					{MainScreenE.CompModeOpts.options[intI].selected = true;
					intI = MainScreenE.CompModeOpts.length;
					}
				}
			MainScreenE.CompTableServiceRadio[1].checked = true;
			MainScreenE.CompTableService.value = "R";
			}

		if (MainScreenE.CompKindOpts.options[MainScreenE.CompKindOpts.options.selectedIndex].value == "FIN6")
			{for (intI=0; intI<MainScreenE.CompModeOpts.length; intI++)
				{if (MainScreenE.CompModeOpts.options[intI].text == "M12345S16S2FIN6")
					{MainScreenE.CompModeOpts.options[intI].selected = true;
					intI = MainScreenE.CompModeOpts.length;
					}
				}
			MainScreenE.CompTableServiceRadio[1].checked = true;
			MainScreenE.CompTableService.value = "R";
			}

		if (MainScreenE.CompKindOpts.options[MainScreenE.CompKindOpts.options.selectedIndex].value == "FIN8")
			{for (intI=0; intI<MainScreenE.CompModeOpts.length; intI++)
				{if (MainScreenE.CompModeOpts.options[intI].text == "M12345678")
					{MainScreenE.CompModeOpts.options[intI].selected = true;
					intI = MainScreenE.CompModeOpts.length;
					}
				}
			}
			MainScreenE.CompTableServiceRadio[1].checked = true;
			MainScreenE.CompTableService.value = "R";
		}
}


//---------------------------------------------------------------------------------------------
// ******	update some fields in competition document
/*OK*/
function doUVolleyIndoorXCompRoundDataUpd(objGameNr)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (objGameNr != "" )
		{MainScreenE.GameNr.value = objGameNr;
		}
	MainScreenE.SWAction.value = "COMPROUNDDATAUPD";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPROUNDDATAUPD";
	doMainMenuFSubmit();
}


//-------------------------------------------------------------------
// ******	take care for checkboxes in case of changing round data
/*OK*/
function doUVolleyIndoorXCompRoundDataUpdNEWCheckbox(objDoc,objShortName,objCheckboxName)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var strShortName;

	if ((MainScreenE.ToCIdTaken.value.indexOf("XAsso_4") > -1) || (MainScreenE.ToCIdTaken.value.indexOf("XHum_") > -1))
		{if (objDoc.indexOf(MainScreenE.ToCIdTaken.value) > -1)
			{if ((MainScreenE[objCheckboxName].checked == false) && (typeof(document.getElementsByName("ShortNames").length) == "number"))
				{for (intI=0;intI<document.getElementsByName("ShortNames").length;intI++)
					{strShortName = document.getElementsByName("ShortNames")[intI].value;

					if (typeof(MainScreenE[strShortName]) == "object")
						{if (MainScreenE[strShortName].value == "off")
							{MainScreenE[objShortName].value = "off";
							return;
							}
						}
					}
					MainScreenE[objCheckboxName].checked = true;
					alert ("Aufhebung der Zustimmung nicht mehr möglich");
					return;
				}
			}
		else
			{if (MainScreenE[objShortName].value == "off")
				{MainScreenE[objCheckboxName].checked = false;
				}
			else
				{MainScreenE[objCheckboxName].checked = true;
				}
			alert ("Berechtigung fehlt");
			}
		}
}


//---------------------------------------------------------------------------------------------
// ******	update some fields in competition document
/*OK*/
function doUVolleyIndoorXCompRoundDataSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intI,intJ,doDateTimeRC,strX,strGameNr;

	intI = MainScreenE.CompRDateDDNew.value.indexOf(".");
	if (doDateTimeRC = (doDDValidity(MainScreenE.CompRDateDDNew.value,intI) == false))
		{alert ("Änderung Datum - Tag fehlerhaft");
		return;
		}

	intI = MainScreenE.CompRDateMMNew.value.indexOf(".");
	if (doDateTimeRC = (doMMValidity(MainScreenE.CompRDateMMNew.value,intI) == false))
		{alert ("Änderung Datum - Monat fehlerhaft");
		return;
		}

	if (MainScreenE.CompRDateYYYYNew.value.length != 4)
		{alert ("Änderung Datum - Jahr 4-stellig eingeben");
		return;
		}
	if (doDateTimeRC = (doYYYYValidity(MainScreenE.CompRDateYYYYNew.value) == false))
		{alert ("Änderung Datum - Jahr fehlerhaft");
		return;
		}

	if (MainScreenE.CompRDateDDNew.value.length == 1)
		{MainScreenE.CompRDateDDNew.value = "0" +MainScreenE.CompRDateDDNew.value;
		}
	if (MainScreenE.CompRDateMMNew.value.length == 1)
		{MainScreenE.CompRDateMMNew.value = "0" +MainScreenE.CompRDateMMNew.value;
		}

//	strX = new Date();

	if (doDateTimeRC = (doDateValidity(MainScreenE.CompRDateDDNew.value,MainScreenE.CompRDateMMNew.value) == false))
		{alert ("Ungueltiges Datum");
		return;
		}
	if (doDateTimeRC = (doLeapYearValidity(MainScreenE.CompRDateDDNew.value,MainScreenE.CompRDateMMNew.value,MainScreenE.CompRDateYYYYNew.value) == false))
		{alert ("Ungueltiges Datum");
		return;
		}

	//----------------------------------------------------------------
	//***	check upd date in case of club

	if (MainScreenE.ToCIdTaken.value.indexOf("XAsso_4") > -1)
		{var objDD,objMM,objYYYY,objXDays,objXDate;
		var NowDate = new Date();

		objDD = NowDate.getDate();
		objMM = NowDate.getMonth() +1;
		objYYYY = NowDate.getFullYear();
		if (typeof(MainScreenE.CompRTempDeadlineNrOfDays) == "object")
			{objXDays = MainScreenE.CompRTempDeadlineNrOfDays.value;
			}
		else
			{objXDays = 0;
			}

		objXDate = doDateDDPlusXDays(objDD,objMM,objYYYY,objXDays);

		objDD = objXDate.substr(0,2);
		objMM = objXDate.substr(3,2);
		objYYYY = objXDate.substr(6,4);

		if (Math.abs(objYYYY) > MainScreenE.CompRDateYYYYNew.value)
			{alert ("Datum nicht erlaubt - früheste Vorverlegung: Heute +" +objXDays +" Tage");
			return;
			}
		if ((Math.abs(objYYYY) == MainScreenE.CompRDateYYYYNew.value) && (Math.abs(objMM) > MainScreenE.CompRDateMMNew.value))
			{alert ("Datum nicht erlaubt - früheste Vorverlegung: Heute +" +objXDays +" Tage");
			return;
			}
		if ((Math.abs(objYYYY) == MainScreenE.CompRDateYYYYNew.value) && (Math.abs(objMM) == MainScreenE.CompRDateMMNew.value) && (Math.abs(objDD) > MainScreenE.CompRDateDDNew.value))
			{alert ("Datum nicht erlaubt - früheste Vorverlegung: Heute +" +objXDays +" Tage");
			return;
			}
		}

	if (doDateTimeRC = (doTimeHHValidity(MainScreenE.CompRTimeHHNew.value) == false))
		{alert ("Änderung Zeit - Stunden fehlerhaft");
		return;
		}
	if (MainScreenE.CompRTimeHHNew.value.length == 1)
		{MainScreenE.CompRTimeHHNew.value = "0" +MainScreenE.CompRTimeHHNew.value;
		}

	if (doDateTimeRC = (doTimeMMValidity(MainScreenE.CompRTimeMMNew.value) == false))
		{alert ("Änderung Zeit - Minuten fehlerhaft");
		return;
		}
	if (MainScreenE.CompRTimeMMNew.value.length == 1)
		{MainScreenE.CompRTimeMMNew.value = "0" +MainScreenE.CompRTimeMMNew.value;
		}
	if (typeof(MainScreenE.CompRPlaceNew) == "object")
		{if (MainScreenE.CompRPlaceNew.value == "")
			{alert ("Ort fehlerhaft");
			return;
			}
		}

	if (typeof(MainScreenE.CompRGameGameNrNew) == "object")
		{
	if (typeof(MainScreenE.CompRGameGameNrNew.length) == "number")
		{for (intI=0;intI<MainScreenE.CompRGameGameNrNew.length;intI++)
			{if ((isNaN(MainScreenE.CompRGameGameNrNew[intI].value) == true) || (MainScreenE.CompRGameGameNrNew[intI].value.indexOf(".") > -1) || (MainScreenE.CompRGameGameNrNew[intI].value.indexOf(" ") > -1) || (MainScreenE.CompRGameGameNrNew[intI].value == ""))
				{MainScreenE.CompRGameGameNrNew[intI].focus();
				alert ("Spiel - Nummer fehlerhaft");
				return;
				}
			for (intJ=0;intJ<MainScreenE.CompRGameGameNrNew.length;intJ++)
				{if (Math.abs(MainScreenE.CompRGameGameNrNew[intI].value) == Math.abs(MainScreenE.CompRGameGameNr[intJ].value))
					{intJ = MainScreenE.CompRGameGameNrNew.length;
					}
				}
			if (intJ != MainScreenE.CompRGameGameNrNew.length +1)
				{MainScreenE.CompRGameGameNrNew[intI].focus();
				alert ("Spiel - Nummer fehlerhaft");
				return;
				}
			}
		for (intI=0;intI<MainScreenE.CompRGameGameNrNew.length;intI++)
			{for (intJ=0;intJ<MainScreenE.CompRGameGameNrNew.length;intJ++)
				{if ((Math.abs(MainScreenE.CompRGameGameNrNew[intI].value) == Math.abs(MainScreenE.CompRGameGameNrNew[intJ].value)) && (intI != intJ))
					{MainScreenE.CompRGameGameNrNew[intI].focus();
					alert ("Spiel - Nummer mehrfach vorhanden");
					return;
					}
				}
			}
		for (intI=0;intI<MainScreenE.CompRGameGameNrNew.length;intI++)
			{strX = Math.abs(MainScreenE.CompRGameGameNrNew[intI].value);

			if (strX <= 9)
				{strGameNr = "00" +strX;
				}
			if ((strX >= 10) && (strX <= 99))
				{strGameNr = "0" +strX;
				}
			if (strX >= 100)
				{strGameNr = strX;
				}
			MainScreenE.CompRGameGameNrNew[intI].value = strGameNr;
			}
		}
	else
		{if (typeof(MainScreenE.CompRGameGameNrNew) == "object")
			{if ((isNaN(MainScreenE.CompRGameGameNrNew.value) == true) || (MainScreenE.CompRGameGameNrNew.value.indexOf(".") > -1) || (MainScreenE.CompRGameGameNrNew.value.indexOf(" ") > -1) || (MainScreenE.CompRGameGameNrNew.value == ""))
				{MainScreenE.CompRGameGameNrNew.focus();
				alert ("Spiel - Nummer fehlerhaft");
				return;
				}
			if (Math.abs(MainScreenE.CompRGameGameNrNew.value) != Math.abs(MainScreenE.CompRGameGameNr.value))
				{MainScreenE.CompRGameGameNrNew.focus();
				alert ("Spiel - Nummer fehlerhaft");
				return;
				}
			}
		}


	var strShortName,strCheckboxName;

	if (typeof(parent.MainScreenFrame.document.getElementsByName("ShortNames").length) == "number")
		{for (intI=0;intI<parent.MainScreenFrame.document.getElementsByName("ShortNames").length;intI++)
			{strCheckboxName = parent.MainScreenFrame.document.getElementsByName("ShortNames")[intI].value +"Checkbox";
			strShortName = parent.MainScreenFrame.document.getElementsByName("ShortNames")[intI].value;

			if (typeof(MainScreenE[strCheckboxName]) == "object")
				{if (MainScreenE[strCheckboxName].checked == true)
					{MainScreenE[strShortName].value = "on";
					}
				else
					{MainScreenE[strShortName].value = "off";
					}
				}
			}
		}
		}

	MainScreenE.SWAction.value = "COMPROUNDDATASAVE";
	doMainScreenFSubmit();
}


//---------------------------------------------------------------------------------------------
// ******	delete whole comprsub in competition document
/*OK*/
function doUVolleyIndoorXCompRoundDelete(GameNr)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var Check = confirm("Diese Runde unwiderruflich löschen?")
	if (Check == false)
		return;

	MainScreenE.GameNr.value = GameNr;
	MainScreenE.SWAction.value = "COMPROUNDDELETE";
	doMainScreenFSubmit();
}


//---------------------------------------------------------------------------------------------
// ******	update referee of this one game in competition document
/*OK*/
function doUVolleyIndoorXCompGameRefUpd(GameNr)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (GameNr != "")
		{MainScreenE.GameNr.value = GameNr;
		}

	MainScreenE.SWAction.value = "COMPGAMEREFUPD";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPGAMEREFUPD";
	doMainMenuFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	update referee of game number in competition document
/*OK*/
function doUVolleyIndoorXCompGameRefNewUpd()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var strX,intJ;
	MainScreenE.GameRefNew.value = "";
	MainScreenE.GameRef.value = "";
	intJ = 0;

	if (typeof(MainScreenE.XCompGameRefUpdAsso) == "object")
		{for (intI=0;intI<MainScreenE.XCompGameRefUpdAsso.options.length;intI++)
			{if (MainScreenE.XCompGameRefUpdAsso.options[intI].selected == true)
				{intJ = intJ +1;
				if (intJ == 4)
					{MainScreenE.XCompGameRefUpdAsso.options[intI].selected = false;
					alert ("Es können max. 3 Vereine/Personen gewählt werden");
					return;
					}

				if (MainScreenE.GameRefNew.value == "")
					{MainScreenE.GameRefNew.value = MainScreenE.XCompGameRefUpdAsso.options[intI].text.replace(/_/g,"");
					MainScreenE.GameRef.value = MainScreenE.XCompGameRefUpdAsso.options[intI].value;
					}
				else
					{MainScreenE.GameRefNew.value = MainScreenE.GameRefNew.value +", " +MainScreenE.XCompGameRefUpdAsso.options[intI].text.replace(/_/g,"");
					MainScreenE.GameRef.value = MainScreenE.GameRef.value +"," +MainScreenE.XCompGameRefUpdAsso.options[intI].value;
					}
				}
			}
		}

	if (typeof(MainScreenE.XCompGameRefUpdXHum) == "object")
		{for (intI=0;intI<MainScreenE.XCompGameRefUpdXHum.options.length;intI++)
			{if (MainScreenE.XCompGameRefUpdXHum.options[intI].selected == true)
				{if (MainScreenE.XCompGameRefUpdXHum.options[intI].value == "EntryDeselect")
					{MainScreenE.XCompGameRefUpdXHum.options[intI].selected = false;
					}
				else
					{intJ = intJ +1;
					if (intJ == 4)
						{MainScreenE.XCompGameRefUpdXHum.options[intI].selected = false;
						alert ("Es können max. 3 Vereine/Personen gewählt werden");
						return;
						}

					if (MainScreenE.GameRefNew.value == "")
						{MainScreenE.GameRefNew.value = MainScreenE.XCompGameRefUpdXHum.options[intI].text;
						MainScreenE.GameRef.value = MainScreenE.XCompGameRefUpdXHum.options[intI].value;
						}
					else
						{MainScreenE.GameRefNew.value = MainScreenE.GameRefNew.value +", " +MainScreenE.XCompGameRefUpdXHum.options[intI].text;
						MainScreenE.GameRef.value = MainScreenE.GameRef.value +"," +MainScreenE.XCompGameRefUpdXHum.options[intI].value;
						}
					}
				}
			}
		}
}

//---------------------------------------------------------------------------------------------
// ******	update referee of game number in competition document
/*OK*/
function doUVolleyIndoorXCompGameRefSave()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intI,doDateTimeRC,strX;

	if (MainScreenE.GameRefNew.value == "")
		{alert ("Schiedsrichter neu fehlerhaft");
		return;
		}

	//	NO selection from listbox
	if (MainScreenE.GameRef.value == "")
		{MainScreenE.GameRef.value = MainScreenE.GameRefNew.value;
		}

	MainScreenE.SWAction.value = "COMPGAMEREFSAVE";
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "COMPDATASHOW";
	doMainMenuFSubmit();
}


//---------------------------------------------------------------------------------------------
// ******	delete one game only in competition document
/*OK*/
function doUVolleyIndoorXCompGameDelete(GameNr)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var Check = confirm("Dieses Spiel unwiderruflich löschen?")
	if (Check == false)
		return;

	MainScreenE.GameNr.value = GameNr;
	MainScreenE.SWAction.value = "COMPGAMEDELETE";
	doMainScreenFSubmit();
}



//---------------------------------------------------------------------------------------------
// ******	register new team for a competition of type "_REG"
/*OK*/
function doUVolleyIndoorXCompTeamRegUpd()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "COMPTEAMREGUPD";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPTEAMREGUPD";
	doMainMenuFSubmit();
}


//---------------------------------------------------------------------------------------------
// ******	register new team for a competition of type "_REG"
/*OK*/
function doUVolleyIndoorXCompTeamRegSave()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
//		alert (MainScreenE.ToCDocTaken.value);

	if (MainScreenE.HashAssoName.value == "")
		{alert ("Name Team fehlerhaft");
		return;
		}
	if (MainScreenE.TeamHumansLeaderOpts.options.selectedIndex == -1)
		{alert ("Kontaktperson muss bekannt gegeben werden");
		return;
		}
/*
	if (MainScreenE.TeamHumansLeaderOpts.options[MainScreenE.TeamHumansLeaderOpts.options.selectedIndex].text.indexOf("Telefonnummer") > -1)
		{alert ("Telefonnr./eMail bei den Personendaten fehlerhaft - bitte aendern!");
		MainScreenE.TeamHumansLeaderOpts.options.selectedIndex = -1;
		return;
		}
	if (MainScreenE.TeamHumansLeaderOpts.options[MainScreenE.TeamHumansLeaderOpts.options.selectedIndex].text.indexOf("@") < 0)
		{alert ("Telefonnr./eMail bei den Personendaten fehlerhaft - bitte aendern!");
		MainScreenE.TeamHumansLeaderOpts.options.selectedIndex = -1;
		return;
		}
*/
	//------------------------------------------------------------------------------------------
	// ******	check name of location
/*
	if (typeof(MainScreenE.TeamAssoLocationName) == "object")
		{if (MainScreenE.TeamAssoLocationName.value == "")
			{alert ("Heimhalle fehlerhaft");
			return;
			}
		else
			{var TeamAssoLocationName = MainScreenE.TeamAssoLocationName.value;
			for (intI=0; intI<TeamAssoLocationName.length; intI++)
				{MainScreenE.TeamAssoLocationName.value = TeamAssoLocationName.replace(/,/," ");
				TeamAssoLocationName = MainScreenE.TeamAssoLocationName.value;
				}
			}
		}
*/
	//------------------------------------------------------------------------------------------
	// ******	check street of organisations address
/*
	if ((typeof(MainScreenE.TeamAssoLocationStreet) == "object") && (typeof(MainScreenE.AssoLocationStreet) == "object"))
		{MainScreenE.TeamAssoLocationStreet.value = MainScreenE.AssoLocationStreet.value;
		}
*/
	//------------------------------------------------------------------------------------------
	// ******	check street number of organisations address
/*
	if ((typeof(MainScreenE.TeamAssoLocationStreetNr) == "object") && (typeof(MainScreenE.AssoLocationStreetNr) == "object"))
		{MainScreenE.TeamAssoLocationStreetNr.value = MainScreenE.AssoLocationStreetNr.value;
		}
*/
	//------------------------------------------------------------------------------------------
	// ******	check postcode of organisations address
/*
	if ((typeof(MainScreenE.TeamAssoLocationPostcode) == "object") && (typeof(MainScreenE.AssoLocationPostcode) == "object"))
		{MainScreenE.TeamAssoLocationPostcode.value = MainScreenE.AssoLocationPostcode.value;
		}
*/
	//------------------------------------------------------------------------------------------
	// ******	check city of organisations address
/*
	if ((typeof(MainScreenE.TeamAssoLocationCity) == "object") && (typeof(MainScreenE.AssoLocationCity) == "object"))
		{MainScreenE.TeamAssoLocationCity.value = MainScreenE.AssoLocationCity.value;
		}
*/
	//------------------------------------------------------------------------------------------
	// ******	check id of location
	if (typeof(MainScreenE.TeamAssoLocationId) == "object")
		{if (MainScreenE.TeamAssoLocationId.value == "")
			{alert ("Heimhalle fehlerhaft - bitte aendern!");
			return;
			}
		}


	MainScreenE.Team0AssoName.value = MainScreenE.HashAssoName.value;

	MainScreenE.SWAction.value = "COMPTEAMSAVE";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPDATASHOW";
	doMainMenuFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	set location of a new team for a competition of type "_REG"
/*OK*/
function doUVolleyIndoorXCompTeamRegLocationId(objLocationId)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.TeamAssoLocationId.value = objLocationId;
}

//---------------------------------------------------------------------------------------------
// ******	give possibility to update competition with new team
/*OK*/
function doUVolleyIndoorXCompTeamNew()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "COMPTEAMUPD";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPTEAMUPD";
	doMainMenuFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	update competition with new team
/*OK*/
function doUVolleyIndoorXCompTeamUpd()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var TeamTableId,TeamAssoName,TeamAssoShortName,TeamAssoToCId,intJ,intK,strX;

	for (intI=0;intI<20;intI++)
		{TeamTableId = "Team" +intI;
		TeamAssoName,TeamAssoShortName,TeamAssoToCId;

		if (parent.MainScreenFrame.document.getElementById(TeamTableId).style.display == "none")
			{TeamAssoName = "Team" +intI +"AssoName";
			TeamAssoShortName = "Team" +intI +"AssoShortName";
			TeamAssoToCId = "Team" +intI +"AssoToCId";

			strX = MainScreenE.CompTeamUpdClubsOpts.options[MainScreenE.CompTeamUpdClubsOpts.options.selectedIndex].text;

			intJ = strX.indexOf("(")
			MainScreenE[TeamAssoName].value = strX.substring(0,intJ -1)

			intK = strX.indexOf(")")
			MainScreenE[TeamAssoShortName].value = strX.substring(intJ +1,intK)

			MainScreenE[TeamAssoToCId].value = MainScreenE.CompTeamUpdClubsOpts.options[MainScreenE.CompTeamUpdClubsOpts.options.selectedIndex].value.substr(0,14);

			parent.MainScreenFrame.document.getElementById(TeamTableId).style.display = "block";
			return;
			}
		}
}

//-------------------------------------------------------------------
// ******	remove a new selected team within this competition
/*OK*/
function doUVolleyIndoorXCompTeamUpdRemove(objTeamTableId)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE[objTeamTableId +"AssoName"].value = "";
	MainScreenE[objTeamTableId +"AssoShortName"].value = "";
	MainScreenE[objTeamTableId +"AssoToCId"].value = "";
	parent.MainScreenFrame.document.getElementById(objTeamTableId).style.display = "none";
}

//-------------------------------------------------------------------
// ******	update competition with new team and save
/*OK*/
function doUVolleyIndoorXCompTeamNewSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XCOMPTEAMNEWSAVE";
	doMainScreenFSubmit();
}

//-------------------------------------------------------------------
// ******	update competition with an existiting team from existing comp
/*OK*/
function doUVolleyIndoorXCompTeamFromOldComp()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "COMPTEAMFROMOLDCOMP";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPTEAMFROMOLDCOMP";
	doMainMenuFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	update competition with new team from an older competition
/*OK*/
function doUVolleyIndoorXCompTeamFromOldCompUpd()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (MainScreenE.CompTeamFromOldCompUpdClubsOpts.options[MainScreenE.CompTeamFromOldCompUpdClubsOpts.options.selectedIndex].value == "")
		{alert ("Bewerb auswaehlen");
		return;
		}

	MainScreenE.CompTeamFromOldCompUpdCompDoc.value = MainScreenE.CompTeamFromOldCompUpdClubsOpts.options[MainScreenE.CompTeamFromOldCompUpdClubsOpts.options.selectedIndex].value;

	MainScreenE.SWAction.value = "COMPTEAMFROMOLDCOMPUPD";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPTEAMFROMOLDCOMPUPD";
	doMainMenuFSubmit();
}


//---------------------------------------------------------------------------------------------
// ******	update competition with new team from an older competition and save
/*OK*/
function doUVolleyIndoorXCompTeamFromOldCompSave()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (typeof(MainScreenE.CompTeamFromOldComp.length) == "number")
		{var intI=0;
		while (intI < MainScreenE.CompTeamFromOldComp.length)
			{if (MainScreenE.CompTeamFromOldComp[intI].checked == true)
				{if (isNaN(MainScreenE.CompTeamFromOldComp[intI+2].value) == true)
					{alert ("Tabellenpunkte " +MainScreenE.CompTeamFromOldComp[intI+2].value +" fehlerhaft");
					return;
					}
				else
					{if (MainScreenE.CompTeamFromOldComp[intI+2].value < 10)
						{MainScreenE.CompTeamFromOldComp[intI+2].value = "00000" + MainScreenE.CompTeamFromOldComp[intI+2].value;
						}
					else
						{if (MainScreenE.CompTeamFromOldComp[intI+2].value < 100)
							{MainScreenE.CompTeamFromOldComp[intI+2].value = "0000" + MainScreenE.CompTeamFromOldComp[intI+2].value;
							}
						else
							{if (MainScreenE.CompTeamFromOldComp[intI+2].value < 1000)
								{MainScreenE.CompTeamFromOldComp[intI+2].value = "000" + MainScreenE.CompTeamFromOldComp[intI+2].value;
								}
							else
								{if (MainScreenE.CompTeamFromOldComp[intI+2].value < 10000)
									{MainScreenE.CompTeamFromOldComp[intI+2].value = "00" + MainScreenE.CompTeamFromOldComp[intI+2].value;
									}
								else
									{if (MainScreenE.CompTeamFromOldComp[intI+2].value < 100000)
										{MainScreenE.CompTeamFromOldComp[intI+2].value = "0" + MainScreenE.CompTeamFromOldComp[intI+2].value;
										}
									}
								}
							}
						}
					}
//				alert ("Tabellenpunkte " +MainScreenE.CompTeamFromOldComp[intI+2].value +" richtig");
				}
			intI = intI +3;
			}
		}

	MainScreenE.SWAction.value = "COMPTEAMFROMOLDCOMPSAVE";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPTEAMFROMOLDCOMP";
	doMainMenuFSubmit();
}


//---------------------------------------------------------------------------------------------
// ******	remove team from competition
/*OK*/
function doUVolleyIndoorXCompTeamRemoveUpd()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "COMPTEAMREMOVEUPD";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPTEAMREMOVEUPD";
	doMainMenuFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	set teams in first round
/*OK*/
function doUVolleyIndoorXCompR16SeedUpd()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XCOMPR16SEEDUPD";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "XCOMPR16SEEDUPD";
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
/*OK*/
function doUVolleyInoorXCompR16SeedTry(objR16TeamSeedName)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var objR16TeamSeedNameTry = objR16TeamSeedName +"Try";

	if (MainScreenE[objR16TeamSeedName].value != MainScreenE[objR16TeamSeedNameTry].value)
		{if (doSAisNaN(MainScreenE[objR16TeamSeedName].value) == false)
			{if (MainScreenE[objR16TeamSeedName].value.toUpperCase() == "FREILOS")
				{MainScreenE[objR16TeamSeedName].value = "Freilos";
				MainScreenE[objR16TeamSeedNameTry].value = "Freilos";
				return;
				}
			else
				{MainScreenE[objR16TeamSeedName].value = MainScreenE[objR16TeamSeedNameTry].value;
				MainScreenE[objR16TeamSeedName].focus();
				MainScreenE[objR16TeamSeedName].select();
				alert ("Nummer Team nicht in Setzliste");
				return;
				}
			}

		for (intI=0;intI<MainScreenE.TeamData.length;intI=intI+4)
			{if (Number(MainScreenE.TeamData[intI].value) == Number(MainScreenE[objR16TeamSeedName].value))
				{MainScreenE[objR16TeamSeedNameTry].value = MainScreenE.TeamData[intI +3].value;
				return;
				}
			}

		MainScreenE[objR16TeamSeedName].value = MainScreenE[objR16TeamSeedNameTry].value;
		MainScreenE[objR16TeamSeedName].focus();
		MainScreenE[objR16TeamSeedName].select();
		alert ("Nummer Team nicht in Setzliste");
		}
}

//-------------------------------------------------------------------
/*OK*/
function doUVolleyInoorXCompR16SeedSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XCOMPR16SEEDSAVE";
	doMainScreenFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	save removed team from competition
/*OK*/
function doUVolleyIndoorXCompTeamRemoveSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "COMPTEAMREMOVESAVE";
	doMainScreenFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	create games for competition
/*OK*/
function doUVolleyIndoorXCompGameNewUpd()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "COMPGAMENEWUPD";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPGAMENEWUPD";
	doMainMenuFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	save created games for competition
/*OK*/
function doUVolleyIndoorXCompGameNewSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var intI,intJ,strX,doTeamDataRC;

	// ===============================================================
	//	maybe delete of round
	if ((MainScreenE.RDateDDupd.value == "") && (MainScreenE.RDateMMupd.value == "") && (MainScreenE.RDateYYYYupd.value == "") && (MainScreenE.RTimeHHupd.value == "") && (MainScreenE.RTimeMMupd.value == "") && (MainScreenE.RdWildcardYNcheckbox.checked == false) && (MainScreenE.RRdupd.value == "") && (MainScreenE.RT1upd.value == "") && (MainScreenE.RT2upd.value == "") && (MainScreenE.RT3upd.value == "") && (MainScreenE.RT4upd.value == "") && (MainScreenE.RT5upd.value == "") && (MainScreenE.RT6upd.value == "") && (MainScreenE.RT7upd.value == "") && (MainScreenE.RT8upd.value == "") && (MainScreenE.RRefereeupd.value == "") && (MainScreenE.ROrganizerupd.value == "") && (MainScreenE.RPlaceupd.value == ""))
		{MainScreenE.FrameReady.value = "";
//		doMainProcessInWorkWindow();
		MainScreenE.SWAction.value = "XCOMPGAMENEWSAVE";
		doMainScreenFSubmit();
		return;
		}

	// ===============================================================
	//	make wildcards
	if (MainScreenE.RdWildcardYNcheckbox.checked == true)
		{MainScreenE.RdWildcardYNupd.value = "Y";
		}
	else
		{MainScreenE.RdWildcardYNupd.value = "N";
		}

	// ===============================================================
	//	proof round
	if ((isNaN(MainScreenE.RRdupd.value) == true) || (MainScreenE.RRdupd.value == "") || (MainScreenE.RRdupd.value.indexOf(".") > -1) || (MainScreenE.RRdupd.value.indexOf(" ") > -1) || (parseInt(MainScreenE.RRdupd.value) == 0))
		{alert ("Runde fehlerhaft");
		MainScreenE.RRdupd.select();
		return;
		}

	// ===============================================================
	//	proof fields because of playing games
	if ((parseInt(MainScreenE.RRdupd.value) > 0) && (MainScreenE.RdWildcardYNupd.value == "N"))
		{// ===============================================================
		//	proof date
		intJ = MainScreenE.RDateDDupd.value.indexOf(".");
		if (doDateTimeRC = (doDDValidity(MainScreenE.RDateDDupd.value,intJ) == false))
			{alert ("Datum/Tag fehlerhaft");
			MainScreenE.RDateDDupd.select();
			return;
			}

		intJ = MainScreenE.RDateMMupd.value.indexOf(".");
		if (doDateTimeRC = (doMMValidity(MainScreenE.RDateMMupd.value,intJ) == false))
			{alert ("Datum/Monat fehlerhaft");
			MainScreenE.RDateMMupd.select();
			return;
			}

		intJ = MainScreenE.RDateYYYYupd.value.indexOf(".");
		if (doDateTimeRC = (doYYYYValidity(MainScreenE.RDateYYYYupd.value,intJ) == false))
			{alert ("Datum/Jahr fehlerhaft");
			MainScreenE.RDateYYYYupd.select();
			return;
			}
		strX = new Date();
		if (parseInt(MainScreenE.RDateYYYYupd.value) <  parseInt(strX.getFullYear()))
			{alert ("Datum/Jahr fehlerhaft");
			MainScreenE.RDateYYYYupd.select();
			return;
			}

		if (doDateTimeRC = (doDateValidity(MainScreenE.RDateDDupd.value,MainScreenE.RDateMMupd.value) == false))
			{alert ("Ungueltiges Datum");
			MainScreenE.RDateDDupd.select();
			return;
			}

		if (doDateTimeRC = (doLeapYearValidity(MainScreenE.RDateDDupd.value,MainScreenE.RDateMMupd.value,MainScreenE.RDateYYYYupd.value) == false))
			{MainScreenE.RDateDDupd.select();
			alert ("Ungueltiges Datum");
			return;
			}

		// ===============================================================
		//	proof time
		if (doDateTimeRC = (doTimeHHValidity(MainScreenE.RTimeHHupd.value) == false))
			{alert ("Zeit/HH fehlerhaft");
			MainScreenE.RTimeHHupd.select();
			return;
			}

		if (doDateTimeRC = (doTimeMMValidity(MainScreenE.RTimeMMupd.value) == false))
			{alert ("Zeit/MM fehlerhaft");
			MainScreenE.RTimeMMupd.select();
			return;
			}

		// ===============================================================
		//	proof referee
		if (MainScreenE.RRefereeupd.value!="")
			{if (MainScreenE.RModeupd.value != "M12")
				{MainScreenE.RRefereeupd.value == "";
				}
			else
				{if (doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.RRefereeupd.value) == false))
					{alert ("S - Schiedsrichter fehlerhaft");
					MainScreenE.RRefereeupd.select();
					return;
					}
				}
			}

		// ===============================================================
		//	proof organizer and place
		if (doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.ROrganizerupd.value) == false))
			{alert ("V - Veranstalter fehlerhaft");
			MainScreenE.ROrganizerupd.select();
			return;
			}

		if (MainScreenE.RPlaceupd.value == "")
			{alert ("Ort/Halle fehlerhaft");
			MainScreenE.RPlaceupd.select();
			return;
			}
		MainScreenE.RPlaceupd.value = MainScreenE.RPlaceupd.value.replace(/,/g," ");
		}

	// ===============================================================
	//	clear fields because of wildcard
	if ((parseInt(MainScreenE.RRdupd.value) > 0) && (MainScreenE.RdWildcardYNupd.value == "Y"))
		{MainScreenE.RDateDDupd.value = "";
		MainScreenE.RDateMMupd.value = "";
		MainScreenE.RDateYYYYupd.value = "";
		MainScreenE.RTimeHHupd.value = "";
		MainScreenE.RTimeMMupd.value = "";
		MainScreenE.ROrganizerupd.value = "";
		MainScreenE.RPlaceupd.value = "";
		}

	// ===============================================================
	//	proof teams 1 - 8
	if ((doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.RT1upd.value) == false)) || (MainScreenE.RT1upd.value == 0))
		{alert ("T1 - Team 1 fehlerhaft");
		MainScreenE.RT1upd.select();
		return;
		}
	if (MainScreenE.RdWildcardYNupd.value == "N")
		{if ((doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.RT2upd.value)== false)) || (MainScreenE.RT2upd.value == 0))
			{alert ("T2 - Team 2 fehlerhaft");
			MainScreenE.RT2upd.select();
			return;
			}
		}
	else
		{if (MainScreenE.RT2upd.value != "")
			{if ((doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.RT2upd.value)== false)) || (MainScreenE.RT2upd.value == 0))
				{alert ("T2 - Team 2 fehlerhaft");
				MainScreenE.RT2upd.select();
				return;
				}
			}
		}
	if (MainScreenE.RT3upd.value != "")
		{if ((doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.RT3upd.value)== false)) || (MainScreenE.RT3upd.value == 0))
			{alert ("T3 - Team 3 fehlerhaft");
			MainScreenE.RT3upd.select();
			return;
			}
		}
	if (MainScreenE.RT4upd.value != "")
		{if ((doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.RT4upd.value)== false)) || (MainScreenE.RT4upd.value == 0))
			{alert ("T4 - Team 4 fehlerhaft");
			MainScreenE.RT4upd.select();
			return;
			}
		}
	if (MainScreenE.RT5upd.value != "")
		{if ((doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.RT5upd.value)== false)) || (MainScreenE.RT5upd.value == 0))
			{alert ("T5 - Team 5 fehlerhaft");
			MainScreenE.RT5upd.select();
			return;
			}
		}
	if (MainScreenE.RT6upd.value != "")
		{if ((doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.RT6upd.value)== false)) || (MainScreenE.RT6upd.value == 0))
			{alert ("T6 - Team 6 fehlerhaft");
			MainScreenE.RT6upd.select();
			return;
			}
		}
	if (MainScreenE.RT7upd.value != "")
		{if ((doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.RT7upd.value)== false)) || (MainScreenE.RT7upd.value == 0))
			{alert ("T7 - Team 7 fehlerhaft");
			MainScreenE.RT7upd.select();
			return;
			}
		}
	if (MainScreenE.RT8upd.value != "")
		{if ((doTeamDataRC = (doUVolleyIndoorTeamDataValidity(MainScreenE.RT8upd.value)== false)) || (MainScreenE.RT8upd.value == 0))
			{alert ("T8 - Team 8 fehlerhaft");
			MainScreenE.RT8upd.select();
			return;
			}
		}

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();
	MainScreenE.SWAction.value = "XCOMPGAMENEWSAVE";
	doMainScreenFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	set location of organizer
/*OK*/
function doUVolleyIndoorXCompGameNewLocation()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intI,intJ,intK;

//	alert (MainScreenE.RdData.length);

	intI=0;
	while (intI < MainScreenE.RdData.length)
		{MainScreenE.RdData[intI +8].value = "";

		var intJ = parseInt(MainScreenE.RdData[intI +7].value);
		var intK=0;

		while (intK < MainScreenE.TeamData.length)
			{if (parseInt(MainScreenE.TeamData[intK].value) == intJ)
				{MainScreenE.RdData[intI +8].value = MainScreenE.TeamData[intK +3].value;

				intK = MainScreenE.TeamData.length;
				}
		
			intK = intK +4;
			}

		intI = intI +19;
		}
}

//---------------------------------------------------------------------------------------------
// ******	set organizer
/*OK*/
function doUVolleyIndoorXCompGameNewUpdOrganizer()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if ((isNaN(MainScreenE.RT1upd.value) == false) && (MainScreenE.RT1upd.value.indexOf(".") == -1) && (MainScreenE.RT1upd.value.indexOf(" ") == -1) && (MainScreenE.RT1upd.value != ""))
		{MainScreenE.ROrganizerupd.value = MainScreenE.RT1upd.value;
		doUVolleyIndoorXCompGameNewUpdLocation();
		}
}

//---------------------------------------------------------------------------------------------
// ******	set location of organizer
/*OK*/
function doUVolleyIndoorXCompGameNewUpdLocation()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intK=0;

	MainScreenE.RPlaceupd.value = "";

	if ((isNaN(MainScreenE.ROrganizerupd.value) == false) && (MainScreenE.ROrganizerupd.value.indexOf(".") == -1) && (MainScreenE.ROrganizerupd.value.indexOf(" ") == -1) && (MainScreenE.ROrganizerupd.value != ""))
		{while (intK < MainScreenE.TeamData.length)
			{if (Math.abs(MainScreenE.TeamData[intK].value) == Math.abs(MainScreenE.ROrganizerupd.value))
				{MainScreenE.RPlaceupd.value = MainScreenE.TeamData[intK +3].value;

				intK = MainScreenE.TeamData.length;
				}
			intK = intK +4;
			}
		}
}

//-------------------------------------------------------------------
// ******	update round data
/*OK*/
function doUVolleyIndoorXCompGameNewUpdRoundReset()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.RDateDDupd.value = "";
	MainScreenE.RDateMMupd.value = "";
	MainScreenE.RDateYYYYupd.value = "";
	MainScreenE.RTimeHHupd.value = "";
	MainScreenE.RTimeMMupd.value = "";
	MainScreenE.RdWildcardYNcheckbox.checked = false;
	MainScreenE.RdWildcardYNupd.value = "N";
	MainScreenE.RRdupd.value = "";
	MainScreenE.RT1upd.value = "";
	MainScreenE.RT2upd.value = "";
	MainScreenE.RT3upd.value = "";
	MainScreenE.RT4upd.value = "";
	MainScreenE.RT5upd.value = "";
	MainScreenE.RT6upd.value = "";
	MainScreenE.RT7upd.value = "";
	MainScreenE.RT8upd.value = "";
	MainScreenE.ROrganizerupd.value = "";
	MainScreenE.RPlaceupd.value = "";
}

//-------------------------------------------------------------------
// ******	update round data
/*OK*/
function doUVolleyIndoorXCompGameNewUpdRoundUpd(objMenuDelete, objDateDD, objDateMM, objDateYYYY, objTimeHH, objTimeMM, objRd, objOrganizer)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var intI=0;

	while (intI<MainScreenE.RdDataUpd.length)
		{if ((MainScreenE.RdDataUpd[intI].value == objDateDD) && (MainScreenE.RdDataUpd[intI +1].value == objDateMM) && (MainScreenE.RdDataUpd[intI +2].value == objDateYYYY) && (MainScreenE.RdDataUpd[intI +3].value == objTimeHH) && (MainScreenE.RdDataUpd[intI +4].value == objTimeMM) && (MainScreenE.RdDataUpd[intI +19].value == objOrganizer))
			{var strDisplayId;

			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayDateTimeWc")
			if (document.getElementById(strDisplayId).style.display == "none")
				{alert ("Aendern nicht moeglich - Runde muss zuerst wieder hergestellt werden");
				return;
				}
			}
		intI = intI +20;
		}

	doUVolleyIndoorXCompGameNewUpdRoundDel(objMenuDelete, objDateDD, objDateMM, objDateYYYY, objTimeHH, objTimeMM, objRd, objOrganizer);

	intI=0;

	while (intI<MainScreenE.RdDataUpd.length)
		{if ((MainScreenE.RdDataUpd[intI].value == objDateDD) && (MainScreenE.RdDataUpd[intI +1].value == objDateMM) && (MainScreenE.RdDataUpd[intI +2].value == objDateYYYY) && (MainScreenE.RdDataUpd[intI +3].value == objTimeHH) && (MainScreenE.RdDataUpd[intI +4].value == objTimeMM) && (MainScreenE.RdDataUpd[intI +7].value == objRd) && (MainScreenE.RdDataUpd[intI +19].value == objOrganizer))
			{MainScreenE.RDateDDupd.value = MainScreenE.RdDataUpd[intI].value;
			MainScreenE.RDateMMupd.value = MainScreenE.RdDataUpd[intI +1].value;
			MainScreenE.RDateYYYYupd.value = MainScreenE.RdDataUpd[intI +2].value;
			MainScreenE.RTimeHHupd.value = MainScreenE.RdDataUpd[intI +3].value;
			MainScreenE.RTimeMMupd.value = MainScreenE.RdDataUpd[intI +4].value;
			if (MainScreenE.RdDataUpd[intI +5].value == "J")
				{MainScreenE.RdWildcardYNcheckbox.checked = true;
				MainScreenE.RdWildcardYNupd.value = "Y";
				}
			else
				{MainScreenE.RdWildcardYNcheckbox.checked = false;
				MainScreenE.RdWildcardYNupd.value = "N";
				}
			MainScreenE.RModeupd.value = MainScreenE.RdDataUpd[intI +6].value;
			MainScreenE.RRdupd.value = MainScreenE.RdDataUpd[intI +7].value;
			MainScreenE.RT1upd.value = MainScreenE.RdDataUpd[intI +8].value;
			MainScreenE.RT2upd.value = MainScreenE.RdDataUpd[intI +9].value;
			MainScreenE.RT3upd.value = MainScreenE.RdDataUpd[intI +10].value;
			MainScreenE.RT4upd.value = MainScreenE.RdDataUpd[intI +11].value;
			MainScreenE.RT5upd.value = MainScreenE.RdDataUpd[intI +12].value;
			MainScreenE.RT6upd.value = MainScreenE.RdDataUpd[intI +13].value;
			MainScreenE.RT7upd.value = MainScreenE.RdDataUpd[intI +14].value;
			MainScreenE.RT8upd.value = MainScreenE.RdDataUpd[intI +15].value;
			MainScreenE.RRefereeupd.value = MainScreenE.RdDataUpd[intI +16].value;
			MainScreenE.ROrganizerupd.value = MainScreenE.RdDataUpd[intI +17].value;
			MainScreenE.RPlaceupd.value = MainScreenE.RdDataUpd[intI +18].value;

			intI = MainScreenE.RdDataUpd.length
			}
		intI = intI +20;
		}
}

//-------------------------------------------------------------------
// ******	delete round data
/*OK*/
function doUVolleyIndoorXCompGameNewUpdRoundDel(objMenuDelete, objDateDD, objDateMM, objDateYYYY, objTimeHH, objTimeMM, objRd, objOrganizer)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intI=0;
	var intJ=-1;
	var intK;

	while (intI<MainScreenE.RdDataUpd.length)
		{if ((MainScreenE.RdDataUpd[intI].value == objDateDD) && (MainScreenE.RdDataUpd[intI +1].value == objDateMM) && (MainScreenE.RdDataUpd[intI +2].value == objDateYYYY) && (MainScreenE.RdDataUpd[intI +3].value == objTimeHH) && (MainScreenE.RdDataUpd[intI +4].value == objTimeMM) && (MainScreenE.RdDataUpd[intI +7].value == objRd) && (MainScreenE.RdDataUpd[intI +19].value == objOrganizer))
			{if (Math.abs(intI) == 0)
				{intK = 0;
				}
			else
				{intK = parseInt(intJ) *9 +9;
				}

			if (MainScreenE.RdDataDel[intK].value == "N")
				{MainScreenE.RdDataDel[intK].value = "Y"
				MainScreenE.RdDataDel[intK +1].value = MainScreenE.RdDataUpd[intI].value;
				MainScreenE.RdDataDel[intK +2].value = MainScreenE.RdDataUpd[intI +1].value;
				MainScreenE.RdDataDel[intK +3].value = MainScreenE.RdDataUpd[intI +2].value;
				MainScreenE.RdDataDel[intK +4].value = MainScreenE.RdDataUpd[intI +3].value;
				MainScreenE.RdDataDel[intK +5].value = MainScreenE.RdDataUpd[intI +4].value;
				MainScreenE.RdDataDel[intK +6].value = MainScreenE.RdDataUpd[intI +7].value;
				MainScreenE.RdDataDel[intK +7].value = objMenuDelete.substr(objMenuDelete.length -3,3);
				MainScreenE.RdDataDel[intK +8].value = MainScreenE.RdDataUpd[intI +19].value;
				}
			else
				{MainScreenE.RdDataDel[intK].value = "N"
				MainScreenE.RdDataDel[intK +1].value = "";
				MainScreenE.RdDataDel[intK +2].value = "";
				MainScreenE.RdDataDel[intK +3].value = "";
				MainScreenE.RdDataDel[intK +4].value = "";
				MainScreenE.RdDataDel[intK +5].value = "";
				MainScreenE.RdDataDel[intK +6].value = "";
				MainScreenE.RdDataDel[intK +7].value = "";
				MainScreenE.RdDataDel[intK +8].value = "";
				}

			var strDisplayId;
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayDateTimeWc")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayMode")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayRd")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayT1")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayT2")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayT3")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayT4")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayT5")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayT6")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayT7")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayT8")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayReferee")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayOrganizer")
			doObjDisplaySwitch(strDisplayId);
			strDisplayId = objMenuDelete.replace(/MenuDelete/,"DisplayPlace")
			doObjDisplaySwitch(strDisplayId);

			intI = MainScreenE.RdDataUpd.length
			}
		intI = intI +20;
		intJ = intJ +1;
		}
}

//---------------------------------------------------------------------------------------------
// ******	handle publishing email
/*OK*/
function doUVolleyIndoorXCompDataeMail1Upd()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XCOMPDATAEMAIL1UPD";
	doMainScreenFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	send publishing email
/*OK*/
function doUVolleyIndoorXCompDataeMail1Send()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XCOMPDATAEMAIL1SEND";
	doMainScreenFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	save/update result from a competitions match
/*OK*/
function doUVolleyIndoorXCompResultUpd(objCompFile,objGameNr)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (objCompFile != "")
		{MainScreenE.CompFile.value = objCompFile;
		MainScreenE.GameNr.value = objGameNr;
		}
	MainScreenE.SWAction.value = "COMPRESULTUPD";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPRESULTUPD";
	doMainMenuFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	save/update golden set result from a competitions match
/*OK*/
function doUVolleyIndoorXCompGSResultUpd(objCompFile,objGameNr)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (objCompFile != "")
		{MainScreenE.CompFile.value = objCompFile;
		MainScreenE.GameNr.value = objGameNr;
		}
	MainScreenE.SWAction.value = "XCOMPGSRESULTUPD";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "XCOMPGSRESULTUPD";
	doMainMenuFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	provide referee fields from a competitions match
/*OK*/

//	function doUVolleyIndoorXCompResetRefereeListbox(RefOpts,RefLastName,RefFirstName,RefNumber)
function doUVolleyIndoorXCompResetRefereeListbox(RefOpts)
{	RefOpts.options.selectedIndex = -1;
/*
	if (typeof(RefLastName) == "object")
		{RefLastName.value = "anwesend";
		RefLastName.style.visibility = "visible";
		}
	if (typeof(RefFirstName) == "object")
		{RefFirstName.value = "Nicht";
		RefFirstName.style.visibility = "visible";
		}
	if (typeof(RefNumber) == "object")
		{RefNumber.value = "Nr.";
		RefNumber.style.visibility = "visible";
		}
*/
}

//---------------------------------------------------------------------------------------------
// ******	set penalty from a competitions match
/*OK*/
function doUVolleyIndoorXCompPenalty(OfficialPenalty)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (OfficialPenalty.checked == true)
		{alert ("Ergebnis und Vorzeichen Punkte setzen");

		MainScreenE.XCompTeam1Sets.value = "0:";
		MainScreenE.XCompTeam1Sets.value = "0:";
		MainScreenE.XCompTeam2Sets.value = "0";
		MainScreenE.XCompSet1.value = "0:0";
		MainScreenE.XCompSet2.value = "0:0";
		if (parseInt(MainScreenE.CompSetsToWin.value) == 3)
			{MainScreenE.XCompSet3.value = "0:0";
			}
		else
			{MainScreenE.XCompSet3.value = "";
			}
		MainScreenE.XCompSet4.value = "";
		MainScreenE.XCompSet5.value = "";

		MainScreenE.CompTeam1SetsOpts.options.selectedIndex = 0;
		MainScreenE.CompTeam2SetsOpts.options.selectedIndex = 0;

		MainScreenE.CompSet1SignOpts.options.selectedIndex = -1;
		MainScreenE.CompSet1PointOpts.options.selectedIndex = 0;

		MainScreenE.CompSet2SignOpts.options.selectedIndex = -1;
		MainScreenE.CompSet2PointOpts.options.selectedIndex = 0;

		if (parseInt(MainScreenE.CompSetsToWin.value) == 3)
			{MainScreenE.CompSet3SignOpts.options.selectedIndex = -1;
			MainScreenE.CompSet3PointOpts.options.selectedIndex = 0;
			}
		else
			{MainScreenE.CompSet3SignOpts.options.selectedIndex = -1;
			MainScreenE.CompSet3PointOpts.options.selectedIndex = -1;
			}

		MainScreenE.CompSet4SignOpts.options.selectedIndex = -1;
		MainScreenE.CompSet4PointOpts.options.selectedIndex = -1;

		MainScreenE.CompSet5SignOpts.options.selectedIndex = -1;
		MainScreenE.CompSet5PointOpts.options.selectedIndex = -1;
		}
}

//---------------------------------------------------------------------------------------------
// ******	build/show result while updating listboxes from a competitions match
/*OK*/
function doUVolleyIndoorXCompResultBuild(objXCompResult)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	switch (objXCompResult)
		{case "CompTeam1SetsOpts":
			MainScreenE.XCompTeam1Sets.value = MainScreenE.CompTeam1SetsOpts.options[MainScreenE.CompTeam1SetsOpts.options.selectedIndex].text +":";
			break;

		case "CompTeam2SetsOpts":
			MainScreenE.XCompTeam2Sets.value = MainScreenE.CompTeam2SetsOpts.options[MainScreenE.CompTeam2SetsOpts.options.selectedIndex].text;
			break;

		default:
			var strPointOpts = objXCompResult;
			var strSignOpts = objXCompResult.replace(/PointOpts/,"SignOpts");
			if ((MainScreenE[strSignOpts].options.selectedIndex == -1) || (MainScreenE[strPointOpts].options.selectedIndex == -1))
				{return;
				}

			var strXCompSet = "";
			var intSetPointsMax = 25;
			var SetPoints = parseInt(MainScreenE[strPointOpts].options[MainScreenE[strPointOpts].options.selectedIndex].text);
			switch (objXCompResult)
				{case "CompSet1PointOpts":
					strXCompSet = "XCompSet1";
					break;
				case "CompSet2PointOpts":
					strXCompSet = "XCompSet2";
					break;
				case "CompSet3PointOpts":
					strXCompSet = "XCompSet3";
					if (MainScreenE.CompSetsToWin.value == 2)
						{intSetPointsMax = 15;
						}
					break;
				case "CompSet4PointOpts":
					strXCompSet = "XCompSet4";
					break;
				case "CompSet5PointOpts":
					strXCompSet = "XCompSet5";
					if (MainScreenE.CompSetsToWin.value == 3)
						{intSetPointsMax = 15;
						}
					break;
				}

			if (MainScreenE[strSignOpts].options[MainScreenE[strSignOpts].options.selectedIndex].text == "+")
				{if (Math.abs(SetPoints) < Math.abs(parseInt(intSetPointsMax) -1))
					{MainScreenE[strXCompSet].value = " " +intSetPointsMax +":" +SetPoints +" ";
					}
				else
					{MainScreenE[strXCompSet].value = " " +Math.abs(parseInt(SetPoints) +2) +":" +SetPoints +" ";
					}
				}
			else
				{if (Math.abs(SetPoints) < Math.abs(parseInt(intSetPointsMax) -1))
					{MainScreenE[strXCompSet].value = " " +SetPoints +":" +intSetPointsMax +" ";
					}
				else
					{MainScreenE[strXCompSet].value = " " +SetPoints +":" +Math.abs(parseInt(SetPoints) +2) +" ";
					}
				}
			break;
		}
}

//---------------------------------------------------------------------------------------------
// ******	check and save result from a competitions match
/*OK*/
function doUVolleyIndoorXCompResultSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	if ((MainScreenE.CompTeam1SetsOpts.options.selectedIndex == -1) || (MainScreenE.CompTeam2SetsOpts.options.selectedIndex == -1))
		{alert ("Unvollstaendinge Eingabe in Spalte: Ergebnis");
		return;
		}

	var intError;
	var CompTeam1Sets = parseInt(MainScreenE.CompTeam1SetsOpts.options[MainScreenE.CompTeam1SetsOpts.options.selectedIndex].text)
	var CompTeam2Sets = parseInt(MainScreenE.CompTeam2SetsOpts.options[MainScreenE.CompTeam2SetsOpts.options.selectedIndex].text)
	var SetSummary = CompTeam1Sets + CompTeam2Sets;

	if ((parseInt(SetSummary) == 0) || (parseInt(SetSummary) == 6))
		{alert ("Falsche Eingabe in Spalte: Ergebnis");
		return;
		}

	var CompSet1SignSelectedIndex = MainScreenE.CompSet1SignOpts.options.selectedIndex;
	var CompSet1PointsSelectedIndex = MainScreenE.CompSet1PointOpts.options.selectedIndex;
	var CompSet2SignSelectedIndex = MainScreenE.CompSet2SignOpts.options.selectedIndex;
	var CompSet2PointsSelectedIndex = MainScreenE.CompSet2PointOpts.options.selectedIndex;
	var CompSet3SignSelectedIndex = MainScreenE.CompSet3SignOpts.options.selectedIndex;
	var CompSet3PointsSelectedIndex = MainScreenE.CompSet3PointOpts.options.selectedIndex;
	var CompSet4SignSelectedIndex = MainScreenE.CompSet4SignOpts.options.selectedIndex;
	var CompSet4PointsSelectedIndex = MainScreenE.CompSet4PointOpts.options.selectedIndex;
	var CompSet5SignSelectedIndex = MainScreenE.CompSet5SignOpts.options.selectedIndex;
	var CompSet5PointsSelectedIndex = MainScreenE.CompSet5PointOpts.options.selectedIndex;

	if ((CompSet1SignSelectedIndex == -1) && (CompSet1PointsSelectedIndex == -1))
		{alert ("Unvollstaendige Eingabe in Spalte: 1. Satz");
		return;
		}
	if ((CompSet1SignSelectedIndex > -1) && (CompSet1PointsSelectedIndex == -1))
		{alert ("Unvollstaendige Eingabe in Spalte: 1. Satz");
		return;
		}
	if ((CompSet1SignSelectedIndex == -1) && (CompSet1PointsSelectedIndex > -1))
		{alert ("Unvollstaendige Eingabe in Spalte: 1. Satz");
		return;
		}

	switch (SetSummary)
		{case 1:
			if ((CompSet2SignSelectedIndex > -1) || (CompSet2PointsSelectedIndex > -1) || (CompSet3SignSelectedIndex > -1) || (CompSet3PointsSelectedIndex > -1) || 			(CompSet4SignSelectedIndex > -1) || (CompSet4PointsSelectedIndex > -1) || 			(CompSet5SignSelectedIndex > -1) || (CompSet5PointsSelectedIndex > -1))
				{alert ("Summe gespielte Saetze stimmt nicht mit Anzahl Satzergebnisse ueberein");
				return;
				}
			break;

		default:
			if ((CompSet2SignSelectedIndex == -1) && (CompSet2PointsSelectedIndex == -1))
				{alert ("Unvollstaendige Eingabe in Spalte: 2. Satz");
				return;
				}
			if ((CompSet2SignSelectedIndex > -1) && (CompSet2PointsSelectedIndex == -1))
				{alert ("Unvollstaendige Eingabe in Spalte: 2. Satz");
				return;
				}
			if ((CompSet2SignSelectedIndex == -1) && (CompSet2PointsSelectedIndex > -1))
				{alert ("Unvollstaendige Eingabe in Spalte: 2. Satz");
				return;
				}

			switch (SetSummary)
				{case 2:
					if ((CompSet3SignSelectedIndex > -1) || (CompSet3PointsSelectedIndex > -1) || 
(CompSet4SignSelectedIndex > -1) || (CompSet4PointsSelectedIndex > -1) || 
(CompSet5SignSelectedIndex > -1) || (CompSet5PointsSelectedIndex > -1))
						{alert ("Summe gespielte Saetze stimmt nicht mit Anzahl Satzergebnisse ueberein");
						return;
						}
					break;

				default:
					if ((CompSet3SignSelectedIndex == -1) && (CompSet3PointsSelectedIndex == -1))
						{alert ("Unvollstaendige Eingabe in Spalte: 3. Satz");
						return;
						}
					if ((CompSet3SignSelectedIndex > -1) && (CompSet3PointsSelectedIndex == -1))
						{alert ("Unvollstaendige Eingabe in Spalte: 3. Satz");
						return;
						}
					if ((CompSet3SignSelectedIndex == -1) && (CompSet3PointsSelectedIndex > -1))
						{alert ("Unvollstaendige Eingabe in Spalte: 3. Satz");
						return;
						}
					switch (SetSummary)
						{case 3:
							if ((CompSet4SignSelectedIndex > -1) || (CompSet4PointsSelectedIndex > -1) || 	(CompSet5SignSelectedIndex > -1) || (CompSet5PointsSelectedIndex > -1))
								{alert ("Summe gespielte Saetze stimmt nicht mit Anzahl Satzergebnisse ueberein");
								return;
								}
							break;

						default:
							if ((CompSet4SignSelectedIndex == -1) && (CompSet4PointsSelectedIndex == -1))
								{alert ("Unvollstaendige Eingabe in Spalte: 4. Satz");
								return;
								}
							if ((CompSet4SignSelectedIndex > -1) && (CompSet4PointsSelectedIndex == -1))
								{alert ("Unvollstaendige Eingabe in Spalte: 4. Satz");
								return;
								}
							if ((CompSet4SignSelectedIndex == -1) && (CompSet4PointsSelectedIndex > -1))
								{alert ("Unvollstaendige Eingabe in Spalte: 4. Satz");
								return;
								}
							switch (SetSummary)
								{case 4:
									if ((CompSet5SignSelectedIndex > -1) || (CompSet5PointsSelectedIndex > -1))
										{alert ("Summe gespielte Saetze stimmt nicht mit Anzahl Satzergebnisse ueberein");
										return;
										}
									break;

								default:
									if ((CompSet5SignSelectedIndex == -1) && (CompSet5PointsSelectedIndex == -1))
									{alert ("Unvollstaendige Eingabe in Spalte: 5. Satz");
									return;
									}
									if ((CompSet5SignSelectedIndex > -1) && (CompSet5PointsSelectedIndex == -1))
										{alert ("Unvollstaendige Eingabe in Spalte: 5. Satz");
										return;
										}
									if ((CompSet5SignSelectedIndex == -1) && (CompSet5PointsSelectedIndex > -1))
										{alert ("Unvollstaendige Eingabe in Spalte: 5. Satz");
										return;
										}
									break;
								}
							break;
						}
					break;
				}
			break;
		}


	switch (SetSummary)
		{case 1:
			alert ("Kein Modus fuer 1 Gewinnsatz vorhanden - Eingabe ungueltig");
			return;

		case 2:
			switch (parseInt(MainScreenE.CompSetsToWin.value))
				{case 2:
					if ((CompSet1SignSelectedIndex != CompSet2SignSelectedIndex))
						{alert ("2 Gewinnsaetze - Satzergebnisse ungueltig");
						return;
						}
					if ((CompTeam1Sets == 0) && (MainScreenE.CompSet1SignOpts.options[CompSet1SignSelectedIndex].text == "+"))
						{alert ("Spielergebnis oder Vorzeichen Satzergebnisse ungueltig");
						return;
						}
					if ((CompTeam1Sets == 2) && (MainScreenE.CompSet1SignOpts.options[CompSet1SignSelectedIndex].text == "-"))
						{alert ("Spielergebnis oder Vorzeichen Satzergebnisse ungueltig");
						return;
						}
					break;
				case 3:
					alert ("3 Gewinnsaetze - Eingabe ungueltig");
					return;
				}
			break;

		case 3:
			switch (parseInt(MainScreenE.CompSetsToWin.value))
				{case 2:
					if ((CompSet1SignSelectedIndex == CompSet2SignSelectedIndex))
						{alert ("2 Gewinnsaetze - Satzergebnisse ungueltig");
						return;
						}
					if ((parseInt(CompTeam1Sets) == 2) && (MainScreenE.CompSet3SignOpts.options[CompSet3SignSelectedIndex].text == "-"))
						{alert ("Spielergebnis oder Ergebnis letzter Satz ungueltig");
						return;
						}
					if ((parseInt(CompTeam2Sets) == 2) && (MainScreenE.CompSet3SignOpts.options[CompSet3SignSelectedIndex].text == "+"))
						{alert ("Spielergebnis oder Ergebnis letzter Satz ungueltig");
						return;
						}
					break;
				case 3:
					if ((CompSet1SignSelectedIndex != CompSet2SignSelectedIndex) || (CompSet1SignSelectedIndex != CompSet3SignSelectedIndex))
						{alert ("3 Gewinnsaetze - Satzergebnisse ungueltig");
						return;
						}
					if ((CompTeam1Sets == 0) && (MainScreenE.CompSet1SignOpts.options[CompSet1SignSelectedIndex].text == "+"))
						{alert ("Spielergebnis oder Vorzeichen Satzergebnisse ungueltig");
						return;
						}
					if ((CompTeam1Sets == 3) && (MainScreenE.CompSet1SignOpts.options[CompSet1SignSelectedIndex].text == "-"))
						{alert ("Spielergebnis oder Vorzeichen Satzergebnisse ungueltig");
						return;
						}
					break;
				}
			break;

		case 4:
			if (parseInt(MainScreenE.CompSetsToWin.value) == 2)
				{alert ("2 Gewinnsaetze - Eingabe ungueltig");
				return;
				}
	//------------------------------------------------------------------------------------------
	// ******	3:0 or 0:3 is impossible
			if ((CompSet1SignSelectedIndex == CompSet2SignSelectedIndex) && (CompSet1SignSelectedIndex == CompSet3SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
				return;
				}
	//------------------------------------------------------------------------------------------
	// ******	2:2 is impossible
			if ((CompSet1SignSelectedIndex == CompSet2SignSelectedIndex) && (CompSet3SignSelectedIndex == CompSet4SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
				return;
				}
			if ((CompSet1SignSelectedIndex == CompSet3SignSelectedIndex) && (CompSet2SignSelectedIndex == CompSet4SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
				return;
				}
			if ((CompSet2SignSelectedIndex == CompSet3SignSelectedIndex) && (CompSet1SignSelectedIndex == CompSet4SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
				return;
				}

	//------------------------------------------------------------------------------------------
	// ******	proof 3:1 (-n +n -n -n) bullshit
			var intI = 0;
			if (MainScreenE.CompSet1SignOpts.options[CompSet1SignSelectedIndex].text == "+")
				{intI++;
				}
			if (MainScreenE.CompSet2SignOpts.options[CompSet2SignSelectedIndex].text == "+")
				{intI++;
				}
			if (MainScreenE.CompSet3SignOpts.options[CompSet3SignSelectedIndex].text == "+")
				{intI++;
				}
			if (MainScreenE.CompSet4SignOpts.options[CompSet4SignSelectedIndex].text == "+")
				{intI++;
				}
			if (parseInt(intI) != parseInt(CompTeam1Sets))
				{alert ("Spielergebnis oder Vorzeichen Satzergebnisse ungueltig");
				return;
				}

	//------------------------------------------------------------------------------------------
	// ******	proof all other possible bullshit
			if ((CompSet1SignSelectedIndex == CompSet2SignSelectedIndex) && (CompSet1SignSelectedIndex != CompSet4SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
					return;
				}
			if ((CompSet1SignSelectedIndex == CompSet3SignSelectedIndex) && (CompSet1SignSelectedIndex != CompSet4SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
					return;
				}
			if ((CompSet2SignSelectedIndex == CompSet3SignSelectedIndex) && (CompSet2SignSelectedIndex != CompSet4SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
					return;
				}
			break;

		case 5:
			if (parseInt(MainScreenE.CompSetsToWin.value) == 2)
				{alert ("2 Gewinnsaetze - Eingabe ungueltig");
				return;
				}
	//------------------------------------------------------------------------------------------
	// ******	3:0 or 0:3 is impossible
			if ((CompSet1SignSelectedIndex == CompSet2SignSelectedIndex) && (CompSet1SignSelectedIndex == CompSet3SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
				return;
				}
	//------------------------------------------------------------------------------------------
	// ******	proof all other possible bullshit
			if ((CompSet1SignSelectedIndex == CompSet2SignSelectedIndex) && (CompSet1SignSelectedIndex == CompSet4SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
					return;
				}
			if ((CompSet1SignSelectedIndex == CompSet3SignSelectedIndex) && (CompSet1SignSelectedIndex == CompSet4SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
					return;
				}
			if ((CompSet2SignSelectedIndex == CompSet3SignSelectedIndex) && (CompSet2SignSelectedIndex == CompSet4SignSelectedIndex))
				{alert ("Satzergebnisse ungueltig");
					return;
				}
			if ((CompSet1SignSelectedIndex == CompSet2SignSelectedIndex) && (CompSet1SignSelectedIndex == CompSet5SignSelectedIndex))
				{if ((CompSet1SignSelectedIndex == CompSet3SignSelectedIndex) || (CompSet1SignSelectedIndex == CompSet4SignSelectedIndex))
					{alert ("Satzergebnisse ungueltig");
					return;
					}
				}
			if ((CompSet1SignSelectedIndex == CompSet3SignSelectedIndex) && (CompSet1SignSelectedIndex == CompSet5SignSelectedIndex))
				{if ((CompSet1SignSelectedIndex == CompSet2SignSelectedIndex) || (CompSet1SignSelectedIndex == CompSet4SignSelectedIndex))
					{alert ("Satzergebnisse ungueltig");
					return;
					}
				}
			if ((CompSet1SignSelectedIndex == CompSet4SignSelectedIndex) && (CompSet1SignSelectedIndex == CompSet5SignSelectedIndex))
				{if ((CompSet1SignSelectedIndex == CompSet2SignSelectedIndex) || (CompSet1SignSelectedIndex == CompSet3SignSelectedIndex))
					{alert ("Satzergebnisse ungueltig");
					return;
					}
				}
/* THIS SHOULD NOT HAPPEN - BEGIN

			if ((CompSet2SignSelectedIndex == CompSet3SignSelectedIndex) && (CompSet2SignSelectedIndex == CompSet4SignSelectedIndex))
				{if ((CompSet2SignSelectedIndex == CompSet1SignSelectedIndex) || (CompSet2SignSelectedIndex == CompSet5SignSelectedIndex))
					{alert ("Satzergebnisse ungueltig");
					return;
					}
				}
 THIS SHOULD NOT HAPPEN - END*/
			if ((CompSet2SignSelectedIndex == CompSet3SignSelectedIndex) && (CompSet2SignSelectedIndex == CompSet5SignSelectedIndex))
				{if ((CompSet2SignSelectedIndex == CompSet1SignSelectedIndex) || (CompSet2SignSelectedIndex == CompSet4SignSelectedIndex))
					{alert ("Satzergebnisse ungueltig");
					return;
					}
				}
			if ((CompSet2SignSelectedIndex == CompSet4SignSelectedIndex) && (CompSet2SignSelectedIndex == CompSet5SignSelectedIndex))
				{if ((CompSet2SignSelectedIndex == CompSet1SignSelectedIndex) || (CompSet2SignSelectedIndex == CompSet3SignSelectedIndex))
					{alert ("Satzergebnisse ungueltig");
					return;
					}
				}
			if ((parseInt(CompTeam1Sets) == 3) && (MainScreenE.CompSet5SignOpts.options[CompSet5SignSelectedIndex].text == "-"))
				{alert ("Spielergebnis oder Ergebnis letzter Satz ungueltig");
				return;
				}
			if ((parseInt(CompTeam2Sets) == 3) && (MainScreenE.CompSet5SignOpts.options[CompSet5SignSelectedIndex].text == "+"))
				{alert ("Spielergebnis oder Ergebnis letzter Satz ungueltig");
				return;
				}
			break;

		default:
			break;
		}

	if ((MainScreenE.GameRef1Opts.options.selectedIndex == -1) || (MainScreenE.GameRef2Opts.options.selectedIndex == -1))
		{var Check = confirm("Unvollständige Eingabe Schiedsrichter - Ergebnis speichern?")

		if (Check == false)
			return;
		}

	if (MainScreenE.GameRef1Opts.selectedIndex > -1)
		{MainScreenE.GameRef1Doc.value = MainScreenE.GameRef1Opts.options[MainScreenE.GameRef1Opts.options.selectedIndex].value;
		}
	else
		{MainScreenE.GameRef1Doc.value = "";
		}

	if (MainScreenE.GameRef2Opts.selectedIndex > -1)
		{MainScreenE.GameRef2Doc.value = MainScreenE.GameRef2Opts.options[MainScreenE.GameRef2Opts.options.selectedIndex].value;
		}
	else
		{MainScreenE.GameRef2Doc.value = "";
		}

	MainScreenE.GameRef3Doc.value = "";

	MainScreenE.SWAction.value = "COMPRESULTSAVE";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPDATASHOW";
	doMainMenuFSubmit();
}

//---------------------------------------------------------------------------------------------
// ******	check and save golden set result from a competitions match
/*OK*/
function doUVolleyIndoorXCompGSResultSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	var intError;
	var CompGSSetSignSelectedIndex = MainScreenE.CompGSSetSignOpts.options.selectedIndex;
	var CompGSSetPointsSelectedIndex = MainScreenE.CompGSSetPointOpts.options.selectedIndex;

	if ((CompGSSetSignSelectedIndex == -1) || (CompGSSetPointsSelectedIndex == -1))
		{alert ("Unvollstaendige Eingabe Golden Set");
		return;
		}

	MainScreenE.SWAction.value = "COMPGSRESULTSAVE";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "COMPDATASHOW";
	doMainMenuFSubmit();
}
//===================================================================
// ****** end of competition functions
//-------------------------------------------------------------------


//===================================================================
// ****** start with team functions
//-------------------------------------------------------------------
// ******	work with fields of a team
/*OK*/
function doUVolleyIndoorXTeamData(objTeamDoc)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (MainScreenE.User.value == "")
		{MainScreenE.SWAction.value = "TEAMDATASHOW";
		MainScreenE.ToCDocTaken.value = objTeamDoc;
		doMainScreenFSubmit();
		}
	else
		{MainScreenE.SWAction.value = "XTEAMDATAUPDPLAYERSLIST";
		MainScreenE.ToCDocTaken.value = objTeamDoc;
		doMainScreenFSubmit();

		MainMenuE.SWAction.value = "XTEAMDATAUPDPLAYERSLIST";
		MainMenuE.ToCDocTaken.value = objTeamDoc;
		doMainMenuFSubmit();
		}
}

//-------------------------------------------------------------------
// ******	add human from players pool to team
/*OK*/
function doUVolleyIndoorXTeamHumanAdd()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (typeof(MainScreenE.TeamHumansSrcOpts) != "object")
		{return;
		}

	var TeamHumansOpts = MainScreenE.TeamHumansOpts;
	var intI,intJ;
	for (intI=0; intI<MainScreenE.TeamHumansSrcOpts.length; intI++)
		{if (MainScreenE.TeamHumansSrcOpts.options[intI].selected == true)
			{for (intJ=0; intJ<TeamHumansOpts.length; intJ++)
				{if (MainScreenE.TeamHumansOpts.options[intJ].value == MainScreenE.TeamHumansSrcOpts.options[intI].value)
					{intJ = 999;
					}
				}

			if ((intJ == 0) || (intJ == TeamHumansOpts.length))
				{TeamHumansOpts[TeamHumansOpts.length] = new Option(MainScreenE.TeamHumansSrcOpts.options[intI].text);
				TeamHumansOpts[TeamHumansOpts.length -1].value = MainScreenE.TeamHumansSrcOpts.options[intI].value;
				}

			MainScreenE.TeamHumansSrcOpts.options[intI].selected = false;
			}
		}
}

//-------------------------------------------------------------------
// ******	remove human from team
/*OK*/
function doUVolleyIndoorXTeamHumanRemove()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (typeof(MainScreenE.TeamHumansOpts) != "object")
		{return;
		}

	var TeamHumansOpts = MainScreenE.TeamHumansOpts;
	var intI=0;
	while (intI<MainScreenE.TeamHumansOpts.length)
		{if (MainScreenE.TeamHumansOpts.options[intI].selected == true)
			{TeamHumansOpts[intI] = null;
			}
		else
			{intI++;
			}
		}
}
//-------------------------------------------------------------------
// ******	save updates in team
/*OK*/
function doUVolleyIndoorXTeamSavePlayersList()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intI;

	// ******	set player to selected if playing is not (yet) allowed by official asso
	if (typeof(MainScreenE.TeamHumansSrcOpts) == "object")
		{for (intI=0; intI<MainScreenE.TeamHumansOpts.length; intI++)
			{if (MainScreenE.TeamHumansOpts.options[intI].value != "")
				{MainScreenE.TeamHumansOpts.options[intI].selected = true;
				}
			}
		}

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();
	MainScreenE.SWAction.value = "XTEAMDATASAVEPLAYERSLIST";
	doMainScreenFSubmit();
	MainToCUFSubmitCheck = window.setInterval("doMainToCUFSubmitCheck()",500);
}

//-------------------------------------------------------------------
// ******	work with fields of a team
/*OK*/
function doUVolleyIndoorXTeamDataUpdContactHumans(objTeamDoc)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XTEAMDATAUPDCONTACTHUMANS";
	MainScreenE.ToCDocTaken.value = objTeamDoc;
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "XTEAMDATAUPDCONTACTHUMANS";
	MainMenuE.ToCDocTaken.value = objTeamDoc;
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
// ******	save updates in team name and contact humans
/*OK*/
function doUVolleyIndoorXTeamSaveContactHumans()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intI;

	// ******	check name of team
	if (typeof(MainScreenE.TeamName) == "object")
		{if (MainScreenE.TeamName.value == "")
			{alert ("Name des Teams fehlerhaft");
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	Team050909 - human for contact must be selected
	if (typeof(MainScreenE.TeamHumansLeaderOpts) == "object")
		{if (MainScreenE.TeamHumansLeaderOpts.options.selectedIndex == -1)
			{alert ("Kontaktperson muss bekannt gegeben werden");
			return;
			}
		if (MainScreenE.TeamHumansLeaderOpts.options[MainScreenE.TeamHumansLeaderOpts.options.selectedIndex].text.indexOf("Telefonnummer") > -1)
			{alert ("Telefonnr./eMail bei den Personendaten fehlerhaft - bitte aendern!");
			MainScreenE.TeamHumansLeaderOpts.options.selectedIndex = -1;
			return;
			}
		if (MainScreenE.TeamHumansLeaderOpts.options[MainScreenE.TeamHumansLeaderOpts.options.selectedIndex].text.indexOf("@") < 0)
			{alert ("Telefonnr./eMail bei den Personendaten fehlerhaft - bitte aendern!");
			MainScreenE.TeamHumansLeaderOpts.options.selectedIndex = -1;
			return;
			}
		}

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();
	MainScreenE.SWAction.value = "XTEAMDATASAVECONTACTHUMANS";
	doMainScreenFSubmit();
//	MainToCUFSubmitCheck = window.setInterval("doMainToCUFSubmitCheck()",500);
}

//-------------------------------------------------------------------
// ******	give possibility to combine teams and locations
/*OK*/
function doUVolleyIndoorXTeamDataUpdLocations()
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XTEAMDATAUPDLOCATIONS";
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "XTEAMDATAUPDLOCATIONS";
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
// ******	update combination of teams and locations
/*OK*/
function doUVolleyIndoorXTeamDataUpdLocationIds(objTeamDoc,objAssoLocationId)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var strTeamLocationId,intZ;

	intZ = objTeamDoc.indexOf(".xml");
	strTeamLocationId = objTeamDoc.substring(0,intZ) +"LocationId";
	MainScreenE[strTeamLocationId].value = objAssoLocationId;
}

//-------------------------------------------------------------------
// ******	save a location for each team
/*OK*/
function doUVolleyIndoorXTeamSaveLocations()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var strTeamName,strTeamLocationIndex,intZ;

	// ******	check wether any team exists
	if (typeof(MainScreenE.XTeamDoc) == "object")
		{if (typeof(MainScreenE.XTeamDoc.length) == "number")
			{for (intI=0;intI<MainScreenE.XTeamDoc.length;intI++)
				{strTeamName = MainScreenE.XTeamDoc[intI].value;

				if (typeof(MainScreenE[strTeamName].length) == "number")
					{for (intJ=0;intJ<MainScreenE[strTeamName].length;intJ++)
						{if (MainScreenE[strTeamName][intJ].checked == true)
							{intJ = 1000;
							}
						}
					if (Math.abs(intJ) == Math.abs(MainScreenE[strTeamName].length))
						{alert (MainScreenE.XTeamDocAlert[intI].value);
						return;
						}
					}
				else
					{if (MainScreenE[strTeamName].checked == false)
						{alert (MainScreenE.XTeamDocAlert[intI].value);
						return;
						}
					}
				}
			}
		else
			{strTeamName = MainScreenE.XTeamDoc.value;

			if (typeof(MainScreenE[strTeamName].length) == "number")
				{for (intJ=0;intJ<MainScreenE[strTeamName].length;intJ++)
					{if (MainScreenE[strTeamName][intJ].checked == true)
						{intJ = 1000;
						}
					}
				if (Math.abs(intJ) == Math.abs(MainScreenE[strTeamName].length))
					{alert (MainScreenE.XTeamDocAlert.value);
					return;
					}
				}
			else
				{if (MainScreenE[strTeamName].checked == false)
					{alert (MainScreenE.XTeamDocAlert.value);
					return;
					}
				}
			}

		MainScreenE.FrameReady.value = "";
//		doMainProcessInWorkWindow();
		MainScreenE.SWAction.value = "XTEAMDATASAVELOCATIONS";
		doMainScreenFSubmit();
		MainToCUFSubmitCheck = window.setInterval("doMainToCUFSubmitCheck()",500);
		}
	else
		{alert('Für Ihren Verein sind keine Teams vorhanden - speichern nicht möglich');
		}
}

//-------------------------------------------------------------------
// ******	get an associatons location for a team - OwnLocation whole thing
/*OK*/
function doUVolleyIndoorXTeamAssoLocationUpd()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

//	alert ("!" + MainScreenE.ToCDocTaken.value + "!" + DataType + "!");

	//------------------------------------------------------------------------------------------
	// ******	check name of location
	if ((typeof(MainScreenE.TeamAssoLocationName) == "object") && (typeof(MainScreenE.AssoLocationName) == "object"))
		{MainScreenE.TeamAssoLocationName.value = MainScreenE.AssoLocationName.value;
		}
	//------------------------------------------------------------------------------------------
	// ******	check street of organisations address
	if ((typeof(MainScreenE.TeamAssoLocationStreet) == "object") && (typeof(MainScreenE.AssoLocationStreet) == "object"))
		{MainScreenE.TeamAssoLocationStreet.value = MainScreenE.AssoLocationStreet.value;
		}
	//------------------------------------------------------------------------------------------
	// ******	check street number of organisations address
	if ((typeof(MainScreenE.TeamAssoLocationStreetNr) == "object") && (typeof(MainScreenE.AssoLocationStreetNr) == "object"))
		{MainScreenE.TeamAssoLocationStreetNr.value = MainScreenE.AssoLocationStreetNr.value;
		}
	//------------------------------------------------------------------------------------------
	// ******	check postcode of organisations address
	if ((typeof(MainScreenE.TeamAssoLocationPostcode) == "object") && (typeof(MainScreenE.AssoLocationPostcode) == "object"))
		{MainScreenE.TeamAssoLocationPostcode.value = MainScreenE.AssoLocationPostcode.value;
		}
	//------------------------------------------------------------------------------------------
	// ******	check city of organisations address
	if ((typeof(MainScreenE.TeamAssoLocationCity) == "object") && (typeof(MainScreenE.AssoLocationCity) == "object"))
		{MainScreenE.TeamAssoLocationCity.value = MainScreenE.AssoLocationCity.value;
		}
}


//---------------------------------------------------------------------------------------------
// ******	save updates in team
/*OK*/
function doUVolleyIndoorXTeamSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var intI;

	// ******	check name of team
	if (typeof(MainScreenE.TeamName) == "object")
		{if (MainScreenE.TeamName.value == "")
			{alert ("Name des Teams fehlerhaft");
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check name of location - OwnLocation Begin
	if (typeof(MainScreenE.TeamAssoLocationName) == "object")
		{if (MainScreenE.TeamAssoLocationName.value == "")
			{alert ("Heimhalle: Name fehlerhaft");
			return;
			}
		else
			{var TeamAssoLocationName = MainScreenE.TeamAssoLocationName.value;
			for (intI=0; intI<TeamAssoLocationName.length; intI++)
				{MainScreenE.TeamAssoLocationName.value = TeamAssoLocationName.replace(/,/," ");
				TeamAssoLocationName = MainScreenE.TeamAssoLocationName.value;
				}
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check street of organisations address
	if (typeof(MainScreenE.TeamAssoLocationStreet) == "object")
		{if (MainScreenE.TeamAssoLocationStreet.value == "")
			{alert ("Heimhalle: Strasse fehlerhaft");
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check street number of organisations address
	if (typeof(MainScreenE.TeamAssoLocationStreetNr) == "object")
		{if (MainScreenE.TeamAssoLocationStreetNr.value == "")
			{alert ("Heimhalle: Nummer fehlerhaft");
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check postcode of organisations address
	if (typeof(MainScreenE.TeamAssoLocationPostcode) == "object")
		{if ((MainScreenE.TeamAssoLocationPostcode.value == "") || (isNaN(MainScreenE.TeamAssoLocationPostcode.value) == true))
			{alert ("Heimhalle: Postleitzahl fehlerhaft (KEINE Zahl)");
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check city of organisations address
	if (typeof(MainScreenE.TeamAssoLocationCity) == "object")
		{if (MainScreenE.TeamAssoLocationCity.value == "")
			{alert ("Heimhalle: Ort/Stadt fehlerhaft");
			return;
			}
		}
	// OwnLocation End

	//------------------------------------------------------------------------------------------
	// ******	Team050909 - human for contact must be selected
	if (typeof(MainScreenE.TeamHumansLeaderOpts) == "object")
		{if (MainScreenE.TeamHumansLeaderOpts.options.selectedIndex == -1)
			{alert ("Kontaktperson muss bekannt gegeben werden");
			return;
			}
		if (MainScreenE.TeamHumansLeaderOpts.options[MainScreenE.TeamHumansLeaderOpts.options.selectedIndex].text.indexOf("Telefonnummer") > -1)
			{alert ("Telefonnr./eMail bei den Personendaten fehlerhaft - bitte aendern!");
			MainScreenE.TeamHumansLeaderOpts.options.selectedIndex = -1;
			return;
			}
		if (MainScreenE.TeamHumansLeaderOpts.options[MainScreenE.TeamHumansLeaderOpts.options.selectedIndex].text.indexOf("@") < 0)
			{alert ("Telefonnr./eMail bei den Personendaten fehlerhaft - bitte aendern!");
			MainScreenE.TeamHumansLeaderOpts.options.selectedIndex = -1;
			return;
			}
		}

	//------------------------------------------------------------------------------------------
	// ******	set player to selected if playing is not (yet) allowed by official asso
	if (typeof(MainScreenE.TeamHumansSrcOpts) == "object")
		{for (intI=0; intI<MainScreenE.TeamHumansOpts.length; intI++)
			{if (MainScreenE.TeamHumansOpts.options[intI].value != "")
				{MainScreenE.TeamHumansOpts.options[intI].selected = true;
				}
			}
		}

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();
	MainScreenE.SWAction.value = "TEAMDATASAVE";
	doMainScreenFSubmit();
	MainToCUFSubmitCheck = window.setInterval("doMainToCUFSubmitCheck()",500);
}


//=============================================================================================
// ****** end of team functions
//---------------------------------------------------------------------------------------------


//=============================================================================================
// ****** start with remote services
//---------------------------------------------------------------------------------------------
/*OK*/
function doUVolleyIndoorRemoteServices(objRemoteType,objRemote)
{	switch (objRemoteType)
		{case "Referees":
/*
			if (document.forms[0].name == "MainScreenForm")
				{
*/
				var MainRemoteScreenE = document.MainScreenForm.elements;
				var MainRemoteScreenF = document.MainScreenForm;

				MainRemoteScreenE.SWAction.value = "XHUMREFEREEDATASHOW";
				MainRemoteScreenE.ToCDocTaken.value = objRemote;
				MainRemoteScreenF.action = "MainRemoteScreen.asp";
				MainRemoteScreenF.target = "_blank";
				MainRemoteScreenF.submit();
/*
				}
			else
				{var MainRemoteScreenE = document.MainRemoteScreenForm.elements;
				var MainRemoteScreenF = document.MainRemoteScreenForm;

				MainRemoteScreenE.SWAction.value = "XHUMREFEREEDATASHOW";
				MainRemoteScreenE.ToCDocTaken.value = objRemote;
				MainRemoteScreenF.action = "MainRemoteScreen.asp";
				MainRemoteScreenF.target = "_blank";
				MainRemoteScreenF.submit();
				}
*/
			break;

		case "Competitions":
			var MainRemoteScreenE = document.MainScreenForm.elements;
			var MainRemoteScreenF = document.MainScreenForm;

			MainRemoteScreenE.SWAction.value = "COMPDATASHOW";
			MainRemoteScreenE.XCompRoundNr.value = objRemote;

			MainRemoteScreenF.action = "MainRemoteScreen.asp";
			MainRemoteScreenF.target = "_blank";
			MainRemoteScreenF.submit();
			break;

		case "XCompTeamAllGames":
			var MainRemoteScreenE = document.MainScreenForm.elements;
			var MainRemoteScreenF = document.MainScreenForm;

			MainRemoteScreenE.SWAction.value = "XCOMPTEAMALLGAMES";
			MainRemoteScreenE.XCompTeamDoc.value = objRemote;

			MainRemoteScreenF.action = "MainRemoteScreen.asp";
			MainRemoteScreenF.target = "_blank";
			MainRemoteScreenF.submit();
			break;

		case "XCompTeamAGames":
			var MainRemoteScreenE = document.MainScreenForm.elements;
			var MainRemoteScreenF = document.MainScreenForm;

			MainRemoteScreenE.SWAction.value = "XCOMPTEAMAGAMES";
			MainRemoteScreenE.XCompTeamDoc.value = objRemote;

			MainRemoteScreenF.action = "MainRemoteScreen.asp";
			MainRemoteScreenF.target = "_blank";
			MainRemoteScreenF.submit();
			break;

		case "XCompTeamHGames":
			var MainRemoteScreenE = document.MainScreenForm.elements;
			var MainRemoteScreenF = document.MainScreenForm;

			MainRemoteScreenE.SWAction.value = "XCOMPTEAMHGAMES";
			MainRemoteScreenE.XCompTeamDoc.value = objRemote;

			MainRemoteScreenF.action = "MainRemoteScreen.asp";
			MainRemoteScreenF.target = "_blank";
			MainRemoteScreenF.submit();
			break;

		case "XCompTeamRGames":
			var MainRemoteScreenE = document.MainScreenForm.elements;
			var MainRemoteScreenF = document.MainScreenForm;

			MainRemoteScreenE.SWAction.value = "XCOMPTEAMRGAMES";
			MainRemoteScreenE.XCompTeamDoc.value = objRemote;

			MainRemoteScreenF.action = "MainRemoteScreen.asp";
			MainRemoteScreenF.target = "_blank";
			MainRemoteScreenF.submit();
			break;
		}
}
//=============================================================================================
// ****** end of remote services
//---------------------------------------------------------------------------------------------


//=============================================================================================
// ****** start with shop functions
//---------------------------------------------------------------------------------------------
// ******	show shop information
/*NOTOK*/
function doUVolleyIndoorShopToC(objToCIdTaken,objShopName,objShopType)
{	var MainScreen = top.frames.MainScreenFrame.MainScreenForm;
	var MainToCU = top.frames.MainToCUFrame.MainToCUForm;

//	MainToCU.MenuAction.value = "SHOPSHOW";
	MainToCU.ToCIdTaken.value = "";
//	MainToCU.MainMenuTaken.value = "";
	MainToCU.ToCDocTaken.value = "Shops_Volley_Indoor.xml";
	MainToCU.action = "MainToCU.asp";
	MainToCU.target = "_self";
	MainToCU.submit();

	switch (objShopType)
		{case "List":
			MainScreen.SWAction.value = "SHOPLIST";
			break;
		case "Order":
			MainScreen.SWAction.value = "SHOPORDER";
			break;
		}

	MainScreen.ToCIdTaken.value = objToCIdTaken;
//	MainScreen.MainMenuTaken.value = objShopName;
	MainScreen.ToCDocTaken.value = "Shops_Volley_Indoor.xml";
	MainScreen.action = "MainScreen.asp";
	MainScreen.target = "_self";
	MainScreen.submit();
}

