$(document).ready(function() { //Remember to remove the div at the bottom of the page $(".popup-fancy-noplugin").hide(); var url = window.location.href.toLowerCase(); // Set the cookie and expiration function setCookie(name, value, path, expire) { var expdate = new Date(); expdate.setDate(expdate.getDate() + expire); document.cookie = name + "=" + escape(value) + ";path=" + path + ";expires=" + expdate.toUTCString(); //document.cookie = name + "=" + escape(value) + ";path=" + path; } // Get Cookie value if it exists function getCookieValue(name) { //alert(name); if (document.cookie.length > 0) { start = document.cookie.indexOf(name + "="); if(start != -1) { start = start + name.length + 1; end = document.cookie.indexOf(";",start); if(end == -1) end = document.cookie.length; return unescape(document.cookie.substring(start, end)); } } } function popupsurvey() { var src = $(".popup-fancy-noplugin").attr("href"); var widthOfPage = $("body").width(); var width = $(".popup-fancy-noplugin").attr("data-width"); var height = $(".popup-fancy-noplugin").attr("data-height"); width = parseInt(width); widthOfPage = parseInt(widthOfPage); var startDivAt = widthOfPage / 2; startDivAt = startDivAt - (width / 2); if (startDivAt < 0) startDivAt = 0; $("form").prepend("
X
"); $("form").append("
"); // transform link into ajax call, and then show by triggering click event. $(".popup-fancy").fancybox({openEffect : 'none', closeEffect : 'none', helpers : { media : {} }}); //if(url.indexOf("/specialpages/" > 0) || url.indexOf("/test/") > 0) // setCookie("popup1", 1, "", 1); //else // setCookie("popup", 1, "", 1); $(".popup-fancy-noplugin").click(); } $(".custom_overlay_close").live("click", function () { $(".custom_overlay_screen, .custom_overlay").remove(); }); // Set variable, see if it exists, and if not, then perform popup action //var sComplete; //if(url.indexOf("/specialpages/" > 0) || url.indexOf("/test/") > 0) // sComplete = getCookieValue("popup1"); //else // sComplete = getCookieValue("popup"); //if(sComplete != 1) //{ url = url.replace("https://", ""); url = url.replace("www.", ""); url = url.replace("default.aspx", ""); if(url == "intrepidmuseum.org/" || url == "intrepidorg.synbeta.com/") var t = setTimeout(popupsurvey, 2000); //} });