function ValidateForm()
{
	var aMand = new Array( 'strOponent', 'dateGame' );
	var aDate = new Array( 'dateGame' );
	var aInt = new Array();
	var aCur = new Array( 'dblPriceGS', 'dblPriceAll' );
	
	return ValidateInput( aMand, aDate, aInt, aCur );
}

function DeleteJourney( strName, strURL )
{
	var bOK = window.confirm( "Eintrag <" + strName + "> löschen?" );
	if( bOK ==true )
	{
		window.location = strURL;
	}
}

function ValidateJourneyEdit()
{
	var aMand = new Array( 'strLastName', 'strFirstName' );
	var aDate = new Array( 'dateBirth', 'datePassportValid' );
	var aInt = new Array('iPersons', 'iBusNr');
	var aCur = new Array( 'dblPayJourneyEUR', 'dblPayVoucherEUR' );
	
	return ValidateInput( aMand, aDate, aInt, aCur );
}

function ValidateJourneyReg()
{
	var cbGS = document.getElementById( 'bGSMember' );
	
	if( !cbGS )
	{
		return false;
	}
	
	if( cbGS.checked )
	{
		// GS-Member: only check First- Lastname and GS-MemberID
		var aMand = new Array( 'strDeparture', 'strLastName', 'strFirstName', 'strGSMemberNr' );
		var aDate = new Array();
	}
	else
	{
		// No Member: all fuelds are mandatory
		var aMand = new Array( 'strDeparture', 'datePassportValid', 'strPassportNr', 'strPhone', 'strEMail', 'dateBirth', 'strCity', 'strPostcode', 'strStr', 'strLastName', 'strFirstName' );
		var aDate = new Array( 'datePassportValid', 'dateBirth' );
	}
	
	var aInt = new Array();
	var aCur = new Array();
	
	return ValidateInput( aMand, aDate, aInt, aCur );
}

function OnOnlyVoucherClicked()
{
	var cbOnlyVoucher = document.getElementById( 'bVoucherOnly' );
	var sbDeparture = document.getElementById( 'strDeparture' );
	if( cbOnlyVoucher != null && sbDeparture != null )
	{
		if( cbOnlyVoucher.checked )
		{
			sbDeparture.selectedIndex = sbDeparture.length - 1;
		}
		else
		{
			sbDeparture.selectedIndex = 0;
		}
	}
}

function OnDepartureSelected()
{
	var cbOnlyVoucher = document.getElementById( 'bVoucherOnly' );
	var sbDeparture = document.getElementById( 'strDeparture' );
	if( cbOnlyVoucher != null && sbDeparture != null )
	{
		if( sbDeparture.selectedIndex == ( sbDeparture.length - 1 ) )
		{
			cbOnlyVoucher.checked = true;
		}
		else
		{
			cbOnlyVoucher.checked = false;
		}
	}
}

function OnDirectionSelected()
{
	var sbDeparture = document.getElementById( 'strDeparture' );
	var sbDirection = document.getElementById( 'strDirection' );
	if( sbDirection != null && sbDeparture != null )
	{
		// only Return -> set Departure empty
		if( sbDirection.selectedIndex == 2  )
		{
			sbDeparture.selectedIndex = 0;
		}
	}
}


