//Image preload, initiate the image count variable var imageCount = 0; // create an array to contain the preloaded image files var preloadImages = new Array(); // Main function to load new image into browser function preload(imageFile) { imageCount++; preloadImages[imageCount] = new Image(); preloadImages[imageCount].src = imageFile; } // Basic function to load the images when the browser has loaded the webpage. //Get in Touch popup function popup(divid) { var block = document.getElementById(divid); block.style.display = "block"; } function windowClose(divid) { var block = document.getElementById(divid); block.style.display = "none"; } function resizeSearchLayer() { var x = jQuery("#searchBar").offset().left; var y = jQuery("#searchBar").offset().top; var offsetX = 3; var offsetY = 39; $("search_overlay").style.left = x + offsetX + "px"; $("search_overlay").style.top = y + offsetY + "px"; } function hideSearchLayer() { $("search_overlay").style.visibility = "hidden"; $("search_footer").style.visibility = "hidden"; } jQuery(document).ready(function() { preload('/Images/bw_button_hugeOn.gif'); preload('/Images/bw_button_medOn.gif'); resizeSearchLayer(); jQuery(window).resize(function() { resizeSearchLayer(); }); jQuery(document).click(function(e) { // element outside of search layer and not the search textbox clicked, so hide it if (e.target.id.toLowerCase().indexOf("search") == -1 && e.target.id.toLowerCase().indexOf(txtSearchID.toLowerCase()) == -1) { setTimeout("hideSearchLayer()", 1000); // give it a 1-second delay } }); }); function uuid() { var chars = '0123456789abcdef'.split(''); var uuid = [], rnd = Math.random, r; uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'; uuid[14] = '4'; // version 4 for (var i = 0; i < 36; i++) { if (!uuid[i]) { r = 0 | rnd() * 16; uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r & 0xf]; } } return uuid.join(''); }