// General functions: DO NOT CHANGE ANYTHING WITHOUT SAM'S HAVING KNOW IT

var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
var WEEK = 7 * DAY;

// If this handler returns true then the "date" given as
// parameter will be disabled.  In this example we enable
// only days within a range of 10 days from the current
// date.
// You can use the functions date.getFullYear() -- returns the year
// as 4 digit number, date.getMonth() -- returns the month as 0..11,
// and date.getDate() -- returns the date of the month as 1..31, to
// make heavy calculations here.  However, beware that this function
// should be very fast, as it is called for each day in a month when
// the calendar is (re)constructed.

function DisabledDays(date) 
{
var today = new Date();

/* Enable +10/-10 Days from today's date */
//return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10;

/* Enable only today's date and all future dates*/
return ((date.getTime() - today.getTime()) / DAY) < 0;

/* Enable only today's date and all past dates*/
//return ((date.getTime() - today.getTime()) / DAY) > 0;
}

/*** ------ BEGIN ---------------- Main functions to do calculations ----------- BEGIN ----------------  ***/

var ScooterBuild;
var ScootersNum = 1;
var ReservedScootersNum = 0;
var ScooterStatus = new Array( 1, 2, 3, 4, 5, 6, 7, 8 );
var ShowVehiclePicture =       new Array(false, false, false, true,  true, true, true,  true, true, false);
var ShowVehiclePictureStatus = new Array(false, false, false, false, false, false, false, false, false, false);

function isValidEmail(str) 
{
return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

function Xtend(X, N) {
    var P;
    X = String(X);
    if (/e/i.test(X)) {
        return X;
    }
    while ((P = X.indexOf(".")) < 0) {
        X += ".";
    }
    while (X.length <= P + N) {
        X += "0";
    }
    return X;
}

function ValidateForm(FormName)
{
if (FormName == "PaymentForm") {

document.forms['PaymentForm'].cardimage.src = getCardType(document.forms['PaymentForm'].CCNumber.value);
if (document.forms['PaymentForm'].cardimage.src.indexOf("invalid") == -1) CCardValid = true;

if (!document.forms['PaymentForm'].elements["PickupLocation"][0].checked && !document.forms['PaymentForm'].elements["PickupLocation"][1].checked && !document.forms['PaymentForm'].elements["PickupLocation"][2].checked) 
 { 
 alert("Please choose pickup location at the top of the form!");
 document.forms['PaymentForm'].elements["PickupLocation"][0].focus(); 
 }

else if (document.forms['PaymentForm'].elements["FirstName"].value == "")
 {
 alert("Please make sure that you put your first name!");
 document.forms['PaymentForm'].elements["FirstName"].focus();
 }

else if (document.forms['PaymentForm'].elements["LastName"].value == "")
 {
 alert("Please make sure that you put your last name!");
 document.forms['PaymentForm'].elements["LastName"].focus();
 }

else if (!isValidEmail(document.forms['PaymentForm'].elements["UserEmail"].value))
 {
 alert("Please make sure that you put your valid email address!");
 document.forms['PaymentForm'].elements["UserEmail"].focus();
 }

else if (document.forms['PaymentForm'].elements["DriverLicense"].value == "")
 {
 alert("Please make sure that you put your driver license number!");
 document.forms['PaymentForm'].elements["DriverLicense"].focus();
 }

else if (document.forms['PaymentForm'].elements["HomePhone"].value == "")
 {
 alert("Please make sure that you put your telephone number!");
 document.forms['PaymentForm'].elements["HomePhone"].focus();
 }

else if (document.forms['PaymentForm'].elements["UserAddress1"].value == "")
 {
 alert("Please make sure that you put your correct billing address: street name and etc.!");
 document.forms['PaymentForm'].elements["UserAddress1"].focus();
 }

else if (document.forms['PaymentForm'].elements["City"].value == "")
 {
 alert("Please make sure that you put your city name!");
 document.forms['PaymentForm'].elements["City"].focus();
 }

else if (document.forms['PaymentForm'].elements["State"].value == "")
 {
 alert("Please make sure that you put your state!");
 document.forms['PaymentForm'].elements["State"].focus();
 }

else if (document.forms['PaymentForm'].elements["Zipcode"].value == "")
 {
 alert("Please make sure that you put your zipcode!");
 document.forms['PaymentForm'].elements["Zipcode"].focus();
 }

else if (document.forms['PaymentForm'].elements["CCNumber"].value.length < 15  || CCardValid == false)
 {
 alert("Please make sure that you put your correct credit card number!\n It should be at least 15-digit number!");
 document.forms['PaymentForm'].elements["CCNumber"].focus();
 }

else if (document.forms['PaymentForm'].elements["CCSecCode"].value == "")
 {
 alert("Please make sure that you put security code of your credit card!\nIt is also known as CVV2 code.");
 document.forms['PaymentForm'].elements["CCSecCode"].focus();
 }

else if (document.forms['PaymentForm'].elements["CCExpMonth"].options.selectedIndex == 0 || document.forms['PaymentForm'].elements["CCExpYear"].options.selectedIndex == 0)
 {
 alert("Please make sure that you put the expiration date of your credit card!");
 document.forms['PaymentForm'].elements["CCExpMonth"].focus();
 }

else { 
     document.forms['PaymentForm'].elements["CCTypeURL"].value = document.forms['PaymentForm'].cardimage.src;
	 document.forms['PaymentForm'].elements["CCType"].value = CardUsed;
	 document.forms['PaymentForm'].submit(); 
     } 
}

if (FormName == "PriceQuoteForm") {
SetSameInfo();

if (ReservedScootersNum <= 0)
 {
 alert("Please make reservation for at least one vehicle!");
 document.forms["PriceQuoteForm"].elements["PassengersPerScooter1"].focus();
 }

else if (ReservationIsFilled()) {
	                            for (var i = 1; i <= ReservedScootersNum; i++) document.getElementById("SDate" + i).disabled = false;
								document.forms["PriceQuoteForm"].submit();
                                } }
}

function ReservationIsFilled()
{
for (var i = 1; i <= ReservedScootersNum; i++)
  {
  if (document.getElementById("SDate" + i).value == "") { alert("Please choose your pickup date!"); document.getElementById("SDate" + i).focus(); return false; }
  if (document.getElementById("STime" + i).options.selectedIndex == 0) { alert("Please choose your pickup time!"); document.getElementById("STime" + i).focus(); return false; }
  if (document.getElementById("RentalTerms" + i).options.selectedIndex == 0) { alert("Please choose your rental terms!"); document.getElementById("RentalTerms" + i).focus(); return false; }
  }
return true;
}

function GetPrices(cat)
{
var StartDate = document.getElementById("SDate" + cat);
var RentTerms = document.getElementById("RentalTerms" + cat);
var PassPerScooter = document.getElementById("PassengersPerScooter" + cat);

if (PassPerScooter.options.selectedIndex == 0) 
 {
 RentTerms.options[0].innerHTML = "Select a term";
 return SpecialPrice[1];
 }
 
if (RentTerms.options.selectedIndex != 0) 
 { 
 RentTerms.options[0].innerHTML = "Change Date"; 
 StartDate.disabled = true; 
 }
else {
	 RentTerms.options[0].innerHTML = "Select a term";
	 StartDate.disabled = false;
	 StartDate.focus();
	 return SpecialPrice[1];
	 } 

if (isNaN(new Date(StartDate.value)) && StartDate.value != "") 
 { 
 RentTerms.options[0].innerHTML = "Select a term";
 StartDate.disabled = false; 
 StartDate.value = "";
 RentTerms.options.selectedIndex = 0; 
 return "1"; 
 }

else if (RentTerms.options.selectedIndex != 0 && StartDate.value == "") 
      { 
	  RentTerms.options[0].innerHTML = "Select a term";
	  StartDate.disabled = false; 
	  RentTerms.options.selectedIndex = 0; 
	  return "2"; 
	  }
	  
else {
	 var todayDate = new Date();
	 var DateChosen = new Date(StartDate.value);
	 
	 if (DateChosen < todayDate) 
	  { 
	  RentTerms.options[0].innerHTML = "Select a term";
	  StartDate.disabled = false; 
	  RentTerms.options.selectedIndex = 0; 
	  StartDate.value = "";
	  return "3";
	  }
	 
	 if (DateChosen != "NaN")
	  {
	  var _day = DateChosen.getDate(); 
      var _month = DateChosen.getMonth(); 
	  var _index = priceK[_month][_day];
	  
	  if (_index == 0) 
	   {
	   RentTerms.options[0].innerHTML = "Select a term";
	   StartDate.disabled = false; 
	   RentTerms.options.selectedIndex = 0; 
	   StartDate.value = "";
	   return "4";
	   }
	  
	  if (RentTerms.options.selectedIndex >= 4)
	   {
   	   var tmpDate = new Date(DateChosen.getTime() + (RentTerms.options.selectedIndex - 3) * DAY);
	   if (priceK[tmpDate.getMonth()][tmpDate.getDate()] == 0) 
	    {
		RentTerms.options[0].innerHTML = "Select a term";
   	    StartDate.disabled = false; 
	    RentTerms.options.selectedIndex = 0; 
	    alert("Drop off date ("+tmpDate.toLocaleString()+") is not available!\nPlease choose another rental terms or rental date!");
		return SpecialPrice[1];
		}
	   }
	  
	  return SpecialPrice[_index]; 
	  }
	 
	 else return SpecialPrice[1];  
	 }
}

function DoCalculate(cat)
{
var PricePerPassengers = new Array(2);
	PricePerPassengers = GetPrices(cat);
		
	if (PricePerPassengers == "1") { alert("Please enter correct rental date!"); document.getElementById("SDate" + cat).focus(); return; }
	if (PricePerPassengers == "2") { alert("Please enter rental date first!"); document.getElementById("SDate" + cat).focus(); return; }
	if (PricePerPassengers == "3") { alert("The date you've chosen is not available for the reservation!\nPlease enter another rental date!"); document.getElementById("SDate" + cat).focus(); return; }	
    if (PricePerPassengers == "4") { alert("Reservation and rental are not available on the chosen date!\nPlease enter another rental date!"); document.getElementById("SDate" + cat).focus(); return; }
			
var PassPerScooter = document.getElementById("PassengersPerScooter" + cat);
var RentTerms = document.getElementById("RentalTerms" + cat);

/*** ------------------------------------------- Result for each scooter --- BEGIN -----------------------------------  ***/
var ResultDiv = document.getElementById("Result" + cat);
var ResultBuild = "<table class=Text3 cellspacing=0 cellpadding=0 border=0><tr><td>Total:</td><td><b>&nbsp;Security Deposit - <font color=red>$";

if (PassPerScooter.options.selectedIndex != 0) 
 {
 ResultBuild += SecurityDeposit[PassPerScooter.options.selectedIndex] + "</font>";
 if (RentTerms.options.selectedIndex != 0) 
  {
  ResultBuild += ",</td></tr><tr><td>&nbsp;</td><td><b>&nbsp;Rent price&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - <font color=red>$";
  ResultBuild += PricePerPassengers[PassPerScooter.options.selectedIndex-1][RentTerms.options.selectedIndex] + "</font>";
  }
 ResultBuild += "</b></td></tr></table>";
 }
else ResultBuild = "Total: <b>NONE</b>";

ResultDiv.innerHTML = ResultBuild;
document.getElementById("TotalResult" + cat).value = ResultBuild;
/*** ---------------------------------------- Result for each scooter --- END --------------------------------------  ***/

/*** ---------------------------------------- Seurity Dep Total --- BEGIN ------------------------------------------  ***/
var SecDepTotalDiv = document.getElementById("SecDepTotal");
var SecDepBuild = "USD <font color=red><b>$";
var TotalSecurityDeposit = 0;

for (var i = 1; i <= ScootersNum; i++) TotalSecurityDeposit += SecurityDeposit[document.getElementById("PassengersPerScooter" + i).options.selectedIndex];
SecDepBuild += TotalSecurityDeposit + "</b></font> (for ";
 
if ((ScootersNum-1) != 0) 
 {
 if (!document.getElementById("PassengersPerScooter4") || document.getElementById("PassengersPerScooter4").options.selectedIndex == 0) 
  {
  SecDepBuild += (ScootersNum-1) + ((ScootersNum-1) == 1 ? " vehicle" : " vehicles") + ")";
  }
 else SecDepBuild += ScootersNum + " vehicles)";
 }
else SecDepBuild = "NONE";

SecDepTotalDiv.innerHTML = SecDepBuild;
document.getElementById("SecDepResult").value = SecDepBuild;
/*** --------------------------------------- Seurity Dep Total --- END -------------------------------------  ***/

/*** --------------------------------------- PRICE Total --- BEGIN -------------------------------------  ***/
var GrandTotalDiv = document.getElementById("GrandTotal");
var PriceTotalDiv = document.getElementById("PriceTotal");
var TaxTotalDiv = document.getElementById("TaxTotal");

var TaxTotalBuild = "USD <font color=red><b>$";
var PriceTotalBuild = "USD <font color=red><b>$";
var GrandTotalBuild = "USD <font color=red><b>$";

if ((ScootersNum-1) != 0) 
 {
 var TotalPrice = 0;
 var ScootersToRent = 0;
 for (var i = 1; i <= ScootersNum; i++)
   {
   if (document.getElementById("RentalTerms" + i).options.selectedIndex != 0) ScootersToRent++;
   //alert(document.getElementById("PassengersPerScooter" + i).options.selectedIndex);
   if (document.getElementById("PassengersPerScooter" + i).options.selectedIndex != 0) 
    {
		//alert("PPS secelted index=" + document.getElementById("PassengersPerScooter" + i).options.selectedIndex + "\ni=" + i + "\nPrice="+ PricePerPassengers[document.getElementById("PassengersPerScooter" + i).options.selectedIndex - 1][document.getElementById("RentalTerms" + i).options.selectedIndex]);
		PricePerPassengers = GetPrices(i);
		TotalPrice += PricePerPassengers[document.getElementById("PassengersPerScooter" + i).options.selectedIndex - 1][document.getElementById("RentalTerms" + i).options.selectedIndex];
	}
   }

 if (TotalPrice != 0)
  {
  var FLTax = 0.07 * TotalPrice;
  var ResWithTax = 1.07 * TotalPrice;
  FLTax = Xtend(Math.round(FLTax * 100) / 100, 2);  
  ResWithTax = Xtend(Math.round(ResWithTax * 100) / 100, 2);  
 
  PriceTotalBuild += TotalPrice + "</b></font> (for ";
  PriceTotalBuild += ScootersToRent + (ScootersToRent == 1?" vehicle":" vehicles") + ")";
  TaxTotalBuild += FLTax + "</b></font>";
  GrandTotalBuild += ResWithTax + "</b></font> (for ";
  GrandTotalBuild += ScootersToRent + (ScootersToRent == 1?" vehicle":" vehicles") + ")";
  }
 else { 
     PriceTotalBuild = "NONE"; 
	 TaxTotalBuild = "NONE"; 
	 GrandTotalBuild = "NONE"; 
     }
 }
else { 
     PriceTotalBuild = "NONE"; 
	 TaxTotalBuild = "NONE"; 
	 GrandTotalBuild = "NONE"; 
     }
	 
PriceTotalDiv.innerHTML = PriceTotalBuild;
TaxTotalDiv.innerHTML = TaxTotalBuild;
GrandTotalDiv.innerHTML = GrandTotalBuild;
document.getElementById("PriceTotalResult").value = PriceTotalBuild;
document.getElementById("TaxTotalResult").value = TaxTotalBuild;
document.getElementById("GrandTotalResult").value = GrandTotalBuild;
/*** --------------------------------------- PRICE Total --- END -------------------------------------  ***/
}

function SetTheSameDates(cat)
{
var StartDate = document.getElementById("SDate" + cat);
var StartTime = document.getElementById("STime" + cat);
var RentTerms = document.getElementById("RentalTerms" + cat);
var TheSameDates = document.getElementById("SameDatesTime" + cat);

if (TheSameDates.checked)
 {
 StartDate.value = document.getElementById("SDate1").value;
 StartTime.options.selectedIndex = document.getElementById("STime1").options.selectedIndex;
 RentTerms.options.selectedIndex = document.getElementById("RentalTerms1").options.selectedIndex;
 }

DoCalculate(cat);
}

function SetSameInfo()
{
for(var i=2; i <= ReservedScootersNum; i++)
  {
  if (document.getElementById("SameDatesTime" + i).checked) 
   {
   document.getElementById("SDate" + i).value = document.getElementById("SDate1").value;
   document.getElementById("STime" + i).options.selectedIndex = document.getElementById("STime1").options.selectedIndex;
   document.getElementById("RentalTerms" + i).options.selectedIndex = document.getElementById("RentalTerms1").options.selectedIndex;
   DoCalculate(i);
   }
  }
}

function UpdateDivs(cat)
{
var PassPerScooter = document.getElementById("PassengersPerScooter" + cat);
var ScooterLimit = ScootersNum - cat;
var NextScooter = cat + 1;

// -------------------- picture showing BEGIN -----------------------

for (var i = 0; i < ShowVehiclePictureStatus.length; i++) ShowVehiclePictureStatus[i] = false;
for (var i = 1; i <= ScootersNum; i++) 
  {
  if (ShowVehiclePicture[document.getElementById("PassengersPerScooter" + i).options.selectedIndex] && !ShowVehiclePictureStatus[document.getElementById("PassengersPerScooter" + i).options.selectedIndex]) 
  ShowVehiclePictureStatus[document.getElementById("PassengersPerScooter" + i).options.selectedIndex] = true;
  }

for (var i = 0; i < ShowVehiclePictureStatus.length; i++)
  if (ShowVehiclePictureStatus[i]) document.getElementById("RentedVehicles").getElementsByTagName('div')[i].style.display = 'block';
  else document.getElementById("RentedVehicles").getElementsByTagName('div')[i].style.display = 'none';

// -------------------- picture showing END -----------------------

if (ScooterLimit >= 2)
 {
 if (PassPerScooter.options.selectedIndex == 0) PassPerScooter.options.selectedIndex = 1;
 return;
 }

var StartDate = document.getElementById("SDate" + cat);
var StartTime = document.getElementById("STime" + cat);
var RentTerms = document.getElementById("RentalTerms" + cat);
var ScooterDiv = document.getElementById("Scooter" + NextScooter);
var TheSameDates = document.getElementById("SameDatesTime" + cat); 

if (PassPerScooter.options.selectedIndex == 0 )
 {
 if (NextScooter <= 4)
  {
  if (NextScooter == 4 && document.getElementById("PassengersPerScooter" + NextScooter).options.selectedIndex != 0) 
   {
   PassPerScooter.options.selectedIndex = 1;
   return;
   }
  ScooterDiv.style.display = "none";
  ScootersNum = cat;
  }

 if (document.getElementById("SameDatesTime" + cat)) 
  { 
  TheSameDates.checked = false; 
  TheSameDates.disabled = true; 
  }
 StartDate.value = "";
 StartDate.disabled = true;
 StartTime.options.selectedIndex = 0;
 StartTime.disabled = true; 
 RentTerms.options.selectedIndex = 0;
 RentTerms.disabled = true;
 ReservedScootersNum--;
 document.getElementById("ResScootersNum").value = ReservedScootersNum;
 }
else { 
     if (document.getElementById("SameDatesTime" + cat)) 
      {
      TheSameDates.disabled = false; 
      }
     if (RentTerms.disabled) { ReservedScootersNum++; document.getElementById("ResScootersNum").value = ReservedScootersNum; }
     StartDate.disabled = false;
     StartTime.disabled = false; 
     RentTerms.disabled = false;
     if (NextScooter <= 4) ScooterDiv.style.display = "block"; 
     if (ScooterStatus[cat] != "built" && NextScooter <= 4) 
      {
      var _SDate = "SDate" + NextScooter;
           
      AddScooter(NextScooter);
      ScooterDiv.innerHTML = ScooterBuild;
      Calendar.setup({
               inputField     :    _SDate,                       // id of the input field
               ifFormat       :    "%m/%d/%Y",                     // format of the input field
               button         :    _SDate,                         // trigger for the calendar (button ID)
               align          :    "Bl",                          // alignment (defaults to "Bl")
               weekNumbers    :    false,
               showOthers     :    true,
               cache          :    true,
               disableFunc    :    DisabledDays,
               singleClick    :    true});
      ScooterStatus[cat] = "built";
      }
     if (NextScooter <= 4) ScootersNum = NextScooter;
     }

}

function AddScooter(Num) {
    ScooterBuild = "             <hr  noshade color='#193A7C'>";
    ScooterBuild += "            <table width='90%' align='center' class='Text3'>";
    ScooterBuild += "             <tr>";
    if (Num == 2) ScooterBuild += "                <td width='50%'>" + Num + "nd";   
    if (Num == 3) ScooterBuild += "                <td width='50%'>" + Num + "rd"; 
    if (Num == 4) ScooterBuild += "                <td width='50%'>" + Num + "th"; 
                  ScooterBuild += " Vehicle Type:</td><td width='50%'>Pick up date (mm/dd/yyyy):</td>";
    ScooterBuild += "             </tr>";
    ScooterBuild += "             <tr>";
    ScooterBuild += "                 <td>";
    ScooterBuild += "                 <select size='1' name='PassengersPerScooter"+ Num + "' id='PassengersPerScooter"+ Num + "' onchange='UpdateDivs(" + Num + ");DoCalculate(" + Num + ");'>";
    ScooterBuild += "                    <option selected='selected'>NONE</option>";
    ScooterBuild += "                    <option value='Scooter 49cc (1 Passenger)'>Scooter 49cc (1 Passenger)</option>";
    ScooterBuild += "                    <option value='Scooter 49cc (2 Passengers)'>Scooter 49cc (2 Passengers)</option>";
	ScooterBuild += "                    <option value='Scooter 250cc (2 Passengers)'>Scooter 250cc (2 Passengers)</option>";
	ScooterBuild += "                    <option value='Buggy 3 Wheels (2 Passengers)'>Buggy 3 Wheels (2 Passengers)</option>";
	ScooterBuild += "                    <option value='Tango 3 Wheels (2 Passengers)'>Tango 3 Wheels (2 Passengers)</option>";
	ScooterBuild += "                    <option value='Hummer H3 (4 Passengers)'>Hummer H3 (4 Passengers)</option>";
	ScooterBuild += "                    <option value='Escalade (4 Passengers)'>Escalade (4 Passengers)</option>";
	ScooterBuild += "                    <option value='Roadster (4 Passengers)'>Roadster (4 Passengers)</option>";
	ScooterBuild += "                    <option value='Bicycle'>Bicycle</option>";
    ScooterBuild += "                 </select><br><br>";
    ScooterBuild += "                 </td>";
    ScooterBuild += "                 <td>";
    ScooterBuild += "                 <input name='SDate" + Num + "' id='SDate" + Num + "' size='11' maxlength='10' disabled><br><br>";
    ScooterBuild += "                 </td>";
    ScooterBuild += "             </tr>";
    ScooterBuild += "             <tr>";
    ScooterBuild += "                <td>Select a length of the rental term:</td><td>Pick up time:</td>";
    ScooterBuild += "             </tr>";
    ScooterBuild += "             <tr>";
    ScooterBuild += "             <td>";
    ScooterBuild += "             <select onchange='DoCalculate(" + Num + ");' name='RentalTerms" + Num + "' id='RentalTerms" + Num + "' disabled>";
    ScooterBuild += "                    <option selected='selected'>Select a term</option>";
    ScooterBuild += "                    <option value='2 hours'>2 hours</option>";
    ScooterBuild += "                    <option value='4 hours'>4 hours</option>";
    ScooterBuild += "                    <option value='Day 10am - 7pm'>Day 10am - 7pm</option>";
    ScooterBuild += "                    <option value='24 hours'>24 hours</option>";
    ScooterBuild += "                    <option value='2 Days'>2 Days</option>";
    ScooterBuild += "                    <option value='3 Days'>3 Days</option>";
    ScooterBuild += "                    <option value='4 Days'>4 Days</option>";
    ScooterBuild += "                    <option value='5 Days'>5 Days</option>";
    ScooterBuild += "                    <option value='6 Days'>6 Days</option>";
    ScooterBuild += "                    <option value='7 Days'>7 Days</option>";
    ScooterBuild += "              </select><br><br>";
    ScooterBuild += "              </td>";
    ScooterBuild += "                 <td>";
    ScooterBuild += "                 <select name='STime" + Num + "' id='STime" + Num + "' disabled>";
    ScooterBuild += "                      <option selected='selected'>Select</option><option value='10 am'>10:00 a.m.</option>";
    ScooterBuild += "                      <option value='11 am'>11:00 am</option>";
    ScooterBuild += "                      <option value='12 noon'>12:00 noon</option>";
    ScooterBuild += "                      <option value='1 pm'>1:00 pm</option>";
    ScooterBuild += "                      <option value='2 pm'>2:00 pm</option>";
    ScooterBuild += "                      <option value='3 pm'>3:00 pm</option>";
    ScooterBuild += "                      <option value='4 pm'>4:00 pm</option>";
    ScooterBuild += "                      <option value='5 pm'>5:00 pm</option>";
    ScooterBuild += "                      <option value='6 pm'>6:00 pm</option>";
    ScooterBuild += "                      <option value='7 pm'>7:00 pm</option>";
    ScooterBuild += "                 </select><br><br>";   
    ScooterBuild += "                 </td>";
    ScooterBuild += "             </tr>";
    ScooterBuild += "             <tr>";
    ScooterBuild += "                <td>";
    ScooterBuild += "                  <div id='Result" + Num + "'>Total: <b>NONE</b></div>";
    ScooterBuild += "                  <input type='hidden' id='TotalResult" + Num + "' name='TotalResult" + Num + "' value='Total: <b>NONE</b>'>";
    ScooterBuild += "                </td>";
    ScooterBuild += "                <td><input id='SameDatesTime" + Num + "' name='SameDatesTime" + Num + "' type='checkbox' onClick='SetTheSameDates(" + Num + ")' disabled>Use the same rental terms as for the 1st one</td>"; 
    ScooterBuild += "             </tr>";
    ScooterBuild += "           </table>";
    ScootersNum = Num;
}

/*** ------ END ---------------- Main functions to do calculations ----------- END ----------------  ***/
