function dyn_callback_jursubthemes(s) {
  var dc = window.top.document;
  var selectControl = dc.getElementById('subthemes');
  selectControl.options.length = 0;
  a1=s.split(';');
  selectControl.options[selectControl.options.length] = new Option(String('Не указана'),String(0),false,false);
  for(i = 0; i < a1.length-1; i++) {
    a2=a1[i].split(':');
    selectControl.options[selectControl.options.length] = new Option(String(a2[1]),String(a2[0]),false,false);
  }
}

function getJurSubthemes(theme) {
  run('jur_subthemes','dyn_callback_jursubthemes',theme);
}

function dyn_callback_court(s) {
  var dc = window.top.document;
  var selectControl = dc.getElementById('CtgData');
  selectControl.options.length = 0;
  a=s.split('|');
  a1 = a[0].split(';');
  a2 = a[1].split(';');
  selectControl.options[selectControl.options.length] = new Option(String('Не указана'),String(0),false,false);
  for(i = 0; i < a1.length-1; i++) {
    a11=a1[i].split(':');
    selectControl.options[selectControl.options.length] = new Option(String(a11[1]),String(a11[0]),false,false);
  }
  selectControl = dc.getElementById('InsData');
  selectControl.options.length = 0;
  selectControl.options[selectControl.options.length] = new Option(String('Не указана'),String(0),false,false);
  for(i = 0; i < a2.length-1; i++) {
    a22=a2[i].split(':');
    selectControl.options[selectControl.options.length] = new Option(String(a22[1]),String(a22[0]),false,false);
  }
}

function getCourt(Crt) {
  run('jur_court','dyn_callback_court',Crt);
}

function HideShowJurBlock(who) {
  var dc = window.top.document;
  var selectControl1 = dc.getElementById('frmFilter1');
  var selectControl2 = dc.getElementById('frmFilter2');
  var selectControl3 = dc.getElementById('frmFilter3');

  selectControl1.style.display = 'none';
  selectControl2.style.display = 'none' ;
  selectControl3.style.display = 'none' ;
  
  if (who == 1) {
    selectControl1.pTypeFltr.value = who;
    selectControl1.style.display = 'block';
  }
  if (who == 2) {
    selectControl2.pTypeFltr.value = who;
    selectControl2.style.display = 'block';
  }
  if (who == 3) {
    selectControl3.pTypeFltr.value = who;
    selectControl3.style.display = 'block';
  }
}

function HideShowCtg(Crt) {
  var dc = window.top.document;
  var selectControl = dc.getElementById('CtgData');
  var selectLabel = dc.getElementById('CtgLabel');
  selectControl.style.display = 'inline';
  selectLabel.style.display = 'inline';
  if (Crt > 0) {
    selectControl.style.display = 'none';
    selectLabel.style.display = 'none';
  }
}
