
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="+encodeURIComponent(document.title);
   var title = "Email_This_Article";
   window.open(url, title, "width=500,height=500,scrollbars=yes");
}

