  function updateTabs(index){
    var tabList = document.getElementById("tabs").getElementsByTagName("li");
    var sectionDivList = document.getElementById("formHolder").getElementsByTagName("div");
    var sectionList = [];
    
    var j=0;
    for (var i=0; i<sectionDivList.length; i++){
      if (sectionDivList[i].className == "formSection"){
          sectionList[j] = sectionDivList[i];
          j++;
      }
    }

    for (i=0; i<tabList.length; i++){
      if (index != i){
        tabList[i].className = "";
        sectionList[i].style.display = "none";
      }
      else{
        tabList[i].className = "selected";
        sectionList[i].style.display = "block";
      }
    }
  }

  function flip(index, display){
    var spanList = document.getElementsByTagName("span");
    var toolsList = [];
    
    var j=0;
    for (var i=0; i<spanList.length; i++){
      if (spanList[i].className == "headTools"){
        toolsList[j] = spanList[i];
        j++;
      }
    }

    if (index==0){
      if (display == 1){
        document.getElementById("activeList").style.display = "none";
        toolsList[index].innerHTML = '<a href="#" onClick="flip(0, 0); return false;">Show</a>';
      }
      else{
        document.getElementById("activeList").style.display = "block";
        toolsList[index].innerHTML = '<a href="#" onClick="flip(0, 1); return false;">Hide</a>';
      }
    }
    else if (index==1){
      if (display == 1){
        document.getElementById("rejectedList").style.display = "none";
        toolsList[index].innerHTML = '<a href="#" onClick="flip(1, 0); return false;">Show</a>';
      }
      else{
        document.getElementById("rejectedList").style.display = "block";
        toolsList[index].innerHTML = '<a href="#" onClick="flip(1, 1); return false;">Hide</a>';
      }
    }
    else if (index==2){
      if (display == 1){
        document.getElementById("inactiveList").style.display = "none";
        toolsList[index].innerHTML = '<a href="#" onClick="flip(2, 0); return false;">Show</a>';
      }
      else{
        document.getElementById("inactiveList").style.display = "block";
        toolsList[index].innerHTML = '<a href="#" onClick="flip(2, 1); return false;">Hide</a>';
      }
    }    
  }
  function resort_order()
  {
    var objectCount = 1;
  	var objCollection = document.getElementById('activeObjectList').getElementsByClassName('bullet');
  	for (var i=0; i<objCollection.length; i++) 
  	{
  		objCollection[i].innerHTML = objectCount;
  		objectCount++;
  	}
  	return true;
  }
