<!--
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)
        {
                var space = item.value.indexOf(" ");
                if (space >= 0) {
                    alert("Your e-mail contains white spaces. Please remove them and resubmit the form");
                    return false
                }
                return true
        }

        alert("Please fill in a proper e-mail so we can contact you");
        return false
}

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


   function strSelValue(selChoice) {
	return selChoice.options[selChoice.selectedIndex].value;
    }

    function intSelIndex(selChoice) {
    	return selChoice.selectedIndex;
    }

    function intSelValue(selChoice) {
    	return parseInt(strSelValue(selChoice));
    }

function check_dates (f) {
        if (f.Month.selectedIndex == 0) {
                alert("Please select the preferred Month")
                return false
        }
        if (f.Day.selectedIndex == 0) {
                alert("Please select the preferred Day")
                return false
        }
        if (f.Year.selectedIndex == 0) {
                alert("Please select the preferred Year")
                return false
        }

      // Get the current date without any time portion
      dtmCurrentDate = TodayDate;
	var intMonth = dtmCurrentDate.getMonth() + 1;
	var intDay = dtmCurrentDate.getDate();
	var intYear = dtmCurrentDate.getFullYear();
      dtmCurrentDate = new Date(intYear, intMonth-1, intDay);
      // Get Arrival Date
	intMonth = intSelIndex(f.Month);
	intDay = intSelValue(f.Day);
	intYear = intSelValue(f.Year);
	var dtmInDate = new Date(intYear,intMonth-1,intDay);
      // Check for Arrival before today
      if (dtmInDate.getTime() < dtmCurrentDate.getTime()) {
        alert("You may not request a reservation for a date that has already occurred.");
        return false;
      }


        return true
}

function is_selected(item, msg) {
        if (item.selectedIndex == 0) {
                alert("Please select " + msg)
                return false
        }

                return true;
}

function form_ok(f)
{
 if (is_selected(f.Treatment, "a Treatment") && check_dates(f) && is_not_empty(f.Name, "your Name") && is_email(f.Email)  )
 {
   return true;
 }
 else return false;
}



-->

