function uresCheck(mezo){
  if (mezo.value != "") return true;
  else{
    alert("A(z) "+ mezo.name +" mezo ures!");
    return false;
  }
}

function emailCheck(mezo){
  var szoveg = mezo.value;
  if (!(szoveg.indexOf('@')>0 && szoveg.indexOf('@')<szoveg.length-1)){
    alert("Rossz e-mail cim!");
    return false;
  }
  else return true;
}

function teszt(adat,minta){
  for (var i=0; i<adat.length; i++)
    if (minta.indexOf(adat.charAt(i)) == -1)
      return false;

  return true;
}

function numerikusCheck(mezo){
  if (!uresCheck(mezo)) return false;
  if (!teszt(mezo.value,"1234567890")){
    alert("Ez nem numerikus ertek!");
    return false;
  }
  else return true;
}

function tartalmaz(adat,minta){
  for (var i=0; i<adat.length; i++)
    if (minta.indexOf(adat.charAt(i)) != -1)
      return true;
  return false;
}

function telefonCheck(mezo){
  if (!uresCheck(mezo)) return false;
  if (!teszt(mezo.value,"1234567890()/- ") ||
    !tartalmaz(mezo.value,"1234567890")){
    alert("Ez nem jo telefonszam!");
    return false;
  }
  else return true;
}

function ellenoriz(){
  if (uresCheck(document.form.nev) &&
  	uresCheck(document.form.telepules) &&
	uresCheck(document.form.utca) &&
    numerikusCheck(document.form.iranyitoszam) &&
    telefonCheck(document.form.telefon) &&
    emailCheck(document.form.email)){
    

    return true;
  }
  else return false;
}

