// JavaScript Document


	var Form_aObligatory = new Array();
	var Form_sErrorIn = "";
	var Form_sFormField = "";
	var Form_sObligatory = ""
	
	function Form_ShowAlert(field, name, cause){
		var sMsg = Form_sErrorIn + " \"" + name + "\" " + Form_sFormField + "\n" + cause
			+ "                                                      \n\n";
		
	  alert(sMsg);
	  if(field != null){
	    if(field.focus) field.focus();
	    if(field.select) field.select();
	  }
	  return false;
	}
	
	function Form_CheckObligatories() {
		for(var i in Form_aObligatory) {
			oInput = document.getElementById("_ufh_" + i);
			if(!oInput) {
				var a = document.getElementsByTagName("INPUT");
				bOtherExists = false;
				iNumOfChecked = 0;
				oFirstCheckbox = null;
				if(a && a.length) {
					for(var j=0; j<=a.length-1; j++) {
						if(a[j].id) {
							s = "\_ufh\_" + i + "\_";
							eval("b = a["+j+"].id.search(/^" + s + "/);");
							if(b!=-1) {
								if(a[j].type="checkbox") {
									if(oFirstCheckbox==null) oFirstCheckbox = a[j];
									bOtherExists = true;
									if(a[j].checked) iNumOfChecked++;
								}
							}
						}
					}
				}
				if(bOtherExists && oFirstCheckbox && !iNumOfChecked) {
					return Form_ShowAlert(oFirstCheckbox, Form_aObligatory[i], Form_sObligatory);
				}
			}
			else {
				if(oInput.type.search(/select/i)!=-1) { // tehát, select box ez az input
					if(!oInput.value) {
						return Form_ShowAlert(oInput, Form_aObligatory[i], Form_sObligatory);
					}
				}
				else if(oInput.type.search(/check/i)!=-1) { // tehát, checkbox ez az input!? előfordulhat!
					if(!oInput.checked) {
						return Form_ShowAlert(oInput, Form_aObligatory[i], Form_sObligatory);
					}
				}
				else if(oInput.value=="") return Form_ShowAlert(oInput, Form_aObligatory[i], Form_sObligatory);
			}  
		}
		return true;
	}
