//===================================================================
// ****** start with toc functions
//-------------------------------------------------------------------
function doUBikeToC(objToCId,objToCDoc,objToC,objToCUDir,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("doUBikeToC('" +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 "UBikeWork":
			doMainMsgHeadDoMenuHome('Bike');
			doMainMenuDoMenuHome('Bike');
			doMainToCUDoMenuHome('Bike');

			MainScreenE.SWAction.value = "WORK";
			MainScreenE.ToCDocTaken.value = "";
			MainScreenE.ToCIdTaken.value = "";
			doMainScreenFSubmit();
			break;

		case "XDivisionDataStart":
			doMainMsgHeadAssoDataShow(objToCDoc);
			doMainToCUDoMenuHome('Bike');

			MainMenuE.SWAction.value = "XDIVISIONDATASTART";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			MainMenuE.ToCUCompStatus.value = "";
			doMainMenuFSubmit();

			doMainScreenAssoDataShow(objToCId,objToCDoc);
			break;

		case "CompArchiveStart":
			doMainMsgHeadAssoDataShow(objToCDoc);
			doMainScreenAssoDataShow(objToCId,objToCDoc)

			doMainMenuDoMenuHome('Bike');
			doMainToCUDoMenuHome('Bike');
			break;

		case "CompDescrStart":
			doMainMsgHeadAssoDataShow(objToCDoc);
			MainToCUE.SWAction.value = "XCOMPDATADESCRSTART";
			MainToCUE.ToCIdTaken.value = objToCId;
			MainToCUE.ToCDocTaken.value = objToCDoc;
			MainToCUE.ToCUCompStatus.value = "";
			doMainToCUFSubmit();

			MainMenuE.SWAction.value = "XCOMPDATADESCRUPD";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			MainMenuE.ToCUCompStatus.value = "";
			doMainMenuFSubmit();

			MainScreenE.SWAction.value = "XASSODATASHOW";
			MainScreenE.ToCIdTaken.value = objToCId;
			MainScreenE.ToCDocTaken.value = objToCDoc;
			MainScreenE.ToCUCompStatus.value = "";
			doMainScreenFSubmit();
			break;

		case "CompStart":
			doMainMsgHeadAssoDataShow(objToCDoc);
			doMainScreenAssoDataShow(objToCId,objToCDoc)

			if (MainScreenE.User.value == "")
				{doMainMenuDoMenuHome('Bike');
				}
			else
				{if (objMenuStatus == "Open")
					{MainMenuE.SWAction.value = "XCOMPBEGIN";
					}
				else
					{MainMenuE.SWAction.value = "";
					}
				MainMenuE.ToCIdTaken.value = objToCId;
				MainMenuE.ToCDocTaken.value = objToCDoc;
				doMainMenuFSubmit();
				}

			doMainToCUDoMenuHome('Bike');
			break;

		case "CompDataStart":
			doMainMsgHeadAssoDataShow(objToCDoc);
			MainToCUE.SWAction.value = "XCOMPDATASTART";
			MainToCUE.ToCIdTaken.value = objToCId;
			MainToCUE.ToCDocTaken.value = objToCDoc;
			MainToCUE.ToCUDir.value = objToCUDir;

			MainToCUE.ToCUCompId.value = objToCUId;
			if (isNaN(objCompStatus) == true)
				{MainToCUE.ToCUCompStatus.value = "";
				MainMenuE.ToCUCompStatus.value = "";
				}
			else
				{MainToCUE.ToCUCompStatus.value = objCompStatus;
				MainMenuE.ToCUCompStatus.value = objCompStatus;
				}
			doMainToCUFSubmit();
			doMainScreenAssoDataShow(objToCId,objToCDoc)
/*	B20060531-01 begin
			if (MainScreenE.User.value == "")
				{doMainMenuDoMenuHome('Bike');
				}
			else
				{
	B20060531-01 end */
				MainMenuE.SWAction.value = "XCOMPDATASTART";
				MainMenuE.ToCIdTaken.value = objToCId;
				MainMenuE.ToCDocTaken.value = objToCDoc;
				MainMenuE.ToCUDir.value = objToCUDir;
				doMainMenuFSubmit();
//	B20060531-01			}
			break;

		case "CompDeadlines":
			doMainMsgHeadAssoDataShow(objToCDoc);

			if (MainScreenE.User.value == "")
				{doMainMenuDoMenuHome('Bike');

				MainScreenE.SWAction.value = "XCOMPDEADLINESHOW";
				MainScreenE.ToCIdTaken.value = objToCId;
				MainScreenE.ToCDocTaken.value = objToCDoc;
				doMainScreenFSubmit();
				}
			else
				{MainMenuE.SWAction.value = "XCOMPDEADLINEUPD";
				MainMenuE.ToCIdTaken.value = objToCId;
				MainMenuE.ToCDocTaken.value = objToCDoc;
				doMainMenuFSubmit();

				MainScreenE.SWAction.value = "XCOMPDEADLINEUPD";
				MainScreenE.ToCIdTaken.value = objToCId;
				MainScreenE.ToCDocTaken.value = objToCDoc;
				doMainScreenFSubmit();
				}

			doMainToCUDoMenuHome('Bike');
			break;

		/* B20070129-01 - begin */
		case "Calendary":
			doMainMsgHeadAssoDataShow(objToCDoc);

			MainMenuE.SWAction.value = "XCALENDARYCOMPS";
			MainMenuE.ToCIdTaken.value = objToCId;
			MainMenuE.ToCDocTaken.value = objToCDoc;
			doMainMenuFSubmit();

			MainScreenE.SWAction.value = "XCALENDARYCOMPSSTART";
			MainScreenE.ToCIdTaken.value = objToCId;
			MainScreenE.ToCDocTaken.value = objToCDoc;
			doMainScreenFSubmit();

			doMainToCUDoMenuHome('Bike');
			break;
		/* B20070129-01 - end */
		}
}

//===================================================================
// ****** start with menu functions
//-------------------------------------------------------------------
function doUBikeMenuBack(objMenu)
{	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	MainMenuE.SWAction.value = objMenu;

	switch (objMenu)
		{case "XCOMPDATASTART":
			MainMenuE.ToCDocTaken.value = MainMenuE.ToCIdTaken.value +".xml";
			break;
		}

	doMainMenuFSubmit();
}

//===================================================================
// ****** start with screen functions
//-------------------------------------------------------------------
function doUBikeScreenBack(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();
}

//===================================================================
// ****** start with category divisions functions
//-------------------------------------------------------------------
// ****** new category division
function doUBikeXDivisionDataNew()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	MainMenuE.SWAction.value = "XDIVISIONDATANEW";
	MainMenuE.ToCBikeDivisionId.value = "";
	doMainMenuFSubmit();

	MainScreenE.SWAction.value = "XDIVISIONDATANEW";
	MainScreenE.ToCBikeDivisionId.value = "";
	doMainScreenFSubmit();
}

//-------------------------------------------------------------------
// ****** update category division fields
function doUBikeXDivisionDataUpd(objBikeDivisionId)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	doMainMsgHeadAssoDataShow('XAsso_2_000001.xml');
	doMainToCUDoMenuHome('Bike');

	MainMenuE.SWAction.value = "XDIVISIONDATAUPD";
	doMainMenuFSubmit();

	MainScreenE.SWAction.value = "XDIVISIONDATAUPD";
	MainScreenE.ToCBikeDivisionId.value = objBikeDivisionId;
	doMainScreenFSubmit();
}

//-------------------------------------------------------------------
// ****** delete bike category division
function doUBikeXDivisionDataDel()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	var Check = confirm("Diese Kategorie unwiderruflich löschen?")
	if (Check == false)
		return;

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();
	MainScreenE.SWAction.value = "XDIVISIONDATADEL";
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "XDIVISIONDATASTART";
	MainMenuE.ToCBikeDivisionId.value = "";
	MainMenuFSubmitCheck = window.setInterval("doMainMenuFSubmitCheck()",500);

	MainToCFSubmitCheck = window.setInterval("doMainToCFSubmitCheck()",500);
}

//-------------------------------------------------------------------
// ****** save category division fields
function doUBikeXDivisionDataSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var strBikeDivisionId,strDivisionId;
	var FieldEmptyFnd = "";
	var FieldEmptyCnt = 0;
	var FieldValueCnt = 0;

//	***** check bike division values
	if (MainScreenE.ToCBikeDivisionId.value != "")
		{strBikeDivisionId = MainScreenE.ToCBikeDivisionId.value;

		for (intI=0;intI<MainScreenE[strBikeDivisionId].length;intI++)
			{MainScreenE[strBikeDivisionId][intI].value = doSATrim(MainScreenE[strBikeDivisionId][intI].value);

			if (MainScreenE[strBikeDivisionId][intI].value == "")
				{FieldEmptyCnt = FieldEmptyCnt +1;
				}
			else
				{FieldValueCnt = FieldValueCnt +1;
				}
			}
		if ((FieldEmptyCnt > 0) && (FieldValueCnt > 0))
			{MainScreenE[strBikeDivisionId][0].select();
			alert ("Kategorie unvollständig");
			return;
			}
		if (FieldEmptyCnt > 0)
			{var Check = confirm("Die gesamte Kategorie unwiderruflich löschen?")
			if (Check == false)
				{return;
				}
			}

//		***** check existing division values
		strBikeDivisionId = MainScreenE.ToCBikeDivisionId.value +"DivisionId";
		for (intI=0;intI<parent.MainScreenFrame.document.getElementsByName(strBikeDivisionId).length;intI++)
			{strDivisionId = parent.MainScreenFrame.document.getElementsByName(strBikeDivisionId)[intI].value;

			FieldEmptyFnd = "";
			FieldEmptyCnt = 0;
			FieldValueCnt = 0;

			for (intJ=0;intJ<MainScreenE[strDivisionId].length;intJ++)
				{MainScreenE[strDivisionId][intJ].value = doSATrim(MainScreenE[strDivisionId][intJ].value);

				if ((Math.abs(intJ) != 2) && (Math.abs(intJ) != 3) && (Math.abs(intJ) != 5) && (Math.abs(intJ) != 8))
					{if (MainScreenE[strDivisionId][intJ].value == "")
						{if (FieldEmptyFnd == "")
							{FieldEmptyFnd = intJ;
							}
						FieldEmptyCnt = FieldEmptyCnt +1;
						}
					else
						{FieldValueCnt = FieldValueCnt +1;
						}
					}

				if (Math.abs(intJ) == 6)
					{if ((MainScreenE[strDivisionId][intJ].value == 9999) || (MainScreenE[strDivisionId][intJ].value == "älter"))
						{MainScreenE[strDivisionId][intJ -1].value = "u.";
						MainScreenE[strDivisionId][intJ].value = "älter";
						}
					else
						{if (MainScreenE[strDivisionId][intJ].value == "")
							{MainScreenE[strDivisionId][intJ -1].value = "";
							}
						else
							{MainScreenE[strDivisionId][intJ -1].value = "-";
							}
						}
					}
				}
			if ((FieldEmptyCnt != FieldValueCnt) && (FieldEmptyFnd != ""))
				{MainScreenE[strDivisionId][FieldEmptyFnd].select();
				alert ("Disziplin unvollständig");
				return;
				}
			}
		}
//	------------------------------------------------------------------
//	***** check new bike division values
	if (typeof(MainScreenE.BikeDivisionNew) == "object")
		{FieldEmptyCnt = 0;
		FieldValueCnt = 0;

		for (intI=0;intI<MainScreenE.BikeDivisionNew.length;intI++)
			{MainScreenE.BikeDivisionNew[intI].value = doSATrim(MainScreenE.BikeDivisionNew[intI].value);
			if (MainScreenE.BikeDivisionNew[intI].value == "")
				{MainScreenE.BikeDivisionNew[intI].focus();
				alert ("Inhalt fehlerhaft");
				return;
				}
			}
		}
//	------------------------------------------------------------------
//	***** check new division values
	FieldEmptyCnt = 0;
	FieldValueCnt = 0;

	for (intI=0;intI<MainScreenE.DivisionNew.length;intI++)
		{MainScreenE.DivisionNew[intI].value = doSATrim(MainScreenE.DivisionNew[intI].value);

		if ((intI != 5) && (intI != 8))
			{if (MainScreenE.DivisionNew[intI].value == "")
				{FieldEmptyCnt = FieldEmptyCnt +1;
				}
			else
				{FieldValueCnt = FieldValueCnt +1;
				}
			}

		if (Math.abs(intI) == 6)
			{if ((MainScreenE.DivisionNew[intI].value == 9999) || (MainScreenE.DivisionNew[intI].value == "älter"))
				{MainScreenE.DivisionNew[intI -1].value = "u.";
				MainScreenE.DivisionNew[intI].value = "älter";
				}
			else
				{if (MainScreenE.DivisionNew[intI].value == "")
					{MainScreenE.DivisionNew[intI -1].value = "";
					}
				else
					{MainScreenE.DivisionNew[intI -1].value = "-";
					}
				}
			}
		}

	if ((FieldEmptyCnt > 0) && (FieldValueCnt > 0))
		{if (FieldEmptyCnt > FieldValueCnt)
			{for (intI=0;intI<MainScreenE.DivisionNew.length;intI++)
				{if (MainScreenE.DivisionNew[intI].value != "")
					{MainScreenE.DivisionNew[intI].select();
					alert("Inhalt fehlerhaft");
					return;
					}
				}
			}
		else
			{for (intI=0;intI<MainScreenE.DivisionNew.length;intI++)
				{if (MainScreenE.DivisionNew[intI].value == "")
					{MainScreenE.DivisionNew[intI].focus();
					alert("Inhalt fehlerhaft");
					return;
					}
				}
			}
		}

	if ((typeof(MainScreenE.BikeDivisionNew) == "object") && (FieldEmptyCnt > 0))
		{MainScreenE.DivisionNew[0].select();
		alert ("Disziplin unvollständig");
		return;
		}

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();
	MainScreenE.SWAction.value = "XDIVISIONDATASAVE";
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "XDIVISIONDATAUPD";
	MainMenuFSubmitCheck = window.setInterval("doMainMenuFSubmitCheck()",500);

	MainToCFSubmitCheck = window.setInterval("doMainToCFSubmitCheck()",500);
}

//-------------------------------------------------------------------
// ****** clear category division fields
function doUBikeXDivisionClear(objId)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var strBikeDivisionId,strDivisionId;

	for (intI=0;intI<MainScreenE[objId].length;intI++)
		{document.getElementsByName(objId)[intI].value = "";
		}

	if (objId.indexOf("BikeDivisionId") > -1)
		{strBikeDivisionId = objId +"DivisionId";

		if (typeof(MainScreenE[strBikeDivisionId].length) == "number")
			{for (intI=0;intI<MainScreenE[strBikeDivisionId].length;intI++)
				{strDivisionId = MainScreenE[strBikeDivisionId][intI].value;

				for (intJ=0;intJ<MainScreenE[strDivisionId].length;intJ++)
					{document.getElementsByName(strDivisionId)[intJ].value = "";
					}
				}
			}
		else
			{strDivisionId = MainScreenE[strBikeDivisionId].value;

			for (intI=0;intI<MainScreenE[strDivisionId].length;intI++)
				{document.getElementsByName(strDivisionId)[intI].value = "";
				}
			}
		}
}

//-------------------------------------------------------------------
// ****** restore category division fields
function doUBikeXDivisionRecov(objId,objIdRecov,objIdParent,objIdParentRecov)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var strBikeDivisionId,strDivisionId,strDivisionIdRecov;

	for (intI=0;intI<MainScreenE[objId].length;intI++)
		{document.getElementsByName(objId)[intI].value = document.getElementsByName(objIdRecov)[intI].value;
		}

	if (objId.indexOf("BikeDivisionId") > -1)
		{strBikeDivisionId = objId +"DivisionId";

		if (typeof(MainScreenE[strBikeDivisionId].length) == "number")
			{for (intI=0;intI<MainScreenE[strBikeDivisionId].length;intI++)
				{strDivisionId = MainScreenE[strBikeDivisionId][intI].value;
				strDivisionIdRecov = objId +strDivisionId +"Recov"

				for (intJ=0;intJ<MainScreenE[strDivisionId].length;intJ++)
					{document.getElementsByName(strDivisionId)[intJ].value = document.getElementsByName(strDivisionIdRecov)[intJ].value;
					}
				}
			}
		else
			{strDivisionId = MainScreenE[strBikeDivisionId].value;
			strDivisionIdRecov = objId +strDivisionId +"Recov"

			for (intI=0;intI<MainScreenE[strDivisionId].length;intI++)
				{document.getElementsByName(strDivisionId)[intI].value = document.getElementsByName(strDivisionIdRecov)[intI].value;
				}
			}
		}
	else
		{for (intI=0;intI<MainScreenE[objIdParent].length;intI++)
			{document.getElementsByName(objIdParent)[intI].value = document.getElementsByName(objIdParentRecov)[intI].value;
			}
		}
}

//===================================================================
// ****** start with licences functions
//-------------------------------------------------------------------
// ****** update licence checklist
function doUBikeXLicenceDataChecklistUpd(objToCDoc)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	doMainMsgHeadAssoDataShow(objToCDoc);
	doMainToCUDoMenuHome('Bike');

	MainMenuE.SWAction.value = "XLICENCEDATACHECKLISTUPD";
	doMainMenuFSubmit();

	MainScreenE.SWAction.value = "XLICENCEDATACHECKLISTUPD";
	doMainScreenFSubmit();
}

//-------------------------------------------------------------------
// ****** save licence checklist
function doUBikeXLicenceDataChecklistSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();
	MainScreenE.SWAction.value = "XLICENCEDATACHECKLISTSAVE";
	doMainScreenFSubmit();

	MainMenuFSubmitCheck = window.setInterval("doMainMenuFSubmitCheck()",500);
}

//-------------------------------------------------------------------
// ****** clear licence fields
function doUBikeXLicenceChecklistClear(objId)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	document.getElementById(objId).value = "";
}

//-------------------------------------------------------------------
// ****** restore licence fields
function doUBikeXLicenceChecklistRecov(objId,objIdRecov)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	document.getElementById(objId).value = document.getElementById(objIdRecov).value;
}

//-------------------------------------------------------------------
// ****** create a list with all assos that habe licences
function doUBikeXLicXAsso(objToCId,objToCDoc)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	doMainMsgHeadAssoDataShow(objToCDoc);
	MainToCUE.SWAction.value = "XLICENCEXASSO";
	doMainToCUFSubmit();
	doMainMenuDoMenuHome(MainMenuE.SASport.value)
	doMainScreenAssoDataShow(objToCId,objToCDoc)
}

//-------------------------------------------------------------------
// ****** show an assos licences
function doUBikeXLicXAssoUpd(objToCId,objToCDoc)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	MainMenuE.SWAction.value = "XLICENCEXASSOUPD";
	MainMenuE.ToCIdTaken.value = objToCId;
	MainMenuE.ToCDocTaken.value = objToCDoc;
	doMainMenuFSubmit();

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();

	MainScreenE.SWAction.value = "XLICENCEXASSOUPD";
	MainScreenE.ToCIdTaken.value = objToCId;
	MainScreenE.ToCDocTaken.value = objToCDoc;
	doMainScreenFSubmit();
}


//===================================================================
// ****** B20070129-01 start with calendary functions
//-------------------------------------------------------------------
function doUBikeXCalendarySave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var CheckboxName;

	MainScreenE.ToCUDocSelection.value = "";

	//----------------------------------------------------------------
	//	***** start here with download data for comps
	if	((MainScreenE.SWAction.value == "XCALENDARYCOMPSSTART") || (MainScreenE.SWAction.value == "XCALENDARYCOMPS"))
		{for (intI=0;intI<MainScreenE.CompCheckbox.length;intI++)
			{CheckboxName = MainScreenE.CompCheckbox[intI].value;
			
			if (MainScreenE[CheckboxName].checked == true)
				{intI = MainScreenE.CompCheckbox.length +1;
				}
			}
		if (Math.abs(intI) == Math.abs(MainScreenE.CompCheckbox.length))
			{alert("Veranstaltungen fehlerhaft");
			return;
			}

		if (typeof(MainScreenE.CalendaryCompDocs.length) == "number")
			{for (intI=0; intI < MainScreenE.CalendaryCompDocs.length; intI++)
				{MainScreenE.ToCUDocSelection.value = MainScreenE.ToCUDocSelection.value +MainScreenE.CalendaryCompDocs[intI].value +",";
				}
			}
		else
			{if (typeof(MainScreenE.CalendaryCompDocs) == "object")
				{MainScreenE.ToCUDocSelection.value = MainScreenE.CalendaryCompDocs.value +",";
				}
			}

		MainScreenE.SWAction.value = "XCALENDARYCOMPS";
		doMainScreenFSubmit();
		}

	//----------------------------------------------------------------
	//	***** start here with download data for assos
	if	((MainScreenE.SWAction.value == "XCALENDARYASSOSSTART") || (MainScreenE.SWAction.value == "XCALENDARYASSOS"))
		{for (intI=0;intI<MainScreenE.AssoCheckbox.length;intI++)
			{CheckboxName = MainScreenE.AssoCheckbox[intI].value;
			
			if (MainScreenE[CheckboxName].checked == true)
				{intI = MainScreenE.AssoCheckbox.length +1;
				}
			}
		if (Math.abs(intI) == Math.abs(MainScreenE.AssoCheckbox.length))
			{alert("Verbände und Vereine fehlerhaft");
			return;
			}

		if (typeof(MainScreenE.CalendaryAssoDocs.length) == "number")
			{for (intI=0; intI < MainScreenE.CalendaryAssoDocs.length; intI++)
				{MainScreenE.ToCUDocSelection.value = MainScreenE.ToCUDocSelection.value +MainScreenE.CalendaryAssoDocs[intI].value +",";
				}
			}
		else
			{if (typeof(MainScreenE.CalendaryAssoDocs) == "object")
				{MainScreenE.ToCUDocSelection.value = MainScreenE.CalendaryAssoDocs.value +",";
				}
			}

		MainScreenE.SWAction.value = "XCALENDARYASSOS";
		doMainScreenFSubmit();
		}
}

function doUBikeXCalendaryComps()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XCALENDARYCOMPSSTART";
	doMainScreenFSubmit();
}

function doUBikeScreenCalendaryAssos()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XCALENDARYASSOSSTART";
	doMainScreenFSubmit();
}


//===================================================================
// ****** start with association functions
//-------------------------------------------------------------------
// ******	delete association
function doUBikeXAssoDelete()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	doMainMsgHeadAssoDataShow('XAsso_2_000001.xml');
	doMainMenuDoMenuHome('Bike');

	doSAToCNavigateDelAsso(MainScreenE.ToCDocTaken.value);
	parent.MainToCFrame.setTimeout("doMainToCFSubmit();",2000);
	doMainToCUDoMenuHome('Bike');
	MainScreenE.SWAction.value = "XASSODELETE";
	doMainScreenFSubmit();
}


//===================================================================
// ****** start with competition functions
//-------------------------------------------------------------------
// ******	save competition deadlines
function doUBikeXCompDeadlinesSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	var intI,intJ,intK,doDateRC;

//	alert ("!" + MainScreenE.ToCDocTaken.value + "!" + DataType + "!");

	//----------------------------------------------------------------
	// ******	check deadline of clubs
	if (typeof(MainScreenE.DeadlineXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXAsso4DD','DeadlineXAsso4MM','DeadlineXAsso4YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of federal state official assos
/*
	if (typeof(MainScreenE.DeadlineXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXAsso3DD','DeadlineXAsso3MM','DeadlineXAsso3YYYY') == false)
			{return;
			}
		}
*/
	//----------------------------------------------------------------
	// ******	check deadline for permission of federal state official assos
	if (typeof(MainScreenE.DeadlinePermitDD) == "object")
		{if(doUBikeXCompDateCheck('DeadlinePermitDD','DeadlinePermitMM','DeadlinePermitYYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions
	if (typeof(MainScreenE.DeadlineXCompDD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompDD','DeadlineXCompMM','DeadlineXCompYYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of proposal
	if (typeof(MainScreenE.DeadlineXCompProposalDD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompProposalDD','DeadlineXCompProposalMM','DeadlineXCompProposalYYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in january
	if (typeof(MainScreenE.DeadlineXCompJanXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompJanXAsso4DD', 'DeadlineXCompJanXAsso4MM', 'DeadlineXCompJanXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompJanXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompJanXAsso3DD', 'DeadlineXCompJanXAsso3MM', 'DeadlineXCompJanXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in february
	if (typeof(MainScreenE.DeadlineXCompFebXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompFebXAsso4DD', 'DeadlineXCompFebXAsso4MM', 'DeadlineXCompFebXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompFebXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompFebXAsso3DD', 'DeadlineXCompFebXAsso3MM', 'DeadlineXCompFebXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in march
	if (typeof(MainScreenE.DeadlineXCompMarXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompMarXAsso4DD', 'DeadlineXCompMarXAsso4MM', 'DeadlineXCompMarXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompMarXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompMarXAsso3DD', 'DeadlineXCompMarXAsso3MM', 'DeadlineXCompMarXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in april
	if (typeof(MainScreenE.DeadlineXCompAprXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompAprXAsso4DD', 'DeadlineXCompAprXAsso4MM', 'DeadlineXCompAprXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompAprXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompAprXAsso3DD', 'DeadlineXCompAprXAsso3MM', 'DeadlineXCompAprXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in may
	if (typeof(MainScreenE.DeadlineXCompMayXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompMayXAsso4DD', 'DeadlineXCompMayXAsso4MM', 'DeadlineXCompMayXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompMayXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompMayXAsso3DD', 'DeadlineXCompMayXAsso3MM', 'DeadlineXCompMayXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in june
	if (typeof(MainScreenE.DeadlineXCompJunXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompJunXAsso4DD', 'DeadlineXCompJunXAsso4MM', 'DeadlineXCompJunXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompJunXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompJunXAsso3DD', 'DeadlineXCompJunXAsso3MM', 'DeadlineXCompJunXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in july
	if (typeof(MainScreenE.DeadlineXCompJulXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompJulXAsso4DD', 'DeadlineXCompJulXAsso4MM', 'DeadlineXCompJulXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompJulXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompJulXAsso3DD', 'DeadlineXCompJulXAsso3MM', 'DeadlineXCompJulXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in august
	if (typeof(MainScreenE.DeadlineXCompAugXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompAugXAsso4DD', 'DeadlineXCompAugXAsso4MM', 'DeadlineXCompAugXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompAugXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompAugXAsso3DD', 'DeadlineXCompAugXAsso3MM', 'DeadlineXCompAugXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in september
	if (typeof(MainScreenE.DeadlineXCompSepXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompSepXAsso4DD', 'DeadlineXCompSepXAsso4MM', 'DeadlineXCompSepXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompSepXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompSepXAsso3DD', 'DeadlineXCompSepXAsso3MM', 'DeadlineXCompSepXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in october
	if (typeof(MainScreenE.DeadlineXCompOctXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompOctXAsso4DD', 'DeadlineXCompOctXAsso4MM', 'DeadlineXCompOctXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompOctXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompOctXAsso3DD', 'DeadlineXCompOctXAsso3MM', 'DeadlineXCompOctXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in november
	if (typeof(MainScreenE.DeadlineXCompNovXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompNovXAsso4DD', 'DeadlineXCompNovXAsso4MM', 'DeadlineXCompNovXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompNovXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompNovXAsso3DD', 'DeadlineXCompNovXAsso3MM', 'DeadlineXCompNovXAsso3YYYY') == false)
			{return;
			}
		}

	//----------------------------------------------------------------
	// ******	check deadline of all competitions in december
	if (typeof(MainScreenE.DeadlineXCompDecXAsso4DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompDecXAsso4DD', 'DeadlineXCompDecXAsso4MM', 'DeadlineXCompDecXAsso4YYYY') == false)
			{return;
			}
		}
	if (typeof(MainScreenE.DeadlineXCompDecXAsso3DD) == "object")
		{if(doUBikeXCompDateCheck('DeadlineXCompDecXAsso3DD', 'DeadlineXCompDecXAsso3MM', 'DeadlineXCompDecXAsso3YYYY') == false)
			{return;
			}
		}

	MainScreenE.SWAction.value = "XCOMPDEADLINESAVE";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "XCOMPDEADLINEUPD";
	doMainMenuFSubmit();
//	doMainMenuDoMenuHome('Bike');
}

//-------------------------------------------------------------------
// ******	create new competition document
function doUBikeXCompNew()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	MainScreenE.ToCDocTaken.value = "Vorlage_Bike_XComp.xml";
	MainScreenE.SWAction.value = "XCOMPDATADESCRUPD";
	doMainScreenFSubmit();

	MainMenuE.ToCDocTaken.value = "Vorlage_Bike_XComp.xml";
	MainMenuE.SWAction.value = "XCOMPDATADESCRUPD";
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
// ******	upd descreption data of competition document
function doUBikeXCompDataDescrUpd(objCompDoc)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	if (objCompDoc == "")
		{MainMenuE.ToCDocTaken.value = MainScreenE.ToCDocTaken.value;

		MainScreenE.SWAction.value = "XCOMPDATADESCRUPD";
		doMainScreenFSubmit();

		MainMenuE.SWAction.value = "XCOMPDATADESCRUPD";
		doMainMenuFSubmit();
		}
	else
		{MainScreenE.ToCDocTaken.value = objCompDoc;
		MainScreenE.SWAction.value = "XCOMPDATADESCRUPD";
		doMainScreenFSubmit();

		MainMenuE.ToCDocTaken.value = objCompDoc;
		MainMenuE.SWAction.value = "XCOMPDATADESCRUPD";
		doMainMenuFSubmit();
		}
}

//-------------------------------------------------------------------
// ******	save competition description data
function doUBikeXCompDataDescrSave(objCompType)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	//------------------------------------------------------------------------------------------
	// ******	check style of competition
	if (typeof(MainScreenE.CompNationality) == "object")
		{if ((MainScreenE.CompNationality.value != "N") && (MainScreenE.CompNationality.value != "I"))
			{alert ("national/international fehlerhaft");
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check name of competition
	if (typeof(MainScreenE.CompName) == "object")
		{if (MainScreenE.CompName.value == "")
			{alert ("Veranstalter fehlerhaft");
			MainScreenE.CompName.select();
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check contact of competition
	if (typeof(MainScreenE.CompContact) == "object")
		{if (MainScreenE.CompContact.value == "")
			{alert ("Kontakt fehlerhaft");
			MainScreenE.CompContact.select();
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check street of competition
	if (typeof(MainScreenE.CompStreet) == "object")
		{if (MainScreenE.CompStreet.value == "")
			{alert ("Strasse/Nr. fehlerhaft");
			MainScreenE.CompStreet.select();
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check postcode of competition
	if (typeof(MainScreenE.CompPostcode) == "object")
		{if ((MainScreenE.CompPostcode.value == "") || (isNaN(MainScreenE.CompPostcode.value) == true))
			{alert ("Postleitzahl fehlerhaft");
			MainScreenE.CompPostcode.select();
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check city of competition
	if (typeof(MainScreenE.CompCity) == "object")
		{if (MainScreenE.CompCity.value == "")
			{alert ("Ort/Stadt fehlerhaft");
			MainScreenE.CompCity.select();
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check phone of competition
	if (typeof(MainScreenE.CompPhone) == "object")
		{if (MainScreenE.CompPhone.value == "")
			{alert ("Telefon fehlerhaft");
			MainScreenE.CompPhone.select();
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check fax of competition
	if (typeof(MainScreenE.CompFax) == "object")
		{if (MainScreenE.CompFax.value == "")
			{alert ("Fax fehlerhaft");
			MainScreenE.CompFax.select();
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check email of competition
	if (typeof(MainScreenE.CompEmail) == "object")
		{if (MainScreenE.CompEmail.value == "")
			{alert ("eMail fehlerhaft");
			MainScreenE.CompEmail.select();
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check title of competition
	if (typeof(MainScreenE.CompTitle) == "object")
		{if (MainScreenE.CompTitle.value == "")
			{alert ("Titel fehlerhaft");
			MainScreenE.CompTitle.select();
			return;
			}
		}

	switch (objCompType)
		{case "CompUpd":
			MainScreenE.SWAction.value = "XCOMPDATADESCRSAVE";
			MainMenuE.ToCDocTaken.value = MainMenuE.ToCDocTaken.value.replace(/Vorlage_/,"")
			break;

		case "CompNew":
			MainScreenE.SWAction.value = "XCOMPDATADESCRSAVEANDNEW";
			MainMenuE.ToCDocTaken.value = "Vorlage_Bike_XComp.xml";
			break;
		}

	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "XCOMPDATADESCRUPD";
	doMainMenuFSubmit();

	if (MainToCUE.SWAction.value == "XCOMPDATADESCRSTART")
		{parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);
		}
}

//-------------------------------------------------------------------
// ******	create competition race data
function doUBikeXCompRaceNew()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
//	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

//	doMainToCUDoMenuHome('Bike');

	MainMenuE.SWAction.value = "XCOMPDATAUPD";
	MainMenuE.ToCDocTaken.value = MainScreenE.ToCDocTaken.value;
	doMainMenuFSubmit();

	MainScreenE.SWAction.value = "XCOMPDATACATEGORYNEW";
	doMainScreenFSubmit();
}

//-------------------------------------------------------------------
// ******	show, upd or define competition data
function doUBikeXCompData(objCompDoc,objCompDateType,objCompDir)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	if (MainScreenE.User.value == "")
		{MainScreenE.ToCDocTaken.value = objCompDoc;
		MainScreenE.ToCUCompDateType.value = objCompDateType;
		MainScreenE.ToCUDir.value = objCompDir;

		MainScreenE.SWAction.value = "XCOMPDATASHOW";
		doMainScreenFSubmit();


		MainMenuE.ToCDocTaken.value = objCompDoc;
		MainMenuE.ToCUCompDateType.value = objCompDateType;
		MainMenuE.ToCUDir.value = objCompDir;

		MainMenuE.SWAction.value = "XCOMPDATASHOW";
		doMainMenuFSubmit();
		}
	else
		{var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

		if (objCompDoc.indexOf("_XComp") > -1)
			{MainScreenE.SWAction.value = "XCOMPDATACATEGORYNEW";
			doMainScreenFSubmit();

			MainMenuE.ToCDocTaken.value = objCompDoc;
			MainMenuE.SWAction.value = "XCOMPDATAUPD";
			if (objCompDateType != "")
				{MainMenuE.ToCUCompStatus.value = MainToCUE.ToCUCompStatus.value;
				}
			doMainMenuFSubmit();
			}

		if (objCompDoc.indexOf("_Comp_") > -1)
			{MainScreenE.ToCDocTaken.value = objCompDoc;
			MainScreenE.ToCUCompDateType.value = objCompDateType;
			MainScreenE.ToCUDir.value = objCompDir;
			var strSWAction;
			if ((MainToCUE.ToCUCompStatus.value == "2") || (MainToCUE.ToCUCompStatus.value == "3") || (MainToCUE.ToCUCompStatus.value == "4"))
				{strSWAction = "XCOMPDATAOFFERTUPD";
				}
			else
				{strSWAction = "XCOMPDATAUPD";
				}

			MainScreenE.SWAction.value = strSWAction;
			doMainScreenFSubmit();

			MainMenuE.ToCUCompDateType.value = objCompDateType;
			MainMenuE.ToCUDir.value = objCompDir;
			MainMenuE.ToCDocTaken.value = objCompDoc;
			MainMenuE.SWAction.value = strSWAction;
			if (objCompDateType != "")
				{MainMenuE.ToCUCompStatus.value = MainToCUE.ToCUCompStatus.value;
				}
			doMainMenuFSubmit();
			}
		}
}

//-------------------------------------------------------------------
// ******	update bkup dates
function doUBikeXCompDate(objDateType)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	switch (objDateType)
		{case "D":
			if (MainScreenE.CompDate1BkupDD.value.indexOf(objDateType) > -1)
				{MainScreenE.CompDate1BkupDD.value = MainScreenE.CompDateDD.value;
				}
			if (MainScreenE.CompDate2BkupDD.value.indexOf(objDateType) > -1)
				{MainScreenE.CompDate2BkupDD.value = MainScreenE.CompDateDD.value;
				}
			break;

		case "M":
			if (MainScreenE.CompDate1BkupMM.value.indexOf(objDateType) > -1)
				{MainScreenE.CompDate1BkupMM.value = MainScreenE.CompDateMM.value;
				}
			if (MainScreenE.CompDate2BkupMM.value.indexOf(objDateType) > -1)
				{MainScreenE.CompDate2BkupMM.value = MainScreenE.CompDateMM.value;
				}
			break;

		case "Y":
			if (MainScreenE.CompDate1BkupYYYY.value.indexOf(objDateType) > -1)
				{MainScreenE.CompDate1BkupYYYY.value = MainScreenE.CompDateYYYY.value;
				}
			if (MainScreenE.CompDate2BkupYYYY.value.indexOf(objDateType) > -1)
				{MainScreenE.CompDate2BkupYYYY.value = MainScreenE.CompDateYYYY.value;
				}
			break;
		}
}

//-------------------------------------------------------------------
// ******	change date with wished bkup date
function doUBikeXCompDateChange(objDateType)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var Weekday,DD,MM,YYYY;

	Weekday = MainScreenE.CompDateWeekday.value;
	DD = MainScreenE.CompDateDD.value;
	MM = MainScreenE.CompDateMM.value;
	YYYY = MainScreenE.CompDateYYYY.value;

	if (objDateType == 'E1')
		{MainScreenE.TCompDateWeekday.value = MainScreenE.CompDate1BkupWeekday.value.substr(0,2);
		MainScreenE.TCompDateDD.value = MainScreenE.CompDate1BkupDD.value;
		MainScreenE.TCompDateMM.value = MainScreenE.CompDate1BkupMM.value;
		MainScreenE.TCompDateYYYY.value = MainScreenE.CompDate1BkupYYYY.value;

		MainScreenE.CompDateWeekday.value = MainScreenE.CompDate1BkupWeekday.value;
		MainScreenE.CompDateDD.value = MainScreenE.CompDate1BkupDD.value;
		MainScreenE.CompDateMM.value = MainScreenE.CompDate1BkupMM.value;
		MainScreenE.CompDateYYYY.value = MainScreenE.CompDate1BkupYYYY.value;

		MainScreenE.E1CompDate1BkupWeekday.value = Weekday.substr(0,2);
		MainScreenE.E1CompDate1BkupDD.value = DD;
		MainScreenE.E1CompDate1BkupMM.value = MM;
		MainScreenE.E1CompDate1BkupYYYY.value = YYYY;

		MainScreenE.CompDate1BkupWeekday.value = Weekday;
		MainScreenE.CompDate1BkupDD.value = DD;
		MainScreenE.CompDate1BkupMM.value= MM;
		MainScreenE.CompDate1BkupYYYY.value = YYYY;
		}
	else
		{MainScreenE.TCompDateWeekday.value = MainScreenE.CompDate2BkupWeekday.value.substr(0,2);
		MainScreenE.TCompDateDD.value = MainScreenE.CompDate2BkupDD.value;
		MainScreenE.TCompDateMM.value = MainScreenE.CompDate2BkupMM.value;
		MainScreenE.TCompDateYYYY.value = MainScreenE.CompDate2BkupYYYY.value;

		MainScreenE.CompDateWeekday.value = MainScreenE.CompDate2BkupWeekday.value;
		MainScreenE.CompDateDD.value = MainScreenE.CompDate2BkupDD.value;
		MainScreenE.CompDateMM.value = MainScreenE.CompDate2BkupMM.value;
		MainScreenE.CompDateYYYY.value = MainScreenE.CompDate2BkupYYYY.value;

		MainScreenE.E2CompDate2BkupWeekday.value = Weekday.substr(0,2);
		MainScreenE.E2CompDate2BkupDD.value = DD;
		MainScreenE.E2CompDate2BkupMM.value = MM;
		MainScreenE.E2CompDate2BkupYYYY.value = YYYY;

		MainScreenE.CompDate2BkupWeekday.value = Weekday;
		MainScreenE.CompDate2BkupDD.value = DD;
		MainScreenE.CompDate2BkupMM.value= MM;
		MainScreenE.CompDate2BkupYYYY.value = YYYY;
		}
}

//-------------------------------------------------------------------
// ******	show journal of date changes with wished bkup dates
function doUBikeXCompDateJournal()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainScreenF = parent.MainScreenFrame.document.MainScreenForm;

	MainScreenE.SWAction.value = "XCOMPDATADATEJOURNAL";

	MainScreenF.action = "MainRemoteScreen.asp";
	MainScreenF.target = "_blank";
	MainScreenF.submit();
}

//-------------------------------------------------------------------
// ******	show competition levels when creating/updating a comp
function doUBikeXCompLevelShow(objRadioName,objCompId,objCompCatName)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var objAllCompIds,objToUse;

	if (objCompCatName != "")
		{objToUse = objCompCatName;
		}
	else
		{objToUse = objCompId;
		}

	if (objToUse == objCompCatName)
		{MainScreenE.CompL4BranchName.value = objToUse;
		}
	else
		{MainScreenE.CompL4BranchName.value = "";
		}

	switch (objRadioName)
		{case "CompL1CompIdRadio":
			MainScreenE.CompL2CompId.value = "";
			MainScreenE.CompL3CompId.value = "";

			if (typeof(MainScreenE.CompL2CompIdRadio.length) == "number")
				{for (intK=0;intK<MainScreenE.CompL2CompIdRadio.length;intK++)
					{MainScreenE.CompL2CompIdRadio[intK].checked = false;
					}
				}
			else
				{MainScreenE.CompL2CompIdRadio.checked = false;
				}

			if (typeof(MainScreenE.CompL3CompIdRadio.length) == "number")
				{for (intK=0;intK<MainScreenE.CompL3CompIdRadio.length;intK++)
					{MainScreenE.CompL3CompIdRadio[intK].checked = false;
					}
				}
			else
				{MainScreenE.CompL3CompIdRadio.checked = false;
				}

			for (intK=0;intK<MainScreenE.CompCatIdCheckbox.length;intK++)
				{MainScreenE.CompCatIdCheckbox[intK].checked = false;
				MainScreenE.CompL4BranchCatRaceNr[intK].value = "0";
				MainScreenE.CompL4BranchCatDistance1[intK].value = "000";
				MainScreenE.CompL4BranchCatDistance2[intK].value = "0";
				MainScreenE.CompCatCupCheckbox[intK].checked = false;
				MainScreenE.CompCatÖMCheckbox[intK].checked = false;
				MainScreenE.CompCatText[intK].value = "";
				}
			break;

		case "CompL2CompIdRadio":
			MainScreenE.CompL3CompId.value = "";

			if (typeof(MainScreenE.CompL3CompIdRadio.length) == "number")
				{for (intK=0;intK<MainScreenE.CompL3CompIdRadio.length;intK++)
					{MainScreenE.CompL3CompIdRadio[intK].checked = false;
					}
				}
			else
				{MainScreenE.CompL3CompIdRadio.checked = false;
				}

			for (intK=0;intK<MainScreenE.CompCatIdCheckbox.length;intK++)
				{MainScreenE.CompCatIdCheckbox[intK].checked = false;
				MainScreenE.CompL4BranchCatRaceNr[intK].value = "0";
				MainScreenE.CompL4BranchCatDistance1[intK].value = "000";
				MainScreenE.CompL4BranchCatDistance2[intK].value = "0";
				MainScreenE.CompCatCupCheckbox[intK].checked = false;
				MainScreenE.CompCatÖMCheckbox[intK].checked = false;
				MainScreenE.CompCatText[intK].value = "";
				}
			break;

		case "CompL3CompIdRadio":
			for (intK=0;intK<MainScreenE.CompCatIdCheckbox.length;intK++)
				{MainScreenE.CompCatIdCheckbox[intK].checked = false;
				MainScreenE.CompL4BranchCatRaceNr[intK].value = "0";
				MainScreenE.CompL4BranchCatDistance1[intK].value = "000";
				MainScreenE.CompL4BranchCatDistance2[intK].value = "0";
				MainScreenE.CompCatCupCheckbox[intK].checked = false;
				MainScreenE.CompCatÖMCheckbox[intK].checked = false;
				MainScreenE.CompCatText[intK].value = "";
				}
			break;
		}

	for (intI=0;intI<MainScreenE.AllCompIds.length;intI++)
		{objAllCompIds = MainScreenE.AllCompIds[intI].value;

		if (document.getElementById)
			{if (document.getElementById(objAllCompIds))
				{if (document.getElementById(objAllCompIds).id)
					{if ((document.getElementById(objAllCompIds).id == objToUse) || (document.getElementById(objAllCompIds).id == MainScreenE.CompL1CompId.value) || (document.getElementById(objAllCompIds).id == MainScreenE.CompL2CompId.value) || (document.getElementById(objAllCompIds).id == MainScreenE.CompL3CompId.value) || (document.getElementById(objAllCompIds).id == MainScreenE.CompL4BranchName.value))
						{document.getElementById(objToUse).style.display = "block";
						}
					else
						{document.getElementById(objAllCompIds).style.display = "none";
						}
					}
				}
			}
		}
}

//-------------------------------------------------------------------
// ******	set dist1 and dist2 for same race numbers
function doUBikeXCompRaceNr(objPosition)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (MainScreenE.CompL4BranchCatRaceNr[objPosition].value == "0")
		{return;
		}

	for (intI=0;intI<MainScreenE.CompL4BranchCatRaceNr.length;intI++)
		{if ((MainScreenE.CompL4BranchCatRaceNr[objPosition].value == MainScreenE.CompL4BranchCatRaceNr[intI].value) && Math.abs(intI)!=Math.abs(objPosition))
			{MainScreenE.CompL4BranchCatDistance1[objPosition].value = MainScreenE.CompL4BranchCatDistance1[intI].value;
			MainScreenE.CompL4BranchCatDistance2[objPosition].value = MainScreenE.CompL4BranchCatDistance2[intI].value;

			intI = MainScreenE.CompL4BranchCatRaceNr.length;
			}
		}
}

//-------------------------------------------------------------------
// ******	reset category fields of this competition
function doUBikeXCompCatReset(objL4CompCatName,objPosition)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var strX,strY;

	if (MainScreenE.CompCatIdCheckbox[objPosition].checked == false)
		{MainScreenE.CompL4BranchCatRaceNr[objPosition].value = "0";
		MainScreenE.CompL4BranchCatDistance1[objPosition].value = "000";
		MainScreenE.CompL4BranchCatDistance2[objPosition].value = "0";
		MainScreenE.CompCatCupCheckbox[objPosition].checked = false;
		MainScreenE.CompCatÖMCheckbox[objPosition].checked = false;
		MainScreenE.CompCatText[objPosition].value = "";
		}
}

//-------------------------------------------------------------------
// ******	allow aut championship and cup checkbox official asso only
function doUBikeXCompCatCheckbox(objUserAuth,objCheckboxName,objPosScreen)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if ((objUserAuth != 'Admin') && (objUserAuth != 'XAsso_2'))
		{if (MainScreenE[objCheckboxName][objPosScreen].checked == true)
			{MainScreenE[objCheckboxName][objPosScreen].checked = false;
			}
		else
			{MainScreenE[objCheckboxName][objPosScreen].checked = true;
			}
		if (objCheckboxName == "CompCatCupCheckbox")
			{alert ("Teilnahme Cup für durch ÖRV möglich");
			}
		else
			{alert ("Teilnahme ÖM für durch ÖRV möglich");
			}
		}
}
//-------------------------------------------------------------------
// ******	save competition data
function doUBikeXCompDataSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	var intI,intJ,intK,doDateRC,doFunctionRC,SADate,SAWeekday;

//	alert ("!" + MainScreenE.ToCDocTaken.value + "!" + DataType + "!");

	//------------------------------------------------------------------------------------------
	// ******	check date of competition
	if (typeof(MainScreenE.CompDateDD) == "object")
		{if(doUBikeXCompDateCheck('CompDateDD','CompDateMM','CompDateYYYY') == false)
			{return;
			}

		SADate = new Date(MainScreenE.CompDateYYYY.value,parseInt(Math.abs(MainScreenE.CompDateMM.value) -1),MainScreenE.CompDateDD.value);
		SAWeekday = SADate.getDay();

		switch (SAWeekday)
			{case 0:
				MainScreenE.CompDateWeekday.value = "Sonntag";
				break;
			case 1:
				MainScreenE.CompDateWeekday.value = "Montag";
				break;
			case 2:
				MainScreenE.CompDateWeekday.value = "Dienstag";
				break;
			case 3:
				MainScreenE.CompDateWeekday.value = "Mittwoch";
				break;
			case 4:
				MainScreenE.CompDateWeekday.value = "Donnerstag";
				break;
			case 5:
				MainScreenE.CompDateWeekday.value = "Freitag";
				break;
			case 6:
				MainScreenE.CompDateWeekday.value = "Samstag";
				break;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check bkup date1 of competition
	if (typeof(MainScreenE.CompDate1BkupDD) == "object")
		{if(doUBikeXCompDateCheck('CompDate1BkupDD','CompDate1BkupMM','CompDate1BkupYYYY') == false)
			{return;
			}

		SADate = new Date(MainScreenE.CompDate1BkupYYYY.value,parseInt(Math.abs(MainScreenE.CompDate1BkupMM.value) -1),MainScreenE.CompDate1BkupDD.value);
		SAWeekday = SADate.getDay();

		switch (SAWeekday)
			{case 0:
				MainScreenE.CompDate1BkupWeekday.value = "Sonntag";
				break;
			case 1:
				MainScreenE.CompDate1BkupWeekday.value = "Montag";
				break;
			case 2:
				MainScreenE.CompDate1BkupWeekday.value = "Dienstag";
				break;
			case 3:
				MainScreenE.CompDate1BkupWeekday.value = "Mittwoch";
				break;
			case 4:
				MainScreenE.CompDate1BkupWeekday.value = "Donnerstag";
				break;
			case 5:
				MainScreenE.CompDate1BkupWeekday.value = "Freitag";
				break;
			case 6:
				MainScreenE.CompDate1BkupWeekday.value = "Samstag";
				break;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check bkup date2 of competition
	if (typeof(MainScreenE.CompDate2BkupDD) == "object")
		{if(doUBikeXCompDateCheck('CompDate2BkupDD','CompDate2BkupMM','CompDate2BkupYYYY') == false)
			{return;
			}

		SADate = new Date(MainScreenE.CompDate2BkupYYYY.value,parseInt(Math.abs(MainScreenE.CompDate2BkupMM.value) -1),MainScreenE.CompDate2BkupDD.value);
		SAWeekday = SADate.getDay();

		switch (SAWeekday)
			{case 0:
				MainScreenE.CompDate2BkupWeekday.value = "Sonntag";
				break;
			case 1:
				MainScreenE.CompDate2BkupWeekday.value = "Montag";
				break;
			case 2:
				MainScreenE.CompDate2BkupWeekday.value = "Dienstag";
				break;
			case 3:
				MainScreenE.CompDate2BkupWeekday.value = "Mittwoch";
				break;
			case 4:
				MainScreenE.CompDate2BkupWeekday.value = "Donnerstag";
				break;
			case 5:
				MainScreenE.CompDate2BkupWeekday.value = "Freitag";
				break;
			case 6:
				MainScreenE.CompDate2BkupWeekday.value = "Samstag";
				break;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check place of competition
	if (typeof(MainScreenE.CompPlace) == "object")
		{if (MainScreenE.CompPlace.value == "")
			{alert ("Ort fehlerhaft");
			return;
			}
		}
	//------------------------------------------------------------------------------------------
	// ******	check all category fields of competition
	if (typeof(MainScreenE.CompCatIdCheckbox) == "object")
		{if (doFunctionRC = (doUBikeXCompProposalSaveCats() == false))
			{return;
			}
		}

	MainScreenE.SWAction.value = "XCOMPDATASAVE";
	doMainScreenFSubmit();

	if (MainScreenE.CompStatus.value != MainScreenE.CompStatusOld.value)
		{MainMenuE.SWAction.value = "XCOMPDATASTART";
		}
	else
		{MainMenuE.SWAction.value = "XCOMPDATAUPD";
		}
	doMainMenuFSubmit();

	parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);
}

//-------------------------------------------------------------------
// ******	check category fields of this competition
function doUBikeXCompProposalSaveCats()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var intCompCatField,AnyCatChecked;

	for (intCompCatField=0;intCompCatField<MainScreenE.CompCatField.length;intCompCatField++)
		{MainScreenE.CompCatField[intCompCatField].value = "";
		}
/*
	for (intCompCatField=0;intCompCatField<MainScreenE.CompCatText.length;intCompCatField++)
		{alert (MainScreenE.CompCatText[intCompCatField].value +"/" +MainScreenE.CompCatIdCheckbox[intCompCatField].checked);
		}
*/
	intCompCatField = 0;
	AnyCatChecked = "N";

	for (intI=0;intI<MainScreenE.CompCatIdCheckbox.length;intI++)
		{if (MainScreenE.CompCatIdCheckbox[intI].checked == true)
			{AnyCatChecked = "Y";

			if (MainScreenE.L4BranchCatRaceNr[intI].value == "Y")
				{MainScreenE.CompL4BranchCatRaceNr[intI].value = doSATrim(MainScreenE.CompL4BranchCatRaceNr[intI].value);
				intJ = MainScreenE.CompL4BranchCatRaceNr[intI].value.indexOf(".");

				if ((MainScreenE.CompL4BranchCatRaceNr[intI].value == "") || (isNaN(MainScreenE.CompL4BranchCatRaceNr[intI].value) == true) || (intJ > -1) || (parseInt(MainScreenE.CompL4BranchCatRaceNr[intI].value) == 0))
					{alert ("Nr. des Rennens fehlerhaft");
					MainScreenE.CompL4BranchCatRaceNr[intI].select();
					return false;
					}
				}

			if (MainScreenE.L4BranchCatDist[intI].value == "Y")
				{MainScreenE.CompL4BranchCatDistance1[intI].value = doSATrim(MainScreenE.CompL4BranchCatDistance1[intI].value);
				intJ = MainScreenE.CompL4BranchCatDistance1[intI].value.indexOf(".");

				if ((MainScreenE.CompL4BranchCatDistance1[intI].value == "") || (isNaN(MainScreenE.CompL4BranchCatDistance1[intI].value) == true) || (intJ > -1) || (parseInt(MainScreenE.CompL4BranchCatDistance1[intI].value) == 0))
					{alert ("Distanz fehlerhaft");
					MainScreenE.CompL4BranchCatDistance1[intI].select();
					return false;
					}

				MainScreenE.CompL4BranchCatDistance2[intI].value = doSATrim(MainScreenE.CompL4BranchCatDistance2[intI].value);
				intJ = MainScreenE.CompL4BranchCatDistance2[intI].value.indexOf(".");

				if ((MainScreenE.CompL4BranchCatDistance2[intI].value == "") || (isNaN(MainScreenE.CompL4BranchCatDistance2[intI].value) == true) || (intJ > -1))
					{alert ("Distanz fehlerhaft");
					MainScreenE.CompL4BranchCatDistance2[intI].select();
					return false;
					}
				}

//			alert (MainScreenE.CompCatIdCheckbox.length +"/" +MainScreenE.CompCatText.length);

			MainScreenE.CompCatField[intCompCatField *7].value = MainScreenE.CompL4BranchCatId[intI].value;
			MainScreenE.CompCatField[intCompCatField *7 +1].value = parseInt(MainScreenE.CompL4BranchCatRaceNr[intI].value);
			MainScreenE.CompCatField[intCompCatField *7 +2].value = parseInt(MainScreenE.CompL4BranchCatDistance1[intI].value);
			MainScreenE.CompCatField[intCompCatField *7 +3].value = parseInt(MainScreenE.CompL4BranchCatDistance2[intI].value);
			if (MainScreenE.CompCatCupCheckbox[intI].checked == false)
				{MainScreenE.CompCatField[intCompCatField *7 +4].value = "N";
				}
			else
				{MainScreenE.CompCatField[intCompCatField *7 +4].value = "Y";
				}
			if (MainScreenE.CompCatÖMCheckbox[intI].checked == false)
				{MainScreenE.CompCatField[intCompCatField *7 +5].value = "N";
				}
			else
				{MainScreenE.CompCatField[intCompCatField *7 +5].value = "Y";
				}
			MainScreenE.CompCatText[intI].value = MainScreenE.CompCatText[intI].value.replace(/,/,"/")
			MainScreenE.CompCatField[intCompCatField *7 +6].value = MainScreenE.CompCatText[intI].value;

			intCompCatField++;
			}
		else
			{if (MainScreenE.L4BranchCatRaceNr[intI].value == "Y")
				{MainScreenE.CompL4BranchCatRaceNr[intI].value = doSATrim(MainScreenE.CompL4BranchCatRaceNr[intI].value);
				intJ = MainScreenE.CompL4BranchCatRaceNr[intI].value.indexOf(".");

				if ((MainScreenE.CompL4BranchCatRaceNr[intI].value == "") || (isNaN(MainScreenE.CompL4BranchCatRaceNr[intI].value) == true) || (intJ > -1) || (parseInt(MainScreenE.CompL4BranchCatRaceNr[intI].value) > 0))
					{alert ("Nr. des Rennens auf Null setzen oder Kategorie anklicken");
					MainScreenE.CompL4BranchCatRaceNr[intI].select();
					return false;
					}
				}

			if (MainScreenE.L4BranchCatDist[intI].value == "Y")
				{MainScreenE.CompL4BranchCatDistance1[intI].value = doSATrim(MainScreenE.CompL4BranchCatDistance1[intI].value);
				intJ = MainScreenE.CompL4BranchCatDistance1[intI].value.indexOf(".");

				if ((MainScreenE.CompL4BranchCatDistance1[intI].value == "") || (isNaN(MainScreenE.CompL4BranchCatDistance1[intI].value) == true) || (intJ > -1) || (parseInt(MainScreenE.CompL4BranchCatDistance1[intI].value) > 0))
					{alert ("Distanz auf Null setzen oder Kategorie anklicken");
					MainScreenE.CompL4BranchCatDistance1[intI].select();
					return false;
					}

				MainScreenE.CompL4BranchCatDistance2[intI].value = doSATrim(MainScreenE.CompL4BranchCatDistance2[intI].value);
				intJ = MainScreenE.CompL4BranchCatDistance2[intI].value.indexOf(".");
				if ((MainScreenE.CompL4BranchCatDistance2[intI].value == "") || (isNaN(MainScreenE.CompL4BranchCatDistance2[intI].value) == true) || (intJ > -1) || (parseInt(MainScreenE.CompL4BranchCatDistance2[intI].value) > 0))
					{alert ("Distanz auf Null setzen oder Kategorie anklicken");
					MainScreenE.CompL4BranchCatDistance2[intI].select();
					return false;
					}
				}

			if (MainScreenE.CompCatCupCheckbox[intI].checked == true)
				{if ((MainScreenE.CompL4BranchName.value != "ÖMCup") && (MainScreenE.CompL4BranchName.value != "Cup") && (MainScreenE.CompL4BranchName.value != "ÖM"))
					{alert ("Cup Serie entfernen oder Kategorie anklicken");
					return false;
					}
				}

			if (MainScreenE.CompCatÖMCheckbox[intI].checked == true)
				{if ((MainScreenE.CompL4BranchName.value != "ÖMCup") && (MainScreenE.CompL4BranchName.value != "Cup") && (MainScreenE.CompL4BranchName.value != "ÖM"))
					{alert ("Oesterr. Meisterschaften entfernen oder Kategorie anklicken");
					return false;
					}
				}
			}
		}

	if (AnyCatChecked == "N")
		{switch (MainScreenE.CompL4BranchName.value)
			{case "ÖMCup":
				for (intI=0;intI<MainScreenE.CompCatCupCheckbox.length;intI++)
					{if (MainScreenE.CompCatCupCheckbox[intI].checked == true)
						{MainScreenE.CompCatField[0 +4].value = "Y";
						}
					if (MainScreenE.CompCatÖMCheckbox[intI].checked == true)
						{MainScreenE.CompCatField[0 +5].value = "Y";
						}
					}

					if (MainScreenE.CompCatField[0 +4].value != "Y")
						{MainScreenE.CompCatField[0 +4].value = "N";
						}
					if (MainScreenE.CompCatField[0 +5].value != "Y")
						{MainScreenE.CompCatField[0 +5].value = "N";
						}
				break;

			case "Cup":
				break;

			case "ÖM":
				break;

			default:
				alert ("speichern OHNE Kategorie nicht moeglich")
				return false;
			}
		}
}

//-------------------------------------------------------------------
// ******	create offert competition data
function doUBikeXCompDataOffertUpd()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
//	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	if (MainMenuE.SWAction.value == "XCOMPDATAUPD")
		{if (doFunctionRC = (doUBikeXCompProposalSaveCats() == false))
			{return;
			}

		for (intI=0;intI<MainScreenE.CompCatIdCheckbox.length;intI++)
			{if (MainScreenE.CompCatIdCheckbox[intI].checked == true)
				{if (MainScreenE.L4BranchCatRaceNr[intI].value == "Y")
					{if (MainScreenE.CompL4BranchCatRaceNr[intI].value != MainScreenE.CompL4BranchCatRaceNrOld[intI].value)
						{alert ("Geaenderte Nummern speichern");
						return;
						}
					}
				}
			}
		}

	MainScreenE.SWAction.value = "XCOMPDATAOFFERTUPD";
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "XCOMPDATAOFFERTUPD";
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
// ******	save offert competition data
function doUBikeXCompDataOffertSave()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
//	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;
	var SubmitTocU;

	SubmitTocU = "N";
	/* --------------------------------------------------------------- */
	/* check comp entry fee */
	if (typeof(MainScreenE.CompEntryfee) == "object")
		{if(MainScreenE.CompEntryfee.value == "")
			{alert ("Nenngeldüberw. fehlerhaft");
			MainScreenE.CompEntryfee.select();
			return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check comp entry human */
	if (typeof(MainScreenE.CompEntryHuman) == "object")
		{if(MainScreenE.CompEntryHuman.value == "")
			{alert ("Nennungen/Person,Anschrift fehlerhaft");
			MainScreenE.CompEntryHuman.select();
			return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check comp entry human email */
	if (typeof(MainScreenE.CompEntryHumanEmail) == "object")
		{if(MainScreenE.CompEntryHumanEmail.value == "")
			{alert ("Nennungen/eMail fehlerhaft");
			MainScreenE.CompEntryHumanEmail.select();
			return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check comp entry human phone */
	if (typeof(MainScreenE.CompEntryHumanPhone) == "object")
		{if(MainScreenE.CompEntryHumanPhone.value == "")
			{alert ("Nennungen/Telefonnr. fehlerhaft");
			MainScreenE.CompEntryHumanPhone.select();
			return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check comp entry date */
	if (typeof(MainScreenE.CompEntryDateDD) == "object")
		{if(doUBikeXCompDateCheck('CompEntryDateDD', 'CompEntryDateMM', 'CompEntryDateYYYY') == false)
			{return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check comp race office address */
	if (typeof(MainScreenE.CompRaceOffice) == "object")
		{if(MainScreenE.CompRaceOffice.value == "")
			{alert ("Rennbüro/Anschrift fehlerhaft");
			MainScreenE.CompRaceOffice.select();
			return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check comp race office time */
	if (typeof(MainScreenE.CompRaceOfficeTime) == "object")
		{if(MainScreenE.CompRaceOfficeTime.value == "")
			{alert ("Rennbüro/Oeffnungszeiten fehlerhaft");
			MainScreenE.CompRaceOfficeTime.select();
			return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check comp starting number distribution */
	if (typeof(MainScreenE.CompStartNrDistribution) == "object")
		{if(MainScreenE.CompStartNrDistribution.value == "")
			{alert ("Startnr. Ausgabe/Anschrift fehlerhaft");
			MainScreenE.CompStartNrDistribution.select();
			return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check comp starting number distribution time */
	if (typeof(MainScreenE.CompStartNrDistributionTime) == "object")
		{if(MainScreenE.CompStartNrDistributionTime.value == "")
			{alert ("Startnr. Ausgabe/Oeffnungszeit fehlerhaft");
			MainScreenE.CompStartNrDistributionTime.select();
			return;
			}
		}
/*	B20070201-01 - begin */
	if (MainScreenE.CompStatus.value == "1")
		{if (typeof(MainScreenE.CompOffertRace) == "undefined")
			{MainScreenE.CompStatus.value = "2";

			MainMenuE.SWAction.value = "XCOMPDATASTART";
			doMainMenuFSubmit();
			SubmitTocU = "Y";
			}
		else
			{
			if (typeof(MainScreenE.CompOffertRace.length) == "number")
				{if (typeof(MainScreenE.ThisOneDone) == "object")
					{if (typeof(MainScreenE.ThisOneDone.length) == "number")
						{if (Math.abs(MainScreenE.CompOffertRace.length) == Math.abs(MainScreenE.ThisOneDone.length))
							{MainScreenE.CompStatus.value = "2";

							MainMenuE.SWAction.value = "XCOMPDATASTART";
							doMainMenuFSubmit();
							SubmitTocU = "Y";
							}
						}
					}
				}
			else
				{if (typeof(MainScreenE.CompOffertRace) == "object")
					{if (typeof(MainScreenE.ThisOneDone) == "object")
						{MainScreenE.CompStatus.value = "2";

						MainMenuE.SWAction.value = "XCOMPDATASTART";
						doMainMenuFSubmit();
						SubmitTocU = "Y";
						}
					}
				}
			}
		}
/*	B20070201-01 - end */

/*	B20070201-01 - begin
			MainScreenE.CompStatus.value = "2";

			MainMenuE.SWAction.value = "XCOMPDATASTART";
			doMainMenuFSubmit();
			parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);
		}
	B20070201-01 - end */
	/* --------------------------------------------------------------- */
	/* check comp licence number */
	if (typeof(MainScreenE.CompLicenceNr) == "object")
		{if(MainScreenE.CompLicenceNr.value != "")
			{MainScreenE.CompStatus.value = "4";
			SubmitTocU = "Y";

//			parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);	/*	B20070201-01 */
			}
		}

	/* check comp canceled */
	if (typeof(MainScreenE.CompCanceled) == "object")
		{if(MainScreenE.CompCanceled.value != MainScreenE.CompCanceledOld.value)
			{SubmitTocU = "Y";															/*	B20070202-01 */
			}
		}

	MainScreenE.SWAction.value = "XCOMPDATAOFFERTSAVE";
	doMainScreenFSubmit();

	if (SubmitTocU == "Y")
		{parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);	/*	B20070201-01 */
		}
}

//-------------------------------------------------------------------
// ******	create offert competition data for a specific race
function doUBikeXCompDataOffertUpdRace(objCompRaceNr)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
//	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	MainScreenE.CompRaceNr.value = objCompRaceNr;
	MainScreenE.SWAction.value = "XCOMPDATAOFFERTUPDRACE";
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "XCOMPDATAOFFERTUPDRACE";
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
// ******	actualize offert competition data for a specific race
function doUBikeMenuCompOffertUpdRaceActualize()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var objCompRaceNr = MainScreenE.CompRaceNr.value;
	doUBikeXCompDataOffertUpdRace(objCompRaceNr);
}

//-------------------------------------------------------------------
// ******	save offert race data
function doUBikeXCompDataOffertSaveRace()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var intI,intJ;

	/* --------------------------------------------------------------- */
	/* check race track */
	if (typeof(MainScreenE.CompTrack) == "object")
		{if(MainScreenE.CompTrack.value == "")
			{alert ("Strecke fehlerhaft");
			MainScreenE.CompTrack.select();
			return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check start time hours */
	if (typeof(MainScreenE.CompStartTimeHH) == "object")
		{intI = MainScreenE.CompStartTimeHH.value.indexOf(".");
		if ((isNaN(MainScreenE.CompStartTimeHH.value) == true) || (intI > -1) || (parseInt(MainScreenE.CompStartTimeHH.value) < 0) || (parseInt(MainScreenE.CompStartTimeHH.value) > 23))
			{alert ("Startzeit/Stunden fehlerhaft");
			MainScreenE.CompStartTimeHH.select();
			return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check start time minutes */
	if (typeof(MainScreenE.CompStartTimeMM) == "object")
		{intI = MainScreenE.CompStartTimeMM.value.indexOf(".");
		if ((isNaN(MainScreenE.CompStartTimeMM.value) == true) || (intI > -1) || (parseInt(MainScreenE.CompStartTimeMM.value) < 0) || (parseInt(MainScreenE.CompStartTimeMM.value) > 59))
			{alert ("Startzeit/Minuten fehlerhaft");
			MainScreenE.CompStartTimeMM.select();
			return;
			}
		}

	/* --------------------------------------------------------------- */
	/* check chash prices */
	if (typeof(MainScreenE.CompCashPrice) == "object")
		{for (intI=0;intI<MainScreenE.CompCashPrice.length;intI++)
			{intJ = MainScreenE.CompCashPrice[intI].value.indexOf(".");
			if ((isNaN(MainScreenE.CompCashPrice[intI].value) == true) || (intJ > -1) || (parseInt(MainScreenE.CompCashPrice[intI].value) < 0) || (MainScreenE.CompCashPrice[intI].value == "") || (MainScreenE.CompCashPrice[intI].value.indexOf(" ") > -1))
				{MainScreenE.CompCashPrice[intI].value = "0";
				alert ("Barpreise/Eingabe fehlerhaft");
				MainScreenE.CompCashPrice[intI].select();
				return;
				}
			}
		}

	/* --------------------------------------------------------------- */
	/* check object prices */
	if (typeof(MainScreenE.CompObjectPrice) == "object")
		{for (intI=0;intI<MainScreenE.CompObjectPrice.length;intI++)
			{intJ = MainScreenE.CompObjectPrice[intI].value.indexOf(".");
			if ((isNaN(MainScreenE.CompObjectPrice[intI].value) == true) || (intJ > -1) || (parseInt(MainScreenE.CompObjectPrice[intI].value) < 0) || (MainScreenE.CompObjectPrice[intI].value == "") || (MainScreenE.CompObjectPrice[intI].value.indexOf(" ") > -1))
				{MainScreenE.CompObjectPrice[intI].value = "0";
				alert ("Sachpreise/Eingabe fehlerhaft");
				MainScreenE.CompObjectPrice[intI].select();
				return;
				}
			}
		}

	MainScreenE.SWAction.value = "XCOMPDATAOFFERTSAVERACE";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "XCOMPDATAOFFERTUPD";
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
// ******	give possibility to upload a document
function doUBikeXCompDataOffertUpdRaceDataUpload()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainScreenF = parent.MainScreenFrame.document.MainScreenForm;

	MainScreenF.action = "AdminUpload.php";
	MainScreenF.target = "_blank";
	MainScreenF.submit();
}

//-------------------------------------------------------------------
// ******	delete competition offert race data document
function doUBikeXCompDataOffertDeleteRaceDataDoc()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	MainScreenE.SWAction.value = "XCOMPDATAOFFERTDELETERACEDATADOC";
	doMainScreenFSubmit();
}

//-------------------------------------------------------------------
// ******	show competition race offert data document in new window
function doUBikeXCompDataOffertShowRaceDataDoc(objDocName)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainScreenF = parent.MainScreenFrame.document.MainScreenForm;

	var myLocationHref = window.location.href.toLowerCase();
	var myHeight = 400;
	var myWidth = 600;
	var strWindowAttr = "status=yes,fullscreen=no,left=0,menubar=no,resizable=yes,scrollbars=yes,titlebar=no,toolbar=no,top=0,height="+myHeight+",width="+myWidth;

	if (myLocationHref.indexOf("//www") < 0)
		{strSWWindow = open("http://acer-747b59264e/sportadapter/ubikedb/" +objDocName,"",strWindowAttr);
		}
	else
		{strSWWindow = open("http://www.sportadapter.com/ubikedb/" +objDocName,"",strWindowAttr);
		}
}

//-------------------------------------------------------------------
// ******	list competition data
function doUBikeXCompList(objSelection)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	MainScreenE.SWAction.value = "COMPLIST" +objSelection;
	MainScreenE.ToCDocTaken.value = "";
	MainScreenE.ToCUCompId.value = MainToCUE.ToCUCompId.value;
	MainScreenE.ToCUCompStatus.value = MainToCUE.ToCUCompStatus.value;
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "COMPLIST" +objSelection;
	MainMenuE.ToCDocTaken.value = MainMenuE.ToCIdTaken.value +".xml";
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
// ******	list details of competition data
function doUBikeXCompDetailList(objSelection)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	MainScreenE.ToCUCompDateType.value = "";

	MainScreenE.SWAction.value = "COMPDETAILLIST" +objSelection;
	MainScreenE.ToCDocTaken.value = "";
	MainScreenE.ToCUCompId.value = MainToCUE.ToCUCompId.value;
	MainScreenE.ToCUCompStatus.value = MainToCUE.ToCUCompStatus.value;
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "COMPDETAILLIST" +objSelection;
	MainMenuE.ToCDocTaken.value = MainMenuE.ToCIdTaken.value +".xml";
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
// ******	archive competition data
function doUBikeXCompArchiveList(objSelection)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	MainScreenE.SWAction.value = "COMPARCHIVELIST" +objSelection;
	MainScreenE.ToCDocTaken.value = MainScreenE.ToCIdTaken.value +".xml";
	MainScreenE.ToCUCompId.value = MainToCUE.ToCUCompId.value;
	MainScreenE.ToCUCompStatus.value = MainToCUE.ToCUCompStatus.value;
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "COMPARCHIVELIST" +objSelection;
	MainMenuE.ToCDocTaken.value = MainMenuE.ToCIdTaken.value +".xml";
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
// ******	select all archive competition data
function doUBikeXCompArchiveListSelectAll()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (typeof(MainScreenE.ArchiveListCheckbox) == "object")
		{if (typeof(MainScreenE.ArchiveListCheckbox.length) == "number")
			{for (intI=0;intI<MainScreenE.ArchiveListCheckbox.length;intI++)
				{if (MainScreenE.ArchiveListSwitch.value == "0")
					{MainScreenE.ArchiveListCheckbox[intI].checked=true;
					MainScreenE.ArchiveCheckbox[intI].value = "Y";
					}
				else
					{MainScreenE.ArchiveListCheckbox[intI].checked=false;
					MainScreenE.ArchiveCheckbox[intI].value = "N";
					}
				}
			}
		else
			{if (MainScreenE.ArchiveListSwitch.value == "0")
				{MainScreenE.ArchiveListCheckbox.checked=true;
				MainScreenE.ArchiveCheckbox.value = "Y";
				}
			else
				{MainScreenE.ArchiveListCheckbox.checked=false;
				MainScreenE.ArchiveCheckbox.value = "N";
				}
			}

		if (MainScreenE.ArchiveListSwitch.value == "0")
			{MainScreenE.ArchiveListSwitch.value = "1";
			}
		else
			{MainScreenE.ArchiveListSwitch.value = "0";
			}
		}
}

//-------------------------------------------------------------------
// ******	select archive competition data
function doUBikeXCompArchiveListSelect()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (typeof(MainScreenE.ArchiveListCheckbox) == "object")
		{if (typeof(MainScreenE.ArchiveListCheckbox.length) == "number")
			{for (intI=0;intI<MainScreenE.ArchiveListCheckbox.length;intI++)
				{if (MainScreenE.ArchiveListCheckbox[intI].checked == true)
					{MainScreenE.ArchiveCheckbox[intI].value = "Y";
					}
				else
					{MainScreenE.ArchiveCheckbox[intI].value = "N";
					}
				}
			}
		else
			{if (MainScreenE.ArchiveListCheckbox.checked == true)
				{MainScreenE.ArchiveCheckbox.value = "Y";
				}
			else
				{MainScreenE.ArchiveCheckbox.value = "N";
				}
			}
		}
}

//-------------------------------------------------------------------
// ******	archive competition
function doUBikeXCompArchive()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	MainScreenE.SWAction.value = "XCOMPARCHIVE";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "XCOMPDATASTART";
	doMainMenuFSubmit();
	parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);
}

//-------------------------------------------------------------------
// ******	delete competition data
function doUBikeXCompDeleteList(objSelection)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;

	MainScreenE.SWAction.value = "COMPDELETELIST" +objSelection;
	MainScreenE.ToCDocTaken.value = MainScreenE.ToCIdTaken.value +".xml";
	MainScreenE.ToCUCompId.value = MainToCUE.ToCUCompId.value;
	MainScreenE.ToCUCompStatus.value = MainToCUE.ToCUCompStatus.value;
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "COMPDELETELIST" +objSelection;
	MainMenuE.ToCDocTaken.value = MainMenuE.ToCIdTaken.value +".xml";
	doMainMenuFSubmit();
}

//-------------------------------------------------------------------
// ******	select all delete competition data
function doUBikeXCompDeleteListSelectAll()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (typeof(MainScreenE.DeleteListCheckbox) == "object")
		{for (intI=0;intI<MainScreenE.DeleteListCheckbox.length;intI++)
			{if (MainScreenE.DeleteListSwitch.value == "0")
				{MainScreenE.DeleteListCheckbox[intI].checked=true;
				MainScreenE.DeleteCheckbox[intI].value = "Y";
				}
			else
				{MainScreenE.DeleteListCheckbox[intI].checked=false;
				MainScreenE.DeleteCheckbox[intI].value = "N";
				}
			}

		if (MainScreenE.DeleteListSwitch.value == "0")
			{MainScreenE.DeleteListSwitch.value = "1";
			}
		else
			{MainScreenE.DeleteListSwitch.value = "0";
			}
		}
}

//-------------------------------------------------------------------
// ******	select delete competition data
function doUBikeXCompDeleteListSelect()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	if (typeof(MainScreenE.DeleteListCheckbox) == "object")
		{for (intI=0;intI<MainScreenE.DeleteListCheckbox.length;intI++)
			{if (MainScreenE.DeleteListCheckbox[intI].checked == true)
				{MainScreenE.DeleteCheckbox[intI].value = "Y";
				}
			else
				{MainScreenE.DeleteCheckbox[intI].value = "N";
				}
			}
		}
}

//-------------------------------------------------------------------
// ******	delete competition from list
function doUBikeXCompDeleteFromList()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	var Check = confirm("Wollen Sie diese Veranstaltung(en) wirklich löschen?")
	if (Check == false)
		return;

	MainScreenE.SWAction.value = "XCOMPDELETEFROMLIST";
	doMainScreenFSubmit();
	MainMenuE.SWAction.value = "XCOMPDATASTART";
	doMainMenuFSubmit();
	parent.MainToCUFrame.setTimeout("doMainToCUFSubmit();",2000);
}

//-------------------------------------------------------------------
// ******	delete competition
function doUBikeXCompDelete()
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;
	var MainMenuE = parent.MainMenuFrame.document.MainMenuForm.elements;
	var MainToCUE = parent.MainToCUFrame.document.MainToCUForm.elements;

	var Check = confirm("Wollen Sie diese Veranstaltung wirklich löschen?")
	if (Check == false)
		return;

	MainScreenE.FrameReady.value = "";
//	doMainProcessInWorkWindow();
	MainScreenE.SWAction.value = "XCOMPDELETE";
	doMainScreenFSubmit();

	MainMenuE.SWAction.value = "XCOMPDATADESCRUPD";
	MainMenuE.ToCDocTaken.value = MainScreenE.ToCIdTaken.value +".xml";
	MainMenuFSubmitCheck = window.setInterval("doMainMenuFSubmitCheck()",500);

	MainToCUFSubmitCheck = window.setInterval("doMainToCUFSubmitCheck()",500);
}

//-------------------------------------------------------------------
// ******	check competition dates
function doUBikeXCompDateCheck(objDD,objMM,objYYYY)
{	var MainScreenE = parent.MainScreenFrame.document.MainScreenForm.elements;

	var intI,doDateRC;

	intI = MainScreenE[objDD].value.indexOf(".");
	if (doDateRC = (doDDValidity(MainScreenE[objDD].value,intI) == false))
		{alert ("Termin/Tag fehlerhaft");
		MainScreenE[objDD].select();
		return false;
		}

	intI = MainScreenE[objMM].value.indexOf(".");
	if (doDateRC = (doMMValidity(MainScreenE[objMM].value,intI) == false))
		{alert ("Termin/Monat fehlerhaft");
		MainScreenE[objMM].select();
		return false;
		}

	if (doDateRC = (doYYYYValidity(MainScreenE[objYYYY].value) == false))
		{alert ("Termin/Jahr fehlerhaft");
		MainScreenE[objYYYY].select();
		return false;
		}

	if (MainScreenE[objDD].value.substr(0,1) == 0)
		{MainScreenE[objDD].value = MainScreenE[objDD].value.substr(1,1);
		}
	if (MainScreenE[objMM].value.substr(0,1) == 0)
		{MainScreenE[objMM].value = MainScreenE[objMM].value.substr(1,1);
		}

	strX = new Date();
	if (doDateRC = (doDateValidity(MainScreenE[objDD].value,MainScreenE[objMM].value) == false))
		{alert ("Termin/Ungueltiges Datum");
		MainScreenE[objDD].select();
		return false;
		}

	if ((objDD.indexOf("Deadline") == -1) && (objDD.indexOf("CompEntryDate") == -1))
		{if (parseInt(MainScreenE[objYYYY].value) <  parseInt(strX.getFullYear()))
			{alert ("Termin fehlerhaft (Jahr < akt. Jahr)");
			MainScreenE[objYYYY].select();
			return false;
			}
		else
			{if (parseInt(MainScreenE[objYYYY].value) ==  parseInt(strX.getFullYear()))
				{if (parseInt(MainScreenE[objMM].value) -1 < parseInt(strX.getMonth()))
					{alert ("Termin fehlerhaft (Monat < akt. Monat)");
					MainScreenE[objMM].select();
					return false;
					}
				else
					{if (parseInt(MainScreenE[objMM].value) -1 == parseInt(strX.getMonth()))
						{if (parseInt(MainScreenE[objDD].value) < parseInt(strX.getDate()))
							{alert ("Termin fehlerhaft (Tag < akt. Tag)");
							MainScreenE[objDD].select();
							return false;
							}
						}
					}
				}
			}
		}

	if (doDateRC = (doLeapYearValidity(MainScreenE[objDD].value,MainScreenE[objMM].value,MainScreenE[objYYYY].value) == false))
		{alert ("Termin/Ungueltiges Datum");
		MainScreenE[objDD].select();
		return false;
		}
}

