$(document).ready(function() { if (document.getElementById("showPopup").value == "true") { // show popup //Put in the DIV id you want to display launchWindow('#popup_dialog'); //if reauthorize link is clicked $('.popup_window .popup_reauthorize').click(function (e) { //Cancel the link behavior e.preventDefault(); $('#popup_mask').hide(); $('.popup_window').hide(); //updateFlag(); window.location = "/mslib/protected/entitlement/RequestEntitlement.jsp"; }); //if do not show link is clicked $('.popup_window .popup_dns').click(function (e) { //Cancel the link behavior e.preventDefault(); $('#popup_mask').hide(); $('.popup_window').hide(); updateFlag(); }); //if close link is clicked $('.popup_window .popup_close').click(function (e) { //Cancel the link behavior e.preventDefault(); $('#popup_mask').hide(); $('.popup_window').hide(); //updateFlag(); }); //if remind me later link is clicked $('.popup_window .popup_rml').click(function (e) { //Cancel the link behavior e.preventDefault(); $('#popup_mask').hide(); $('.popup_window').hide(); updateSession(); }); /* //if mask is clicked $('#popup_mask').click(function () { $(this).hide(); $('.popup_window').hide(); updateFlag(); }); */ } }); function updateSession() { var xmlHttpReq = false; var self = this; // Mozilla/Safari if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } var id = document.getElementById("membershipId"); var url = "/mslib/updateFlag?id=" + id.value + "&flag=2&rand="+ Math.random(); self.xmlHttpReq.open('GET', url, false); self.xmlHttpReq.send(null); } function updateFlag() { //if (document.getElementById("dnsCB").checked) { var xmlHttpReq = false; var self = this; // Mozilla/Safari if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } var id = document.getElementById("membershipId"); var url = "/mslib/updateFlag?id=" + id.value + "&flag=0&rand="+ Math.random(); self.xmlHttpReq.open('GET', url, false); self.xmlHttpReq.send(null); //} } function launchWindow(id) { //Get the screen height and width var maskHeight = $(document).height(); var maskWidth = $(window).width(); //Set heigth and width to mask to fill up the whole screen $('#popup_mask').css({'width':maskWidth,'height':maskHeight}); //transition effect //$('#popup_mask').fadeIn(1000); $('#popup_mask').fadeIn("fast"); //$('#popup_mask').fadeTo("slow",0.8); $('#popup_mask').fadeTo("fast",0.5); //Get the window height and width var winH = $(window).height(); var winW = $(window).width(); //Set the popup window to center $(id).css('top', winH/2-$(id).height()); $(id).css('left', winW/2-$(id).width()/2); //transition effect //$(id).fadeIn(2000); $(id).fadeIn("fast"); }