<!--
function uf_submit(theForm)
{
  if (empty(theForm.title.value)) {
      alert("请输入标题！");
      theForm.title.focus();
      return(false);
  }

  if (theForm.cols.options.length == 0) {
      alert("请输入报表列！");
      theForm.colsAdd.focus();
      return(false);
  }

  if (theForm.items.options.length == 0) {
      alert("请输入报表项！");
      theForm.itemsAdd.focus();
      return(false);
  }
  if (empty(theForm.display.value)) {
      alert("请输入显示顺序！");
      theForm.display.focus();
      return(false);
  }

  colsValue = new Array();
  itemsValue = new Array();
  
  for (i=0; i< theForm.cols.options.length; i++) {
      colsValue[i] = theForm.cols.options[i].value;
  }
  theForm("colsValue").value = colsValue;

  for (i=0; i< theForm.items.options.length; i++) {
      itemsValue[i] = theForm.items.options[i].value;
  }
  theForm("itemsValue").value = itemsValue;
  theForm.submit();
}

function findSelected(obj)
{
  for (i=0; i< document.all(obj).options.length; i++) {
     if (document.all(obj).options(i).selected == true) return (i);
  }
}

function setSelect(obj, value) 
{
  for (i=0; i< document.all(obj).options.length; i++) {
    if (document.all(obj).options(i).value == value) {
        document.all(obj).options(i).selected = true;
    }
  }  
}

function setNull(obj)
{
    document.all(obj).value = "";
}

function addItem(obj)
{
    var value;
    if (obj == "cols") {
      value  = "层次：1 | 名称：名称 | 宽度：50";
    } else {
      value  = "层次：1 | 名称：名称 | 级别：0";
    }
    len  = document.all(obj).options.length;
    document.all(obj).options[len] = new Option(value, value);
    document.all(obj).options[len].selected = true;
    changeItem(obj);
}

function changeItem(obj)
{
    var arr;
    i = findSelected(obj);
    value = document.all(obj).options[i].value;
    arr = value.split(" | ");
    setSelect(obj+"Layer", arr[0].substr(3)); 
    document.all(obj+"Name").value = arr[1].substr(3);
    document.all(obj+"Name").select();
    document.all(obj+"Name").focus();
    if (obj == "cols") {
      document.all(obj+"Width").value = arr[2].substr(3);
    } else {
      setSelect(obj+"Rank", arr[2].substr(3)); 
    }
}

function editItem(obj)
{
    var value;
    if (document.all(obj).options.length <= 0) return(false);
    i = findSelected(obj+"Layer");
    layer = "层次：" + document.all(obj+"Layer").options[i].value;
    name  = "名称：" + document.all(obj+"Name").value;
    if (obj == "cols") {
      width = "宽度：" + document.all(obj+"Width").value;
      value = layer + " | " + name + " | " + width;　
    } else {
      i = findSelected(obj+"Rank");
      rank = "级别：" + document.all(obj+"Rank").options[i].value;
      value = layer + " | " + name + " | " + rank;　
    }
    i = findSelected(obj);
    document.all(obj).options[i].text  = value;
    document.all(obj).options[i].value = value;
    changeItem(obj);
}

function deleteItem(obj)
{
    if (document.all(obj).options.length <= 0) return(false);
    if (confirm("是否真的删除？"))
    {
       if  (document.all(obj).options.length == 0) {
           setNull(obj+"Name");
           return;
       }
       i = findSelected(obj);
       document.all(obj).options[i] = null;
       if  (document.all(obj).options.length == 0) {
           setNull(obj+"Name");
           return;
       }
       if (i == 0) i = 1;
       i--;
       document.all(obj).options[i].selected = true;
       changeItem(obj);
    }
}

function isDigit() {
    return ((event.keyCode >= 48) && (event.keyCode <= 57) || (event.keyCode == 37));
}

function uf_onload() {
  if (document.all("cols").options.length > 0) {
    document.all("cols").options[0].selected = true;
  }
  if (document.all("items").options.length > 0) {
    document.all("items").options[0].selected = true;
    //chageItem("items");
  }
  turnit(Content10,Img10,Aux10);
}
-->
