﻿function CheckAll(c){
  var cell = c.parentNode
  var t, i, j, ck
  var cellIndex 
  while (cell.tagName.toUpperCase()!='TD') 
      cell = cell.parentNode
  cellIndex = cell.cellIndex
  while(cell.tagName.toUpperCase()!='TABLE')
      cell = cell.parentNode
      
  t = cell
  
  for (i=0; i < t.rows.length; i++)
    if (t.rows[i].cells[cellIndex]) {      
        ck = t.rows[i].cells[cellIndex].firstChild;
        if (ck.tagName.toUpperCase()=='INPUT')
          if (ck.type=='checkbox')
              ck.checked = c.checked
  }
}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();