function repkepablak(kep,adat) {  
  
  magassag = 500;
  szelesseg = 765;
  
  if (magassag >= screen.height) {magassag = screen.height-200;}
  if (szelesseg >= screen.width) {szelesseg = screen.width-200;}
    
   window.open('/kep_ugrik.php?kep='+kep+'&adat='+adat+'','IndexKepek', 'status=no,scrollbars=1,resizable=yes,menu=no,width='+ szelesseg +',height='+ magassag +'');
}

function display_city(azon) {
	if (varos[azon]) {
		document.getElementById('urlap[varos]').value = varos[azon];
		document.getElementById('urlap[megye_id]').selectedIndex = megye[azon];
		
	} else {
		document.getElementById('urlap[varos]').value = '';
		document.getElementById('urlap[megye_id]').selectedIndex = 0;
	}
}

//Add more fields dynamically.
function addField(area,field,limit) {
	if(!document.getElementById) return; //Prevent older browsers from getting any further.
	var field_area = document.getElementById(area);
	var all_inputs = field_area.getElementsByTagName("input"); //Get all the input fields in the given area.
	//Find the count of the last element of the list. It will be in the format '<field><number>'. If the 
	//		field given in the argument is 'friend_' the last id will be 'friend_4'.
	var last_item = all_inputs.length - 1;
	var last = all_inputs[last_item].id;
	var count = Number(last.split("_")[1]) + 1;
	
	//If the maximum number of elements have been reached, exit the function.
	//		If the given limit is lower than 0, infinite number of fields can be created.
	if(count > limit && limit > 0) return;
 	
	if(document.createElement) { //W3C Dom method.
		var li = document.createElement("li");
		var input = document.createElement("input");
		input.id = field+count;
		input.name = field+count;
		input.type = "text"; //Type of field - can be any valid input type like text,file,checkbox etc.
		li.appendChild(input);
		field_area.appendChild(li);
	} else { //Older Method
		field_area.innerHTML += "<li><input name='"+(field+count)+"' id='"+(field+count)+"' type='text' /></li>";
	}
}


//Add more fields dynamically.
function addField_jelentkezo(area,limit) {
	if(!document.getElementById) return; //Prevent older browsers from getting any further.
	var field_area = document.getElementById(area);
	var all_inputs = field_area.getElementsByTagName("input"); //Get all the input fields in the given area.
	//Find the count of the last element of the list. It will be in the format '<field><number>'. If the 
	//		field given in the argument is 'friend_' the last id will be 'friend_4'.
	var last_item = all_inputs.length - 1;
	var last = all_inputs[last_item].id;
	var count = Number(last.split("_")[1]) + 1;
	
	//If the maximum number of elements have been reached, exit the function.
	//		If the given limit is lower than 0, infinite number of fields can be created.
	if(count > limit && limit > 0) return;
 	
	if(document.createElement) { //W3C Dom method.
		var li = document.createElement("li");
		var input;
		
		input = "<input type=\"text\" name=\"rnev[]\" id=\"rnev_"+count+"\" \/><input type=\"text\" name=\"rbeosztas[]\" id=\"rbeosztas_"+count+"\" value=\"\"><input type=\"text\" name=\"remail[]\" id=\"remail_"+count+"\" value=\"\"><br class=\"clr\">";
		
		li.innerHTML = input;
		field_area.appendChild(li);
	} else { //Older Method
		field_area.innerHTML += "<li><input name='"+(field+count)+"' id='"+(field+count)+"' type='text' /></li>";
	}
}

