//\//////////////////////////////////////////////////////////////////////////////////
//\  BugHotel WebBased Reservation System  --  This notice must remain untouched at all times.
//\
//\  Copyright (C) 1998-2004 Bug Software Corporation.
//\  Copyright (C) 1998-2004 Bug Software.
//\  
//\  Bug Software
//\  Rua Dr. Jorge Fonseca Jorge Nr.322
//\  4415 Grijo
//\  Portugal
//\  email : bugsoft@bug-software.com
//\  url : http://www.bug-software.com/
//\  
//\  Get the latest version of BugHotel WebBased Reservation System at http://www.bug-hotel.org/
//\
//\  You should have received a copy of the License
//\  along with this program; if not, write to Bug Software Corporation.
//\  Rua Dr. Jorge Fonseca Jorge Nr.322, 4415 Grijo, Portugal
//\//////////////////////////////////////////////////////////////////////////////////

//
// These function make sure the form only gets submitted once
//
numberoftimes = 0;
function onlyonce() {
   numberoftimes += 1;
   if (numberoftimes > 1) {
      var themessage = "Please be patient. You have already submitted this form. Pressing submit multiple times will result in multiple records.";
      if (numberoftimes == 3) {
         themessage = "DO NOT PRESS SUBMIT MULTIPLE TIMES. YOUR ACCOUNT WILL HAVE BLANK RECORDS EACH TIME YOU PRESS SUBMIT. Processing may take  up to one minute.";
      }
      alert(themessage);
      return false;
   }
   else
   {
      return true;
   }
}

function disable() {

	var i, w;
	d=document;
	for (w=0;w<d.forms.length;w++) {
		 for (i=0;i<d.forms[w].length;i++) {	
			if (d.forms[w][i].type=="button") {
				d.forms[w][i].disabled=true;
			};
			if (d.forms[w][i].type=="reset") {
				d.forms[w][i].disabled=true;
			};
			if (d.forms[w][i].type=="submit") {
				d.forms[w][i].disabled=true;
			};
		}
	}
}

