/*
Cookie Controlled Pop Window -
modified by Brad Richardson at speculativevision.com
from original cookie script by echoecho.com
*/

/* reads the cookie */
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;
}

/* deletes the cookie if a link is provided to do so */
function delCookie (NameOfCookie) {
  if (getCookie(NameOfCookie)) {
    document.cookie = NameOfCookie + "=" +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

/* pops up the window if the cookie has not been set yet */
/* change parameters in MyWindow to match your desired settings */
/* in particular, be sure you change the URL or your visitors are */
/* only going to see the sample pop up at Speculative Vision */

function screenInfo() {
	if (window.screen) {
		h=screen.height;
		w=screen.width;
		ah=screen.availHeight;
		aw=screen.availWidth;
		cd=screen.colorDepth;
		str=w+"x"+h+"_"+aw+"x"+ah+"_"+cd;
		url="/newsletter_popup.php?scr="+str;
		return url;
	}
}


function DoTheCookieStuff()
{
 visited=getCookie('visited');
 if (visited==null)
 {
 gotoURL=screenInfo();
MyWindow=window.open(gotoURL,"MyWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=200,height=300,left=1,top=1");
MyWindow.blur();
window.focus();
 }
}