// prepare the form when the DOM is ready

$(document).ready(function() {
  // Setup the ajax indicator
  $('body').append('<div id="ajaxBusy" style="background-color:lightgray; font-variant:small-caps;">Processing Request<br><img src="loading.gif"><br><input type="button" onclick="hideBlockingBox(true);" value="Cancel"></div>');

  $('#ajaxBusy').css({
    fontWeight:'bold',
    display:"none",
    margin:"0px",
    paddingLeft:"20px",
    paddingRight:"20px",
    paddingTop:"15px",
    paddingBottom:"15px",
    position:"fixed",
    textAlign:"center",
     width:"auto"
  });

  $('#ajaxBusy').position({my:'center',at:'center',of:$(window)});
});


function hideBlockingBox(flag){
  if (xhr && flag) {
    xhr.abort();
  }
  $('#ajaxBusy').hide(); 
}
function showBlockingBox(descrpt){
  $('#ajaxBusy').show(); 
}


