// validateRoomToAdult()
//
// @summary: Function is used to validate (and enforce) a set of rules between the rooms and the adults selector
// @params: none
// @output: none, will make the necessary changes to the DOM

function validateRoomToAdult() {
    var rooms = parseInt(document.searchForm.rooms.value);
    var guests = parseInt(document.searchForm.guests.value);

    if (rooms > guests)
    {
        document.searchForm.guests.value = document.searchForm.rooms.value;
    }

}

// validateRoomToAdult()
//
// @summary: Function is used to validate (and enforce) a set of rules between the adults and the rooms selector
// @params: none
// @output: none, will make the necessary changes to the DOM

function validateAdultToRoom() {
    var rooms = parseInt(document.searchForm.rooms.value);
    var guests = parseInt(document.searchForm.guests.value);

    if (guests < rooms)
    {
        document.searchForm.rooms.value = document.searchForm.guests.value;
    }
}
