function iNumberOfCheckedCheckboxes(objCheckboxGroup)
{
  var iAantalChecked = 0;

  if (typeof objCheckboxGroup == 'undefined')
  {
    alert('Updater: onbekend checkbox group object');
    iAantalChecked = 0;
  }
  else  
  {
    // als de checkboxgroup uit 1 radiobutton bestaat dan is de checkboxgroup helemaal
    // geen checkbox group maar 1 checkbox en dient dus als zodanig te worden behandeld. 
    if (typeof objCheckboxGroup.length == 'undefined')
    {
      iAantalChecked = objCheckboxGroup.checked?1:0;
    }
    else
    {
      var iNumberOfCheckboxes;
      iNumberOfCheckboxes = objCheckboxGroup.length;
    
      for (var i = 0; i < iNumberOfCheckboxes; i++)
      {
        if (objCheckboxGroup[i].checked)
        {
          iAantalChecked++;
        }
      }
    }
  }
  
  return iAantalChecked;
}


/*
function    : isLegalDate
description : checks if the given year, month, day form a legal date
arguments   : [in] iYear, the year (4 digits)
              [in] iMonth, the month (0=januari, 1=februari ... 11=december)
              [in] iDay, the day of the month (1=first day)
returns     : true if the given year, month, day form a legal date else false
*/
function isLegalDate(iYear, iMonth, iDay)
{
  // save the given date as a legal date
  var dDate = new Date(iYear, iMonth, iDay);
  // the date will be shifted to a legal date if it is illegal.
  // if the year, month and day are not the same as specified through the arguments
  // of this function then the date was shifted e.g. was illegal. 
  var getYear_dDate = (dDate.getYear()<1900)?dDate.getYear() + 1900:dDate.getYear();
  return ((iYear == getYear_dDate) && (iMonth == dDate.getMonth()) && (iDay == dDate.getDate()));
}

/*
' function    : isValidInteger
' description : returns true if the string is a integer
' arguments   : [in] sNumber
' returns     : true if the string contains a valid integer value and nothing but an integer value
'               else false
*/
function isValidInteger(sNumber)
{
  return ((parseInt(parseFloat(sNumber)) == parseFloat(sNumber)) && (!isNaN(sNumber)));
}

/*
' function  : isValidFilename
' overview  : checks if the filename is valid
' arguments : 
' return    : 
' example   : 
' note      : the filename may contain a path, which will be stripped before checking the filename (i.o.w. the )
*/
function isValidFilename(sFilename) {
  return ((/(^|\\|\/)(\w|:|\/| |\.|-)*\.([a-z]+)$/i).test(sFilename));
}


