
var pops=new Array(10);
var npops=0;

function dontshow(win,cn,ce,cp,cd) {
  document.cookie=cn+"=yes; expires="+ce+"; path="+cp;
  win.close(); return;
}
// ERROR: If your browser thinks this text is a page, not a comment, please upgrade your mac as it is a piece of junk.

function doshow(fld,cn,ce,cp,cd) {
  document.cookie=cn+"=no; expires="+ce+"; path="+cp;
  return;
}

function getCookie(Name) {
  //alert ( "getCookie: " + Name + "\ndocument.cookie.length: " + document.cookie.length + "\n" + location.href);
  if (document.cookie.length > 0) { 
    start = document.cookie.indexOf(Name+"=");
    if (start != -1) { 
      start += Name.length+1;
      end = document.cookie.indexOf(";", start);
      if (end == -1) { end = document.cookie.length; }
      //alert (unescape(document.cookie.substring(start, end)));
      return(unescape(document.cookie.substring(start, end)));
    } 
  }
  return("");
}

function resetCookies() { document.cookie="resetCookies=yes"; return; }

function popup(cookieName,cookieExpire,title,url,wid,hei,moreinfo,local,dbug)
{
    if ((getCookie(cookieName)!="yes")||(getCookie("resetCookies")=="yes"))
    {
        if (local == '1') { var cookiePath=location.pathname; }
        else { var cookiePath="/"; }
        document.cookie="resetCookies=no";

        var popwnd=window.open("","win"+cookieName,"width="+wid+",height="+hei);
        popwnd.document.writeln("<html><HEAD><TITLE>"+title+"</TITLE>\n"+
            "<script language=\"Javascript\">\n"+
  	    "  var cookieNam = \""+cookieName+"\";\n"+
  	    "  var cookieExp = \""+cookieExpire+"\";\n"+
  	    "  var cookiePat = \""+cookiePath+"\";\n"+
  	    "  var moreinfo = \""+moreinfo+"\";\n"+
	    unescape("%3C")+"/script>\n"+
            "</head>"+
            "<FRAMESET ROWS=\"*,40\" BORDER=0>" +
            "<FRAME SRC=\"" + url + "\" NAME=\"info\">"); 
        if (moreinfo!="") {
          popwnd.document.writeln("<FRAME SRC=\"frame_moreinfo.html\" NAME=\"control\" SCROLLING=\"NO\">");
        } else {
          popwnd.document.writeln("<FRAME SRC=\"frame_not_moreinfo.html\" NAME=\"control\" SCROLLING=\"NO\">");
        }
	popwnd.document.writeln("</FRAMESET></html>");
        popwnd.document.close();

        pops[npops]=popwnd;
        npops++;
    }
  return;
}

function donepopup() { document.cookie="resetCookies=no"; return;}

function processUnload()
{
  for (var x=0;x<npops;x++)
    { if (!pops[x].closed) { pops[x].close(); } }
  npops=0;
  return;
}

function emailpopup(path)
{
   var url = path+"?url=" + document.URL + "&title="+escape(document.title);
   var title = "Email_This_ARticle";
   window.open(url, title, "width=450,height=500"); 
}

