var hilitedElt = null;
var lefts = null;
var win = null;

function hilite(id) {
	if (!document.getElementById) return;
	hilitedElt = document.getElementById(id);
	hilitedElt.style.visibility = 'visible';
}

function unhilite() {
	if (!document.getElementById) return;
	if (hilitedElt != null) {
		hilitedElt.style.visibility = 'hidden';
		hilitedElt = null;
	}
}

function mailto() {
	location = 'mailto:info@mathieuyno.fayat.com';
}

function recommend() {
	location = 'mailto:?subject=Grand%20Azura&body=Je%20vous%20recommande%20de%20visiter%20ce%20site%20%3A%0D%0Ahttp%3A%2F%2F' + encodeURIComponent(location.host);
}
function recommend_en() {
	location = 'mailto:?subject=Grand%20Azura&body=I%20recommend%20to%20you%20to%20visit%20this%20website%20%3A%0D%0Ahttp%3A%2F%2F' + encodeURIComponent(location.host);
}

function loaded() {
	if (!document.getElementById) return;
	lefts = {n1_contact:0, n2_prev:0, n3_home:0, n4_next:0, n5_print:0, barre_front:0};
	for (var id in lefts) {
		lefts[id] = document.getElementById(id).offsetLeft;
	}
	resized();
}

function resized() {
	if (!document.getElementById) return;
	var left0 = getElementLeft(document.body.getElementsByTagName('table')[0].rows[0].cells[0]);
	for (var id in lefts) {
		document.getElementById(id).style.left = (left0 + lefts[id]) + 'px';
	}
}

function getElementLeft(elt) {
	var x = 0;
	while (elt != document.body) {
		x += elt.offsetLeft;
		elt = elt.offsetParent;
	}
	return x;
};

function enlarge(src, w, h) {
	unloaded();
	win = window.open(null, 'win', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,status=no,dependent=yes,scrollbars=no,resizable=no,width=' + w + ',height=' + h);
	win.document.open();
	win.document.write('<html><head><title></title></head><body style="margin:0px;"><img src="' + src + '"></body></html>');
	win.document.close();
}

function popup(src, w, h) {
	win = window.open(src, 'win', 'left=0,top=0,screenX=0,screenY=0,menubar=no,toolbar=no,location=no,status=no,dependent=yes,scrollbars=no,resizable=no,width=' + w + ',height=' + h);
}


function unloaded() {
	if (win != null) {
		if (!win.closed) win.close();
		win = null;
	}
}