
//affichage photos
var diapo, affiche;
var zoom_cour = '';

function en_diapo(photo) {
	// if (affiche === undefined) affiche = document.getElementById('affiche');
	// if (diapo === undefined) diapo = document.getElementById('diapo');
	
	if (affiche) {
		if (zoom_cour != photo) {
			diapo.innerHTML = '<img src="photos/'+photo+'" alt="photo" title="cliquer pour masquer"/>';
			affiche.style.display = 'none';
			diapo.style.display = '';
			zoom_cour = photo;
		} else masquer_diapo();
	}
}

function masquer_diapo() {
	affiche.style.display = '';
	diapo.style.display = 'none';
	zoom_cour = '';
}
function verif () {
	var antispam = document.getElementById('antispam'),
	ok = antispam.value != '';
	if (!ok) {
		antispam.select();
		antispam.className = 'erreur';
	}
	return ok;
}

function bugs_navi () {
	affiche = affiche || document.getElementById('affiche');
	diapo = diapo || document.getElementById('diapo');
	var userAgent = navigator.userAgent.toLowerCase(),
	browser = {
		version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
		// opera: /opera/.test( userAgent ),
		// msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
		// mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ),
		safari: /webkit/.test( userAgent )
	};
	// alert(browser.version);

	if (browser.safari &&  parseInt(browser.version) < 416 /*524*/) {
		// alert(browser.version + '\n' + parseInt(browser.version));
		affiche.style.width = Math.max(520, document.body.clientWidth - (200 + 200 + 20 + 210)) +'px';
	}
}
