function SetupContact(website_description, counter)
{
	if (counter == 1)
	{
		document.write("<a href=\"mailto:info@heritagecommunityfdn.org?Subject="+website_description+" Web Site\" title=\"Contact us by Email\">Contact us by Email</a>");
	}
}

//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 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 for Dynamic Pop Ups
function DynaPop(level,szImgSource,szDescription,szCopyright)
{
	popSource = szImgSource;
	popDescription = szDescription;
	popCopyright = szCopyright;

	if (popDescription == "description")
		popDescription = "";

	width=620;
	height=620;

	//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);

	else if(level==2)
		openWin("../../dynapop.htm",width,height);

	else if(level==3)
		openWin("../audiopop.htm",width,height);

	else if(level==4)
		openWin("../../audiopop.htm",width,height);

}


function Open_Audio(szSource)
{
	width=620;
	height=620;

	//If resolution is 640x480
	if(screen.width < 800)
		height=350;
	//If resolution is 800x600
	else if(screen.width < 1024)
		height=500;

	openWin(szSource,width,height);
}


//function that swaps pictures
function Switch(imgName,imgObjName)
{
  if (document.images)
  {
   document.images[imgName].src = eval(imgObjName + ".src");
  }
}


//Andrew's Function to Open a New Window

function largewin(URLarg) {
    largeWindow = window.open(URLarg,"largewin","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=620,height=410");
    largeWindow.focus();
}


//Function to display copyright.
nCurrentMessage=0;
var overImage=0;
aClickMessages = new Array();
aClickMessages[0] = 'Image copyright the Heritage Community Foundation';
aClickMessages[1] = 'Audio copyright the CKUA Radio Network Inc. and Don Hill<br> Used with permission';
aClickMessages[2] = 'Image copyright the Maclean-Hunter Limited';
aClickMessages[3] = 'Image copyright the Provincial Archives';
aClickMessages[4] = 'Image copyright the Glenbow Museum, Art Gallery, Library and Archives';
aClickMessages[5] = 'Image copyright the University of Alberta';
aClickMessages[6] = 'Image copyright the Parks and Protected Areas - Alberta Community Development';
aClickMessages[7] = 'Image copyright the Alberta Research Council';
aClickMessages[8] = 'Image copyright the Petroleum Communication Foundation';
aClickMessages[9] = 'Image copyright Fleet Publishing Inc.';
aClickMessages[10] = 'Audio copyright CKUA Radio Network Inc.';
aClickMessages[11] = 'Audio copyright CKUA Radio Network Inc. and Cheryl Croucher';
aClickMessages[12] = 'Image copyright Aubrey Kerr';
aClickMessages[13] = 'Image copyright Imperial Oil Archives';
aClickMessages[14] = 'Image copyright 1946 ASPG Roster';
aClickMessages[15] = 'Image copyright P. Bediz';
aClickMessages[16] = 'Image copyright W. Rabey';
aClickMessages[17] = 'Image copyright R. Astle';
aClickMessages[18] = 'Image copyright S. Bleakley';
aClickMessages[19] = 'Image copyright Imperial Oil Ltd.';
aClickMessages[20] = 'Image copyright D. Gamble';
aClickMessages[21] = 'Image copyright Mike Woodhead';
aClickMessages[22] = 'Image copyright F. Lineham';
aClickMessages[23] = 'Image copyright Ian Chesher';
aClickMessages[24] = 'Image copyright L. Key';
aClickMessages[25] = 'Image copyright Westburne';
aClickMessages[26] = 'Image copyright Max W. Ball, Bobbs-Merrill';
aClickMessages[27] = 'Image copyright Howard Blanchard';
aClickMessages[28] = 'Image copyright George Warne, ERCB';
aClickMessages[29] = 'Image copyright Alex Essery';
aClickMessages[30] = 'Image copyright GSC';
aClickMessages[31] = 'Image copyright Nate Goodman';
aClickMessages[32] = 'Image copyright Lyle Caspell';
aClickMessages[33] = 'Image copyright P.A. Dykstra';
aClickMessages[34] = 'Image copyright Syncrude Canada Ltd';
aClickMessages[35] = 'Image copyright Alberta Research Council';
aClickMessages[36] = 'Image copyright TransCanada';
aClickMessages[37] = 'Image copyright Tech4Learning, Inc';
aClickMessages[38] = '';
aClickMessages[39] = 'Image copyright http://www.sasktelwebsite.net/herschel/archaeol.htm';
aClickMessages[40] = 'Image copyright Enbridge';
aClickMessages[41] = 'Image copyright Robert L. Anderson, USDA Forest Service, www.forestryimages.org';
aClickMessages[42] = 'Image copyright Water Rose Test: Judith Rose Burke';
aClickMessages[43] = 'Image copyright Safety Boss';
aClickMessages[44] = 'Image copyright Gulf Oil International';
aClickMessages[45] = 'Image copyright Koch Industries ';
aClickMessages[46] = 'Image copyright Copyright © EnCana Corporation. All rights reserved.';
aClickMessages[47] = 'Image copyright Aboriginal Pipeline Group';
aClickMessages[48] = 'Image copyright Shell Canada Ltd.';
aClickMessages[49] = 'Image copyright Suncor Energy';
aClickMessages[50] = 'Image copyright Alberta Order of Excellence';
aClickMessages[51] = 'Image copyright Syncrude';
aClickMessages[52] = 'Image copyright Alberta Research Council';
aClickMessages[53] = 'Image copyright Canadian Petroleum Hall of Fame';
aClickMessages[54] = 'Image copyright Petro-Canada';
aClickMessages[55] = 'Image copyright Imperial Oil';
aClickMessages[56] = 'Image copyright Newfoundland and Labrador Department of Natural Resources';
aClickMessages[57] = 'Image copyright The Alberta Energy and Utilities Board and the Canadian Association of Petroleum Producers, http://www.forestwatchalberta.ca/oil/oil_sands.html';
aClickMessages[58] = 'Image copyright Library and Archives Canada';
aClickMessages[59] = 'Image copyright Glenbow Archives';
aClickMessages[60] = 'Image copyright Centre for Energy';
aClickMessages[61] = 'Image copyright Koch Industries';
aClickMessages[62] = 'Image copyright Canadian Association of Petroleum Producers';
aClickMessages[63] = 'Image copyright CN Rail';
aClickMessages[64] = 'Image copyright Agrium';
aClickMessages[65] = 'Image copyright Styrud (http://www.styrud.se/)';
aClickMessages[66] = 'Image copyright Ignacy Lukasiewicz Memorial Museum of Oil Industry';
aClickMessages[67] = 'Image copyright Acclaim Images.com';
aClickMessages[68] = 'Image copyright Enbridge';
aClickMessages[69] = 'Image Copyright Weir-Jones Inc';
aClickMessages[70] = 'Image Copyright Town of Unity, Saskatchewan';
aClickMessages[71] = 'Image copyright ExxonMobil';
aClickMessages[72] = 'Image Copyright Petroleum History Society';
aClickMessages[73] = 'Image Copyright Archives of Ontario';
aClickMessages[74] = 'Image Copyright NWT Archives (reprinted with permission of JuneWarren Publishing)';
aClickMessages[75] = 'Image Copyright William Brice';

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= "true" />\n');
		//the embed is in here because of old browser functionality
		document.write('<embed src='+ AudioNameAndPath +' type="audio/x-mpeg" 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="true" />\n');
        document.write('<param name="controller" value="true" />\n');
        document.write('</object>\n');
	}
}