function toggleDetail(plus,id){
  element = document.getElementById(id);
  sign = document.getElementById(plus);
  if(element.style.display == "none")
  {
    element.style.display = "";
    sign.innerHTML = "-";
  }else{
    element.style.display = "none";
    sign.innerHTML = "+";
  }
  
}

function addOnloadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
          oldonload();
          func();
        }
    }
}

function toggleStateSelect(){
  
  if( document.getElementById('RecipientEmail') ) {
    val = document.getElementById('RecipientEmail').selectedIndex;
    stateField = document.getElementById('State');
    stateLabel = document.getElementById('StateLabel');
    if(val == 1){
      stateField.style.display = '';
      stateLabel.style.display = '';
      if(stateField.nextSibling.tagName == 'BR') stateField.nextSibling.style.display = '';
    }else{
      stateField.style.display = 'none';
      stateLabel.style.display = 'none';
      if(stateField.nextSibling.tagName == 'BR') stateField.nextSibling.style.display = 'none';
    }
  }
}
addOnloadEvent(toggleStateSelect)
