function reset_dep() { document.form.dep.selectedIndex=0; }
function reset_reg() { document.form.region.selectedIndex=0; }
function reset_champ(form_nom, nom) { document.forms[form_nom].elements[nom].value=""; }

var newwindow;
function poptastic(url,w,h)
{
	newwindow=window.open(url,'permisapoints','height='+h+',width='+w+',scrollbars=yes, resizable=yes');
	if(window.focus) {newwindow.focus()}
}


function typestage_cas2() {
	if(document.getElementById("cas2_choix").checked)	
		document.getElementById("cas2").className=""
	else
		document.getElementById("cas2").className="cache"
}

/*
function redirect(url) {
	window.location.replace(url);
}
*/

function controlFormInscription() {	
	if(document.getElementById("cas2_choix").checked) {
		var mess=""
		if(document.getElementById("infraction_lieu").value=="")
			mess+=" - lieu de l'infraction\n"
		if(document.getElementById("infraction_date").value=="")
			mess+=" - date de l'infraction\n"
		if(document.getElementById("infraction_heure").value=="")
			mess+=" - heure de l'infraction\n"
		if(mess!="") {
			mess="Erreur lors de la validation :\n\n"+mess+"\nVeuillez corriger les erreurs."
			alert(mess)
			return false
		}
		else
			return true
	}
}

function redirect(form) {
        var index=form.select.selectedIndex
        if (form.select.options[index].value != "0") {
        location=form.select.options[index].value;}
}
