/**
 * @author Alexander Farkas
 * v. 1.02
 */
(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);

// preload obrázků
$.preloadImages(['../img/titul-01.jpg']);
$.preloadImages(['../img/loc-map.jpg','../img/proj-map.jpg','../foto/foto-title-01b.jpg']);
$.preloadImages(['../img/desc-santovka.jpg','../img//desc-university.jpg','../img/desc-city.jpg','../img/desc-parks.jpg','../img/desc-bus.jpg','../img/desc-train.jpg','../img/desc-tram.jpg']);
$.preloadImages(['/img/proj-desc-1.jpg','/img/proj-desc-2.jpg','/img/proj-desc-3.jpg','/img/proj-desc-4.jpg','/img/proj-desc-5.jpg','/img/proj-desc-7.jpg','/img/proj-desc-a.jpg','/img/proj-desc-b.jpg','/img/proj-desc-c.jpg']);
$.preloadImages(['../foto/foto-title-01b.jpg']);
$.preloadImages(['../img/floor-map.jpg','../img/floor-p3.png','../img/floor-p2.png','../img/floor-p1.png','../img/floor-m1.png','../img/floor-m2.png','../img/floor-p3.jpg','../img/floor-p2.jpg','../img/floor-p1.jpg','../img/floor-m1.jpg','../img/floor-m2.jpg']);

// animace titulní stránky
$(document).ready(function(){
	$('#titul-en-first').delay(2000).animate({height:'300px'}, {duration:2000})
	$('#titul-en-first div.info-en').delay(2000).animate({top:'266px'}, {duration:2000})
	$('#titul-first').delay(2000).animate({height:'315px'}, {duration:2000})
	$('#titul-first div.info').delay(2000).animate({top:'281px'}, {duration:2000})
	$('#titul-text-first').delay(3000).animate({borderWidth:'2px'}, {duration:50})
	$('#titul-text-first h1, #titul-text-first p').delay(2500).fadeIn(4000)
});

// Fotogalerie - START
$(function(){
	$('#gal-1')
		.mouseover(function(){
			$('span[id^="name-"]').css({display: "none"})
			$('#name-1').css({display: "inline"})
		})
		.mouseout(function(){
			$('span[id^="name-"]').css({display: "none"})
		})
});

$(function(){
	$('#gal-2')
		.mouseover(function(){
			$('span[id^="name-"]').css({display: "none"})
			$('#name-2').css({display: "inline"})
		})
		.mouseout(function(){
			$('span[id^="name-"]').css({display: "none"})
		})
});

$(function(){
	$('#gal-3')
		.mouseover(function(){
			$('span[id^="name-"]').css({display: "none"})
			$('#name-3').css({display: "inline"})
		})
		.mouseout(function(){
			$('span[id^="name-"]').css({display: "none"})
		})
});

$(function(){
	$('#gal-4')
		.mouseover(function(){
			$('span[id^="name-"]').css({display: "none"})
			$('#name-4').css({display: "inline"})
		})
		.mouseout(function(){
			$('span[id^="name-"]').css({display: "none"})
		})
});

$(function(){
	$('#gal-5')
		.mouseover(function(){
			$('span[id^="name-"]').css({display: "none"})
			$('#name-5').css({display: "inline"})
		})
		.mouseout(function(){
			$('span[id^="name-"]').css({display: "none"})
		})
});

$(function(){
	$('#gal-6')
		.mouseover(function(){
			$('span[id^="name-"]').css({display: "none"})
			$('#name-6').css({display: "inline"})
		})
		.mouseout(function(){
			$('span[id^="name-"]').css({display: "none"})
		})
});
// Fotogalerie - END

// Lokalita - START

// inicializace hodnoty proměnné
$(document).ready(function(){
  $('div').data('active', '#santovka').data('active2', '#desc-santovka')
});

$(function(){
	$('#loc-menu-santovka')
		.mouseover(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$('#santovka').css({display: "block"})
			$('#loc-map div.brief').stop(false,true).fadeOut(300)
			$('div[id^="desc"]').css({display: "none"})
			$('#desc-santovka').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.mouseout(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$($('div').data('active')).css({display: "block"})
			$('div[id^="desc"]').css({display: "none"})
			$($('div').data('active2')).stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.click(function(){
			$('div[id^="desc"]').css({display: "none"})
			$('#desc-santovka').fadeIn(300).css({display: "table-cell"})
			$('div').data('active', '#santovka').data('active2', '#desc-santovka')
		})
});

$(function(){
	$('#loc-menu-university')
		.mouseover(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$('#university').css({display: "block"})
			$('#loc-map div.brief').stop(false,true).fadeOut(300)
			$('div[id^="desc"]').css({display: "none"})
			$('#desc-university').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.mouseout(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$($('div').data('active')).css({display: "block"})
			$('div[id^="desc"]').css({display: "none"})
			$($('div').data('active2')).stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.click(function(){
			$('div[id^="desc"]').css({display: "none"})
			$('#desc-university').fadeIn(300).css({display: "table-cell"})
			$($('div').data('active')).css({display: "none"})
			$('div').data('active', '#university').data('active2', '#desc-university')
		})
});

$(function(){
	$('#loc-menu-city')
		.mouseover(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$('#city').css({display: "block"})
			$('#loc-map div.brief').stop(false,true).fadeOut(300)
			$('div[id^="desc"]').css({display: "none"})
			$('#desc-city').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.mouseout(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$($('div').data('active')).css({display: "block"})
			$('div[id^="desc"]').css({display: "none"})
			$($('div').data('active2')).stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.click(function(){
			$('div[id^="desc"]').css({display: "none"})
			$('#desc-city').fadeIn(300).css({display: "table-cell"})
			$($('div').data('active')).css({display: "none"})
			$('div').data('active', '#city').data('active2', '#desc-city')
		})
});

$(function(){
	$('#loc-menu-parks')
		.mouseover(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$('#parks').css({display: "block"})
			$('#loc-map div.brief').stop(false,true).fadeOut(300)
			$($('div').data('active2')).css({display: "none"})
			$('#desc-parks').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.mouseout(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$($('div').data('active')).css({display: "block"})
			$('div[id^="desc"]').css({display: "none"})
			$($('div').data('active2')).stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.click(function(){
			$('div[id^="desc"]').css({display: "none"})
			$('#desc-parks').fadeIn(300).css({display: "table-cell"})
			$($('div').data('active')).css({display: "none"})
			$('div').data('active', '#parks').data('active2', '#desc-parks')
		})
});

$(function(){
	$('#loc-menu-bus')
		.mouseover(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$('#bus').css({display: "block"})
			$('#loc-map div.brief').stop(false,true).fadeOut(300)
			$($('div').data('active2')).css({display: "none"})
			$('#desc-bus').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.mouseout(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$($('div').data('active')).css({display: "block"})
			$('div[id^="desc"]').css({display: "none"})
			$($('div').data('active2')).stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.click(function(){
			$('div[id^="desc"]').css({display: "none"})
			$('#desc-bus').fadeIn(300).css({display: "table-cell"})
			$($('div').data('active')).css({display: "none"})
			$('div').data('active', '#bus').data('active2', '#desc-bus')
		})
});

$(function(){
	$('#loc-menu-train')
		.mouseover(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$('#train').css({display: "block"})
			$('#loc-map div.brief').stop(false,true).fadeOut(300)
			$($('div').data('active2')).css({display: "none"})
			$('#desc-train').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.mouseout(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$($('div').data('active')).css({display: "block"})
			$('div[id^="desc"]').css({display: "none"})
			$($('div').data('active2')).stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.click(function(){
			$('div[id^="desc"]').css({display: "none"})
			$('#desc-train').fadeIn(300).css({display: "table-cell"})
			$($('div').data('active')).css({display: "none"})
			$('div').data('active', '#train').data('active2', '#desc-train')
		})
});

$(function(){
	$('#loc-menu-tram')
		.mouseover(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$('#tram').css({display: "block"})
			$('#loc-map div.brief').stop(false,true).fadeOut(300)
			$($('div').data('active2')).css({display: "none"})
			$('#desc-tram').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.mouseout(function(){
			$('#loc-map img').not($('div').data('active')).css({display: "none"})
			$($('div').data('active')).css({display: "block"})
			$('div[id^="desc"]').css({display: "none"})
			$($('div').data('active2')).stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
		.click(function(){
			$('div[id^="desc"]').css({display: "none"})
			$('#desc-tram').fadeIn(300).css({display: "table-cell"})
			$($('div').data('active')).css({display: "none"})
			$('div').data('active', '#tram').data('active2', '#desc-tram')
		})
});

/*
// animace stránky Lokalita
$(document).delay(6000).ready(function(){
	$('#loc-map img').fadeOut(0)
	$('#santovka').delay(0).fadeIn(0).delay(500).fadeOut(0).delay(7000).fadeIn(0)
	$('#university').delay(500).fadeIn(0).delay(1000).fadeOut(0)
	$('#city').delay(1000).fadeIn(0).delay(1500).fadeOut(0)
	$('#parks').delay(1500).fadeIn(0).delay(2000).fadeOut(0)
	$('#bus').delay(2000).fadeIn(0).delay(2500).fadeOut(0)
	$('#train').delay(2500).fadeIn(0).delay(3000).fadeOut(0)
	$('#tram').delay(3000).fadeIn(0).delay(3500).fadeOut(0)
});
*/
// Lokalita - END


// O projektu - START
/*
$(function(){
	$('#proj-map')
		.mouseover(function(){
			$('#proj-map img').css({display: "none"})
		})
});
*/
$(function(){
	$('#proj-menu-people')
		.mouseover(function(){
			$('#proj-map img').css({display: "none"})
			$('#people').css({display: "block"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
		})
		.mouseout(function(){
			$('#proj-map img').not($('div').data('active')).css({display: "none"})
			$($('div').data('active')).css({display: "block"})
		})
});

$(function(){
	$('#proj-menu-cars')
		.mouseover(function(){
			$('#proj-map img').css({display: "none"})
			$('#cars').css({display: "block"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
		})
		.mouseout(function(){
			$('#proj-map img').not($('div').data('active')).css({display: "none"})
			$($('div').data('active')).css({display: "block"})
		})
});

$(function(){
	$('#proj-menu-supply')
		.mouseover(function(){
			$('#proj-map img').css({display: "none"})
			$('#supply').css({display: "block"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
		})
		.mouseout(function(){
			$('#proj-map img').not($('div').data('active')).css({display: "none"})
			$($('div').data('active')).css({display: "block"})
		})
});

$(function(){
	$('#proj-1')
		.mouseover(function(){
			$('div.point').css({backgroundImage: "url('../img/point-blue-trans.png')"})
			$('#proj-a').css({backgroundImage: "url('../img/point-a-blue-trans.png')"})
			$('#proj-b').css({backgroundImage: "url('../img/point-b-blue-trans.png')"})
			$('#proj-c').css({backgroundImage: "url('../img/point-c-blue-trans.png')"})
			$(this).css({backgroundImage: "url('../img/point-red-trans.png')"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
			$('#proj-desc div').css({display: "none"})
			$('#desc-1').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
});

$(function(){
	$('#proj-2a,#proj-2b,#proj-2c')
		.mouseover(function(){
			$('div.point').css({backgroundImage: "url('../img/point-blue-trans.png')"})
			$('#proj-a').css({backgroundImage: "url('../img/point-a-blue-trans.png')"})
			$('#proj-b').css({backgroundImage: "url('../img/point-b-blue-trans.png')"})
			$('#proj-c').css({backgroundImage: "url('../img/point-c-blue-trans.png')"})
			$('#proj-2a,#proj-2b,#proj-2c').css({backgroundImage: "url('../img/point-red-trans.png')"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
			$('#proj-desc div').css({display: "none"})
			$('#desc-2').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
});

$(function(){
	$('#proj-3')
		.mouseover(function(){
			$('div.point').css({backgroundImage: "url('../img/point-blue-trans.png')"})
			$('#proj-a').css({backgroundImage: "url('../img/point-a-blue-trans.png')"})
			$('#proj-b').css({backgroundImage: "url('../img/point-b-blue-trans.png')"})
			$('#proj-c').css({backgroundImage: "url('../img/point-c-blue-trans.png')"})
			$(this).css({backgroundImage: "url('../img/point-red-trans.png')"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
			$('#proj-desc div').css({display: "none"})
			$('#desc-3').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
});

$(function(){
	$('#proj-4')
		.mouseover(function(){
			$('div.point').css({backgroundImage: "url('../img/point-blue-trans.png')"})
			$('#proj-a').css({backgroundImage: "url('../img/point-a-blue-trans.png')"})
			$('#proj-b').css({backgroundImage: "url('../img/point-b-blue-trans.png')"})
			$('#proj-c').css({backgroundImage: "url('../img/point-c-blue-trans.png')"})
			$(this).css({backgroundImage: "url('../img/point-red-trans.png')"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
			$('#proj-desc div').css({display: "none"})
			$('#desc-4').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
});

$(function(){
	$('#proj-5')
		.mouseover(function(){
			$('div.point').css({backgroundImage: "url('../img/point-blue-trans.png')"})
			$('#proj-a').css({backgroundImage: "url('../img/point-a-blue-trans.png')"})
			$('#proj-b').css({backgroundImage: "url('../img/point-b-blue-trans.png')"})
			$('#proj-c').css({backgroundImage: "url('../img/point-c-blue-trans.png')"})
			$(this).css({backgroundImage: "url('../img/point-red-trans.png')"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
			$('#proj-desc div').css({display: "none"})
			$('#desc-5').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
});

$(function(){
	$('#proj-6')
		.mouseover(function(){
			$('div.point').css({backgroundImage: "url('../img/point-blue-trans.png')"})
			$('#proj-a').css({backgroundImage: "url('../img/point-a-blue-trans.png')"})
			$('#proj-b').css({backgroundImage: "url('../img/point-b-blue-trans.png')"})
			$('#proj-c').css({backgroundImage: "url('../img/point-c-blue-trans.png')"})
			$(this).css({backgroundImage: "url('../img/point-red-trans.png')"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
			$('#proj-desc div').css({display: "none"})
			$('#desc-6').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
});

$(function(){
	$('#proj-7')
		.mouseover(function(){
			$('div.point').css({backgroundImage: "url('../img/point-blue-trans.png')"})
			$('#proj-a').css({backgroundImage: "url('../img/point-a-blue-trans.png')"})
			$('#proj-b').css({backgroundImage: "url('../img/point-b-blue-trans.png')"})
			$('#proj-c').css({backgroundImage: "url('../img/point-c-blue-trans.png')"})
			$(this).css({backgroundImage: "url('../img/point-red-trans.png')"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
			$('#proj-desc div').css({display: "none"})
			$('#desc-7').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
});

$(function(){
	$('#proj-a')
		.mouseover(function(){
			$('div.point').css({backgroundImage: "url('../img/point-blue-trans.png')"})
			$('#proj-b').css({backgroundImage: "url('../img/point-b-blue-trans.png')"})
			$('#proj-c').css({backgroundImage: "url('../img/point-c-blue-trans.png')"})
			$(this).css({backgroundImage: "url('../img/point-a-red-trans.png')"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
			$('#proj-desc div').css({display: "none"})
			$('#desc-a').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
});

$(function(){
	$('#proj-b')
		.mouseover(function(){
			$('div.point').css({backgroundImage: "url('../img/point-blue-trans.png')"})
			$('#proj-a').css({backgroundImage: "url('../img/point-a-blue-trans.png')"})
			$('#proj-c').css({backgroundImage: "url('../img/point-c-blue-trans.png')"})
			$(this).css({backgroundImage: "url('../img/point-b-red-trans.png')"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
			$('#proj-desc div').css({display: "none"})
			$('#desc-b').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
});

$(function(){
	$('#proj-c')
		.mouseover(function(){
			$('div.point').css({backgroundImage: "url('../img/point-blue-trans.png')"})
			$('#proj-a').css({backgroundImage: "url('../img/point-a-blue-trans.png')"})
			$('#proj-b').css({backgroundImage: "url('../img/point-b-blue-trans.png')"})
			$(this).css({backgroundImage: "url('../img/point-c-red-trans.png')"})
			$('#proj-map div.brief').stop(false,true).fadeOut(300)
			$('#proj-desc div').css({display: "none"})
			$('#desc-c').stop(false,true).fadeIn(300).css({display: "table-cell"})
		})
});

// O projektu - END

// Pro nájemce - START
$(document).ready(function(){
	$('div').data('active3', '#floor-p1 img').data('active4', '#ten-floor-p1')
});

$(function(){
	$('#floor-p3')
		.mouseover(function(){
			$('#floor-map img').not($('div').data('active3')).css({display: "none"})
			$('#floor-p3 img').css({display: "block"})
			$('#floor-map div.brief').stop(false,true).fadeOut(300)
			$('div[id^="ten-floor"]').css({display: "none"})
			$('#ten-floor-p3').stop(false,true).fadeIn(300)
		})
		.mouseout(function(){
			$('#floor-map img').not($('div').data('active3')).css({display: "none"})
			$($('div').data('active3')).css({display: "block"})
			$('div[id^="ten-floor"]').css({display: "none"})
			$($('div').data('active4')).stop(false,true).fadeIn(300)
		})
		.click(function(){
			$($('div').data('active')).css({display: "none"})
			$('div').data('active3', '#floor-p3 img').data('active4', '#ten-floor-p3')
		})
});

$(function(){
	$('#floor-p2')
		.mouseover(function(){
			$('#floor-map img').not($('div').data('active3')).css({display: "none"})
			$('#floor-p2 img').css({display: "block"})
			$('#floor-map div.brief').stop(false,true).fadeOut(300)
			$('div[id^="ten-floor"]').css({display: "none"})
			$('#ten-floor-p2').stop(false,true).fadeIn(300)
		})
		.mouseout(function(){
			$('#floor-map img').not($('div').data('active3')).css({display: "none"})
			$($('div').data('active3')).css({display: "block"})
			$('div[id^="ten-floor"]').css({display: "none"})
			$($('div').data('active4')).stop(false,true).fadeIn(300)
		})
		.click(function(){
			$($('div').data('active')).css({display: "none"})
			$('div').data('active3', '#floor-p2 img').data('active4', '#ten-floor-p2')
		})
});

$(function(){
	$('#floor-p1')
		.mouseover(function(){
			$('#floor-map img').not($('div').data('active3')).css({display: "none"})
			$('#floor-p1 img').css({display: "block"})
			$('#floor-map div.brief').stop(false,true).fadeOut(300)
			$('div[id^="ten-floor"]').css({display: "none"})
			$('#ten-floor-p1').stop(false,true).fadeIn(300)
		})
		.mouseout(function(){
			$('#floor-map img').not($('div').data('active3')).css({display: "none"})
			$($('div').data('active3')).css({display: "block"})
			$('div[id^="ten-floor"]').css({display: "none"})
			$($('div').data('active4')).stop(false,true).fadeIn(300)
		})
		.click(function(){
			$($('div').data('active')).css({display: "none"})
			$('div').data('active3', '#floor-p1 img').data('active4', '#ten-floor-p1')
		})
});

$(function(){
	$('#floor-m1')
		.mouseover(function(){
			$('#floor-map img').not($('div').data('active3')).css({display: "none"})
			$('#floor-m1 img').css({display: "block"})
			$('#floor-map div.brief').stop(false,true).fadeOut(300)
			$('div[id^="ten-floor"]').css({display: "none"})
			$('#ten-floor-m1').stop(false,true).fadeIn(300)
		})
		.mouseout(function(){
			$('#floor-map img').not($('div').data('active3')).css({display: "none"})
			$($('div').data('active3')).css({display: "block"})
			$('div[id^="ten-floor"]').css({display: "none"})
			$($('div').data('active4')).stop(false,true).fadeIn(300)
		})
		.click(function(){
			$($('div').data('active')).css({display: "none"})
			$('div').data('active3', '#floor-m1 img').data('active4', '#ten-floor-m1')
		})
});

$(function(){
	$('#floor-m2')
		.mouseover(function(){
			$('#floor-map img').not($('div').data('active3')).css({display: "none"})
			$('#floor-m2 img').css({display: "block"})
			$('#floor-map div.brief').stop(false,true).fadeOut(300)
			$('div[id^="ten-floor"]').css({display: "none"})
			$('#ten-floor-m2').stop(false,true).fadeIn(300)
		})
		.mouseout(function(){
			$('#floor-map img').not($('div').data('active3')).css({display: "none"})
			$($('div').data('active3')).css({display: "block"})
			$('div[id^="ten-floor"]').css({display: "none"})
			$($('div').data('active4')).stop(false,true).fadeIn(300)
		})
		.click(function(){
			$($('div').data('active')).css({display: "none"})
			$('div').data('active3', '#floor-m2 img').data('active4', '#ten-floor-m2')
		})
});
// Pro nájemce - END


// inicializace lightboxu
$(document).ready(function(){
  $("a[rel^='lb']").lightbox();
});



function check_email(adresa) {
//	re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$/;
	re = /^([a-zA-Z0-9._-]+)@([a-zA-Z0-9._-]+)\.([a-zA-Z]{2,5})$/;
	return adresa.search(re) == 0;
}

function sendmail() {

	if(document.forms[0].jmeno.value == "") {
		alert("Vyplňte, prosím, Vaše jméno a příjmení!");
		document.forms[0].jmeno.focus();
		return false;
	}

	if(document.forms[0].email.value == "") {
		alert("Vyplňte, prosím, Vaši emailovou adresu!");
		document.forms[0].email.focus();
		return false;
	}
	if(document.forms[0].robot.value == "") {
		document.forms[0].robot.value = 7;
	}
	if (!check_email(document.forms[0].email.value) ) {
	   alert("Vaše emailová adresa není vyplněna správně!");
	   document.forms[0].email.focus();
	   return false;
	}
	if(document.forms[0].zprava.value == "") {
		alert("Teď už nám jen něco napište! :-)");
		document.forms[0].zprava.focus();
		return false;
	}
	document.forms[0].submit();

}

