function ouvrePop () {
	popHandler = window.open('','popup','width=400,height=400,scrollbars=yes');
	if (popHandler.window.focus) {
		popHandler.window.focus();
	}
}
function ouvreLien(url) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1');");
}
function montreCache (qui) {
	var cible=document.getElementById(qui);
	if (cible.style.display!="block") {
		cible.style.display="block";
	} else {
		cible.style.display="none";
	}
}
window.addEvent('domready', function(){
  SqueezeBox.initialize({
    size: {x: 600, y: 410}
  });
  $('inscriptionForm').addEvent('submit', function(e) {
		e.stop();
    alert('test');
	});
  eveilValider();
  SqueezeBox.assign($$('a[rel=modal]'));

});

function eveilValider() {
  $('envoyer').getElement('a').addEvent('click', function(e) {
    e = new Event(e).stop();
    leForm = $('inscriptionForm');
    leForm.set('send', {     
      onComplete: function(response) { 
        if (response=="OK") {
          window.location = "enquete.php";
        } else {
          $('formulaire').empty();
          $('formulaire').set('html',response);
          $('inscriptionForm').addEvent('submit', function(e) {
		        e.stop();
	        });
	        eveilValider();
	        alert('Certaines informations sont incorrectes.\nMerci de corriger pour valider votre participation...');
        }
      }
    });
		leForm.send();
  });
}

