   var popunder = "/PS/en/home/aliantsurvey_e.jsp";
   var windowprops = "width=800, height=550, directories=no, fullscreen=no, location=no, addressbar=no, toolbar=no, menubar=no, scrollbars=yes, status=no, resizable=no";
   var aliantcookie = document.cookie;
   var acceptedCookie = 0;
   var invitedCookie = 0;

   function getSurveyCookie(name)  {

      var result = 0;
      result = document.cookie.indexOf(name);

      if (result == -1) {
         return -1;
      }
      else
      {
         return 0;
      }
   }

   function loadpopunder() {
      popUnderWindow = window.open(popunder, "surveyWindow", windowprops);
      popUnderWindow.blur();
      window.focus();
   }

   function createSurveyCookie(name,value,expiresAfterXDays) {
      var date = new Date();
      date.setTime(date.getTime()+(expiresAfterXDays*24*60*60*1000));
      var expires = "; expires="+date.toGMTString();
      document.cookie = name+"="+value+expires+"; path=/";
   }

   //check to see if the cooki exists
   invitedCookie = getSurveyCookie("AliantWebSurvey_Invited");
   acceptedCookie = getSurveyCookie("AliantWebSurvey_Accepted");

   //check if popunder should be displayed
   if ((invitedCookie == -1)  && (acceptedCookie == -1)) {
      //create the cookie
      createSurveyCookie('AliantWebSurvey_Invited', 'Invited', 30);

      //load the popunder window
      loadpopunder();

      if (window != top) {
         top.location.href = location.href;
      }
   }
