<!--
var day="";

var month="";

var myweekday="";

var year="";

mydate = new Date();

myday = mydate.getDay();

mymonth = mydate.getMonth();

myweekday= mydate.getDate();

weekday= myweekday;

myyear= mydate.getYear();

year = myyear

if(myday == 0)

day = " Sunday "      

else if(myday == 1)

day = " Monday "

else if(myday == 2)

day = " Tuesday "   

else if(myday == 3)

day = " Wednesday "   

else if(myday == 4)

day = " Thursday "

else if(myday == 5)

day = " Friday "

else if(myday == 6)

day = " Saturday "

if(mymonth == 0) {

month = "January "}

else if(mymonth ==1)

month = "February "

else if(mymonth ==2)

month = "March "

else if(mymonth ==3)

month = "April "

else if(mymonth ==4)

month = "May "

else if(mymonth ==5)

month = "June "

else if(mymonth ==6)

month = "July "

else if(mymonth ==7)

month = "August "

else if(mymonth ==8)

month = "September "

else if(mymonth ==9)

month = "October "

else if(mymonth ==10)

month = "November "

else if(mymonth ==11)

month = "December "

function is_selected(item, msg) {
        if (item.selectedIndex == 0) {
                alert(msg)
                return false
        }
		return true;
}

function is_not_empty(item, msg)
{
        if (item.value.length > 0)
               return true
        else
        {
               alert("Please fill in your " + msg)
                return false
        }
}

function is_number(item, msg){
	if (isFinite(item.value)) { // the value is a Finite number
		return true;
	}
	else {
		alert("Please provide a valid number for the " + msg);
		return false;
	}
}

function is_email(item)
{
        var mhkos = item.value.length
        var papaki = item.value.indexOf("@")
        var teleia = item.value.lastIndexOf(".")
        if (mhkos>4 && papaki>0 && teleia>papaki+1)
                return true
        alert("Please fill in a proper e-mail so we can contact you")
        return false
}

function is_selected(item, msg) {
	if (item.selectedIndex == 0) {
		alert(msg)
		return false
	}
	return true
}

function check_dates (f) {
        if (f.Pickup_Day.selectedIndex == 0) {
                alert("Please select the Pick-up Day")
                return false
        }
        if (f.Pickup_Month.selectedIndex == 0) {
                alert("Please select the Pick-up Month")
                return false
        }
        if (f.Pickup_Year.selectedIndex == 0) {
                alert("Please select the Pick-up Year")
                return false
        }
        if (f.Delivery_Day.selectedIndex == 0) {
                alert("Please select the Drop Off Day")
                return false
        }
        if (f.Delivery_Month.selectedIndex == 0) {
                alert("Please select the Drop Off Month")
                return false
        }
        if (f.Delivery_Year.selectedIndex == 0) {
                alert("Please select the Drop Off Year")
                return false
        }
		// check if Pick-up date > delivery date
		if (f.Pickup_Year.selectedIndex > f.Delivery_Year.selectedIndex) {
				alert("The Pick-Up Year must be less than the Drop Off Year. Please correct the dates")
				return false
		}
		if (f.Pickup_Year.selectedIndex == f.Delivery_Year.selectedIndex) {
			if (f.Pickup_Month.selectedIndex > f.Delivery_Month.selectedIndex) {
				alert("The Pick-Up Month must be less than the Drop Off Month. Please correct the dates")
				return false
			}
			if (f.Pickup_Month.selectedIndex == f.Delivery_Month.selectedIndex) {
				if (f.Pickup_Day.selectedIndex >= f.Delivery_Day.selectedIndex) {
					alert("The Pick-Up Day must be less than the Drop Off Day. Please correct the dates")
					return false
				}
				if ((f.Pickup_Day.selectedIndex == (f.Delivery_Day.selectedIndex-2)) || (f.Pickup_Day.selectedIndex == (f.Delivery_Day.selectedIndex-1))) {
					alert("IMPORTANT NOTICE!\nThis is an \"One or Two Days Reservation\".\n Prices are on request. Please contact us.")
					return true
				}
			}
		}
        return true
}

function form_ok(f)
{
        if  (
            is_not_empty(f.Name, "Name") &&
            is_not_empty(f.telephone, "Telephone Number") &&
//            is_number(f.telephone, "Telephone Number") &&
            is_email(f.Email) &&
            is_not_empty(f.birthday, "Date of Birth") &&
            check_dates(f) &&
            is_selected(f.Pickup_Time, "Please select the Pick-up Time") &&
		 is_selected(f.DropOff_Time, "Please select the Drop Off Time")
            )
     {
return true
     }
        return false
}
//-->

