<script language=vbscript>
SetLocale(11274)
function validarFecha()
ok=1
if form1.location.value="-1" then
ok=0
msgbox "Please select the pick up location"
else
if form1.Location2.value="-1" then
ok=0
msgbox "Please select the drop off location"
else
if not isdate(form1.DiaPickUp.value + "/" + form1.MesAnoPickUp.value) then
msgbox "Please complete a valid PickUp date"
ok=0
else
if not isdate(form1.DiaDrop.value + "/" + form1.MesAnoDrop.value) then
msgbox "Please complete a valid Drop Of date"
ok=0
else
if datediff("d",date(),form1.DiaPickUp.value + "/" + form1.MesAnoPickUp.value) <2 then
ok=0
msgbox "You only can make reservations 2 days ahead from the present date."
else
if datediff("d",form1.DiaPickUp.value + "/" + form1.MesAnoPickUp.value,form1.DiaDrop.value + "/" + form1.MesAnoDrop.value)<=0 then
msgbox "The Drop of date have to be greater than Pick Up date"
ok=0
end if
end if
end if
end if
end if
end if
if ok=1 then
form1.CantDias.value = datediff("d",form1.DiaPickUp.value + "/" + form1.MesAnoPickUp.value,form1.DiaDrop.value + "/" + form1.MesAnoDrop.value)
form1.FechaPU.value = form1.DiaPickUp.value + "/" + form1.MesAnoPickUp.value
form1.FechaDO.value = form1.DiaDrop.value + "/" + form1.MesAnoDrop.value
validarFecha=cbool(True)
else
validarFecha=cbool(False)
end if
end function
</script>