/***************************************************
**                                                **
** Title: Pop-Up JavaScript Library               **
** Date: August 23, 2000                          **
** Author:  Kofi Garbrah                          **
** Purpose: Causes a new window to be opened      **
**          containing an html document. This new **
**          window will NOT contain the toolbars  **
**          or navigation bars of an internet     **
**          browser but it CAN be scrolled or     **
**          resized.                              **
**                                                **
****************************************************/

// Global Variable
// This variable represents the Pop-Up window
var PopUp;

// This function compensates for the change in
// how we numbered the images; we went from a
// Two digit system to an alphabetical sytem.
// Rather than re-code over 1000 webpages,
// I decided to change this one file instead.
//
//  -Kofi Garbrah
//

function SetupContact(website_description)
{
	document.write("<a href=\"mailto:info@heritagecommunityfdn.org?Subject="+website_description+" Web Site\" title=\"Contact us by Email\">Contact us by Email</a>");
}

function openBrWindow(theURL,winName,features) {
  aWindow = window.open(theURL,winName,features);
  aWindow.focus();
}

//function that swaps pictures
function Switch(imgName,imgObjName) 
{
  if (document.images) 
  {
   document.images[imgName].src = eval(imgObjName + ".src");
  }
}

//function that swaps pictures
function Switchb(id,name)
{
if (document.images){
    if (document.images[id]){document.images[id].src=eval(name+".src");
    } else {
      if (document.layers){
        for (i=0; i < document.layers.length; i++) {
          if (document.layers[i].document.images[id]) {
          document.layers[i].document.images[id].src=eval(name+".src");
          break;
          }
        }
      }
    }
  }
}

//Function for Dynamic Pop Ups
function DynaPop(level,szImgSource,szDescription,nCopyrightNum)
{
	popSource = szImgSource;
	popDescription = szDescription;
	popCopyright = nCopyrightNum;

	if (popDescription == "description")
		popDescription = "";
	
	width=575;
	height=600;

	//If resolution is 640x480
	if(screen.width < 800)
		height=350;
	//If resolution is 800x600
	else if(screen.width < 1024)
		height=500;

	if(level==0)
		openWin("dynapop.htm",width,height);
	
	else if(level==1)
		openWin("../dynapop.htm",width,height)

}

//Function to open new windows
function openWin(URL, Width, Height)
{

	aWindow=window.open(URL,"PopUp","width="+Width+",height="+Height+",resizable=yes,scrollbars=yes,left=100,top=60");
	
	aWindow.resizeTo(Width, Height);
	
	aWindow.focus();
	if(aWindow.opener == null)
	{
		aWindow.opener = window;
		aWindow.opener.name = "opener";
	}

}

function openDescription(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=560,height=420,left = 10,top = 10');");
}

//Function for Dynamic Pop Ups
function DynaPopMap(level,szImgSource,szDescription,nCopyrightNum)
{
	popSource = szImgSource;
	popDescription = szDescription;
	popCopyright = nCopyrightNum;

	if (popDescription == "description")
		popDescription = "";
	
	width=650;
	height=600;

	//If resolution is 640x480
	if(screen.width < 800)
		height=350;
	//If resolution is 800x600
	else if(screen.width < 1024)
		height=500;

	if(level==0)
		openWin("dynapop.htm",width,height);
	
	else if(level==1)
		openWin("../dynapop.htm",width,height)

}

function openFootnote(footnote) 
{
	var PopUpString =
         "width=350,height=150,left=100,top=100,scrollbars=yes";
	
	winFootnote = window.open('footnotes.html', "Footnote", PopUpString);
	
	if(winFootnote.opener == null)
	{
		winFootnote.opener = window;
		winFootnote.opener.name = "opener";
	}
	winFootnote.opener.footnote=footnote;
	winFootnote.location.reload();
	winFootnote.focus();
}