function validateEmpty(fld, nev) {
    var error = "";
 
    if (fld.value.length == 0) {
      //  fld.style.background = '#F5A38D'; 
        error = " - "+nev+" /Mezö kitöltése kötelezö/\n";
		fld.focus();
    } else {
      //  fld.style.background = 'White';
    }
    return error;  
}


function trim(s)
{
  return s.replace(/^\s+|\s+$/, '');
}

function validateEmail(fld, nev) {
    var error="";
    var tfld = trim(fld.value);                        // value of field with whitespace trimmed off
    var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
    var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
   
	if (!emailFilter.test(tfld)) {              //test email for illegal characters
      //  fld.style.background = '#F5A38D';
        error = " - "+nev+" /Érvényes e-mail címet adjon meg/\n";
    } else if (fld.value.match(illegalChars)) {
     //   fld.style.background = '#F5A38D';
        error = " - "+nev+" /Az e-mail cím illegális karaktereket tartalmaz/\n";
    } else {
      //  fld.style.background = 'White';
    }
    return error;
}

function replace_str(str){
	str.replace("o",String.fromCharCode(111)); //o		
	str.replace("u",String.fromCharCode(117)); //u		
	str.replace("o",String.fromCharCode(79)); //O		
	str.replace("o",String.fromCharCode(85)); //U
	return str;
}

/* 
	String.fromCharCode(64);
	String.charCodeAt('o'); //111
	String.charCodeAt('u'); //117
	String.charCodeAt('O'); //79
	String.charCodeAt('U'); //85
*/

/*
function validateForm(theForm) {
var reason = "";

  reason += validateEmail(eval("document."+theForm+".theForm.email"), 'email');
  reason += validateEmpty(eval("document."+theForm+".igenylo_tn"), 'Igénylo neve');
      
  if (reason != "") {
	
    alert("Hibás vagy hiányzó mezök:\n" + reason);
    return false;
  }

  return true;
}
*/