function changeMainCategory(mainBox, subBox, subLabel) {
  var mainIndex = eval(mainBox.selectedIndex)
	var main      = mainBox.options[ mainIndex ].value
    
	if (main != "X") {
    main = eval(main)
    subBox.length = 1
    var subOpt = new Option(subLabel)
    subBox.options[0] = subOpt
    subBox.options[0].value = "X"
        
    for (var i = 0; i < main.length - 1; i++) {
      subBox.length += 1
      subBox.options[subBox.length - 1] = new Option(eval('s' + main[i]))
      subBox.options[subBox.length - 1].value = main[i]
    }
  } else {
      subBox.length = 1
      var subOpt = new Option(subLabel)
      subBox.options[0] = subOpt
      subBox.options[0].value = "X"        
  }
  subBox.selectedIndex = 0
}

function jump(page) {
  if (page == "undefined")
     page = "index.jsp";
   
  parent.top.location.href = page;
  return true;
}

var theForm;
var isSubmitted = false;  

function disable(btn, form) {
  if (!isSubmitted) {
    theForm = form;
    btn.disabled = true;
    isSubmitted = true;
    setTimeout("submitIt()", 300);
  } else {
    return false;
  }
}

function submitIt() {
  theForm.submit();
  return false;
}

