function hideall()
{
  $("ul[id^='submenu_']").hide();
}

function time_hide()
{

}

$(function(){
	$(".calendar").datepicker(
  {
    dateFormat:'dd.mm.yy',
    dayNamesMin: ['Ne', 'Po', 'Ut', 'St', 'Čt', 'Pá', 'So', 'Ne'],
    firstDay: 1,
    monthNames: ['Leden','Únor','Březen','Duben','Květen','Červen','Červenec','Srpen','Září','Říjen','Listopad','Posinec']
  }
  );
});

$(document).ready(function(){
  $("ul[id^='submenu_']").hover(
    function(){return true;},
    function(){time_hide();}
  );
  
  $("li[id^='menuitem_']").hover(function(){
    var myid     = $(this).attr("id");
    hideall();
    var submenu = $("#submenu_"+myid.split("menuitem_")[1]);
    submenu.show()
           .css("position","absolute")
  });

  $("a.zoom").fancybox();
  
  $("a.fancy_popis").fancybox({
  'overlayOpacity':0.7,
  'overlayColor':'#000000'
  });
  
  $("a.zoom2").fancybox({
  'zoomSpeedIn':500,
  'zoomSpeedOut':500,
  'overlayShow':false
  });

	$(".video").fancybox({
		'width'			: 663,
		'height'			: 405,
    'autoScale'     	: false,
    'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'overlayOpacity': '0.0',
		'overlayColor': '#000000',
		'centerOnScroll' : false
	});	
	
	$(".iframe").fancybox({
		'frameWidth'			: 674,
		'frameHeight'			: 425,
    'autoScale'     	: false,
    'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'overlayOpacity': '0.0',
		'overlayColor': '#000000',
		'centerOnScroll' : false
	});	
	
	$(".iframe2").fancybox({
		'width'			: 680,
		'height'			: 425,
    'autoScale'     	: false,
    'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'overlayOpacity': '0.0',
		'overlayColor': '#000000',
		'centerOnScroll' : false
	});	

	$(".news_fancybox").fancybox({
		'width'			: 800,
		'height'			: 600,
    'autoScale'     	: false,
    'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'overlayOpacity': '0.0',
		'overlayColor': '#000000',
		'centerOnScroll' : false
	});	
	
	$('a.email').each(function(){
		e = this.title.replace('[A]','@');
	  var mail_array = e.split('[+]');
    var mail = mail_array.join('') 
		this.href = 'mailto:' + mail;
		this.title = 'email';
		$(this).text(mail);
	});
	
	$('#spash-banner').click(function(){
		$(this).hide();
	});
});
