////////////////////////////////////////////////////////////////////////////
// city_state.js ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////

var rooms = Object();

rooms['Standard'] = 'Single|Double|Both';
rooms['Deluxe'] = 'single|double|both';


var no_of_rooms = Object();
no_of_rooms['Single'] = '1|2|3|4|5|6|7|8|9|10|11|12|13|14';
no_of_rooms['Double'] = '1|2|3|4|5|6|7|8|9|10|11|12|13|14';
no_of_rooms['Both'] = '1|2|3|4|5|6|7|8|9|10|11|12|13|14';
no_of_rooms['single'] = '1|2|3|4|5|6|7';
no_of_rooms['double'] = '1|2|3|4|5|6|7';
no_of_rooms['both'] = '1|2|3|4|5|6|7';
//Africa

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////

function setRooms()
{
	for (room_type in rooms)
		document.write('<option value="' + room_type + '">' + room_type + '</option>');
}

function set_room(oRoomSel, oCountrySel, oCity_StateSel)
{
	var countryArr;
	oCountrySel.length = 0;
	oCity_StateSel.length = 0;
	var room_type = oRoomSel.options[oRoomSel.selectedIndex].text;
	if (rooms[room_type])
	{
		oCountrySel.disabled = false;
		oCity_StateSel.disabled = true;
		oCountrySel.options[0] = new Option('Select Occupancy','');
		countryArr = rooms[room_type].split('|');
		for (var i = 0; i < countryArr.length; i++)
			oCountrySel.options[i + 1] = new Option(countryArr[i], countryArr[i]);
		document.getElementById('txtRoom').innerHTML = room_type;
		document.getElementById('txtplacename').innerHTML = '';
	}
	else oCountrySel.disabled = true;
}

function set_room_type(oCountrySel, oCity_StateSel)
{
	var city_stateArr;
	oCity_StateSel.length = 0;
	var occupancy = oCountrySel.options[oCountrySel.selectedIndex].text;
	if (no_of_rooms[occupancy])
	{
		oCity_StateSel.disabled = false;
		oCity_StateSel.options[0] = new Option('Select No of Rooms','');
		city_stateArr = no_of_rooms[occupancy].split('|');
		for (var i = 0; i < city_stateArr.length; i++)
			oCity_StateSel.options[i+1] = new Option(city_stateArr[i],city_stateArr[i]);
		document.getElementById('txtplacename').innerHTML = occupancy;
	}
	else oCity_StateSel.disabled = true;
}

function print_room_no(oCountrySel, oCity_StateSel)
{
	var occupancy = oCountrySel.options[oCountrySel.selectedIndex].text;
	var no_of_rooms = oCity_StateSel.options[oCity_StateSel.selectedIndex].text;
	if (no_of_rooms && no_of_rooms[occupancy].indexOf(no_of_rooms) != -1)
		document.getElementById('txtplacename').innerHTML = no_of_rooms + ', ' + occupancy;
	else document.getElementById('txtplacename').innerHTML = occupancy;
}// JavaScript Document
