function accord() {
	var myAccordion = new Accordion($('accordion'), 'a.toggler', 'div.element', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.addEvent('click',closeAccordeon);
		},
		onBackground: function(toggler, element){
			toggler.removeEvent('click',closeAccordeon);
		}
	});
	closeAccordeon();
	function closeAccordeon()
	{
		myAccordion.display(-1);
	}	
}

function isAnswered(questionNb){
    var divQuestion = $('divQuestion' + questionNb);
    var arrRadios = divQuestion.getElementsByTagName("INPUT");

    for (var i = 0; i < arrRadios.length; i++) {
        if (arrRadios[i].checked) return true;
    }

    return false;
}

function quest() {
	var totIncrement = 0;
	var maxQuest = 1;
	var increment	= 730;
	var maxRightIncrement	= increment*(-10);
	 
	 
	$('q'+maxQuest).setStyle('background-color', '#43ae78');
	
	var fx = new Fx.Style('myList', 'margin-left', {
			duration: 2000,
			/*transition: Fx.Transitions.linear,*/
			transition: Fx.Transitions.Quart.easeInOut, 
			wait: true
	});


	$$('.rep').addEvents({
	    'click': function(event) {
	        if (!isAnswered(maxQuest)) return false;
	        if (maxQuest == 10) return true;

	        maxQuest++;
	        if (totIncrement > maxRightIncrement) {
	            totIncrement = totIncrement - increment;
	            fx.stop()
	            fx.start(totIncrement);

	            $('q' + maxQuest).setStyle('background-color', '#43ae78');
	        }
	    }
	})

}


	tempsFermeture = 0;
	function Debute(URL, WIDTH, HEIGHT) {
	propFenetre = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT;
	pub = window.open(URL, "pub", propFenetre);
	if (tempsFermeture) setTimeout("pub.close();", tempsFermeture*1000);
	}

	function PopUp() {
	url = "http://vichy.canalchat.fr/2010/1/";
	width = 843; // largeur du PopUp en pixels
	height = 700; // hauteur du PopUp en pixels
	delay = 6; // temps en seconde avant l'ouverture du PopUp
	timer = setTimeout("Debute(url, width, height)", delay*1000);
	}





