// fonction pour ajouter un handler supplémentaire
// à un événement pour un objet DOM
function addEvent(obj, evType, fn) { 
  if (obj.addEventListener){ 
    obj.addEventListener(evType, fn, true); 
    return true; 
  } 
  else if (obj.attachEvent){ 
    var r = obj.attachEvent("on"+evType, fn); 
    return r; 
  } 
  else { return false; } 
}

function hideElem(aElemId) {
  if(document.getElementById) {
    elem = document.getElementById(aElemId);
    if (elem) {
      elem.style.visibility = 'hidden';
    }
  }
}

function openChildWnd(aURL,aLeft,aTop,aWidth,aHeight) {
   if((aLeft == null) || (aLeft == -1)) aLeft = 100;
   if((aTop == null) || (aTop == -1)) aTop = 100;
   if((aWidth == null) || (aWidth == -1)) aWidth = 400;
   if((aHeight == null) || (aHeight == -1)) aHeight = 400;
   childWnd = window.open(aURL,'childWnd',
                              'left=' + aLeft + ',' +
                              'top=' + aTop + ',' +
                              'width=' + aWidth + ',' +
                              'height=' + aHeight + ',' + 
                              'menubar=no,' +
                              'scrollbars=yes,' +
                              'resizable=yes', +
                              'dependant=yes');
   if (!childWnd.opener) {
     childWnd.opener = self;
   }
   childWnd.focus();
}

function getSelectValue(aSelectElem) {
   if(aSelectElem.selectedIndex >= 0) {
     return aSelectElem.options[aSelectElem.selectedIndex].value;
   }
   else { return null; }
}

function getRadioValue(aRadio) {
  for (var i=0;i<aRadio.length;i++) {
     if (aRadio[i].checked) { 
        return aRadio[i].value;
     }
  }
  return null;
}      

function closeAndRefreshParent() {
  if(window.opener) {
    window.opener.location.reload(true);
  }
  window.close();
}

setTimeout('hideElem("actionMsg")',3000);

