var now = new Date();
var cal1 = new CalendarPopup("cal_div");
cal1.setCssPrefix("my");
cal1.showNavigationDropdowns();
cal1.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
cal1.setYearSelectStartOffset(1);


function enableOtherTextField(){
	var elem = document.getElementById('othercityname');
	elem.readOnly=false;
	elem.focus();
}

function submitSearch(){
  document.getElementById("id-submit").disabled=true;
	document.getElementById("id-searchform").submit();
}

function adjustOccupancyRows(){
	var elem = document.getElementById('roomsCountId');

var text = '';
	for(i = 0; i < elem.value; i++) {
		text += 'Room ';
		text += eval(i+1);
		text += '&nbsp;&nbsp;';
		text += 'Adults:&nbsp;';
		text += '<select name="roomOccupancies['+i+'].numberOfAdults"';
		text += ' size="1" class="select01">';
		text += '<option value="1">1</option>';
		text += '<option value="2" selected>2</option>';
		text += '<option value="3">3</option>';
		text += '<option value="4">4</option>';
		text += '</select>';
		text += '&nbsp;&nbsp;Children:&nbsp;';
		text += '<select name="roomOccupancies['+i+'].numberOfChildren"';
		text += ' size="1" class="select01">';
		text += '<option value="0">0</option>';
		text += '<option value="1">1</option>';
		text += '<option value="1">2</option>';
		text += '</select>';
		text += '<p class="small"/>';
	}
	text += '';
	document.getElementById('roomsOccupanciesDiv').innerHTML = text;
}
