// JavaScript Document
//Bibliothèque lamedocaine.com
<!--
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
	if (d) {d.style.display='block';}
}
//-->
function ShowHide(id) {
	var e = document.getElementById(id);
	var dStyle = ((e.style.display == '' || e.style.display == 'none') ? 'block':'none');
	e.style.display = dStyle;
}
function getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	}
	else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		}
		else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
<!--Gestion popups
var infoShow;
function createInfoShow(urlInfo,width,height) {
	infoShow = window.open('info.php' + urlInfo,'infoShow','scrollbars=yes,width=' + width + ',height=' + height + ',screenX=0,screenY=0,top=10,left=10');
}
function info(url,width,height) {
	if(typeof(infoShow)!="undefined") {
		if(infoShow.closed!=true)
			infoShow.close();
	}
	var urlInfo  = '?info=' + url;
	createInfoShow(urlInfo,width,height);
}
function closeInfoShow() {
	if(typeof(infoShow)!="undefined") {
		if(infoShow.closed!=true)
			infoShow.close();
	}
}
//-->
<!--Alerte suppression-->
function supp(texte,lien) {
	if (confirm(texte))
		window.location=lien;
}
<!--Alerte archivage-->
function archive(texte,lien) {
	if (confirm(texte))
		window.location=lien;
}
function carClavier(e) {
	if (window.event)
		// Pour IE Explorer
		return String.fromCharCode(window.event.keyCode);
	else
		// Pour Netscape
		return String.fromCharCode(e.which);
}

function testNum(e) {
	caractere = carClavier(e);
	if (caractere < "0" || caractere > "9") return false;
	else return true;
}
function JumpSelect(targ,adresse,selObj,restore){ 
  eval(targ+".location='"+adresse+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function createWindow(url,width,height) {
	var containerWidth = getWindowWidth();
	var positionX = ((containerWidth / 2) - (width /2 ));
	var containerHeight = getWindowHeight();
	var positionY = ((containerHeight / 2) - (height /2 ));
	window.open(url,'infoShow','scrollbars=yes,width=' + width + ',height=' + height + ',screenX=0,screenY=0,top=' + positionY + ',left=' + positionX);
}

