function SelectAll(form_name, value) {
  len = document.forms[form_name].elements.length;
  var i=0;
  while(i < len) {
    if (document.forms[form_name].elements[i].type=='checkbox')
			document.forms[form_name].elements[i].checked = value;
		i++;
	}
}

function HideAll(form_name) {
  len = document.forms[form_name].elements.length;
  var i=0;
  while(i < len) {
		document.forms[form_name].elements[i].style.visibility = 'hidden';
		i++;
	}
}

function close_popup(elem) {
  show(elem);
  if (document.getElementsByTagName) {
    // this is the way the standards work
    var style2 = document.getElementsByTagName("table").style;
    style2.filter = "alpha(opacity=100)";
    style2.MozOpacity = "1";
    style2.opacity = "1";
  }
  else if (document.all) {
    
  }
  else if (document.layers) {
    
  }
}

function show(elem) {
  if (document.getElementById) {
    // this is the way the standards work
    var style2 = document.getElementById(elem).style;
    style2.display = style2.display? "":"block";
  }
  else if (document.all) {
    // this is the way old msie versions work
    var style2 = document.all[elem].style;
    style2.display = style2.display? "":"block";
  }
  else if (document.layers) {
    // this is the way nn4 works
    var style2 = document.layers[elem].style;
    style2.display = style2.display? "":"block";
  }
}

function CalendarInput(nForm, nInput, obj){
	if (window.event)
    ObjFenCal = window.open('mycalendar.php?form=' + nForm + '&elem=' + nInput,'Calendrier','left='+event.screenX+',top='+event.screenY+',width=200px,height=320px,toolbar=no,menubar=no,dependent=yes,resizable=no,location=no,directories=no,status=no,scrollbars=no,copyhistory=no');
	else
    ObjFenCal = window.open('mycalendar.php?form=' + nForm + '&elem=' + nInput,'Calendrier','left='+obj.offsetLeft+',top='+obj.offsetTop+',width=200px,height=320px,toolbar=no,menubar=no,dependent=yes,resizable=no,location=no,directories=no,status=no,scrollbars=no,copyhistory=no');
  ObjFenCal.focus();
}

