function DoSubmitSurveyAnswer() {
	var iNumElems = frmSurvey.elements.length;
	var iChoiseID = -2;

	var bSubmit = true;
	for (var i=0;i<iNumElems;i++){
		var eElem = frmSurvey.elements[i];
		if ("radio" == eElem.type )	{ if (eElem.checked) { iChoiseID = eElem.value } }
	}
	
	if (iChoiseID<0) {	
		alert('Δεν έχετε επιλέξει κάποιο πρόσωπο.');
		bSubmit = false;
	} else if (iChoiseID==0) {
		var sUserValue = frmSurvey.txtUserValue.value
		if (sUserValue.length<5) {
			alert('Εχετε επιλέξει να ψηφίσετε κάποιο πρόσωπο της δικής σας επιλογής, αλλά δεν έχετε πληκτρολογήσει ένα αποδεκτό όνομα για αυτό.');
			frmSurvey.txtUserValue.focus();
			bSubmit = false;		
		}
	}
	
	if (bSubmit) {
		document.getElementById('btnSubmitSurveyAnswer').disabled = true;
		frmSurvey.submit();
	}
}

function DoSubmitEventSurveyAnswer() {
	var iNumElems = frmSurvey.elements.length;
	var iChoiseID = -2;

	var bSubmit = true;
	for (var i=0;i<iNumElems;i++){
		var eElem = frmSurvey.elements[i];
		if ("radio" == eElem.type )	{ if (eElem.checked) { iChoiseID = eElem.value } }
	}
	
	if (iChoiseID<0) {	
		alert('Δεν έχετε επιλέξει κάποιο γεγονός.');
		bSubmit = false;
	} else if (iChoiseID==0) {
		var sUserValue = frmSurvey.txtUserValue.value
		if (sUserValue.length<5) {
			alert('Εχετε επιλέξει να ψηφίσετε κάποιο γεγονός της δικής σας επιλογής, αλλά δεν έχετε πληκτρολογήσει ένα αποδεκτό κείμενο για αυτό.');
			frmSurvey.txtUserValue.focus();
			bSubmit = false;		
		}
	}
	
	if (bSubmit) {
		document.getElementById('btnSubmitSurveyAnswer').disabled = true;
		frmSurvey.submit();
	}
}

function wndSCD(iChoiceID){
	var wndChoice
	var lngLeft = (((window.screen.availWidth-176)/2))
	var lngTop	= (((window.screen.availHeight-580)/2))
	wndChoice = window.open("choiceDetails.asp?iChoiceID=" + iChoiceID, "wndChoice", "top=" + lngTop + ",left=" + lngLeft + ",width=580,height=470,scrollabrs=no,location=no,resizable=no")
	wndChoice.focus();
}

function blnValidMail(strMail) {
  var regex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  return regex.test(strMail);
}

function blnValidZipCode(strZipCode) {
  var regex = /^[1-9][0-9]{4}$/;
  return regex.test(strZipCode);
}
