

top.frames[2].location = "InstrRoomAvail.asp"


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 > 1)
  {
    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 <= "9"))
  {
    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;
	document.IQ_Form1.CheckInYear.selectedIndex  =  year;
    mywindow.close();
}

function checkoutrestart() {

	document.IQ_Form1.CheckOutMonth.selectedIndex  =  month;
	document.IQ_Form1.CheckOutDay.selectedIndex  =  day;
	document.IQ_Form1.CheckOutYear.selectedIndex  =  year;
    mywindow.close();
}


function setCheckInDate(y,m,d) {
	var f = document.forms['IQ_Form1'];
	f.CheckInMonth.selectedIndex  =  m;
	f.CheckInDay.selectedIndex  =  d;
	f.CheckInYear.selectedIndex  =  y;
};
function CheckInCal(a) {
	 cal.setReturnFunction("setCheckInDate");
	 cal.showCalendar(a);
}
function setCheckOutDate(y,m,d) {
	var f = document.forms['IQ_Form1'];
	f.CheckOutMonth.selectedIndex  =  m;
	f.CheckOutDay.selectedIndex  =  d;
	f.CheckOutYear.selectedIndex  =  y;
};
function CheckOutCal(a) {
	 cal.setReturnFunction("setCheckOutDate");
	 cal.showCalendar(a);
}