var win;
var browserVer=parseInt(navigator.appVersion); 

if (lang == 'f') {
var fermer = 'Fermer la fen&ecirc;tre';
var agrandir = 'Agrandir l\'image';
var titre = 'Une Chronologie de l\'histoire postale du Canada';
var imprimer = 'Imprimer';
}
else {
var fermer = 'Close window';
var agrandir = 'Enlarge image';	
var titre = 'A Chronology of Canadian Postal History';
var imprimer = 'Print';
}

var win1;

function info(lang)
{
	s = 'info' + lang + '.shtml';
	win1 = window.open(s, 'info1', 'toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=no,directories=no,location=no,width=350,height=200');
}

function printIt()
{
window.print();
}

function putFermer()
{
window.document.write('<br clear=all><br><br><div align="center"><table BORDER=0 CELLPADDING=0 CELLSPACING=0>' +
'     				<tr>' +
'     					<td>' +
'     						<a href="#" onClick="printIt(); return false"><img src="images/bouton.gif" width="16" height="23" alt="fermer/close" border="0" /></a></td>' +
'     					<td>' +
'     						&nbsp;<a href="#" onClick="printIt(); return false"><font face="Arial" size="2" color="#01429D">' + imprimer + '</font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>' +
'     					<td>' +
'     						<a href="chclose.shtml"><img src="images/bouton.gif" width="16" height="23" alt="fermer/close" border="0" /></a></td>' +
'     					<td>' +
'     						&nbsp;<a href="chclose.shtml"><font face="Arial" size="2" color="#01429D">' + fermer + '</font></a></td>' +
'     				</tr>' +
'     			</table></div><br><br>');
if (browserVer >= 4) {
window.document.write('</td><td width="5%">&nbsp;</td></tr></table></div>');
}
}

function zoom(srce,leg,credit,largeur,hauteur)
{	
var annee = srce.toString().substring(0,4);

//suffix = (srce.substr(0,6) == '1857a1') ? 'gif' : 'jpg';
suffix = "jpg";

var contenu = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>' + titre + ' - ' + annee + '</title><link rel="stylesheet" href="poste.css" type="text/css" /></head><body class="contenu">' +
'<table width="' + largeur + '" cellpadding="0" cellspacing="0" border="0"><tr><td>' +
'<img src="images/' + srce + 'b.' + suffix + '" width="' + largeur + '" height="' + hauteur + '" border="1" alt="image" /><br /><br />' +
'	<font face="Arial" size="2" color="#F5DDA2">' + leg + '</font>&nbsp;<font face="Arial" size="1" color="#F5DDA2">' + credit + '</font><br /><br /></td></tr></table>' +
'     			<table>' +
'     				<tr>' +
'     					<td>' +
'     						<a href="chclose.shtml"><img src="images/bouton.jpg" width="16" height="23" alt="fermer/close" border="0" /></a></td>' +
'     					<td>' +
'     						&nbsp;<a href="chclose.shtml"><font face="Arial" size="2" color="#F5DDA2">' + fermer + '</font></a></td>' +
'     				</tr>' +
'     			</table>' +
'</body></html>';

if (win && !win.closed) {
win.close()
}	
win = window.open('chblank.shtml', 'zoom', 'toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=no,directories=no,location=no,width=400,height=400');
win.document.open();
win.document.write(contenu);
win.document.close();
}		

function putImgLeft(srce,leg,credit,largeur,hauteur) // date, legende, credits,largeur,hauteur de l'image
{
var zoomX, zoomY;
zoomX = 0;
zoomY = 0;
if (largeur >= hauteur) { //dimension finale: 550 x ?)
zoomX = 550;
zoomY = Math.floor((zoomX / largeur) * hauteur);
}
else { //dimension finale: ? x 550)
zoomY = 550;
zoomX = Math.floor((zoomY / hauteur) * largeur);
}

suffix = "jpg";

window.document.write('<div align="center"><table width="90%" cellpadding="0" cellspacing="0" border="0">' +
'<tr>' +
'	<td colspan="3"><img src="images/spacer.gif" width="1" height="10" alt="" border="0" /></td>' +
'</tr>' +
'<tr>' +
'	<td><a href="#" onClick="zoom(\'' + srce + '\',\'' + leg + '\',\'' + credit + '\',' + zoomX + ',' + zoomY + '); return false"><img src="images/' + srce + 'a.' + suffix + '" alt="image" border="1" width="' + largeur + '" height="' + hauteur + '"></a></td>' +
' <td width="10"><img src="images/spacer.gif" width="10" height="1" alt="" border="0" /></td>' +
'	<td valign="bottom" width="100%"><font face="Arial" size="2" color="#01429D">' + leg + ' </font><font face="Arial" size="1" color="#01429D">' + credit + '</font><br><br>' +
'  <table BORDER=0 CELLPADDING=0 CELLSPACING=0>' +
'   <tr>' +
'    <td>' +
'     <a href="#" onClick="zoom(\'' + srce + '\',\'' + leg + '\',\'' + credit + '\',' + zoomX + ',' + zoomY + '); return false"><img src="images/bouton.gif" width="16" height="23" alt="agrandir/enlarge" border="0" /></a></td>' +
'    <td>' +
'   &nbsp;<a href="#" onClick="zoom(\'' + srce + '\',\'' + leg + '\',\'' + credit + '\',' + zoomX + ',' + zoomY + '); return false"><font face="Arial" size="2" color="#01429D">' + agrandir + '</font></a></td>' +
'   </tr>' +
'  </table>' +									
' </td>' +
'</tr>' +
'<tr>' +
'	<td colspan="3"><img src="images/spacer.gif" width="1" height="10" alt="" border="0" /></td>' +
'</tr>' +
'</table></div>');
}

function putImgTop(srce,leg,credit,largeur,hauteur) // date, legende, credits,largeur,hauteur de l'image
{
var zoomX, zoomY;
if (largeur >= hauteur) { //dimension finale: 550 x ?)
zoomX = 550;
zoomY = Math.floor((zoomX / largeur) * hauteur);
}
else { //dimension finale: ? x 550)
zoomY = 550;
zoomX = Math.floor((zoomY / hauteur) * largeur);
}

window.document.write('<div align="center"><table width="90%" cellpadding="0" cellspacing="0" border="0"><tr><td><table cellpadding="0" cellspacing="0" border="0" width="' + largeur + '">' +
'<tr>' +
'	<td><img src="images/spacer.gif" width="1" height="10" alt="" border="0" /></td>' +
'</tr>' +
'<tr>' +
'<td><a href="#" onClick="zoom(\'' + srce + '\',\'' + leg + '\',\'' + credit + '\',' + zoomX + ',' + zoomY + '); return false"><img src="images/' + srce + 'a.jpg" alt="image" border="1" width="' + largeur + '" height="' + hauteur + '"></a></td>' +
'</tr>' +
'<tr>' +
'<td height="10"><img src="images/spacer.gif" width="1" height="10" alt="" border="0" /></td>' +
'</tr>' +
'<tr>' +
'<td><font face="Arial" size="2" color="#01429D">' + leg + 
' </font><font face="Arial" size="1" color="#01429D">' + credit + 
'</font><br>' +
'  <table BORDER=0 CELLPADDING=0 CELLSPACING=0>' +
'   <tr>' +
'    <td>' +
'     <a href="#" onClick="zoom(\'' + srce + '\',\'' + leg + '\',\'' + 
credit + '\',' + zoomX + ',' + zoomY + '); return false">' +
'<img src="images/bouton.gif" width="16" height="23" alt="agrandir/enlarge"' + 
'border="0" /></a></td>' +
'    <td>' +
'   &nbsp;<a href="#" onClick="zoom(\'' + srce + '\',\'' + leg + '\',\'' + 
credit + '\',' + zoomX + ',' + zoomY + '); return false">' +
'<font face="Arial" size="2" color="#01429D">' + agrandir + '</font></a></td>' +
'   </tr>' +
'  </table></td>' +
'</tr>' +
'<tr>' +
'	<td><img src="images/spacer.gif" width="1" height="10" alt="" border="0" /></td>' +
'</tr>' +
'</table></td></tr></table></div>');
}

function putImgTopWide(srce,leg,credit,largeur,hauteur) // date, legende, credits,largeur,hauteur de l'image
{
var zoomX, zoomY;
if (largeur >= hauteur) { //dimension finale: 550 x ?)
zoomX = 550;
zoomY = Math.floor((zoomX / largeur) * hauteur);
}
else { //dimension finale: ? x 550)
zoomY = 550;
zoomX = Math.floor((zoomY / hauteur) * largeur);
}

window.document.write('<div align="center"><table width="90%" cellpadding="0" cellspacing="0" border="0"><tr><td><table cellpadding="0" cellspacing="0" border="0" width="100%">' +
'<tr>' +
'	<td><img src="images/spacer.gif" width="1" height="10" alt="" border="0" /></td>' +
'</tr>' +
'<tr>' +
'<td><a href="#" onClick="zoom(\'' + srce + '\',\'' + leg + '\',\'' + credit + '\',' + zoomX + ',' + zoomY + '); return false"><img src="images/' + srce + 'a.jpg" alt="image" border="1" width="' + largeur + '" height="' + hauteur + '" /></a></td>' +
'</tr>' +
'<tr>' +
'<td height="10"><img src="images/spacer.gif" width="1" height="10" alt="" border="0" /></td>' +
'</tr>' +
'<tr>' +
'<td><font face="Arial" size="2" color="#01429D">' + leg + 
' </font><font face="Arial" size="1" color="#01429D">' + credit + 
'</font><br>' +
'  <table BORDER=0 CELLPADDING=0 CELLSPACING=0>' +
'   <tr>' +
'    <td>' +
'     <a href="#" onClick="zoom(\'' + srce + '\',\'' + leg + '\',\'' + 
credit + '\',' + zoomX + ',' + zoomY + '); return false">' +
'<img src="images/bouton.gif" width="16" height="23" alt="agrandir/enlarge"' + 
'border="0" /></a></td>' +
'    <td>' +
'   &nbsp;<a href="#" onClick="zoom(\'' + srce + '\',\'' + leg + '\',\'' + 
credit + '\',' + zoomX + ',' + zoomY + '); return false">' +
'<font face="Arial" size="2" color="#01429D">' + agrandir + '</font></a></td>' +
'   </tr>' +
'  </table></td>' +
'</tr>' +
'<tr>' +
'	<td><img src="images/spacer.gif" width="1" height="10" alt="" border="0" /></td>' +
'</tr>' +
'</table></td></tr></table></div>');
}

function putBody(date, texte) {
if (epoche == '1506') alttag = (lang == 'f') ? '1506-1759 - La Nouvelle-France ou l\'assise française' : '1506-1759 - New France  or the French Foundation';
if (epoche == '1760') alttag = (lang == 'f') ? '1760-1840 - L\'implantation du système postal impérial en Amérique du Nord britannique' : '1760-1840 - Planting the Imperial Postal System in British North America';
if (epoche == '1841') alttag = (lang == 'f') ? '1841-1867 - Vers la réforme postale et l\'autonomie gouvernementale' : '1841-1867 - Toward Postal Reform and Self Government';
if (epoche == '1868') alttag = (lang == 'f') ? '1868-1899 - Les Postes canadiennes au sein du nouveau Dominion' : '1868-1899 - The Canadian Post Office in the New Dominion';
if (epoche == '1900') alttag = (lang == 'f') ? '1900-1919 - La poste au début du XXe siècle' : '1900-1919 - The Post at the Beginning of \"Canada\'s Century\"';
if (epoche == '1920') alttag = (lang == 'f') ? '1920-1950 - La création du système postal moderne' : '1920-1950 - The Making of the Modern Post Office';
if (epoche == '1951') alttag = (lang == 'f') ? '1951 à ce jour - La mécanisation, la technologie et les affaires postales' : '1951 to the Present - Mechanization, Technology and Postal Business';
window.document.write('<TABLE BACKGROUND="images/bleu1.jpg" WIDTH="100%" HEIGHT="120" BORDER="0" CELLPADDING="0" CELLSPACING="0">');
window.document.write('<TR><TD WIDTH="49%">&nbsp;</TD>');
window.document.write('<TD WIDTH="2%" HEIGHT="120" rowspan="2" align="left"><nobr><IMG SRC="images/ch2' + epoche + '.jpg" width="93" height="120" alt="" border="0"><IMG SRC="images/ch1' + lang + '.jpg" width="247" height="120" ALT="A Chronology of Canadian Postal History" BORDER="0"></nobr></TD>');
window.document.write('<TD BACKGROUND="images/degr1.jpg" WIDTH="49%" HEIGHT="120" rowspan="2"><IMG SRC="images/spacer.gif" WIDTH="1" HEIGHT="120" ALT=""></TD></TR>');
window.document.write('<tr><td align="left" valign="bottom"><IMG SRC="images/ch3' + epoche + lang + '.jpg" width="240" height="78" alt="' + alttag + '" border="0"></td></tr></TABLE>');

if (browserVer >= 4) {
window.document.write('<div align="center"><table border="0" cellpadding="0" cellspacing="0" width="85%"><tr><td>');
}
window.document.write('<span class="dateTitre"><font face="Arial" size="3" color="#CB0000"><b><br>' + date + '<br><br></font></span><span class="textTitre"><FONT FACE="Arial" SIZE="3" COLOR="#000000">' + texte + '</b></font></span><br><br>');
}



