
var reponsesVisibles = false;
var intervalID = null;
var indexPhoto = 0;

function getHauteur () {
	var hauteurFenetre = 480
	if (parseInt(navigator.appVersion)>3) {
		hauteurFenetre = screen.height;
	} else if (navigator.appName == "Netscape"  && parseInt(navigator.appVersion)==3 && navigator.javaEnabled() ) {
		var jToolkit = java.awt.Toolkit.getDefaultToolkit();
		var jScreenSize = jToolkit.getScreenSize();
		hauteurFenetre = jScreenSize.height;
	}
	if(navigator.userAgent.indexOf("Safari") != -1) hauteurFenetre = screen.height;
	return parseInt(hauteurFenetre - 80);
}
function openCarteAppreciation() {
	q=window.open("carte_appreciation.asp","Commentaires","menubar,scrollbars,resizable,width=770,height="+getHauteur()+",top=0,left=0");
	q.opener = this;
	q.focus();
}
function openCandidature() {
	q=window.open("candidature.asp","Candidature","menubar,scrollbars,resizable,width=770,height="+getHauteur()+",top=0,left=0");
	q.opener = this;
	q.focus();
}
function openPostuler(IdEmploi) {
	q=window.open("postuler.asp?IdEmploi="+IdEmploi,"Candidature","menubar,scrollbars,resizable,width=770,height="+getHauteur()+",top=0,left=0");
	q.opener = this;
	q.focus();
}


function showHideReponse () {
	wL = 440;
	if (navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Windows") != -1) wL += 18;
	var q= window.open("sondage.asp","Sondage","width="+wL+",height=480,menubar,resizable,scrollbars,top=0,left=0");
	q.opener = this;
	q.focus();
	/*if(reponsesVisibles) {
		reponsesVisibles = false;
		MM_showHideLayers('reponses','','hide');
	} else {
		reponsesVisibles = true;
		MM_showHideLayers('reponses','','show');
	}*/
}
var alternateImage = function() {
	document.images["imageAnim"].src = photoSuivante();
}
function startAlternateImage () {
	intervalID = setInterval("alternateImage()",secondesInterval*1000);
}
function photoSuivante() {
	indexPhoto++;
	if(indexPhoto == listePhoto.length) indexPhoto=0;
	return imagesPath + listePhoto[indexPhoto];
}
function SubmitQuiz(){
	//alert(verifieReponse());
	if (verifieReponse()) {
		document.forms["formQuiz"].submit();
	} else {
		alert("Veuillez faire un choix de réponse.")
	}
	
}
function verifieReponse(){
	var r =  document.forms["formQuiz"].reponse;
	var complet = false;
	for (var i=0; i < r.length; i++) {
		if (r[i].checked) complet = true;
	}
	return complet;
}
