// responsive functions var screenWidth = $(window).width(); var screenHeight = $(window).height(); var infoFromTop = 120; var galleryCurrent = 0; // gallery var galleryArr = Array(); var popisyArr = Array(); var titulkyArr = Array(); galleryArr[0] = 'gallery/ilustrace/2/4c4fb144.jpg'; popisyArr[0] = 'Císařův slavík';galleryArr[1] = 'gallery/ilustrace/2/c639647f.jpg'; popisyArr[1] = 'Ošklivé kačátko';galleryArr[2] = 'gallery/ilustrace/2/515f5ff6.jpg'; popisyArr[2] = 'Děvčátko se sirkami';galleryArr[3] = 'gallery/ilustrace/2/8b602909.jpg'; popisyArr[3] = 'Sněhová královna';galleryArr[4] = 'gallery/ilustrace/2/0f2b1370.jpg'; popisyArr[4] = 'Sněhová královna';galleryArr[5] = 'gallery/ilustrace/2/2c55d7e4.jpg'; popisyArr[5] = 'Sněhová královna';galleryArr[6] = 'gallery/ilustrace/2/338892d8.jpg'; popisyArr[6] = 'Sněhová královna';galleryArr[7] = 'gallery/ilustrace/2/527f79d8.jpg'; popisyArr[7] = 'Ošklivé kačátko';galleryArr[8] = 'gallery/ilustrace/2/cb5fcbac.jpg'; popisyArr[8] = 'Cínový vojáček';galleryArr[9] = 'gallery/ilustrace/3/5cf48852.jpg'; popisyArr[9] = 'Kabátek z peří';galleryArr[10] = 'gallery/ilustrace/3/fe1e7efb.jpg'; popisyArr[10] = 'Ženšenový kořen';galleryArr[11] = 'gallery/ilustrace/3/fc1b1f34.jpg'; popisyArr[11] = 'O žlutém drakovi';galleryArr[12] = 'gallery/ilustrace/3/ac536e3f.jpg'; popisyArr[12] = 'Panáček z jujuby';galleryArr[13] = 'gallery/ilustrace/3/a50dd05f.jpg'; popisyArr[13] = 'O statečné Pchu-i';galleryArr[14] = 'gallery/ilustrace/4/8d17a1ea.jpg'; popisyArr[14] = 'Markéta a teta';galleryArr[15] = 'gallery/ilustrace/4/e7b198ff.jpg'; popisyArr[15] = 'Dánské poselstvo';galleryArr[16] = 'gallery/ilustrace/4/125d625d.jpg'; popisyArr[16] = 'Rodiče';galleryArr[17] = 'gallery/ilustrace/4/df112b84.jpg'; popisyArr[17] = 'Loučení';galleryArr[18] = 'gallery/ilustrace/4/35fb9d57.jpg'; popisyArr[18] = 'Po Labi';galleryArr[19] = 'gallery/ilustrace/4/bd0ecb68.jpg'; popisyArr[19] = 'Ribe';galleryArr[20] = 'gallery/ilustrace/4/cc7e27cb.jpg'; popisyArr[20] = 'Celý plakát';galleryArr[21] = 'gallery/ilustrace/4/61c11cc2.jpg'; popisyArr[21] = 'Waldemar otec a Waldemar syn';galleryArr[22] = 'gallery/ilustrace/4/e79fd399.jpg'; popisyArr[22] = 'Jízda do Ribe';galleryArr[23] = 'gallery/ilustrace/5/634cec48.jpg'; popisyArr[23] = 'Komiks z časopisu Mateřídouška';galleryArr[24] = 'gallery/ilustrace/5/3c1a94a7.jpg'; popisyArr[24] = 'Komiks z časopisu Mateřídouška';galleryArr[25] = 'gallery/ilustrace/6/e37ac235.jpg'; popisyArr[25] = 'Slovanské tance';galleryArr[26] = 'gallery/ilustrace/6/d2c6b3b3.jpg'; popisyArr[26] = 'Dimitrij';galleryArr[27] = 'gallery/ilustrace/6/92435caa.jpg'; popisyArr[27] = 'Koncert pro violoncello';galleryArr[28] = 'gallery/ilustrace/7/29226ba9.jpg'; popisyArr[28] = 'Doba ledová';galleryArr[29] = 'gallery/ilustrace/7/62dd5ab6.jpg'; popisyArr[29] = 'Starověký Řím';galleryArr[30] = 'gallery/ilustrace/7/fe504147.jpg'; popisyArr[30] = 'Cesta vzhůru';galleryArr[31] = 'gallery/ilustrace/7/08874b16.jpg'; popisyArr[31] = 'Renesance';galleryArr[32] = 'gallery/ilustrace/7/6874b384.jpg'; popisyArr[32] = 'Třicetiletá válka';galleryArr[33] = 'gallery/ilustrace/7/b82ba362.jpg'; popisyArr[33] = 'První průmyslová revoluce';galleryArr[34] = 'gallery/ilustrace/7/6cb27ffa.jpg'; popisyArr[34] = 'Zrození sportu';galleryArr[35] = 'gallery/ilustrace/7/3761dfa9.jpg'; popisyArr[35] = 'Pod hladinou lidské duše';galleryArr[36] = 'gallery/ilustrace/7/c2df6ac7.jpg'; popisyArr[36] = 'Moderní malířské směry';galleryArr[37] = 'gallery/ilustrace/7/7b8417b6.jpg'; popisyArr[37] = 'A co dál?';galleryArr[38] = 'gallery/ilustrace/8/8c7533aa.jpg'; popisyArr[38] = 'Sirotek z Nivnice';galleryArr[39] = 'gallery/ilustrace/8/ff05b49c.jpg'; popisyArr[39] = 'Žerotín';galleryArr[40] = 'gallery/ilustrace/8/0fc46de0.jpg'; popisyArr[40] = 'Orbis Pictus';galleryArr[41] = 'gallery/ilustrace/8/958c73b8.jpg'; popisyArr[41] = 'Orbis Pictus';galleryArr[42] = 'gallery/ilustrace/8/df013091.jpg'; popisyArr[42] = 'Václav Hollar';galleryArr[43] = 'gallery/ilustrace/8/dbb79794.jpg'; popisyArr[43] = 'Londýn';galleryArr[44] = 'gallery/ilustrace/8/21f44239.jpg'; popisyArr[44] = 'Descartes';galleryArr[45] = 'gallery/ilustrace/8/f395428c.jpg'; popisyArr[45] = 'Královna Kristina';galleryArr[46] = 'gallery/ilustrace/8/a156395c.jpg'; popisyArr[46] = 'Amsterodam';galleryArr[47] = 'gallery/ilustrace/9/ebc192b6.jpg'; popisyArr[47] = 'Čekání na Pinkertona';galleryArr[48] = 'gallery/ilustrace/9/119b4093.jpg'; popisyArr[48] = 'Čerstvě pokřtěná';galleryArr[49] = 'gallery/ilustrace/9/2f58a3df.jpg'; popisyArr[49] = 'Pinkertonův syn';galleryArr[50] = 'gallery/ilustrace/9/d0f96cbe.jpg'; popisyArr[50] = 'Setkání s Pinkertonovou manželkou';galleryArr[51] = 'gallery/ilustrace/10/07852103.jpg'; popisyArr[51] = 'Letní slunovrat';galleryArr[52] = 'gallery/ilustrace/10/ce702d9a.jpg'; popisyArr[52] = 'Dívčí válka';galleryArr[53] = 'gallery/ilustrace/10/37406626.jpg'; popisyArr[53] = 'Čarodějka';galleryArr[54] = 'gallery/ilustrace/10/45fce1f1.jpg'; popisyArr[54] = 'Přemysl a Libuše';galleryArr[55] = 'gallery/ilustrace/10/e2eba00d.jpg'; popisyArr[55] = 'Bořivojův křest';galleryArr[56] = 'gallery/ilustrace/10/a7a062f8.jpg'; popisyArr[56] = 'Veligrad';galleryArr[57] = 'gallery/ilustrace/11/02fcf21c.jpg'; popisyArr[57] = 'Lakomec Scroog';galleryArr[58] = 'gallery/ilustrace/11/2e61dd32.jpg'; popisyArr[58] = 'Vánoční víla';galleryArr[59] = 'gallery/ilustrace/12/8773e9a3.jpg'; popisyArr[59] = 'Bořivoj a Svatopluk';galleryArr[60] = 'gallery/ilustrace/12/56ac1ffa.jpg'; popisyArr[60] = 'Katedrála svatého Víta';galleryArr[61] = 'gallery/ilustrace/12/1aa8ac03.jpg'; popisyArr[61] = 'Smrt Ludmily';galleryArr[62] = 'gallery/ilustrace/12/4e5476f1.jpg'; popisyArr[62] = 'Kristián v katedrále';galleryArr[63] = 'gallery/ilustrace/12/20ec9aac.jpg'; popisyArr[63] = 'Prodej malých otroků';galleryArr[64] = 'gallery/ilustrace/13/63cb4390.jpg'; popisyArr[64] = 'Noe';galleryArr[65] = 'gallery/ilustrace/13/c2f69e27.jpg'; popisyArr[65] = 'Jonáš';galleryArr[66] = 'gallery/ilustrace/13/bd5de896.jpg'; popisyArr[66] = 'Jeremiáš';galleryArr[67] = 'gallery/ilustrace/14/d4de40bf.jpg'; popisyArr[67] = 'Mikuláš';galleryArr[68] = 'gallery/ilustrace/14/55613aff.jpg'; popisyArr[68] = 'Mláďátka';galleryArr[69] = 'gallery/ilustrace/14/52510f89.jpg'; popisyArr[69] = 'Tři krále'; function callNext() { ++galleryCurrent; if (galleryCurrent>=galleryArr.length) { galleryCurrent = 0; } $("#detail").load(function() { // buttons(); }).attr('src', galleryArr[galleryCurrent]); var info = "

" + titulkyArr[galleryCurrent] + "

" + popisyArr[galleryCurrent] + "
"; $("#infoClick").html(info); /* casovac = setTimeout("callNext()", 5000); */ $('.close').click(function(e) { e.preventDefault(); $('#infoClick').css("display", "none"); /* casovac = setTimeout("callNext()", 5000); */ }); } function getWidth() { screenWidth = $(window).width(); // alert(screenWidth); screenHeight = $(window).height(); if(screenWidth<768) { screenWidth = 768; } /* if(screenWidth>1500) { screenWidth = 1500; } */ /* full screen */ if ($(document).is('.homepage') || $(document).is('.novinky')) { $('#page').css("height", screenHeight+"px"); } else { $('#page').css("height", screenHeight-150+"px"); $('#header').css("position", "relative"); } if (screenHeight>500) { infoFromTop = (screenHeight/2)-150; } else { infoFromTop = 150; } $('#info').css("top", (infoFromTop+120-30)+"px"); $('#info-detail').css("top", infoFromTop+"px"); $('#books-info').css("top", (infoFromTop+120-30)+"px"); $('#ikony').css("top", (infoFromTop+120)+"px"); $('#infoClick').css("top", (infoFromTop-30+120)+"px"); /* list */ $('#infoClick').css("width", (screenWidth/2.4)-80+"px"); /* $('.col-left div').css("height", screenWidth/6+"px"); $('.col-med div').css("height", screenWidth/6+"px"); $('.col-right div').css("height", screenWidth/6+"px"); */ $('.inf').css("height", $('#p1').width()/1.5+"px"); $('#detail').css("height", "100%"); $('.innerP').css("width", $('#p1').width()-10+"px"); $('.innerP').css("height", $('#p1').height()+"px"); $('.innerP a').css("width", $('.innerP').width()); $('.innerP a').css("height", $('.innerP').height()); // alert($('#detail').width()); } $(document).ready(function() { $("#detail").attr('src', galleryArr[0]); var info = "

" + popisyArr[0] + "

"; $("#infoClick").html(info); $('#info .close').click(function(e) { e.preventDefault(); $('#info').css("display", "none"); }); /* $('img').click(function(e) { curElem = e.target.id; curElem = parseInt(curElem.substring(1)); $('innerP').css("background-color", "pink"); }); $('.inf').mouseout(function(e) { curElem = e.target.id; curElem = parseInt(curElem.substring(1)); $('innerP').css("background-color", "blue"); }); */ $('#info-detail .close').click(function(e) { e.preventDefault(); $('#info-detail').css("display", "none"); }); $('.close').click(function(e) { e.preventDefault(); $('#infoClick').css("display", "none"); }); $('.continue').click(function(e) { e.preventDefault(); $('#info-detail').css("display", "block"); }); $('.more').click(function(e) { e.preventDefault(); if($('#infoClick').css("display") != "block") { $('#infoClick').css("display", "block"); } else { $('#infoClick').css("display", "none"); } }); $('.next').click(function(e) { e.preventDefault(); ++galleryCurrent; if (galleryCurrent>=galleryArr.length) { galleryCurrent = 0; } $("#detail").load(function() { // buttons(); }).attr('src', galleryArr[galleryCurrent]); var info = "

" + popisyArr[galleryCurrent] + "

"; $("#infoClick").html(info); $('.close').click(function(e) { e.preventDefault(); $('#infoClick').css("display", "none"); }); /* clearTimeout(casovac); */ }); $('.prev').click(function(e) { //TESTERJE alert("WT"); e.preventDefault(); --galleryCurrent; if (galleryCurrent<0) { galleryCurrent = galleryArr.length - 1; } $("#detail").load(function() { // buttons(); }).attr('src', galleryArr[galleryCurrent]); var info = "

" + popisyArr[galleryCurrent] + "

"; $("#infoClick").html(info); $('.close').click(function(e) { e.preventDefault(); $('#infoClick').css("display", "none"); }); /* clearTimeout(casovac);*/ }); /* $("#detail").load(function() { // buttons(); }).attr('src', galleryArr[galleryCurrent]); }); */ $('#books a').mouseover(function(e) { curElem = e.target.id; curElem = parseInt(curElem.substring(1)); $('#books-info div').css("display", "none"); $('#books-info #i'+curElem).css("display", "block"); }); $('#p1').load(function() { $('.innerP').css("width", $('#p1').width()-10+"px"); $('.innerP').css("height", $('#p1').height()+"px"); $('.innerP a').css("width", $('.innerP').width()); $('.innerP a').css("height", $('.innerP').height()); }); $('img').mouseover(function(e) { $('.innerP').css("visibility", "hidden"); $('img').css("opacity", "1"); curElem = e.target.id; curElem = parseInt(curElem.substring(1)); //alert(curElem); $('#p'+curElem).css("opacity", "0.3"); $('#d'+curElem).css("visibility", "visible"); }); $('.innerP').mouseout(function(e) { curElem = e.target.id; curElem = parseInt(curElem.substring(1)); // alert(curElem); $('#p'+curElem).css("opacity", "1"); $('#d'+curElem).css("visibility", "hidden"); }); // on resize var delay = (function(){ var timer = 0; return function(callback, ms){ clearTimeout (timer); timer = setTimeout(callback, ms); }; })(); $(window).resize(function() { delay(function(){ getWidth(); }, 200); }); // on load center .box getWidth(); /* */ /* if (typeof(galleryArr) != "undefined" && variable !== null) { $("#detail").load(function() { buttons(); }).attr('src', galleryArr[0]); } */ });