//Create French and English Links
frLink = window.location.href.replace('/eng/','/fr/');
frLink = '<map name="FPMap1"><area href="' + frLink + '" shape="rect" coords="74, 3, 125, 47" alt="Français"></map>';

engLink = window.location.href.replace('/fr/','/eng/');
engLink = '<map name="FPMap1"><area href="' + engLink + '" shape="rect" coords="16, 3, 71, 47" alt="Anglais"></map>';


// Global Variable
// This variable represents the Pop-Up window
var PopUp;

function correct_old_numbering(doc) 
{
	var newdoc;
	var number = doc.substring(1,doc.indexOf("_"));
	var name = doc.substring(doc.indexOf("_"),doc.length);
	if ((doc.substring(0,1) == "i") && (number.length > 0))
		doc = "i" + name;
	return doc;

}

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>");
	}
	else if (counter == 2) // French
	{
		document.write("<a href=\"mailto:info@heritagecommunityfdn.org?Subject="+website_description+" Web Site\" title=\"Nous Rejoindre\">Nous Rejoindre</a>");
	}
}

//Function for Dynamic Pop Ups
function DynaPop(level,szImgSource,szDescription,nCopyrightNum)
{
    popSource = szImgSource;
    popDescription = szDescription;
    popCopyright = nCopyrightNum;

    if (popDescription == "description")
        popDescription = "";
    
    width=590;
    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)

    else if(level==2)
        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 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);
}


// Generates a Pop-Up window that has
// no directories and no menu or toobars.  
// This window can be resized, however.
//
// - Kofi Garbrah
//
function pop_up(html_document) 
{
	var PopUpString =
         "toolbar=no,location=no,directories=no,status=no," +
         "menubar=no,scrollbars=yes,resizeable=yes," +
          "width=595,height=448";
	
	var new_html_document = window.open(html_document, "", PopUpString);
	//PopUp = window.open(new_html_document, "HeritageTrail", PopUpString);


}

//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";
    }

}

