
function dspWs(){
	var t = document.getElementById('ws').innerHTML;
	document.getElementById('ws').innerHTML =  document.getElementById('ws_full').innerHTML;
	document.getElementById('ws_full').innerHTML = t
}

function dspExtraDocs(){
	var t = document.getElementById('extradocs').innerHTML;
	document.getElementById('extradocs').innerHTML =  document.getElementById('extradocs_full').innerHTML;
	document.getElementById('extradocs_full').innerHTML = t
}

function dspBoc(){
	var t = document.getElementById('boc').innerHTML;
	document.getElementById('boc').innerHTML =  document.getElementById('boc_full').innerHTML;	
	document.getElementById('boc_full').innerHTML = t;
}

function ToggleVis(inId) {
  var i = 1
  var the_selector = "row_" + inId + "_" + i;
  var the_sub_cel_selector = "";

  while ($(the_selector)) {
    if ($(the_selector).visible()) {
      var j = 1
      var the_sub_selector = "row_" + inId + "_" + i + "_" + j;
      while ($(the_sub_selector)) {
        $(the_sub_selector).hide();

        the_sub_cel_selector = "td_" + inId + "_" + i;
        if ($(the_sub_cel_selector)) {
          $(the_sub_cel_selector).addClassName('closed');
          $(the_sub_cel_selector).removeClassName('opened');
        }

        j = j + 1;
        the_sub_selector = the_sub_selector = "row_" + inId + "_" + i + "_" + j;
      }
    }    
    $(the_selector).toggle();
    i = i + 1;
    the_selector = "row_" + inId + "_" + i
  }
  var the_cel_selector = "td_" + inId;
  if ($(the_cel_selector)) {
    $(the_cel_selector).toggleClassName('closed');
    $(the_cel_selector).toggleClassName('opened');
  }
}

function ShowAllRows() {
  var theId = 1;
  var i = 1;
  var j = 1;
  var the_selector = "";
  var the_sub_selector = "";
  var the_sub_cel_selector = "";
  var the_cel_selector = "";

  var the_top_selector = "row_" + theId;
  while ($(the_top_selector)) {
    i = 1
    the_selector = "row_" + theId + "_" + i;
    while ($(the_selector)) {
      $(the_selector).show();
      j = 1
      the_sub_selector = "row_" + theId + "_" + i + "_" + j;
      while ($(the_sub_selector)) {
        $(the_sub_selector).show();
        j = j + 1;
        the_sub_selector = the_sub_selector = "row_" + theId + "_" + i + "_" + j;
      }
      the_sub_cel_selector = "td_" + theId + "_" + i;
      if ($(the_sub_cel_selector)) {
        $(the_sub_cel_selector).removeClassName('closed');
        $(the_sub_cel_selector).addClassName('opened');
      }
      i = i + 1;
      the_selector = "row_" + theId + "_" + i
    }
    the_cel_selector = "td_" + theId;
    if ($(the_cel_selector)) {
      $(the_cel_selector).removeClassName('closed');
      $(the_cel_selector).addClassName('opened');
    }
    theId = theId + 1;
    the_top_selector = "row_" + theId;
  }
}

function HideAllRows() {
  var theId = 1;
  var i = 1;
  var j = 1;
  var the_selector = "";
  var the_sub_selector = "";
  var the_sub_cel_selector = "";
  var the_cel_selector = "";

  var the_top_selector = "row_" + theId;
  while ($(the_top_selector)) {
    i = 1
    the_selector = "row_" + theId + "_" + i;
    while ($(the_selector)) {
      $(the_selector).hide();
      j = 1
      the_sub_selector = "row_" + theId + "_" + i + "_" + j;
      while ($(the_sub_selector)) {
        $(the_sub_selector).hide();
        j = j + 1;
        the_sub_selector = the_sub_selector = "row_" + theId + "_" + i + "_" + j;
      }
      the_sub_cel_selector = "td_" + theId + "_" + i;
      if ($(the_sub_cel_selector)) {
        $(the_sub_cel_selector).addClassName('closed');
        $(the_sub_cel_selector).removeClassName('opened');
      }
      i = i + 1;
      the_selector = "row_" + theId + "_" + i
    }
    the_cel_selector = "td_" + theId;
    if ($(the_cel_selector)) {
      $(the_cel_selector).addClassName('closed');
      $(the_cel_selector).removeClassName('opened');
    }
    theId = theId + 1;
    the_top_selector = "row_" + theId;
  }
}

function MakeVis(inArray) {
  for (i in inArray) {
    var theId = inArray[i];
    var i = 1
    var the_selector = "row_" + theId + "_" + i;
    while ($(the_selector)) {
      $(the_selector).show();
      i = i + 1;
      the_selector = "row_" + theId + "_" + i
    }
  }
}

