var recaptchaReady=false; function GetOffsetTop(node) { if (node.parentNode && node.parentNode.offsetTop) return node.offsetTop+GetOffsetTop(node.parentNode); else return node.offsetTop; } function SlideShow(node,imageList) { this.node=node; this.imageList=imageList; this.imageCount=imageList.length; this.currentImage=0; this.firstNode=true; this.loading=false; this.arrow = Array(); this.arrow[0] = document.createElement("img"); this.arrow[1] = document.createElement("img"); this.arrow[0].className="arrow_left"; this.arrow[1].className="arrow_right"; this.arrow[0].style.display="none"; this.arrow[1].style.display="none"; this.node.appendChild(this.arrow[0]); this.node.appendChild(this.arrow[1]); this.img = Array(); this.img[0] = document.createElement("img"); this.img[1] = document.createElement("img"); this.node.appendChild(this.img[0]); this.node.appendChild(this.img[1]); this.img[0].className="slideshow_img slideshow_img_0"; this.img[1].className="slideshow_img slideshow_img_1"; this.img[0].style.opacity=0; this.img[1].style.opacity=0; this.imageLoader = new Image(); this.imageLoader.slideShow=this; this.imageLoader.onload=function(event) { this.slideShow.onLoad(event); } this.imageLoader.onerror=function(event) { this.slideShow.onError(event); } this.arrow[0].slideShow=this; this.arrow[1].slideShow=this; this.arrow[0].onclick=function(event) { if (this.slideShow.loading) return; this.slideShow.LoadImage(-1); } this.arrow[1].onclick=function(event) { if (this.slideShow.loading) return; this.slideShow.LoadImage(1); } this.onLoad = function(event) { this.arrow[0].style.display=""; this.arrow[1].style.display=""; this.img[(this.firstNode ? 0 : 1)].style.opacity="0"; this.img[(this.firstNode ? 0 : 1)].style.position="absolute"; this.img[(this.firstNode ? 1 : 0)].src=this.imageList[this.currentImage]; this.img[(this.firstNode ? 1 : 0)].style.opacity="1"; this.img[(this.firstNode ? 1 : 0)].style.position="relative"; this.firstNode=!this.firstNode; this.loading=false; } this.OnError = function(event) { this.loading=false; } this.LoadImage = function(pos) { if (this.loading) return; this.loading=true; this.currentImage+=pos; if (this.currentImage >= this.imageCount) this.currentImage=0; if (this.currentImage < 0) this.currentImage=this.imageCount-1; this.imageLoader.src=this.imageList[this.currentImage]; this.img[(this.firstNode ? 0 : 1)].style.opacity="0"; } this.LoadImage(0); } var backgroundFiles=new Array( "a_start_1.jpg.jpg","p_1.jpg.jpg","p_2.jpg.jpg","p_5.jpg.jpg","p_6.jpg.jpg","p_7.jpg.jpg","p_8.jpg.jpg","p_9.jpg.jpg"); var gFilesCount=backgroundFiles.length; var slideShowFiles=new Array( "graphics/slideshow/breakfast_1.jpg","graphics/slideshow/flower_1.jpg","graphics/slideshow/hotel_1.jpg","graphics/slideshow/hotel_2.jpg","graphics/slideshow/hotel_3.jpg"); gLoad=false; gStart=false; var gImage=new Image(); var gLoading=false; var gAnim=false; var gNoScrollingAnim=false; var gCurrentVisible=true; var gImgCointainer = new Array(); var gImg = new Array(); var gArrows = new Array(); var gCurrentImage=0; var timeOut=0; function SetImage(image) { ChangeBackgroundImage(image); return false; } function LoadNextImage(image) { if (timeOut) { window.clearTimeout(timeOut) timeOut=0; } timeOut = window.setTimeout(function() { ChangeBackgroundImage(image); timeOut=0; },9000); } function OnLoadImage(msg) { gLoading=false; gImg[(gCurrentVisible ? 1 : 0)].src=gImage.src; gImgCointainer[(gCurrentVisible ? 1 : 0)].offsetHeight; gImgCointainer[(gCurrentVisible ? 0 : 1)].offsetHeight; gImgCointainer[(gCurrentVisible ? 1 : 0)].className="main_image_inner_container main_image_inner_container_visible"; gImgCointainer[(gCurrentVisible ? 0 : 1)].className="main_image_inner_container"; gCurrentVisible=!gCurrentVisible; window.setTimeout(function() { gArrows[0].style.opacity="" gArrows[1].style.opacity="" gArrows[0].style.transform="" gArrows[1].style.transform="" gArrows[0].style.cursor="" gArrows[1].style.cursor="" gAnim=false; },1800); LoadNextImage(1); } function OnError(msg) { gArrows[0].style.opacity="" gArrows[1].style.opacity="" gArrows[0].style.transform="" gArrows[1].style.transform="" gArrows[0].style.cursor="" gArrows[1].style.cursor="" gAnim=false; } var doc; function Start() { if (gStart) return; gStart=true; gImgCointainer[0]=document.getElementById("image_container0"); gImgCointainer[1]=document.getElementById("image_container1"); gArrows[0]=document.getElementById("arrow_left"); gArrows[1]=document.getElementById("arrow_right"); gImg[0]=document.getElementById("img0"); gImg[1]=document.getElementById("img1"); document.getElementById("insert_tel").innerHTML ="43"+" "+" 7435"+" "+"52319"; document.getElementById("insert_mail").innerHTML ="gasthof"+String.fromCharCode(64)+"pillgrab"+".at"; document.getElementById("insert_tel2").innerHTML ="43"+" "+" 7435"+" "+"52319"; document.getElementById("insert_mail2").innerHTML ="gasthof"+String.fromCharCode(64)+"pillgrab"+".at"; document.getElementById("insert_mail2").href="mailto:gasthof"+String.fromCharCode(64)+"pillgrab"+".at"; gImage.onload=OnLoadImage; gImage.onerror=OnError; ChangeBackgroundImage(0); var headerNode = document.getElementById("header") var headerNodeOffset=891;//headerNode.offsetTop; var headerNodeOffset2=611;//headerNode.offsetTop; doc = document.documentElement; var scrollNode=new Array(); var tmpNode=null; var index=0; for (var index=0; index < 100; index++) { if ((tmpNode=document.getElementById("scroll_move_"+index))) scrollNode[scrollNode.length]=tmpNode; } scrollNode[scrollNode.length]=document.getElementById("slideshow_0"); var scrollNodesCount=scrollNode.length; function OnScroll(msg) { var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var topScroll = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0); if (topScroll > (w <= 1050 ? headerNodeOffset2 : headerNodeOffset)) { headerNode.className="header_fixed"; } else { headerNode.className="header_absolute"; } var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; for (var i=0; i < scrollNodesCount; i++) { if (topScroll+(height*0.8) > GetOffsetTop(scrollNode[i])) { if (typeof (scrollNode[i].scrollStyle) == 'undefined') { scrollNode[i].style.transform="translateX(0px)"; scrollNode[i].style.opacity="1"; scrollNode[i].scrollStyle=true; scrollNode[i].style.transition=""; if (gNoScrollingAnim) { scrollNode[i].style.transition="all 0ms"; scrollNode[i].offsetHeight; } } } else if (typeof (scrollNode[i].scrollStyle) != 'undefined') { scrollNode[i].style.transform=""; scrollNode[i].style.opacity=""; delete scrollNode[i].scrollStyle; scrollNode[i].style.transition=""; if (gNoScrollingAnim) { scrollNode[i].style.transition="all 0ms"; scrollNode[i].offsetHeight; } } } } window.onscroll = OnScroll; var slideshow0 = new SlideShow(document.getElementById("slideshow_0"),slideShowFiles); var topScroll = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0); //window.scrollTo(0, topScroll-70); UpdateValue(document.getElementById("input_anrede"),true); UpdateValue(document.getElementById("input_vorname"),true); UpdateValue(document.getElementById("input_nachname"),true); UpdateValue(document.getElementById("input_plz"),true); UpdateValue(document.getElementById("input_ort"),true); UpdateValue(document.getElementById("input_land"),true); UpdateValue(document.getElementById("input_email"),true); UpdateValue(document.getElementById("input_tage"),true); UpdateValue(document.getElementById("input_datum"),true); UpdateValue(document.getElementById("input_text"),true); } function Load() { if (gLoad) return; gLoad=true; Start(); gNoScrollingAnim=true; HeaderButton(location.hash.substring(1, location.hash.length)); gNoScrollingAnim=false; } if (document.addEventListener) { document.addEventListener('DOMContentLoaded', Start, false); window.addEventListener('load', Load, false ) } else { window.onload=Load; } function ChangeBackgroundImage(image) { if (gLoading) return; if (gAnim) return; gArrows[0].style.opacity="0.3" gArrows[1].style.opacity="0.3" gArrows[0].style.transform="scale(-0.8,0.8)" gArrows[1].style.transform="scale(0.8,0.8)" gArrows[0].style.cursor="default" gArrows[1].style.cursor="default" gLoading=true; gAnim=true; gCurrentImage+=image; if (gCurrentImage >= gFilesCount) gCurrentImage=0; if (gCurrentImage < 0) gCurrentImage=gFilesCount-1; gImage.src="./graphics/backgrounds/"+backgroundFiles[gCurrentImage]; } var intervalId=null; var scrollToPos=0; var scrollCurrent=0; var scrollSpeed=50; function HeaderButton(id) { if (!document.getElementById(id)) return; MenuLinkClick(); if (gNoScrollingAnim) { scrollSpeed=50000; } else { scrollSpeed=50; } var offsetTop = GetOffsetTop(document.getElementById(id))-70; scrollToPos=offsetTop; scrollCurrent= (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0); if(history.pushState) { history.pushState(null, null, '#'+id); } else { location.hash = '#'+id; } if (intervalId) { window.clearInterval(intervalId); } intervalId=window.setInterval(function() { var scrollTmp= (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0); if (scrollCurrent < scrollToPos) { scrollCurrent+=scrollSpeed; if (scrollCurrent >= scrollToPos) { scrollCurrent=scrollToPos; window.clearInterval(intervalId); } } else if (scrollCurrent > scrollToPos) { scrollCurrent-=scrollSpeed; if (scrollCurrent <= scrollToPos) { scrollCurrent=scrollToPos; window.clearInterval(intervalId); } } else { window.clearInterval(intervalId); } window.scrollTo(0,scrollCurrent); },10); return false; } function UpdateValue(node,focusLost) { if (focusLost) { if (node.value == "" || node.value == node.getAttribute("standardvalue")) { node.value = node.getAttribute("standardvalue"); node.valueSet=false; } else { node.valueSet=true; } } else { if (typeof(node.valueSet) == "undefined" || node.valueSet==false) { node.value=""; } } } function OnSubmit(node) { if (!recaptchaReady) return false; var error=false; if (!document.getElementById("input_datenschutz").checked) { document.getElementById("input_datenschutz_value").style.color="red"; error=true; } if (!document.getElementById("input_anrede").valueSet) { document.getElementById("input_anrede").style.backgroundColor="red"; error=true; } if (!document.getElementById("input_vorname").valueSet) { document.getElementById("input_vorname").style.backgroundColor="red"; error=true; } if (!document.getElementById("input_nachname").valueSet) { document.getElementById("input_nachname").style.backgroundColor="red"; error=true; } if (!document.getElementById("input_ort").valueSet) { document.getElementById("input_ort").style.backgroundColor="red"; error=true; } if (!document.getElementById("input_plz").valueSet) { document.getElementById("input_plz").style.backgroundColor="red"; error=true; } if (!document.getElementById("input_land").valueSet) { document.getElementById("input_land").style.backgroundColor="red"; error=true; } if (!document.getElementById("input_email").valueSet) { document.getElementById("input_email").style.backgroundColor="red"; error=true; } if (!document.getElementById("input_datum").valueSet) { document.getElementById("input_datum").style.backgroundColor="red"; error=true; } if (!document.getElementById("input_tage").valueSet) { document.getElementById("input_tage").style.backgroundColor="red"; error=true; } if (!error) { UpdateValue(document.getElementById("input_text"),false); } return !error; } function InputFocus(node,message,focusLost) { UpdateValue(node,focusLost); } function InputOnKeyUp(node,message) { if (node.value.length > 0) { node.style.backgroundColor=""; } } function MenuButtonClick(node) { node.style.display="none"; document.getElementById("header_text").style.display="block"; return false; } function MenuLinkClick() { document.getElementById("menu_button").style.display=""; document.getElementById("header_text").style.display=""; } var verifyCallback = function() { recaptchaReady=true; }; function ClickVideo(event) { event.preventDefault(); var url = 'https://youtu.be/5qSEFtFmkhQ'; window.open(url, '_blank'); document.getElementById("yt_video").pause(); console.log(event); }