function changeMaxPersonas()
{
	var zn = document.getElementById("zona");
	var val = zn.options[zn.selectedIndex].value;
	var lst = val.split("|||");
	intiNumPersonas(lst[1]);
}
function intiNumPersonas(maxpeople)
{
	var h = document.getElementById("numPersonas").options;
	for (n=h.length-1; n>=0; n--)
	{
		h[n] = null;
	}
	for (n=0; n<= maxpeople-1; n++)
	{
		t = n+1;
		v = n+1;
		if (n < 10) {t = "0"+t;}
		h[n] = new Option(t,v);
	}
}
window.onLoad = changeMaxPersonas;

function checkCampos(){
	
	date1 = document.getElementById("fecha_ini");
	date2 = document.getElementById("fecha_fin");
	nPer = document.getElementById("numPersonas");
	//zona = document.getElementById("zona");
	Error = 0;
	if (date1.value == "")
	{
		Error = 1;
	}
	if (date2.value == "")
	{
		Error = 2;
	}
	if (nPer.value == "")
	{
		Error = 3;
	}
	/*if (zona.value == "")
	{
		Error = 4;
	}*/
	if (Error != 0) {alert("Rellene todos los campos correspondientes.");return false;}
	return true;
}


<!--  to hide script contents from old browsers
var startDate;
var endDate;
var ONEDAY = 3600 * 24;

function resetDates() {
	startDate = endDate = null;
}

function filterDates1(cal) {
	startDate = cal.date.getTime();
	/* If they haven't chosen an 
	end date before we'll set it to the same date as the start date This
	way if the user scrolls in the start date 5 months forward, they don't
	need to do it again for the end date.
	*/

	/*if (endDate == null) { 
		Zapatec.Calendar.setup({
			inputField     :    "arrivalDate",
			button         :    "button8b",  // What will trigger the popup of the calendar
			ifFormat       :    "%b %d, %Y",
			date           :     cal.date,
			showsTime      :     false,          //no time
			dateStatusFunc		:    disallowDateBefore, //the function to call
			onUpdate       :    filterDates2
		});
	}*/
}


function filterDates2(cal) {
	var date = cal.date;
	endDate = date.getTime()
}

/*
* This functions return true to disallow a date
* and false to allow it.
*/


/* 
* Can't choose days before today or before the
* end date
*/
function disallowDateBefore(date) {
	date = date.getTime();
	if ((startDate != null) && (date < (startDate + ONEDAY))) {
		//start date can't be prior to end date
		return true; 
	} 
	var now = new Date().getTime();
	if (date < (now - ONEDAY)) {
		//start date can't be prior to today
		return true;
	}

	return false;
}

/* 
* Can't choose days before today or before the
* start date
*/
function disallowDateAfter(date) {
	date = date.getTime();
	if ((endDate != null) && (date > (endDate - ONEDAY))) {
		//end date can't be before start date
		return true;
	} 
	var now = new Date().getTime();
	if (date < (now - ONEDAY)) {
		//end date can't be prior to today
		return true;
	}
	dd = new Date(date);
	dateIsSpecial(dd.getFullYear(), dd.getMonth(), dd.getDay());
	return false;
}

function dateIsSpecial(year, month, day) {
		/*for (ii = 0; ii < diasReservados.length; ii++) {
			if (((diasReservados[ii] [0]) == month) &&
			(((diasReservados[ii] [1]) == day))) {
				return true;
			}
		}*/
		return false;
	};