var ieColspan = function(c) {
  var i;
  var j;
  var k;
  var l;
  var doc = document;
  var theTables;
  var theTRs;
  var maxcols;
  var allcols;
  var sibs;
  var bodyE;
  var sibcolspan;
  function init() {
    c = !c ? "spanner" : c;
    theTables = doc.getElementsByTagName("TABLE");
    i         = theTables.length;
    if (i < 1) return;
    while (i--) {
      theTRs = theTables[i].getElementsByTagName("TR");
      j      = theTRs.length;
      maxcols = 1;
      while (j--) {
        if (theTRs[j].childNodes.length > maxcols) {
          maxcols = theTRs[j].childNodes.length;
        }
      }
      j = theTRs.length;
      while (j--) {
        allcols = theTRs[j].childNodes;
        k       = allcols.length;
        while (k--) {
          if (!allcols[k].getAttribute) {return}
          if (allcols[k].getAttribute("colSpan")==='0' ||
              allcols[k].className.indexOf("spanner")>=0) {
            sibs       = allcols[k].parentNode.childNodes.length;
            sibcolspan = 0;
            while (l--) {
              sibcolspan = sibcolspan + sibs[l].colSpan;
            }
            allcols[k].colSpan = maxcols - sibcolspan;
          }
        }
      }
    }
  }
  return {
    init:init
  };
}();