// swap the display of which
function swapDisplay(obj, which){
	
	if (document.getElementById){
		oWhich = eval ("document.getElementById('" + which + "')")
	} else {
		oWhich = eval ("document.all." + which)
	}

	window.focus();

	if (oWhich.style.display=="none"){
		oWhich.style.display=""
		obj.className = "headSelected"; 
	} else{ 
		oWhich.style.display="none"
		obj.className = "head"; 
	}
}


//-- check the required inputs of a form
function checkRequiredInputs( wForm, hInputs ){
	
	result=true;
	for(var i=hInputs.length-1;i>=0;i--){
		inp=eval("document."+wForm+"."+hInputs[i]);
		
		if (inp.value=="" || inp.value==" " || inp.value=="//" || inp.value=="&nbsp;"){
			inp.style.borderColor="red";
			inp.focus();
			result=false;
		}
	}
	if(result==false){
		alert("Les champs encadrés en rouge sont obligatoires.");
	}
	return result;
}
