// THESE FUNCTIONS Check to see if the windows are already open
// If not it opens the window, if the window is already open, it gives the window focus.
// 
var rsvpPage
var votePage
var feedbackPage
var hpabpixPage
var hpabwinnersCircle
var prPage
var PR

function openRSVP()
{
if (!rsvpPage||rsvpPage.closed)
	{
votePage = window.open('forms/habrsvp.html','','status=yes, scrollbars=auto, resizable=yes, width=600, height=550');
	}
	else {
rsvpPage.focus();
	}
}
function openVote()
{
if (!votePage||votePage.closed)
	{
votePage = window.open('voting.html','','status=yes, scrollbars=auto, resizable=yes, width=500, height=400');
	}
	else {
votePage.focus();
	}
}

function openFeedBack()
{
if (!feedbackPage||feedbackPage.closed)
	{
feedbackPage = window.open('forms/feedback.html','','status=yes, scrollbars=auto, resizable=yes, width=600, height=600');
	}
	else {
feedbackPage.focus();
	}
}

function openPhotos()
{
if (!hpabpixPage||hpabpixPage.closed)
	{
hpabpixPage = window.open('hpabpix.html','','status=yes, scrollbars=auto, resizable=yes, width=600, height=600');
	}
	else {
hpabpixPage.focus();
	}
}

function winnersCircle()
{
if (!hpabwinnersCircle||hpabwinnersCircle.closed)
	{
hpabwinnersCircle = window.open('hpabAwardWinners.html','','status=yes, scrollbars=auto, resizable=yes, width=600, height=600');
	}
	else {
hpabwinnersCircle.focus();
	}
}

// This funsction is supposed to open the Activities page if it's not already open

function loadOpener() {
    if (opener && !opener.closed)
        opener.location='activities.html';
    else {
        var origin = window.open('activities.html','','');
        // trick the window into thinking it was opened by this new window:
        opener = origin;
	fullWindow();
    }
}

// Makes the browser window Maximize if it's too small
function fullWindow()
{
if (document.all || document.layers)
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight)
}

function viewPR()
{
if (!PR||PR.closed)
	{
prPage = window.open('hofPressRelease.html','','status=no, scrollbars=yes, resizable=yes, width=700, height=500');
	}
	else {
prPage.focus();
	}
}
