var nombre_de_planche = 435;
var message_erreur_no_planche = "Vous devez entrer un nombre entre 1 et " + nombre_de_planche + ".\n You must enter a number from 1 to " + nombre_de_planche + ".";


function ouvrir_credits() {
	varHeight="490" 
	varWidth="760"
	newContenu = window.open('http://www.mcq.org/audubon/credits.html','Credits','width=760,height=490,top='+((screen.availHeight/2)-(varHeight/2))+',left='+((screen.availWidth/2)-(varWidth/2))+',toolbar=0,scrollbars=1,resizable=1,menubar=0,status=1,directories=0,location=0');
	newContenu.focus();
}

function ouvrir_envoyer() {
	newContenu = window.open("http://www.mcq.org/audubon/catalogue/envoyer.html","audubon_top","WIDTH=776,HEIGHT=465,status,resizable,copyhistory,scrollbars,menubar");
	newContenu.focus();
}

function ouvrir_contact() {
	document.location = "mailto:archives@mcq.org?subject=Audubon - Harmonie&cc=webmestre@mcq.org";
}

function ouvrir_multimedia(url_multimedia) {
	var bUser = navigator.userAgent.toLowerCase();
	var is_mac    = (bUser.indexOf("mac")!=-1);
	
	largeur = 760;
	hauteur = 445;
		
	if ((!is_mac) && (navigator.appName == 'Microsoft Internet Explorer') ) {
		hauteur = hauteur - 19;
	}
	if (is_mac) {
		largeur = largeur - 14;
		hauteur = hauteur - 16;
	}

	newContenu = window.open("../"+url_multimedia+".html","audubon_multimedia","WIDTH="+largeur+",HEIGHT="+hauteur+",status,resizable,copyhistory,menubar");
	newContenu.focus();
}

function ouvrir_reliure() {
	newContenu = window.open("http://www.mcq.org/audubon/catalogue/index.html","audubon_top","WIDTH=776,HEIGHT=465,status,resizable,copyhistory,scrollbars,menubar");
	newContenu.focus();
}

function ouvrir_intro() {
	ouvrir_reliure();
}

function ouvrir_intro_catalogue() {
	newContenu = window.open("catalogue/index.html","audubon_top","WIDTH=776,HEIGHT=465,status,resizable,copyhistory,scrollbars,menubar");
	newContenu.focus();
}


function ouvrir_catalogue(no_planche) {
	newContenu = window.open("audubon_"+no_planche+".html","audubon_catalogue","WIDTH=767,HEIGHT=" + (screen.availHeight - 120) +",status,resizable,copyhistory,scrollbars,menubar,toolbar");
	newContenu.focus();
}

function ouvrir_catalogue2(no_planche) {
	newContenu = window.open("catalogue/audubon_"+no_planche+".html","audubon_catalogue","WIDTH=767,HEIGHT=" + (screen.availHeight - 120) +",status,resizable,copyhistory,scrollbars,menubar,toolbar");
	newContenu.focus();
}

function go_planche(destination) {
	var no_planche_courant = String(window.location).substr((String(window.location).length)-8,3);
	if (destination == "go") {
		no_planche_courant = document.FormNoPlanche.planche.value;
		if ((Number(no_planche_courant) < 1) || (Number(no_planche_courant) > nombre_de_planche) || !Number(no_planche_courant) ) {
			alert(message_erreur_no_planche);
		} else {
			no_planche_courant = no_planche_courant - 1;
			destination = "suivant";
		}
	}
	if (destination == "suivant") {
		if (no_planche_courant == nombre_de_planche) {
			no_planche_courant = 0;
		}
		ouvrir_catalogue(String(Number(no_planche_courant) +1001).substr(1,3));
	}
	if (destination == "prec") {
		if (no_planche_courant == 1) {
			no_planche_courant = nombre_de_planche + 1;
		}		
		ouvrir_catalogue(String(Number(no_planche_courant) +999).substr(1,3));
	}
}
		



function ouvrir_index() {
	fenOpener = window.opener;
	
	var rech_1 = "index-num";
	var rech_2 = "index-latin";
	var rech_3 = "index-fr";
	var rech_4 = "index-en";

if (fenOpener == null  || fenOpener.closed) {
		fenIndex = window.open("http://www.mcq.org/audubon/catalogue/index-num.html","audubon_top","WIDTH=780,HEIGHT=" + (screen.availHeight - 110) +",status,resizable,copyhistory,scrollbars,menubar");
		//self.close();
	} else {
		chcar = String(fenOpener.location);
		if (chcar.match(rech_1) || chcar.match(rech_2) || chcar.match(rech_3) || chcar.match(rech_4)) {	
			fenOpener.focus();
		} else {
			fenIndex = window.open("http://www.mcq.org/audubon/catalogue/index-num.html","audubon_top","WIDTH=780,HEIGHT=" + (screen.availHeight - 110) +",status,resizable,copyhistory,scrollbars,menubar");
			fenIndex.focus();
		}		
	}
}

function EnteteCatalogue() {
	chaine = '';
	chaine += '<table border="0" cellpadding="0" cellspacing="2" width="740"><tr>';
	chaine += '<td width="200"><p><a href="index.html" target="audubon_top">CATALOGUE / CATALOG</a></p></td>';
	chaine += '<td width="70" align="center"><p><a href="index_planches.html" target="audubon_top">INDEX</a></p></td>';
	chaine += '<td width="200" align="center"><p><a href="../index.html" target="harmonie">HARMONIE / <br>HARMONY</a></p></td>';
	chaine += '<td width="100" align="center"><a href="liens.html">LIENS /<br>LINKS</a></td>';
	chaine += '<td width="100" align="center"><p><a href="(Empty Reference!)">CR&Eacute;DITS /  CREDITS</a></p></td>';
	chaine += '<td width="70" align="center"><p><a href="javascript:ouvrir_contact();">CONTACT</a></p></td>';
	chaine += '</tr></table>';
	
	document.write(chaine);
}

function PiedCatalogue() {
	var no_planche_url = String(window.location).substr((String(window.location).length)-8,3);
	if (document.FormNoPlanche) {
		document.FormNoPlanche.planche.value = no_planche_url;
	}


	chaine = '';

	chaine += '<div id="basbox">';
	chaine += '<div class="petit"><a href="http://www.mcq.org">&copy;&nbsp;Mus&eacute;e de la civilisation 2003</a>&nbsp;&#8212;&nbsp;';
	chaine += '<a href="mailto:archives@mcq.org?subject=Audubon - Harmonie&amp;cc=webmestre@mcq.org">Contact</a><br><a href="javascript:ouvrir_envoyer();">ENVOYER  &Agrave; UN AMI!</a> / <a href="javascript:ouvrir_envoyer();"><span class="eng">TELL A FRIEND!</span></a></div>';
	chaine += '</div>';
	
	document.write(chaine);

}