PageSourceSearch

https://hotelforoyar.fo/Files/Templates/Designs/SSTemplate/js/hotelfo_v3.js?ver=5

js hotelforoyar.fo collected 2026-09-24 22:38:21 UTC 8,420 bytes, 262 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function () {
2  var lazyImages = [].slice.call(document.querySelectorAll("img.lazy"));
3  var active = false;
4
5  const lazyLoad = function () {
6    if (active === false) {
7      active = true;
8
9      setTimeout(function () {
10        lazyImages.forEach(function (lazyImage) {
11          if (
12            lazyImage.getBoundingClientRect().top <= window.innerHeight &&
13            lazyImage.getBoundingClientRect().bottom >= 0 &&
14            getComputedStyle(lazyImage).display !== "none"
15          ) {
16            lazyImage.src = lazyImage.dataset.src;
17            lazyImage.srcset = lazyImage.dataset.srcset;
18            lazyImage.classList.remove("lazy");
19
20            lazyImages = lazyImages.filter(function (image) {
21              return image !== lazyImage;
22            });
23
24            if (lazyImages.length === 0) {
25              document.removeEventListener("scroll", lazyLoad);
26              window.removeEventListener("resize", lazyLoad);
27              window.removeEventListener("orientationchange", lazyLoad);
28            }
29          }
30        });
31
32        active = false;
33      }, 200);
34    }
35  };
36
37  document.addEventListener("scroll", lazyLoad);
38  window.addEventListener("resize", lazyLoad);
39  window.addEventListener("orientationchange", lazyLoad);
40  lazyLoad();
41});
42
43$(".selectcountry").click(function (e) {
44  $(".selectcountry").removeClass("active");
45  $(this).addClass("active");
46  var sublist = $(this).attr("rel");
47  $(".clwrapper").fadeOut(100);
48  $("." + sublist).fadeIn(100);
49});
50$(".countryli").click(function (e) {
51  $(".countryli").removeClass("active");
52  $(this).addClass("active");
53  var showcont = $(this).attr("rel");
54  $(".countrydisplay").fadeOut(100);
55  setTimeout(function () {
56    $("." + showcont).fadeIn(100);
57  }, 100);
58});
59
60$(document).keydown(function (e) {
61  if (e.keyCode == 37) {
62    $(".prev").click();
63  } else if (e.keyCode == 39) {
64    $(".next").click();
65  }
66});
67
68var menpos = 0;
69$(".navtrigger").click(function () {
70  setTimeout(function () {
71    $(".navtrigger").removeClass("right");
72  }, 300);
73
74  if (menpos == 0) {
75    $("body").addClass("menuopen");
76    $("body").addClass("scrollactive");
77    $("body").removeClass("scrollgoback");
78    setTimeout(function () {
79      $(".navtrigger").text(close);
80
81      $(".navtrigger").addClass("black");
82    }, 50);
83
84    document.getElementById("mainmenu").style.height = "100vh";
85    document.getElementById("maincontent").style.marginTop = "100vh";
86    menpos = 1;
87  } else if (menpos == 1) {
88    $("body").removeClass("menuopen");
89    $("body").removeClass("scrollactive");
90    $("body").addClass("scrollgoback");
91    if ($(document).scrollTop() >= 150) {
92      setTimeout(function () {
93        $("body").addClass("scrollactive");
94        $("body").removeClass("scrollgoback");
95      }, 300);
96    }
97    setTimeout(function () {
98      $(".navtrigger").html('<span class="icon-menu"></span> ' + navigate);
99    }, 300);
100    $(".navtrigger").removeClass("black");
101    document.getElementById("mainmenu").style.height = "0vh";
102    document.getElementById("maincontent").style.marginTop = "0vh";
103    menpos = 0;
104  } else if (menpos == 2) {
105    $("body").removeClass("menuopen");
106    $("body").removeClass("scrollactive");
107    $("body").addClass("scrollgoback");
108    if ($(document).scrollTop() >= 150) {
109      setTimeout(function () {
110        $("body").addClass("scrollactive");
111        $("body").removeClass("scrollgoback");
112      }, 300);
113    }
114    setTimeout(function () {
115      $(".navtrigger").html('<span class="icon-menu"></span> ' + navigate);
116    }, 300);
117    $(".navtrigger").removeClass("black");
118    document.getElementById("mainbooking").style.height = "0vh";
119    document.getElementById("maincontent").style.marginTop = "0vh";
120    book = 0;
121    menpos = 0;
122  }
123
124  /*  alert("book " + book);
125      alert("menpos " + menpos);*/
126});
127
128/* var book = 0;
129$(".bookingtrigger").click(function () {
130  if (book == 0) {
131    setTimeout(function () {
132      $(".navtrigger").text(close);
133    }, 50);
134    $(".navtrigger").addClass("black");
135    $("body").addClass("menuopen");
136    $("body").addClass("scrollactive");
137    $("body").removeClass("scrollgoback");
138    setTimeout(function () {
139      $(".navtrigger").addClass("right");
140    }, 50);
141    document.getElementById("mainbooking").style.height = "100vh";
142    document.getElementById("maincontent").style.marginTop = "100vh";
143    book = 1;
144    menpos = 2;
145  } else {
146    $(".navtrigger").removeClass("black");
147    $(".navtrigger").removeClass("right");
148    $("body").removeClass("menuopen");
149
150    $("body").removeClass("scrollactive");
151    $("body").addClass("scrollgoback");
152    if ($(document).scrollTop() >= 150) {
153      setTimeout(function () {
154        $("body").addClass("scrollactive");
155        $("body").removeClass("scrollgoback");
156      }, 300);
157    }
158    document.getElementById("mainbooking").style.height = "0vh";
159    document.getElementById("maincontent").style.marginTop = "0vh";
160    book = 0;
161  }
162  s
163}); */
164
165$(".filterselect").click(function () {
166  $(".filterselect").removeClass("active");
167  $(this).addClass("active");
168  var thema = $(this).attr("rel");
169  if (thema == "allcat") {
170    $(".inspcont").fadeOut(100);
171    setTimeout(function () {
172      $(".inspcont").fadeIn(100);
173    }, 100);
174  } else {
175    $(".inspcont").fadeOut(100);
176    setTimeout(function () {
177      $("." + thema).fadeIn(100);
178    }, 100);
179  }
180});
181
182var mentriggered = false;
183
184$(document).scroll(function () {
185  var scrollvalue = $(document).scrollTop(); /* <== here*/
186
187  if (scrollvalue >= 150 || $("body").hasClass("menuopen")) {
188    mentriggered = true;
189    $("body").addClass("scrollactive");
190    $("body").removeClass("scrollgoback");
191  } else {
192    if (mentriggered === true) {
193      $("body").removeClass("scrollactive");
194      $("body").addClass("scrollgoback");
195    }
196  }
197});
198
199$(".pagelinkli").mouseover(function () {
200  var mynd = $(this).attr("data-image");
201  $("#mainmenu").css({ "background-image": "url('" + mynd + "')" });
202  $("#mainmenu").addClass("goactive");
203  $("#mainmenu").removeClass("gopassive");
204});
205$(".pagelinkli").mouseout(function () {
206  $("#mainmenu").addClass("gopassive");
207  $("#mainmenu").removeClass("goactive");
208});
209$(document).ready(function () {
210  $(".modal-blur").on("click", function () {
211    $("#exampleModal").modal("hide");
212  });
213});
214
215$(document).ready(function () {
216  // Switch from .modal-body to .pricecalendarwidget on button click
217  $(".roomtrigger").on("click", function () {
218    // Hide .modal-body with a smooth transition and show .pricecalendarwidget
219    $(".modal-body").addClass("hidden");
220    setTimeout(function () {
221      $(".modal-body").css("display", "none"); // Set display:none after the animation ends
222      $(".roomwidget").css("display", "block");
223      setTimeout(function () {
224        $(".roomwidget").removeClass("hidden"); // Animate showing of pricecalendarwidget
225      }, 10); // Delay to allow transition to apply
226    }, 500); // This should match the transition duration (0.5s)
227  });
228
229  // Switch from .modal-body to .pricecalendarwidget on button click
230  $(".tabletrigger").on("click", function () {
231    // Hide .modal-body with a smooth transition and show .pricecalendarwidget
232    $(".modal-body").addClass("hidden");
233    setTimeout(function () {
234      $(".modal-body").css("display", "none"); // Set display:none after the animation ends
235      $(".tablewidget").css("display", "block");
236      setTimeout(function () {
237        $(".tablewidget").removeClass("hidden"); // Animate showing of pricecalendarwidget
238      }, 10); // Delay to allow transition to apply
239    }, 500); // This should match the transition duration (0.5s)
240  });
241
242  // Reset modal to original state when it is closed
243  $("#exampleModal").on("hide.bs.modal", function () {
244    // Reset visibility of .modal-body and .pricecalendarwidget
245    $(".modal-body").removeClass("hidden").css("display", "block");
246    $(".roomwidget").addClass("hidden").css("display", "none");
247    $(".tablewidget").addClass("hidden").css("display", "none");
248  });
249});
250
251function afterModalTransition(e) {
252  e.setAttribute("style", "display: none !important;");
253}
254$("#exampleModal").on("hide.bs.modal", function (e) {
255  setTimeout(() => afterModalTransition(this), 200);
256});
257
258//$("#exampleModal").modal();
259
260$(document).ready(function () {
261  $("#exampleModal").modal("hide"); // Ensures the modal is hidden when the page loads
262});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.