/**
 * Script specific for wedstrijduitslagen selection form
 **/

/**
 * Only if the 'Selctie' is selected, the date edits and data pickers must be enabled
 **/
function changeSelection(pInput){
  if (pInput.type=="radio" && pInput.name=="period"){
    enableDateTimePickers(pInput.value=="selection");
  }
}

/**
  * id pEnabled == true then the date time edits and pickers are enabled otherwise not
  **/
function enableDateTimePickers(pEnabled){
  from = document.getElementById("selectionFrom");
  fromDtp = document.getElementById("AselectionFrom");
  to = document.getElementById("selectionTo");
  toDtp = document.getElementById("AselectionTo");
  if (pEnabled){
    from.removeAttribute("disabled");
    to.removeAttribute("disabled");
    fromDtp.setAttribute("href", "javascript:newCal('selectionFrom','ddmmyyyy',false,24)");
    toDtp.setAttribute("href", "javascript:newCal('selectionTo','ddmmyyyy',false,24)");
  } 
  else {
    from.setAttribute("disabled", true);
    to.setAttribute("disabled", true);
    fromDtp.removeAttribute("href");
    toDtp.removeAttribute("href");
  }  
}
