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 that swaps pictures
function Switch(imgName,imgObjName) 
{
  if (document.images) 
  {
   document.images[imgName].src = eval(imgObjName + ".src");
  }
}

//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 to pop up windows for images.
function Imgpop(level,szImgSource,szDescription,szTitle,nCopyrightNum)
{
    popSource = szImgSource;
    popDescription = szDescription;
    popCopyright = nCopyrightNum;
	popUrl = "";
	popTitle = szTitle;

    if (popDescription == "description")
        popDescription = "";
    
    width=650;
    height=750;

    //If resolution is 640x480
    if(screen.width< 800)
        height=350;
    //If resolution is 800x600
    else if(screen.width< 1024)
        height=500;

    for(i=1; i<=level; i++)
	{
		popUrl = popUrl + "../";
	}
	popUrl = popUrl + "inc/popup.html";
	openWin(popUrl,width,height);
}

//Function to pop up windows for footnotes.
function openFootnote(level,szDescription)
{
    popDescription = szDescription;
 
    if (popDescription == "description")
        popDescription = "";
    
    width=400;
    height=150;

    if(level==0)
        openWin("footnote.html",width,height);
    
    else if(level==1)
        openWin("../footnote.html",width,height);

    else if(level==2)
        openWin("../../footnote.html",width,height);
}
function InsertAudio(AudioNameAndPath)
{
	if (window.ActiveXObject)
	{
		document.write('<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" width="260" height="45" align="middle">\n');
		document.write('<param name="src" value='+ AudioNameAndPath +' />\n');
		document.write('<param name= "autoplay" value= "false" />\n');
		//the embed is in here because of old browser functionality
		document.write('<embed src='+ AudioNameAndPath +' autoplay="true" width="260" height= "45" align= "middle" bgcolor="E7EADF" pluginspage="http://www.apple.com/quicktime/download/">\n');
		document.write('</embed>\n');
		document.write('</object>\n');
	}
	else
	{
		document.write('<object type="audio/x-mpeg" data='+ AudioNameAndPath +' width="260" height="45">\n');
        document.write('<param name="autoplay" value="false" />\n');
        document.write('<param name="controller" value="true" />\n');
        document.write('</object>\n');
	}
}
function InsertVideo(VideoNameAndPath)
{
		document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="320" height="256">');
		document.write('<param name="src" value='+ VideoNameAndPath +' />');
		document.write('<param name="autoplay" value="false" />');
		document.write('<param name="controller" value="true" />');
		document.write('	<object data='+ VideoNameAndPath +' type="video/x-ms-wvx" width="320" height="256">');
		document.write('		<param name="autoplay" value="false" />');
		document.write('		<param name="controller" value="true" />');
		document.write('	</object>');
		document.write('</object>');
}