// Global flag indicating whether or not the form has submitted already
// Used in the function checkSubmit(...)
{
   G_FORM_SUBMITTED = false;

   G_IMAGE = new Image();
   G_IMAGE.src = "images/but_please_wait.gif";
}   

function checkSubmit(theSubmitButton)
{
   // Flag telling the form to submit/not submit. Assume failure.
   var returnValue = false;

   if (!G_FORM_SUBMITTED)
   {
      // If the form has not been submitted yet, set flag to true and change image
      G_FORM_SUBMITTED = true;
      theSubmitButton.src = G_IMAGE.src;
      returnValue = true;
   }
   else
   {
      // If the form has already been submitted, tell user to wait
      alert("Your request has already been submitted - please wait...");
   }

   return returnValue;
}

function popUpWindow(url, width, height)
{
	height = height || 550;
	width = width || 700;	
   window.open(url,'displaywindow','toolbar=no,width='+width+',height='+height+',directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
}