var nao_esconde_mais = false;

function montrer(where) {
	if (document.getElementById(where).style.display == "none") {
		document.getElementById(where).style.display = "inline";
	} else {
		document.getElementById(where).style.display = "none";
	}
}

function cacher(where) {
	if (nao_esconde_mais) { 
		return
	}
	document.getElementById(where).style.display = 'none';
}

function montrer_string(where,variavel) {
	if (nao_esconde_mais) { 
		return
	}
	document.getElementById(where).style.display = "inline";
	document.getElementById(where).innerHTML = variavel;
}

// -----

var tempo = 24;

first_time = true;

function fade_in(where) {
	if (document.getElementById(where).style.display == 'none') {
		i = 0;
		document.getElementById(where).style.opacity = 0;
		if (document.getElementById(where).style.display == 'none') {
			document.getElementById(where).style.display = "";
		}
		fade_in_var = window.setInterval("fade_in_app('"+where+"')", tempo);	
	}
	else { 
		first_time = true;
		fade_out(where);
	}
}
function fade_in_app(where) {
	document.getElementById(where).style.opacity = i / 10;
	i++;
	if (i==10) {
		clearInterval(fade_in_var); 
		document.getElementById(where).style.opacity = 1;
	}
}

// -----

function fade_out(where) {
	i = 10;
	document.getElementById(where).style.opacity = 1;
	fade_out_var = window.setInterval("fade_out_app('"+where+"')", tempo);
}
function fade_out_app(where) {
	document.getElementById(where).style.opacity = i / 10;
	i--;
	if (i<=0) {
		clearInterval(fade_out_var);
		document.getElementById(where).style.display = "none";
		document.getElementById(where).style.opacity = 0;
	}
}

// -----

function hide_divs() {
	document.getElementById('float_mouvements').style.display = "none";
	document.getElementById('float_certifications').style.display = "none";
}
function hide_div_presentation() {
	document.getElementById('div_presentation_00').style.display = "inline";
	document.getElementById('div_presentation_01').style.display = "none";
	document.getElementById('div_presentation_02').style.display = "none";
	document.getElementById('div_presentation_03').style.display = "none";
	document.getElementById('div_presentation_04').style.display = "none";
}

// -----

function check_champs_demande(langue) {
	if (form_contact.nom.value == "") {
		if (langue == 'fr') { document.getElementById("div_contact_log").innerHTML = "Nom - champ obligatoire<br>"; }
		if (langue == 'de') { document.getElementById("div_contact_log").innerHTML = "Name - obligatorisch<br>"; }
		if (langue == 'en') { document.getElementById("div_contact_log").innerHTML = "Name - obligatory<br>"; }
		document.getElementById('div_contact_log').style.display = "inline";
		form_contact.nom.focus();
		return (false);
	}
	if (form_contact.societe.value == "") {
		if (langue == 'fr') { document.getElementById("div_contact_log").innerHTML = "Societ&eacute; - champ obligatoire<br>"; }
		if (langue == 'de') { document.getElementById("div_contact_log").innerHTML = "Unternehmen - obligatorisch<br>"; }
		if (langue == 'en') { document.getElementById("div_contact_log").innerHTML = "Company - obligatory<br>"; }
		document.getElementById('div_contact_log').style.display = "inline";
		form_contact.societe.focus();
		return (false);
	}
	if (form_contact.email.value == "") {
		if (langue == 'fr') { document.getElementById("div_contact_log").innerHTML = "E-mail - champ obligatoire<br>"; }
		if (langue == 'de') { document.getElementById("div_contact_log").innerHTML = "E-mail - obligatorisch<br>"; }
		if (langue == 'en') { document.getElementById("div_contact_log").innerHTML = "E-mail - obligatory<br>"; }
		document.getElementById('div_contact_log').style.display = "inline";
		form_contact.email.focus();
		return (false);
	}

	// si tout va bien, envoi le form
	return (true);
}
