// JavaScript Document window.onresize = function(event) { w = window.innerWidth; h = window.innerHeight; document.getElementById("patinfo").innerHTML = " "+w+" x "+h+"px"; nastavCookie("display", w+":"+h, 1); if(w>640) document.getElementById("hl-menu").style.display = "block"; }; var pozice = 0; posuv = 0; obr = []; i = 0; cesta = window.location.protocol + "//" + window.location.host+"/"; //+ window.location.pathname; function fb(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/cs_CZ/sdk.js#xfbml=1&version=v2.6&appId=114153604063"; fjs.parentNode.insertBefore(js, fjs); } window.onload=function(){ w = window.innerWidth; h = window.innerHeight; document.getElementById("patinfo").innerHTML = " "+w+" x "+h+"px"; nastavCookie("display", w+":"+h, 1); x = document.createElement("div"); x.setAttribute("id", "obrazek"); x.setAttribute("poz", 0); document.body.appendChild(x); n = document.getElementsByTagName("A").length; text = ""; bb = 0; obrazky2 = []; for(a = 0; a < n; a++) { text = document.getElementsByTagName("A")[a].getAttribute("href"); zkouska = /images/; if(zkouska.test(text)) { text = text.replace(/\/images/i, 'img/c'); testovani = document.getElementsByTagName("A")[a].getAttribute("title"); document.getElementsByTagName("A")[a].setAttribute("name", bb); obrazky2[bb] = [cesta+text,testovani]; document.getElementsByTagName("A")[a].onclick = function() { zobrazit(this.name); return false; } bb += 1; }} document.getElementById("ikona-menu").onclick = function() { var e = document.getElementById("hl-menu"); if(e.style.display=="block"){ e.style.display="none"; } else { e.style.display="block"; } } zabal_obrazky("imgclanek","divimgclanek"); } //if(window.innerWidth > 1282){document.onscroll=function(){document.body.style.backgroundPosition = "0 -"+(document.documentElement.scrollTop/2)+"px";}} function zavri_menu() { document.getElementById("hl-menu").style.display="none"; } function nastavCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + "; " + expires; } function zabal_obrazky(co, cim) { x = document.getElementsByClassName(co); if(x.length > 0) { for(i=0;i

"+obrazky2[i][1]+"

"; posuv = 1; if(w < (h * 1.33)) {document.getElementById("aktualni").setAttribute("width", (w - 60)); } else {document.getElementById("aktualni").setAttribute("height", (h - 60));} document.getElementById("obrazek").style.display = "block"; document.getElementById("aktualni").style.opacity = 1; //uloz informace data1 = "jmeno="+obrazky2[i][0]+"&stranka="+document.baseURI+"&ip=18.223.119.17 : www.ditom.cz"; var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { } } xhttp.open("POST", "foto-view.php", true); xhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded;charset=utf-8"); xhttp.setRequestHeader("Content-length", data1.length); xhttp.setRequestHeader("Connection", "close"); xhttp.send(data1); } function zavriimg() { document.getElementById("obrazek").innerHTML = ""; document.getElementById("obrazek").style.display = "none"; posuv = 0; window.scrollTo(0, document.getElementById("obrazek").getAttribute("poz")); } window.onscroll = function() { pozice = getScrollingPosition()[1]; if(posuv == 1) window.scrollTo(0,0); } function getScrollingPosition() { var position = [0, 0]; if (typeof window.pageYOffset != 'undefined') {position = [window.pageXOffset, window.pageYOffset];} else if (typeof document.documentElement.scrollTop != 'undefined' && document.documentElement.scrollTop > 0) {position = [document.documentElement.scrollLeft, document.documentElement.scrollTop];} else if (typeof document.body.scrollTop != 'undefined') {position = [document.body.scrollLeft, document.body.scrollTop];} return position; } function scrollToTop(scrollDuration) { var scrollStep = -window.scrollY / (scrollDuration / 2), scrollInterval = setInterval(function(){ if ( window.scrollY != 0 ) { window.scrollBy( 0, scrollStep ); } else clearInterval(scrollInterval); },2); }