Pop-ups that work!

Pop-ups that work!

This page may have a horizontal scroll bar because of the script.

The following article will describe how to install a pop-up
window to get more subscribers to your ezine.
I know, I know you’ve all heard about the evils of pop-up windows.
However, the simple fact of the matter is that they work!

The following script will install a pop-up on any web page that you
put it on. It also uses cookies to prevent a user from getting the
pop-up on subsequent visits to the page.

Below the script, you will find instructions on how to
install the pop up.

Script

<SCRIPT>
function getCookie(NameOfCookie){
    if (document.cookie.length > 0) {
    begin = document.cookie.indexOf(NameOfCookie+”=”);
    if (begin != -1) {
      begin += NameOfCookie.length+1;
      end = document.cookie.indexOf(“;”, begin);
      if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(begin, end));
    }
  }
  return null;
}

function setCookie(NameOfCookie, value, expiredays) {
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

  document.cookie = NameOfCookie + “=” + escape(value) +
  ((expiredays == null) ? “” : “; expires=” + ExpireDate.toGMTString());
}

function delCookie (NameOfCookie) {
  if (getCookie(NameOfCookie)) {
    document.cookie = NameOfCookie + “=” +
    “; expires=Thu, 01-Jan-70 00:00:01 GMT”;
  }
}

function DoTheCookieStuff()
{
 visited=getCookie(‘visited’);
  if (visited==null)
 {
setCookie(‘visited’,’yes’,365)
MyWindow=window.open(‘pop.htm’,’MyWindow’,’toolbar=no,location=yes,directories=no,status=yes,
menubar=no,scrollbars=no,resizable=yes,width=315,height=340,left=1,top=1′);
 }
}
</SCRIPT>

Directions

1. Place this above script in between
<HEAD> and </HEAD>
at the top of your web page.

2. Place

onUnLoad=”DoTheCookieStuff()”

in the <BODY> tag.

Looks like this:
<BODY onUnLoad=”DoTheCookieStuff()”>

You can also have all the regular stuff
in the BODY tag, like link colors
and margin widths, whatever you normally use.

(“onLoad” for it to come up when they first hit the page,
“onUnload” for it to come up when they leave the page)

3. Name your popup page “pop.htm”.
In the pop.htm file, include whatever you
want the pop-up window to show.

4. This line in the script:

setCookie(‘visited’,’yes’,365)

sets the popup to pop once a year per visitor.
You can change the number 365 to any number of days you like.
It does set cookies, so you will want to have a privacy statement
somewhere on your site, that tells visitors you use cookies and why.

One final note:
Once you visit the page, you will only see the
popup the first time you visit,
because a cookie has been set on your computer,
in order to see it work again,
you will need to go into your temporary internet files
and remove that cookie.

More Information

Visit Get High Forum
for a great discussion on all the ins and outs of pop-ups
including the ethics of it,
and more information on installation.