function doSubmitContactList()
{
	var objListForm = document.getElementById( 'contactformlist' );
	if( objListForm != null )
	{
		if( checkDataContactList() )
		{
			objListForm.submit();
		}
	}

	return false;
}

function checkDataContactList()
{
	var bStatus = true;
	var Msg = "Eingabefehler... \n";
		
	var objList = document.getElementById( 'listselector' );
	if( objList != null )
	{
		if( objList.selectedIndex >= 0 && objList.options[ objList.selectedIndex ].value == '0' )
		{
			Msg += ' - Es muss ein Eintrag aus der Liste ausgewählt werden...\n';
			bStatus = false;
		}
	}


	if( !bStatus )
	{
		alert( Msg );
	}

	return bStatus;
}



function doSubmitContactData()
{
	var objDataForm = document.getElementById( 'contactformdata' );
	if( objDataForm != null )
	{
		if( checkDataContactData() )
		{
			objDataForm.submit();
		}
	}

	return false;
}

function checkDataContactData()
{
	var bStatus = true;
	var Msg = "Eingabefehler... \n";
		
	var objTitle = document.getElementById( 'user_title' );
	if( objTitle != null )
	{
		if( objTitle.selectedIndex >= 0 && objTitle.options[ objTitle.selectedIndex ].value == '0' )
		{
			Msg += ' ... Im Feld - Anrede - muss ein Eintrag ausgewählt sein...\n';
			bStatus = false;
		}
	}

	var objFirstName = document.getElementById( 'user_firstname' );
	if( objFirstName != null )
	{
		if( objFirstName.value.length == 0 )
		{
			Msg += ' ... Das Feld - Vorname - darf nicht leer sein...\n';
			bStatus = false;
		}
	}

	var objLastName = document.getElementById( 'user_lastname' );
	if( objLastName != null )
	{
		if( objLastName.value.length == 0 )
		{
			Msg += ' ... Das Feld - Nachname - darf nicht leer sein...\n';
			bStatus = false;
		}
	}

	var formalEmailCheckRE = /^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/;
	var objEMail = document.getElementById( 'user_email' );
	if( objEMail != null )
	{
		if( objEMail.value.length == 0 )
		{
			Msg += ' ... Das Feld - EMail-Adresse - darf nicht leer sein...\n';
			bStatus = false;
		}
		else
		{
			if( !formalEmailCheckRE.test( objEMail.value ) )
			{
				Msg += ' ... Das Feld - EMail-Adresse enthält einen ungültigen Wert...\n';
				bStatus = false;
			}
		}
	}
	
	var objQuestion = document.getElementById( 'user_question_comment' );
	if( objQuestion != null )
	{
		if( objQuestion.value.length == 0 )
		{
			Msg += ' ... Das Feld - Ihre Frage - darf nicht leer sein...\n';
			bStatus = false;
		}
		else
		{
			if( objQuestion.value.length > 2048 )
			{
				Msg += ' ... Im Feld - Ihre Frage - dürfen max. 2048 Zeichen eingegeben werden...\n';
				bStatus = false;
			}
		}
	}


	if( !bStatus )
	{
		alert( Msg );
	}

	return bStatus;
}


function countQuestionChars( id, maxChars )
{
	if (typeof(maxChars) == 'undefined')
	{
		maxChars = 512;
	}
	
	var objComment = document.getElementById(id + '_comment');
	if (objComment != null)
	{
		var objCounterDisplay = document.getElementById(id + '_comment_counter');
		if (objCounterDisplay != null)
		{
			objCounterDisplay.value = objComment.value.length + " von " + maxChars + " Zeichen";
		}
	}

	return true;
}
