function loadPanel(panel_id, content_url){  $('#'+panel_id).load(content_url); }

function toggleLayer(lyr, lyrToggle) {
  $('#'+lyr).toggle();
  var tmp_html = ($('#a_'+lyrToggle).html() == '+')? '-':'+';
  $('#a_'+lyrToggle).html(tmp_html);
 
 
}

function WarnDeleteLineItem(blah, the_url) {
  if (confirm("Are you sure to delete " + ((blah)? "' " + blah + " '" : "") + "?")) {
    top.location.href=the_url;
  }
}

function textCounter(field,cntfield,maxlimit) {
  if (field.value.length > maxlimit) // if too long...trim it!
    field.value = field.value.substring(0, maxlimit);
    // otherwise, update 'characters left' counter
  else
    cntfield.value = maxlimit - field.value.length;
}


function window_unload() {
  
  var answer = confirm ("Please close all the browser windows to log out of this application")
  if (answer)
  window.close();

}
