
// Plum Beach Club
// todd@hampson.us

// global

var loggedin = false;

function reloadNewsFrame ()
{
  window.parent.frames[1].location.reload();
}

function pageswap (page, type)
{
  if (!type) {type = "html";}
  if (window.parent.frames.mainFrame)
  {
    window.parent.frames.mainFrame.location = page + '.' + type;
  }
  else
  {
    window.location.href = page + '.' + type;
  }
}

function popupWindow (url,name,opt) // correct order
{
  // alert ('in popupWindow');
  if (opt == '' || opt == 'default')
  {
    opt = 'height=300,width=300,resizable=1,scrollbars=1,toolbar=0,menubar=0,titlebar=0';
  }
  var newwin = window.open(url,name,opt);
  newwin.focus();
}

function memberLogin ()
{ 
  popupWindow('members.php','MemberLogin','height=150,width=250,resizable=1,scrollbars=0,toolbar=0,menubar=0,titlebar=0');
}

function passwordCorrect() 
{
  // alert('Welcome to the Members Only Area!');
  if (window.opener)
  {
    window.opener.parent.frames[2].location = "02874.html";
    window.close();
  }
  else
  {
    window.location.href='index.html';
    window.frames.mainFrame.location = "02874.html";
  }
}

function passwordIncorrect()
{
  alert('Sorry, that password is incorrect.\nIf you are a member, please contact PBC.');
  // document.mainform.mode.value = 'init';
  if (window.opener) {window.close();}
}

// end of PBC utilities

