
var g_arrLnkName     = new Array("Monthly Bulletin","Friday Night Films");
var g_arrLnkPage     = new Array
    (
        "MB.pdf",
        "FilmNights.pdf"
    );
var g_iPopupWidth    = 820;
var g_body_popup_on  = '#373535';
var g_body_popup_off = '#000000';

function fnOnLoad()
{
    var buf = "";

    // Build: spacer.
    buf  = "<table width='100%' cellspacing='2' cellpadding='0'> ";
    buf += "  <tr>";
    buf += "    <td height='4'><img src='spacer.gif' width='1' height='1' /></td>";
    buf += "	</tr>";
    buf += "</table>";
    document.getElementById('sec01').innerHTML = buf;  

    // Build: Links table.
    buf  = "<center>";
    buf += "<table border='0' id='popFrm_lnk_tbl1'  >";
    buf += "<tr height='27px'>";
    for (var x=0; x<g_arrLnkName.length; x++)
    {
        buf += "<td class='popFrm_lnk_td1' width='30%'>";
        buf += "  <a href='javascript:fnShowPopup(" + x + ")' >" + g_arrLnkName[x] + "</a>";
        buf += "</td>";
    }
    buf += "</tr>";		
    buf += "</table>";
    buf += "</center>";            
    document.getElementById('popFrm_secLinks').innerHTML = buf;
  
    // Build: Frame.
    buf  = "<table id='popFrm_tbl1' cellpadding='0' cellspacing='0' border='0' >";
    buf += "  <tr>";
    buf += "      <td width='80%' align='center' valign='top'>";
    buf += "          <label id='popFrm_labHdr' ></label>";
    buf += "      </td>";
    buf += "      <td align='right'>";
    buf += "          <img id='popFrm_close_img' src='close.gif' alt='Close' onclick='fnCloseFrameWindow()' />";
    buf += "      </td>";
    buf += "  </tr>";
    buf += "</table>";
    buf += "<iframe id='popFrm_iFrame1' scrolling='auto' frameborder='0'  /> ";
    document.getElementById('popFrm_secFrame1').innerHTML = buf;
}
function fnShowPopup(idx)
{
    switch (parseFloat(idx))
    {
        case 0:
        case 1:
            var myWidth = 0, myHeight = 0, tmp;
            var iWidth = 0; iHeight = 0;    
            var iPopupLeft = 0; iPopupTop = 20;
            
            var m = document.getElementById('sec00');
            var o = document.getElementById('popFrm_secFrame1');
            var f = document.getElementById('popFrm_iFrame1');
            var l = document.getElementById('popFrm_secLinks');
            var h = document.getElementById("popFrm_labHdr");

            tmp = fnGetWinSize().split("|");
            myWidth  = tmp[0];
            myHeight = tmp[1];
            
            iPopupLeft = (myWidth - g_iPopupWidth) / 2;

            m.style.display    = 'none';
            l.style.display    = 'none';
            window.document.body.style.backgroundColor = g_body_popup_on;

            o.style.position   = 'absolute';
            o.style.visibility = 'visible';
            o.style.left = iPopupLeft;
            o.style.top  = iPopupTop;

            f.style.width  = g_iPopupWidth;
            f.style.height = myHeight - 50; 

            h.innerHTML = g_arrLnkName[idx];
            f.src       = g_arrLnkPage[idx];
            break;
    }

}
function fnGetWinSize()
{ 
    var myWidth = 0, myHeight = 0; 
  if( typeof( window.innerWidth ) == 'number' )
  {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
  {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  }
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
  {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return myWidth + "|" + myHeight;
}
function fnCloseFrameWindow()
{
    var o = document.getElementById('popFrm_secFrame1');
    var m = document.getElementById('sec00');
    var l = document.getElementById('popFrm_secLinks');

    o.style.visibility = 'hidden';
    m.style.display = '';
    l.style.display = '';
    window.document.body.style.backgroundColor = g_body_popup_off;
}