function switchbull(bgimage) 
{
    document.getElementById('citation').style.background = bgimage;
	$("#temoignages a").removeClass("selected");
}




function video(numero)
{
$.get("get_video.php",{video:numero},
  function(data)
  {
  document.getElementById('flash_video').innerHTML = data;
  });
}


function get_quote(numero) {
$.get("get_quote.php",{temoin:numero},
  function(data)
  {
  document.getElementById('citation').innerHTML = data;
  });
}
function faq() {
$("#faq").load("FAQ.html");
$("#faq").show('slow');
}
function promo() {
$("#faq").load("cgv.html");
$("#faq").show('slow');
}
function epa() {
$("#faq").load("epa.html");
$("#faq").show('slow');
}
function contact() {
$("#faq").load("contactez-nous.html");
$("#faq").show('slow');
}
function temoin_post() {
$("#faq").load("temoignage-post.php");
$("#faq").show('slow');
}
function ml() {
$("#faq").load("ml.html");
$("#faq").show('slow');
}
function openWindow(width,height) {
x = (640 - width)/2, y = (480 - height)/2;
if (screen) {
y = (screen.availHeight - height)/2;
x = (screen.availWidth - width)/2;
}
if (screen.availWidth > 1800) {
x = ((screen.availWidth/2) - width)/2;
}
window.open('temoignage-form.php','newWin','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+',scrollbars=no');
}

function postContact() {
	$.post('contact-post.php',
		{txtNom: document.getElementById('txtNom').value,
		 txtPrenom: document.getElementById('txtPrenom').value,
		 txtAdresse: document.getElementById('txtAdresse').value,
		 txtCP: document.getElementById('txtCP').value,
		 txtVille: document.getElementById('txtVille').value,
		 txtEmail: document.getElementById('txtEmail').value,
		 txtSujet: document.getElementById('txtSujet').value,
		 txtQuestion: document.getElementById('txtQuestion').value,
		 chkOptIn: document.getElementById('chkOptIn').checked },
		function (data) {
			// Le post s'est bien passé
			if (data.substr(0,2) == 'OK') {
				alert('Votre question a bien été envoyée à nos conseillers. Merci !');
				$('#faq').hide('slow');
			}
			// Erreur dans le formulaire
			if (data.substr(0,2) == '#2')
				alert('Votre formulaire contient des erreurs :' + "\n" + data.substr(3, data.length - 3) + "\n" + 'Merci de corriger.');
			// Erreur MySQL
			if (data.substr(0,2) == '#3')
				alert('Erreur inconnue, merci de recommencer.');
	});
	// pour éviter que le formulaire soit finalement vraiment posté
	return false;
}