// JavaScript Document

$(document).ready(function(){

// focus search field
$('form#search #word').focus(function() {
  $(this).attr('value', '');
});

$('.imgMap').hover(
  function () {
    var showElement = $(this).attr('id');
    var linkTo = $(this).attr('href');
    $('div.'+showElement).show().click(function() {
    window.location.replace(linkTo);
    });
    $('div.'+showElement+' span').show().click(function() {
    window.location.replace(linkTo);
    });
    $('img.mapRegion').attr('src','/images/mapa-s-01-'+$(this).attr('id')+'.png');
    
  }, 
  function () {

  }
);

$('.imgMapBig').hover(
  function () {
    var showElement = $(this).attr('id');
    var linkTo = $(this).attr('href');
    $('.mapFlag').hide();
    $('div.'+showElement).show().click(function() {
    window.location.replace(linkTo);
    });
    $('div.'+showElement+' span').show().click(function() {
    window.location.replace(linkTo);
    });
    $('img.mapRegionBig').attr('src','/images/mapa-01-'+$(this).attr('id')+'.gif');
    
  }, 
  function () {

  }
);

$('.mapRegionBig').mouseout (
  function () {
  	$('.mapFlag').hide();
  }
);


$('.imgMap').click(
  function () {
  	var showElement = $(this).attr('id');
  	$('#selectRegion option').removeAttr('selected');
  	$('#selectRegion option.'+showElement).attr('selected','selected');
  	$('.jNice').jNice();
  }
);

/* skryvani a zobrazovani obsahu */
$(".toggle-container").hide();
$("a.toggle").click(function(e){
  $(this).toggleClass("togglevisible").parent().next().slideToggle('slow');
});

});
