Shadowbox.init({
});

function Jump(theSelect){
    selindex = theSelect.selectedIndex;
    selvalue = theSelect.options[selindex].value;
    window.location.href = selvalue;
}  

/* google mapa */
google.load("maps", "2"); // nacteni API Google Maps
var gmapa = function GoogleMAPA() {
	var mapa = new google.maps.Map2(document.getElementById("aquaMapa")); // vytvoreni samotne mapy
	mapa.setCenter(new google.maps.LatLng(49.573788,17.223355), 13); // jeji nastaveni - stredu a urovne priblizeni
	//mapa.addOverlay(new google.maps.Marker(new GLatLng(49.573788,17.223355))); // oznaceni mista
	mapa.addControl(new GSmallMapControl()); // ovladaci prvky mapy

	createMarker();
	function createMarker(){
		var blueIcon = new GIcon(G_DEFAULT_ICON); // definice ikony
		blueIcon.image = "http://www.aqua-olomouc.cz/pics/glogo.png";
		blueIcon.shadow='';
		blueIcon.iconSize=new GSize(130,85);
		blueIcon.iconAnchor=new GPoint(55,82);
		markerOptionsBlueIcon = { icon:blueIcon };
		mapa.addOverlay(new google.maps.Marker(new GLatLng(49.573788,17.223355), markerOptionsBlueIcon));
	}
}
/* google mapa - konec */

	$(document).ready(function() {
	
	$("#hotbanner").show();  
//   setInterval(function(){
//     $("#hotbanner").animate({ backgroundColor: "#16758F" }, 500);
//     $("#hotbanner").animate({ backgroundColor: "#00ABDA" }, 500);
//     }, 1000); 
	$("#hotbanner").click(function() {
		$(this).hide();
	});
	$("#close-big-banner").click(function () {
		$("#head-banner-big").css("display", "none");
		//alert("klik na zavreno");
	});

/* vyber obrazku do mensi hlavicky leto*/
 	$("#head-slideshow").each(function() {
 		var imgNum = Math.floor(Math.random()*11);
 		if (imgNum == 0) {imgNum = 1;}
 		var newImg = $(this).html() + "<div id='shead"+imgNum+"'></div>";
 		$(this).html(newImg);
 	});
// /* vyber obrazku do mensi hlavicky - konec */

/* pridani kulatych rohu */

	$(".big-cc").each(function() {
		var newHTML = $(this).html() + "<div class='ctl'></div><div class='ctr'></div><div class='cbl'></div><div class='cbr'></div>";
		$(this).html(newHTML);
	});
	$(".small-cc").each(function() {
		var newHTML = $(this).html() + "<div class='ctl'></div><div class='ctr'></div><div class='cbl'></div><div class='cbr'></div>";
		$(this).html(newHTML);
	});

/* pridani kulatych rohu - konec */

/* topmenu onmouse */
	
	$(".top-li").hover(function() {
    vystredSubmenu = ($(this).find(".sub-menu").width()/2)*-1;
		$(this).find(".sub-menu").css("margin-left", vystredSubmenu).slideDown("normal");
  },
  function() {
    $(this).find(".sub-menu").slideUp("fast");
  });

/* topmenu onmouse konec */
  
  $("span.show").click(function()  
  { 
   $(this).parent().next("div.none").show(); 
   $(this).hide();   
  }); 
  $("span.hide").click(function()  
  { 
   $(this).parent().hide(); 
   $("span.show").show();   
  });

/* pocasi */
	wDnes=new Date();
	wZitra=new Date();
	wPozitri=new Date();
	wPopozitri=new Date();
	if (wDnes.getHours() < 17) {
		preklop = 0;
	} else {
		preklop = 1;
	}
	wZitra.setTime(wZitra.getTime() + (preklop+0)*24*60*60*1000);
	wPozitri.setTime(wPozitri.getTime() + (preklop+1)*24*60*60*1000);
	wPopozitri.setTime(wPopozitri.getTime() + (preklop+2)*24*60*60*1000);
	
	var vypisDen=new Array(7);
	vypisDen[0]="neděle";
	vypisDen[1]="pondělí";
	vypisDen[2]="úterý";
	vypisDen[3]="středa";
	vypisDen[4]="čtvrtek";
	vypisDen[5]="pátek";
	vypisDen[6]="sobota";
	
	var vypisMesic=new Array(12);
	vypisMesic[0]="ledna";
	vypisMesic[1]="února";
	vypisMesic[2]="března";
	vypisMesic[3]="dubna";
	vypisMesic[4]="května";
	vypisMesic[5]="června";
	vypisMesic[6]="července";
	vypisMesic[7]="sprna";
	vypisMesic[8]="září";
	vypisMesic[9]="října";
	vypisMesic[10]="listopadu";
	vypisMesic[11]="prosince";
	
	wDnesWrite = "Dnes je <b>"+vypisDen[wDnes.getDay()]+"<br />"+wDnes.getDate()+"."+vypisMesic[wDnes.getMonth()]+" "+wDnes.getFullYear()+"</b>";
	wZitraWrite = wZitra.getDate()+"."+vypisMesic[wZitra.getMonth()]+" "+wZitra.getFullYear()+"<br /><b>"+vypisDen[wZitra.getDay()]+"</b><br />";
	wPozitriWrite = wPozitri.getDate()+"."+vypisMesic[wPozitri.getMonth()]+" "+wPozitri.getFullYear()+"<br /><b>"+vypisDen[wPozitri.getDay()]+"</b><br />";
	wPopozitriWrite = wPopozitri.getDate()+"."+vypisMesic[wPopozitri.getMonth()]+" "+wPopozitri.getFullYear()+"<br /><b>"+vypisDen[wPopozitri.getDay()]+"</b><br />";
	$("#today-text").html(wDnesWrite);
	$("#wd1 .w-text").html(wZitraWrite);
	$("#wd2 .w-text").html(wPozitriWrite);
	$("#wd3 .w-text").html(wPopozitriWrite);
/* pocasi - konec */

/* jcarousel teploty */
	$("#teplo-carousel").jCarouselLite({
		auto: 3000,
		speed: 350,
		visible: 1
	});
	$("#vip-akce").jCarouselLite({
		auto: 6000,
		speed: 350,
		visible: 1
	});
  
	$("#akceleft").jCarouselLite({
		auto: 6000,
		speed: 350,
		visible: 1
	});
/* jcarousel teploty - konec */

/* kalendar */
	$(".calendar_active_item, .calendar_active_item_weekend").hover(function () {
		$(this).css("z-index", "2");
		$(this).animate({ 
			backgroundColor: "#0090c8",
			color: "#fff"
		}, "fast" );
		$(this).find(".info").slideDown("fast");
	}, function () {
		$(this).animate({ 
			backgroundColor: "#fff",
			color: "#0090c8"
		}, "fast" );
		$(this).find(".info").fadeOut("fast");
		$(this).css("z-index", "1");
	});
/* kalendar - konec */

/* tabulka - radky na stridacku */
	$(function() { 
		$(".tabulka-obecna").find("tr:even").addClass("suda"); 
		$(".tabulka-obecna tr:odd").addClass("licha"); 
	});
/* tabulka - radky na stridacku - konec */

/* lightbox */
	$(function() {
	  $("a[rel^='lightbox']").lightbox();
	});
/* lightbox - konec */
  $("#newsletterLink").click(function () {
    $("#newsletter").fadeOut(250).fadeIn(250).fadeOut(250).fadeIn(250).fadeOut(250).fadeIn(250); 
    $("#newsletter").animate({ backgroundColor: "#007EB1", color: "#fff;" }, 500);
    $("#newsletter h2").css({ color: "#fff"}, 1500);
    $("#newsletter").animate({ backgroundColor: "#BEF0FA", color: "#000;" }, 500);
    $("#newsletter h2").css({ color: "#00AAD9"}, 1500);
  });
});


re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$/;

function kontrolanapiste() {
	
	if (document.napiste.napiste_jmeno.value== ""){
		alert("Prosím, vložte své jméno a příjmení");
		document.napiste.napiste_jmeno.focus();
		document.napiste.napiste_jmeno.select();
		return false;
	}

	if (document.napiste.napiste_email.value== ""){
		alert("Prosím, vložte svůj email");
		document.napiste.napiste_email.focus();
		document.napiste.napiste_email.select();
		return false;
	}

//	Kontrola e-mailu
	if ( document.napiste.napiste_email.value != "" ) {
		if (re.test(document.napiste.napiste_email.value) == 0) {
			alert ("E-mailová adresa není správná");
			document.napiste.napiste_email.focus();
			document.napiste.napiste_email.select();
			return false;
		}
	}
	
	if (document.napiste.napiste_zprava.value== "") {
		alert("Prosím, vložte zprávu");
		document.napiste.napiste_zprava.focus();
		document.napiste.napiste_zprava.select();
		return false;
	}	
}

function kontrolamail() {
	if (document.news.emailnews.value== ""){
		alert("Prosím, vložte svůj email");
		document.news.emailnews.focus();
		document.news.emailnews.select();
		return false;
	}
	if ( document.news.emailnews.value != "" ) {
		if (re.test(document.news.emailnews.value) == 0) {
			alert ("E-mailová adresa není správná");
			document.news.emailnews.focus();
			document.news.emailnews.select();
			return false;
		}
	}
}

