/***************************************************************
 * Toggle layer between add and delete displays.  There is a
 * '+' sign when the layer is folded, and a minus when the 
 * content is unfolded.  Flash the background of the layer on
 * change.
 **************************************************************/
function toggleLayer (layerID) {
  var Cstyle = layerID + "C";
  var Tstyle = layerID + "T";
  Cstyle = document.getElementById(Cstyle).style;
  Tstyle = document.getElementById(layerID + "T").style;  

  if (Cstyle.display == "") {
    Cstyle.display = "none";
    Tstyle.background = "url('images/icons/add.png') left no-repeat";
  } else {
    Cstyle.display = "";
    Tstyle.background = "url('images/icons/delete.png') left no-repeat";
  }
  textFlash(layerID + "T");
}

/*****************************************************************
 * 
 ****************************************************************/
function textFlash(elementID) {
  var elementStyle = document.getElementById(elementID).style;
  elementStyle.backgroundColor = "rgb(255, 255, 90)";
  for (i = 105; i <= 255; i++) {
    setTimeout(function() {
	elementStyle.backgroundColor = "rgb(255, 255, " + i + ")";
    }, 1500);
  }
}

