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 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 DynaPop(level,szImgSource,szDescription,szCopyright)
{
	popSource = szImgSource;
	popDescription = szDescription;
	popCopyright = szCopyright;

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

	//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);	

}



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


//Function to pop up window for footnotes.
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();
}

//Function to display copyright.
nCurrentMessage=0;
var overImage=0;
aClickMessages = new Array();
aClickMessages[0] = 'Image copyright the Heritage Community Foundation';
aClickMessages[1] = 'Image copyright the Glenbow Museum, Art Gallery, Library and Archives';
aClickMessages[2] = 'Image copyright the City of Edmonton Archives';


//Function to protect images.
function over(n)
{
    overImage=n;
    
}

function disableclick(e) {

clickmessage = aClickMessages[nCurrentMessage];

if(nCurrentMessage != 0)
{
    
    if (document.all) {
        if (event.button>=2||event.button==3) {
            if (event.srcElement.tagName=="IMG"){
                alert(clickmessage);
                return false;
            }
        }
    }
    else if (document.layers) {
        if (e.which == 3) {
            if(overImage==1)
            {
            alert(clickmessage);
            return false;
            }
        }
    }
    else if (document.getElementById){
        if (e.which==3&&e.target.tagName=="IMG"){
            alert(clickmessage)
                return false;
        }
    }
}
}

function associateimages(){
    for(i=0;i<document.images.length;i++)
        document.images[i].onmousedown=disableclick;
}

function init(){
    nCurrentMessage=0;
    overImage=0;
}

if (document.all)
    document.onmousedown=disableclick
else if (document.getElementById)
{   //  document.onmouseup=disableclick
    window.captureEvents(Event.RIGHTCLICK);
    document.onclick = disableclick;
}   
else if (document.layers)
{
    //associateimages()
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=disableclick;
}
document.onmouseout=init

