/***************************************************
**                                                **
** 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 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;

}

// 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=380,height=540";
	
	var new_html_document = correct_old_numbering(html_document);
	PopUp = window.open(new_html_document, "HeritageTrail", PopUpString);

}

/*function pop_up1(html_document) 
{
	var PopUpString =
         "toolbar=no,location=no,directories=no,status=no," +
         "menubar=no,scrollbars=yes,resizeable=yes," +
          "width=480,height=450";
	
	var new_html_document = correct_old_numbering(html_document);
	PopUp = window.open(new_html_document, "HeritageTrail", PopUpString);

}*/

//footnote
function popup_footnote(html_document) 
{
	var PopUpString =
         "toolbar=no,location=no,directories=no,status=no," +
         "menubar=no,scrollbars=yes,resizeable=yes," +
          "width=480,height=200";
	
	var new_html_document = correct_old_numbering(html_document);
	PopUp = window.open(new_html_document, "HeritageTrail", PopUpString);

}
function popup_txt(html_document) 
{
	var PopUpString =
         "toolbar=no,location=no,directories=no,status=no," +
         "menubar=no,scrollbars=yes,resizeable=yes," +
          "width=480,height=200";
	
	var new_html_document = correct_old_numbering(html_document);
	PopUp = window.open(new_html_document, "HeritageTrail", PopUpString);

}

//table
function popup_table(html_document) 
{
	var PopUpString =
         "toolbar=no,location=no,directories=no,status=no," +
         "menubar=no,scrollbars=yes,resizeable=yes," +
          "width=480,height=500";
	
	var new_html_document = correct_old_numbering(html_document);
	PopUp = window.open(new_html_document, "HeritageTrail", PopUpString);

}

//thumbnail pop up
function popup_sq(imtitle,imgsrc,imdesc,imcopy) 
{

var input;

input="<HTML><HEAD><TITLE>"+imtitle+"<\/TITLE>"+
"<p align='center'><font face='Century Gothic' size='4pt' color='#009240'><b>"+imtitle+"</b><\/font><\/p>"+
		"<p align='center'><img src="+imgsrc+"><\/p>"+
		"<p align='center'><font face='Century Gothic' size='3pt'>"+imdesc+"<\/font><\/p>"+
		"<p align='center' class='nav'><font face='Arial' size='3pt'>"+imcopy+"<\/font><\/p>"+
		"<p align='center'><font face='Arial' size='3pt'>[<a href='javascript:self.close()'>Close Window<\/a>]<\/font><\/p><\/BODY><\/HTML>"

var dynWin = window.open("","PhotoGallery",",width=520,height=520,resizable=yes,scrollbars=yes");
		dynWin.document.write(input);
		
		dynWin.document.close();

		dynWin.focus()

}

//diary pop up
function popup_diary(html_document) 
{
	var PopUpString =
         "toolbar=no,location=no,directories=no,status=no," +
         "menubar=no,scrollbars=yes,resizeable=yes," +
          "width=580,height=650";
	
	var new_html_document = correct_old_numbering(html_document);
	PopUp = window.open(new_html_document, "HeritageTrail", PopUpString);

}

//slideshow pop up
function popup_slide_show(html_document) 
{
	var PopUpString =
         "scrollbars=yes,resizeable=yes," +
          "width=450,height=550,left=10,top=10";
	var new_html_document = correct_old_numbering(html_document);
	PopUp = window.open(new_html_document, "", PopUpString);

}

//diary pop up
function popup_congresso(html_document) 
{
	var PopUpString =
         "scrollbars=yes,resizeable=yes," +
          "width=570,height=500,left=10,top=10";
	
	congresso = window.open(html_document, "IlCongresso", PopUpString);
congresso.focus();

}

function openFootnote(footnote) 
{
	var PopUpString =
         "width=350,height=150,left=100,top=100,scrollbars=yes";
	
	winFootnote = window.open('../background/footnotes.html', "Footnote", PopUpString);
	
	if(winFootnote.opener == null)
	{
		winFootnote.opener = window;
		winFootnote.opener.name = "opener";
	}
	winFootnote.opener.footnote=footnote;
	winFootnote.location.reload();
	winFootnote.focus();
}


//diary pop up
function popup_little_italy(html_document) 
{
	var PopUpString =
         "scrollbars=yes,resizeable=yes," +
          "width=810,height=650,left=10,top=10";
	
	PopUp = window.open(html_document, "LittleItaly", PopUpString);
	PopUp.focus();

}

//photos pop up
function popup_photo(imtitle,imgsrc,imdesc,imcopy)
{

var input;

input="<HTML><HEAD><TITLE>"+imtitle+"<\/TITLE>"+
"<LINK href='http://www.albertasource.ca/abitalian/global/styles.css' type='text/css' rel=stylesheet>"+
"<p align='center'><font face='Century Gothic' size='4pt' color='#009240'><b>"+imtitle+"</b><\/font><\/p>"+
		"<p align='center'><img src="+imgsrc+"><\/p>"+
		"<p align='center'><font face='Century Gothic' size='3pt'><b>"+imdesc+"</b><\/font><\/p>"+
		"<p align='center' class='nav'><font face='Arial' size='3pt'>"+imcopy+"<\/font><\/p>"+
		"<p align='center'><font face='Arial' size='3pt'>[<a href='javascript:self.close()'>Close Window<\/a>]<\/font><\/p><\/BODY><\/HTML>"

var dynWin = window.open("","PhotoGallery",",width=560,height=560,resizable=yes,scrollbars=yes");
		dynWin.document.write(input);
		
		dynWin.document.close();

		dynWin.focus()	

}