Event.onDOMReady(function() {
	var items = $H({
		'search-country-cz': 'search-district-cz',
		'search-country-sk': 'search-district-sk'
	});
	items.each(function(item) {
		var control = $(item.key);
		if(control) {
			Event.observe(control, 'click', function(event) {
				control.up('form').getElementsByClassName(item.value).invoke(control.checked ? 'disable' : 'enable');
				//Event.stop(event);
			});
		}
	});

	var areaobjs = $$('area');
	areaobjs.each(function(el) {
		Event.observe(el, 'mouseover', regionOver.bindAsEventListener(el));
		Event.observe(el, 'mouseout',  regionOut.bindAsEventListener(el));
	});

});

function regionOver(evt) {
	$(this.className).addClassName('over');
}

function regionOut(evt) {
	$(this.className).removeClassName('over');
}

function searchForm(what) {
	$('search-form-courses').style.display = 'none';
	$('search-form-indoors').style.display = 'none';
	$('search-form-drivings').style.display = 'none';
	$('search-form-all').style.display = 'none';
	$('search-form-' + what).style.display = 'block';
	$('search-tab-courses').removeClassName('active');
	$('search-tab-indoors').removeClassName('active');
	$('search-tab-drivings').removeClassName('active');
	$('search-tab-all').removeClassName('active');
	$('search-tab-' + what).addClassName('active');
	
}

