
/******************************************************************************/

function csomag_check() {
  if (document.reg_start.csomag[0].checked || document.reg_start.csomag[1].checked || document.reg_start.csomag[2].checked) return true;
  else {
  	alert('Nem választott csomagot!');
  	return false;
  }
}

/******************************************************************************/

function reg_check(form) {
	var nec = new Array('nev',
											'cegnev',
											'cim',
											'email',
											'map_long',
											'map_lat',
											'teaor_fo',
											'hatokor',
											'profil',
											'keyword',
											'cegalapitas',
											'adoszam',
											'cegjegyzekszam',
											'kapcsolat_nev',
											'kapcsolat_elerhetoseg',
											'username',
											'password',
											'password2');
	var alertcolor = '#FFCCCC';
	var basecolor = '#FFFFFF';
	var firstmiss = '';
	for (var i=nec.length-1; i>=0; i--) {
		if (!eval("form."+nec[i]+".value")) {
			eval("form."+nec[i]+".style.backgroundColor = '"+alertcolor+"'");
			firstmiss = nec[i];
		} else {
			eval("form."+nec[i]+".style.backgroundColor = '"+basecolor+"'");
		}
	}
	if (firstmiss) {
		eval("form."+firstmiss+".focus()");
		alert ('Hiányzó kötelező adat!');
		return false;
	} else {
		return true;
	}
}

/******************************************************************************/

function mod_check(form) {
	var nec = new Array('nev',
											'cegnev',
											'cim',
											'email',
											'map_long',
											'map_lat',
											'teaor_fo',
											'hatokor',
											'profil',
											'keyword',
											'cegalapitas',
											'adoszam',
											'cegjegyzekszam',
											'kapcsolat_nev',
											'kapcsolat_elerhetoseg',
											'username');
	var alertcolor = '#FFCCCC';
	var basecolor = '#FFFFFF';
	var firstmiss = '';
	for (var i=nec.length-1; i>=0; i--) {
		if (!eval("form."+nec[i]+".value")) {
			eval("form."+nec[i]+".style.backgroundColor = '"+alertcolor+"'");
			firstmiss = nec[i];
		} else {
			eval("form."+nec[i]+".style.backgroundColor = '"+basecolor+"'");
		}
	}
	if (firstmiss) {
		eval("form."+firstmiss+".focus()");
		alert ('Hiányzó kötelező adat!');
		return false;
	} else { return true; }
}

/******************************************************************************/

function toggle(checkbox, element) {
	if (checkbox.checked) document.getElementById(element).style.display = 'block';
	else document.getElementById(element).style.display = 'none';
}

/******************************************************************************/
