function change_currency(objForm)
{
	var addiURL = objForm.hidCurrencyURL.value;

	var objCurrency = objForm.cmbCurrency;
	var objValue = objCurrency.options[objCurrency.selectedIndex].value;

	var strGetVar = HTTP_SERVER + "lodging?" + addiURL + "&currency=" + objValue;
	window.location = strGetVar;
}

function change_sort(objForm)
{
	var addiURL = objForm.hidSortURL.value;

	var objSort = objForm.cmbSortOrder;
	var objValue = objSort.options[objSort.selectedIndex].value;

	var strGetVar = HTTP_SERVER + "lodging?" + addiURL + "&sorttype=" + objValue;
	window.location = strGetVar;
}

function show_rooms(objRooms)
{
	var intNoRooms = objRooms.value;
	for(i=1; i<=8; i++)
	{
		var objDisRooms = document.getElementById("Rooms_"+i);
		if(i <= intNoRooms)
		{
			if(objDisRooms.style.display == 'none')
			{
				objDisRooms.style.display = '';
			}
		}
		else
		{
			if(objDisRooms.style.display == '')
			{
				objDisRooms.style.display = 'none';
			}
		}
	}
}

function change_child_age(objChild, Room)
{	
	var noOfRooms = Room;
	var intNoChild = objChild.value;
	var objMainAges = document.getElementById("agesChild_"+noOfRooms);
	if(intNoChild == '0')
	{
		if(objMainAges.style.display == 'none')
		{
			objMainAges.style.display = '';
		}
		else if(objMainAges.style.display == '')
		{
			objMainAges.style.display = 'none';
		}
	}
	else
	{
		objMainAges.style.display = '';

		for(i=1; i<=3; i++)
		{
			var objDisRooms = document.getElementById("childAges_"+noOfRooms+"_"+i);
			if(i <= intNoChild)
			{
				if(objDisRooms.style.display == 'none')
				{
					objDisRooms.style.display = '';
				}
			}
			else
			{
				if(objDisRooms.style.display == '')
				{
					objDisRooms.style.display = 'none';
				}
			}
		}
	}
}

function submit_hotel_search(objForm)
{
	var cityName = objForm.cmbTownCity.value;
	var intRooms = objForm.cmbRooms.value;
	var arrivalDate = objForm.txtCheckIn.value;
	var depDate = objForm.txtCheckOut.value;
	var urlAdultStr = '';
	var urlChildStr = '';
	var urlAgeStr = '';
	var currency = objForm.hidCurrency.value;
	var sorttype = objForm.hidSortType.value;

	for(i=1; i<=intRooms; i++)
	{
		//if(i != 1) urlStr = urlStr + '&';
		var objAdults = document.getElementById("cmbAdults[" + i + "]").value;
		var objChild = document.getElementById("cmbChildren[" + i + "]").value;
		urlAdultStr = urlAdultStr + 'adults['+ i +']=' + objAdults + '&';
		urlChildStr = urlChildStr + 'child['+ i +']=' + objChild + '&';
		if(objChild != '0')
		{
			for(j=1; j<=objChild; j++)
			{
				objChildAges = document.getElementById("cmbAgeChildren[" + i + "][" + j + "]").value;
				//if(j!=1)urlAgeStr = urlAgeStr + '&';
				urlAgeStr = urlAgeStr + 'childAges['+ i +'][' + j + ']=' + objChildAges + '&';
			}
		}
	}
	//alert(urlAdultStr+urlChildStr+urlAgeStr);

	var strGetVar = HTTP_SERVER + "lodging?city=" + cityName + "&checkin=" +  arrivalDate + "&checkout=" + depDate + "&room=" + intRooms +"&"+ urlAdultStr + urlChildStr + urlAgeStr + "currency=" + currency + "&sorttype=" + sorttype;
	window.location = strGetVar;
}