var display_count=0
function CheckAll(theForm,chkAll,chkCtrl) {
  for (var i=0;i<theForm.elements.length;i++) {
    var e = theForm.elements[i];
    if (e.name != chkAll && e.type=='checkbox' && e.name == chkCtrl)
      e.checked = theForm.elements[chkAll].checked;
  }
}
function showhidefrm(id) {
  if (document.getElementById){
    obj = document.getElementById(1);
    if (id == 1) {
      obj.style.display = "";
	}
    else {
      obj.style.display = "none";
	}
  }
}
function showhide(id){
  if (document.getElementById){
    obj = document.getElementById(id);
    if (obj.style.display == "none") {
      obj.style.display = "";
	  display_count++;
	}
    else {
      obj.style.display = "none";
	  display_count--
	}
	if(display_count>0) {
      document.display_close_img.src="../images/close_all.gif"
	}
	if(display_count==0) {
      document.display_close_img.src="../images/display_all.gif"
	}
  }
}
function showhideAll(){
  for(i=1;i<=18;i++) {
    if (document.getElementById){
      obj = document.getElementById(i);
	  if(display_count>0)
        obj.style.display = "none";
      else
        obj.style.display = "";
    }
  }
  if(display_count>0) {
    display_count=0
	document.display_close_img.src="../images/display_all.gif"
  }
  else {
    display_count=10
	document.display_close_img.src="../images/close_all.gif"
  }
}
function showhideAlla(){
  for(i=1;i<=10;i++) {
    if (document.getElementById){
      obj = document.getElementById(i);
	  if(display_count>0)
        obj.style.display = "none";
      else
        obj.style.display = "";
    }
  }
  if(display_count>0) {
    display_count=0
	document.display_close_img.src="../images/display_all.gif"
  }
  else {
    display_count=19
	document.display_close_img.src="../images/close_all.gif"
  }
}
