Our load_page function has had a number of things added to it. Do not get confused here, the basic method of importing documents is intact and exactly the same as before. It is only that in order to build the gallery that some extra functionality was thrown in. Let us look at the additions to the load page function so that we can understand what is going:

Line 1: pageWidth = (dom) ? innerWidth : document.body.clientWidth;

Line 2: preload = document.getElementById("preloadLYR");

Line 3: gallery = document.getElementById("galleryLYR");

Line 1: A variable named pageWidth is created. It then checks for whether the browser is Internet Explorer or another