<!--

function IQ_Form1_Validator(theForm)

{

 

 

 

  if (theForm.txtAdults.value == "")

  {

    alert("Please enter a value in the Adults field.");

    theForm.txtAdults.focus();

    return (false);

  }

 

  if (theForm.txtAdults.value.length < 1)

  {

    alert("Please enter at least 1 character in the Adults field.");

    theForm.txtAdults.focus();

    return (false);

  }

 

  if (theForm.txtAdults.value.length > 2)

  {

    alert("Please enter at most 1 character in the Adults field.");

    theForm.txtAdults.focus();

    return (false);

  }

 

  var checkOK = "0123456789-";

  var checkStr = theForm.txtAdults.value;

  var allValid = true;

  var decPoints = 0;

  var allNum = "";

  for (i = 0;  i < checkStr.length;  i++)

  {

    ch = checkStr.charAt(i);

    for (j = 0;  j < checkOK.length;  j++)

      if (ch == checkOK.charAt(j))

        break;

    if (j == checkOK.length)

    {

      allValid = false;

      break;

    }

    allNum += ch;

  }

  if (!allValid)

  {

    alert("Please enter only digit characters in the Adults field.");

    theForm.txtAdults.focus();

    return (false);

  }

 

  var chkVal = allNum;

  var prsVal = parseInt(allNum);

  if (chkVal != "" && !(prsVal >= "1" && prsVal <= "99"))

  {

    alert("Please enter a value greater than or equal to 1 and less than or equal to 9 in the Adults field.");

    theForm.txtAdults.focus();

    return (false);

  }

 

 

  if (theForm.txtChildren.value == "")

  {

    alert("Please enter a value for the Children field.  Enter 0 for no children.");

    theForm.txtChildren.focus();

    return (false);

  }

 

  if (theForm.txtChildren.value.length < 1)

  {

    alert("Please enter at least 1 characters in the Children field.");

    theForm.txtChildren.focus();

    return (false);

  }

 

  if (theForm.txtChildren.value.length > 1)

  {

    alert("Please enter at most 1 character in the Children field.");

    theForm.txtChildren.focus();

    return (false);

  }

 

  var checkOK = "0123456789-";

  var checkStr = theForm.txtChildren.value;

  var allValid = true;

  var decPoints = 0;

  var allNum = "";

  for (i = 0;  i < checkStr.length;  i++)

  {

    ch = checkStr.charAt(i);

    for (j = 0;  j < checkOK.length;  j++)

      if (ch == checkOK.charAt(j))

        break;

    if (j == checkOK.length)

    {

      allValid = false;

      break;

    }

    allNum += ch;

  }

  if (!allValid)

  {

    alert("Please enter only digit characters in the Children field.");

    theForm.txtChildren.focus();

    return (false);

  }

 

  var chkVal = allNum;

  var prsVal = parseInt(allNum);

  if (chkVal != "" && !(prsVal >= "0" && prsVal <= "9"))

  {

    alert("Please enter a value greater than or equal to 0 and less than or equal to 9 in the Children field.");

    theForm.txtChildren.focus();

    return (false);

  }

 

 

  return (true);

 

}

 

function y2k(number) { return (number < 1000) ? number + 1900 : number; }

 

var today = new Date();

var day   = today.getDate();

var month = today.getMonth();

var year  = y2k(today.getYear());

var yearindex  = null;

 

function padout(number) { return (number < 10) ? '0' + number : number; }

 

function checkinrestart() {

 

	document.IQ_Form1.CheckInMonth.selectedIndex  =  month;

	document.IQ_Form1.CheckInDay.selectedIndex  =  day-1;

	document.IQ_Form1.CheckInYear.selectedIndex  =  year-2011;

    mywindow.close();

}

 

function checkoutrestart() {

 

	document.IQ_Form1.CheckOutMonth.selectedIndex  =  month;

	document.IQ_Form1.CheckOutDay.selectedIndex  =  day-1;

	document.IQ_Form1.CheckOutYear.selectedIndex  =  year-2011;

    mywindow.close();

}

 

function setCheckInDate(y,m,d) {

	var f = document.forms['IQ_Form1'];

	f.CheckInMonth.selectedIndex  =  m-1;

	f.CheckInDay.selectedIndex  =  d-1;

	f.CheckInYear.selectedIndex  =  y-2011;

 

	d = d + 1;



 

	if (m == 2 && d == 29) 

		{

		m = 3;

		d = 1;

		}

	else 

		{

		if (m == 4 || m == 6 || m == 9 || m == 11) 

			{

	   			if (d == 31) {

			       m +=1;

				   d = 1;

				}

			}

		else

			{	if (d == 32) {

					m+=1;

					d=1;

					

					if (m == 13) {

							m = 1;

							y+=1;

						}

				}

			}

		}

	   

	f.CheckOutMonth.selectedIndex  =  m-1;

	f.CheckOutDay.selectedIndex  =  d-1;

	f.CheckOutYear.selectedIndex  =  y-2011;

 

}

 

function CheckInCal(a) {

	 cal.setReturnFunction("setCheckInDate");

	 var DateParm = (document.IQ_Form1.CheckInMonth.selectedIndex+1) + "/" + (document.IQ_Form1.CheckInDay.selectedIndex+1) + "/" + (year + document.IQ_Form1.CheckInYear.selectedIndex);

	 cal.showCalendar(a,DateParm,'mm/dd/yyyy');

}

 

function setCheckOutDate(y,m,d) {

	var f = document.forms['IQ_Form1'];

	f.CheckOutMonth.selectedIndex  =  m-1;

	f.CheckOutDay.selectedIndex  =  d-1;

	f.CheckOutYear.selectedIndex  =  y-2011;

}

 

function CheckOutCal(a) {

	 cal.setReturnFunction("setCheckOutDate");

	 var d = new Date();

	 var DateParm = (document.IQ_Form1.CheckOutMonth.selectedIndex+1) + "/" + (document.IQ_Form1.CheckOutDay.selectedIndex+1) + "/" + (d.getFullYear() + document.IQ_Form1.CheckOutYear.selectedIndex);

	 cal.showCalendar(a ,DateParm,'mm/dd/yyyy');

	

}



function setForms(){

	var cDate = new Date();

	

	document.IQ_Form1.CheckInMonth.selectedIndex = cDate.getMonth();

	document.IQ_Form1.CheckOutMonth.selectedIndex = cDate.getMonth();

	document.IQ_Form1.CheckInDay.selectedIndex = (cDate.getDate() - 1);

	document.IQ_Form1.CheckOutDay.selectedIndex = cDate.getDate();

	document.IQ_Form1.CheckInYear.selectedIndex = (2011 - cDate.getFullYear());

	document.IQ_Form1.CheckOutYear.selectedIndex = (2011 - cDate.getFullYear());

}

//-->


