function enable_counties(){
	var city = document.getElementById('city');
	var county = document.getElementById('county');
	var country = document.getElementById('country');
	var div_city = document.getElementById('div_city');
	var div_city1 = document.getElementById('div_city1');
	if(country.value == '131'){
		county.disabled = false;
		city.disabled = false;
		div_city.style.display = "block";
		div_city1.style.display = "none";
	}else{
		county.disabled = true;
		city.disabled = true;
		div_city.style.display = "none";
		div_city1.style.display = "block";
	}
}

function enable_orient_counties(){
	var orient_city = document.getElementById('orient_city');
	var orient_county = document.getElementById('orient_county');
	var orient_country = document.getElementById('orient_country');
	var orient_div_city = document.getElementById('div_orient_city');
	var orient_div_city1 = document.getElementById('div_orient_city1');
	if(orient_country.value == '131'){
		orient_county.disabled = false;
		orient_city.disabled = false;
		orient_div_city.style.display = "block";
		orient_div_city1.style.display = "none";
	}else{
		orient_county.disabled = true;
		orient_city.disabled = true;
		orient_div_city.style.display = "none";
		orient_div_city1.style.display = "block";
	}
}

function enable_billing_counties(){
	var billing_city = document.getElementById('billing_city');
	var billing_county = document.getElementById('billing_county');
	var billing_country = document.getElementById('billing_country');
	var billing_div_city = document.getElementById('div_billing_city');
	var billing_div_city1 = document.getElementById('div_billing_city1');
	if(billing_country.value == '131'){
		billing_county.disabled = false;
		billing_city.disabled = false;
		billing_div_city.style.display = "block";
		billing_div_city1.style.display = "none";
	}else{
		billing_county.disabled = true;
		billing_city.disabled = true;
		billing_div_city.style.display = "none";
		billing_div_city1.style.display = "block";
	}
}
function change_city(){
	var county = document.getElementById('county');
	var div_varos = document.getElementById('div_varos');
	var div_kerulet = document.getElementById('div_kerulet');
	if(county.value == '0'){
		div_kerulet.style.display = "block";
		div_varos.style.display = "none";
	}else{
		div_kerulet.style.display = "none";
		div_varos.style.display = "block";
	}
}

function change_orient_city(){
	var orient_county = document.getElementById('orient_county');
	var orient_div_varos = document.getElementById('div_orient_varos');
	var orient_div_kerulet = document.getElementById('div_orient_kerulet');
	if(orient_county.value == '0'){
		orient_div_kerulet.style.display = "block";
		orient_div_varos.style.display = "none";
	}else{
		orient_div_kerulet.style.display = "none";
		orient_div_varos.style.display = "block";
	}
}

function change_billing_city(){
	var billing_county = document.getElementById('billing_county');
	var billing_div_varos = document.getElementById('div_billing_varos');
	var billing_div_kerulet = document.getElementById('div_billing_kerulet');
	if(billing_county.value == '0'){
		billing_div_kerulet.style.display = "block";
		billing_div_varos.style.display = "none";
	}else{
		billing_div_kerulet.style.display = "none";
		billing_div_varos.style.display = "block";
	}
}

function change_other(){
	var level = document.getElementById('education_level');
	var other = document.getElementById('education_other_div');
	if(level.value == '7'){
		other.style.display = "block";
	}else{
		other.style.display = "none";
	}
}

function mutat_div(element,max){	
	var talalt = false;
	for(i=1;i<=max;i++){
		if(!talalt){
			var div = document.getElementById(element+i);
			if(div.style.display == 'none'){
				div.style.display = "block";
				talalt = true;
				if(i==max){
					document.getElementById('mutat_'+element).style.display = 'none';
				}
			}
		}
	}
}

function addOption(selectId, val, txt, sel) {
    var objOption = new Option(txt, val, sel);
     document.getElementById(selectId).options.add(objOption);
}

function kep_valt(id){
	document.getElementById("full_pic").src = "http://www.ende.hu/picture.php?id=" + id + "&size=3";
}

function valt(selectId){
	var div = document.getElementById(selectId);
	if(div.style.display == 'none'){
		div.style.display = 'block';
	}else{
		div.style.display = 'none';
	}

}