// JavaScript Document
function Form_utils(){}
////// etat d'un checkbox
Form_utils.prototype.setChecked = function (check,val){
	document.getElementById(check).checked = (val==1)?true:false;
}
////// cherche dans un groupe de radios et checke au bon index
Form_utils.prototype.setGroupToChecked =function (group,val){
	var f = document.getElementsByName(group);
	var l =f.length;
	for(var i= 0;i<l;i++){
		if(f[i].value==val){
			f[i].checked=true;
			break;
		}
	}
}
////// cherche dans un select et place au bon index
Form_utils.prototype.setValToIndex = function (combo,val){
	//alert(val);
	var f = document.getElementById(combo).options;
	var l =f.length;
	for(var i= 0;i<l;i++){
		if(f[i].value==val){
			f.selectedIndex=i;
			break;
		}
	}
}
