///Esta variable dice cuántos días después empieza a contar el calendariovar diasmas = 2catTree = [["", "Origen", [["", "Destino"]]],["BCN", "Barcelona", [["AMS", "Amsterdam"],["ROM","Roma"]]],["MAD", "Madrid", [["MAD", "Barcelona"],["PAR","Paris"]]]	];function init1() {fillDayDropdown(document.flightsearch.depdateday,true,false,true);fillMonthDropdown2(document.flightsearch.depdatemonth,true,false,true);}function init2(){	fillDayDropdown(document.fs_portal.D_Day,true,false,true);	fillMonthDropdown(document.fs_portal.D_Month,true,false,true);	fillDayDropdown(document.fs_portal.R_Day,false,false,true);	fillMonthDropdown(document.fs_portal.R_Month,false,false,true);}function init3(){	fillDayDropdown(document.fs_portal.D_Day,true,false,true);	fillMonthShortDropdown(document.fs_portal.D_Month,true,false,true);	fillDayDropdown(document.fs_portal.R_Day,false,false,true);	fillMonthShortDropdown(document.fs_portal.R_Month,false,false,true);		fillTimeDropdown(document.fs_portal.D_Time,false,true,"")	fillTimeDropdown(document.fs_portal.R_Time,false,true,"")		fillPeopleDropdown(document.fs_portal.R_Adults,true,false,true);}function init4(){	fillTimeDropdown(document.fs_portal.D_Time,false,true,"")	fillTimeDropdown(document.fs_portal.R_Time,false,true,"")		fillPeopleDropdown(document.fs_portal.R_Adults,true,false,true);}function fillPeopleDropdown2(list,leaveBlank,set,value){	var ind = 0;	var sel = 0;		for (var i = 1; i <= 9 ; i++) {		var st = i.toString();		list.options[ind] = new Option(st, i, (value==i)?true:false);		if (value == i) sel = ind;		ind++;	}	list.selectedIndex = 0;}function initHomeSearchAmadeus3(show0){	fillTimeDropdownExt(document.flightsearch.departureTime, false, true, "");	fillTimeDropdownExt(document.flightsearch.returnTime, false, true, "");	if (show0 == null) { 		fillPeopleDropdown(document.flightsearch.adults,true,false,true);	} else {		fillPeopleDropdown2(document.flightsearch.adults,true,false,true);	}		document.flightsearch.depDate.value = getDatePlusNdays(7);	document.flightsearch.retDate.value = getDatePlusNdays(10);	}function initAirLinePage(){	fillDayDropdown(document.fs_portal.D_Day,true,false,true);	fillMonthShortDropdown(document.fs_portal.D_Month,true,false,true);	fillDayDropdown(document.fs_portal.R_Day,false,true,"");	fillMonthShortDropdown(document.fs_portal.R_Month,false,true,"");		fillTimeDropdown(document.fs_portal.D_Time,false,true,"")	fillTimeDropdown(document.fs_portal.R_Time,false,true,"")	fillPeopleDropdown(document.fs_portal.R_Adults,true,false,true);	fillPeopleDropdown(document.fs_portal.R_Childs,false,false,true);	fillPeopleDropdown(document.fs_portal.R_Infants,false,false,true);}function initAirLineLH(){	/*combolino = document.fs_portal.D_City;	for (i = 0; i < catTree.length; i++) {		var cat1 = new Option(catTree[i][1], catTree[i][0]);		combolino.options[i] = cat1;	}*/	fillDayDropdown(document.fs_portal.D_Day,true,false,true);	fillMonthShortDropdown(document.fs_portal.D_Month,true,false,true);	fillDayDropdown(document.fs_portal.R_Day,true,false,true);	fillMonthShortDropdown(document.fs_portal.R_Month,true,false,true);		fillTimeDropdown(document.fs_portal.D_Time,false,true,"")	fillTimeDropdown(document.fs_portal.R_Time,false,true,"")	fillPeopleDropdown(document.fs_portal.R_Adults,true,false,true);	fillPeopleDropdown(document.fs_portal.R_Childs,false,false,true);	fillPeopleDropdown(document.fs_portal.R_Infants,false,false,true);}function populate () {	combolotto = document.fs_portal.A_City;	indice = document.fs_portal.D_City.selectedIndex;	cat1 = catTree[indice][2];		for (j = combolotto.length; j > 0; j--) {    	combolotto.options[j] = null;    }    for (k = 0; k < cat1.length; k++) {	    var cat2 = new Option(cat1[k][1], cat1[k][0]);    	combolotto.options[k] = cat2;    } }var today = new Date();var minDate = new Date(Date.parse((parseInt(today.getMonth()) + 1) + "/" + (parseInt(today.getDate()) + diasmas) + "/" + today.getFullYear()));var minDate2 = new Date(Date.parse((parseInt(today.getMonth()) + 1) + "/" + (parseInt(today.getDate()) + 6) + "/" + today.getFullYear()));var maxDate = new Date(Date.parse((parseInt(today.getMonth()) + 12) + "/" + today.getDate() + "/" + today.getFullYear()));function reserveLines(number,cont){for (i=1;i<=number;i++) {document.write('<option value="">' + cont + '</option>');}}function fillDayDropdown(list,salida,leaveBlank,set,value){var ind = 0;if (salida) {var val = minDate.getDate();}else  {var val = minDate2.getDate();}if (leaveBlank)	{list.options[ind] = new Option("", "", false);ind++;}for (var i = 1; i <= 31 ; i++) {list.options[ind] = new Option(i, i, false);if (i == val) sel = ind;ind++;}if (set) {list.options.selectedIndex = sel;}else {list.options.selectedIndex = 0;}}function fillTimeDropdown(list,leaveBlank,set,value){	var d = today.getDate();	var ind = 0;	var sel = 0;		if (leaveBlank)	{		list.options[0] = new Option("", "", (value=="")?true:false);		ind++;	} 	list.options[ind] = new Option("(N.I.)", "ANY", (value=="ANY")?true:false);	if (value == "ANY") sel = ind; ind++;	list.options[ind] = new Option("00:00", "24", (value=="24")?true:false);	if (value == "24") sel = ind; ind++;	for (var i = 1; i <= 23 ; i++)	{		var st = (i<10)?"0"+i.toString():i.toString();		list.options[ind] = new Option(st+":00", i, (value==i)?true:false);		if (value == i) sel = ind;		ind++;	}	list.selectedIndex = 0;}function fillPeopleDropdown(list,leaveBlank,set,value){	var ind = 0;	var sel = 0;		if (leaveBlank)	{		list.options[0] = new Option("elige...", "1", (value=="")?true:false);		ind++;	}	else {		list.options[ind] = new Option("elige...", "0", (value=="")?true:false);		ind++;		} 	for (var i = 0; i <= 9 ; i++) {		var st = i.toString();		list.options[ind] = new Option(st, i, (value==i)?true:false);		if (value == i) sel = ind;		ind++;	}	list.selectedIndex = 0;}function fillMonthDropdown(list,salida,leaveBlank,set,value){var sel = list.options.SelectedIndex;var m = today.getMonth() + 1;var y = today.getFullYear();var mnames = new Array("","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");var mdays = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);var ind = 0;if (salida) {var val = minDate.getMonth() + 1;}else  {var val = minDate2.getMonth() + 1;}if (leaveBlank)	{list.options[0] = new Option("", "", (value=="")?true:false);ind++;}for (var i = m; i <= 12 ; i++) {var sm = (i<10)?"0"+i.toString():i.toString();var ym = y.toString() + sm;list.options[ind] = new Option(mnames[i], ym, false);if (i == val) sel = ind;ind++;}y = y + 1;for (var i = 1; i < m ; i++) {var sm = (i<10)?"0"+i.toString():i.toString();var ym = y.toString() + sm;list.options[ind] = new Option(mnames[i], ym, false);if (i == val) sel = ind;ind++;}if (set) {list.options.selectedIndex = sel;}else {list.options.selectedIndex = 0;}}function fillMonthShortDropdown(list,salida,leaveBlank,set,value){	var sel = list.options.SelectedIndex;	var m = today.getMonth() + 1;	var y = today.getFullYear();	var mnames = new Array("","Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic");	var mdays = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);	var ind = 0;	if (salida) 	{		var val = minDate.getMonth() + 1;	}	else  {		var val = minDate2.getMonth() + 1;	}	if (leaveBlank)		{		list.options[0] = new Option("", "", (value=="")?true:false);		ind++;	}	for (var i = m; i <= 12 ; i++) 	{		var sm = (i<10)?"0"+i.toString():i.toString();		var ym = y.toString() + sm;		list.options[ind] = new Option(mnames[i], ym, false);		if (i == val) sel = ind;		ind++;	}	y = y + 1;	for (var i = 1; i < m ; i++) 	{		var sm = (i<10)?"0"+i.toString():i.toString();		var ym = y.toString() + sm;		list.options[ind] = new Option(mnames[i], ym, false);		if (i == val) sel = ind;		ind++;	}	if (set) 	{		list.options.selectedIndex = sel;	}	else 	{		list.options.selectedIndex = 0;	}}function moredestinations(){if (document.packagesearch.elements['selectDestination'].options[packagesearch.elements['selectDestination'].selectedIndex].value == "more"){document.location = "/viajes/";}}function checkForm(form){	// calculation of dates used to check the search form	var dDay = new String(form.D_Day.options[form.D_Day.selectedIndex].value);	var dMonth = new String(form.D_Month.options[form.D_Month.selectedIndex].value);	var rDay = new String(form.R_Day.options[form.R_Day.selectedIndex].value);	var rMonth = new String(form.R_Month.options[form.R_Month.selectedIndex].value);	var depDate = new Date(Date.parse(dMonth.substring(4,6) + "/" + dDay + "/" + dMonth.substring(0,4))); 	var retDate = new Date(Date.parse(rMonth.substring(4,6) + "/" + rDay + "/" + rMonth.substring(0,4))); 	var RightNow = new Date()	var Hr = RightNow.getHours() + 1	//	alert(parseInt(dMonth.substring(4,6)) +" - "+ parseInt(RightNow.getMonth() + 1));//	alert(parseInt(dDay) +" - "+ (parseInt(today.getDate()) + diasmas));	// Controla si quiere irse demasiado pronto		if (parseInt(dMonth.substring(4,6)) == parseInt(RightNow.getMonth() + 1))	{	 	if (parseInt(dDay) == (parseInt(today.getDate()) + diasmas))		{		document.fs_portal.D_Time.value = Hr;		}	}		// check destination city	var	re = new RegExp("[A-Za-z0-9]"); // can refine the regular expression!	var chars = form.A_City.value.search(re);	if (chars < 0) {			alert("Debes introducir una ciudad o aeropuerto de destino");			form.A_City.focus();			return false;	}	// check departure city	var	re = new RegExp("[A-Za-z0-9]"); // can refine the regular expression!	var chars = form.D_City.value.search(re);	if (chars < 0) {			alert("Debes introducir una ciudad o aeropuerto de salida");			form.A_City.focus();			return false;	}	// check departure date	if (depDate < minDate || depDate > maxDate)	{		alert("La fecha de salida debe ser entre 24 horas y 11 meses");		form.D_Day.focus();		return false;	}	// check return date only if necessary	if (rDay == "" && rMonth == "")	{		form.TripType.value = "1"; // it's a one way trip	}	else	{		// check if the date is not complete		if (isNaN(retDate)) {			alert("Indica una fecha de retorno completa o dejas el campo en blanco");			form.R_Day.focus();			return false;		}		// check if it's valid		if (retDate < minDate || retDate > maxDate)	{			alert("La fecha de retorno debe ser posterior a la salida");			form.R_Day.focus();			return false;		}		// check if it's after departing date		if (depDate > retDate)	{			alert("La fecha de retorno debe ser posterior a la salida");			form.R_Day.focus();			return false;		}		form.TripType.value = "2"; // it's a roundtrip	}	return true;}function setSearchtermDest(){	var index = document.flightsearch.selectDestination.selectedIndex;	document.flightsearch.searchterm.value=document.flightsearch.selectDestination.options[index].value;	document.flightsearch.selectActivity.value="-1";}function setSearchtermDest2(){	var index = document.packagesearch.selectDestination.selectedIndex;	document.packagesearch.searchterm.value=document.packagesearch.selectDestination.options[index].value;}function setSearchtermAct(){	var index = document.flightsearch.selectActivity.selectedIndex;	document.flightsearch.searchterm.value=document.flightsearch.selectActivity.options[index].value;	document.flightsearch.selectDestination.value="-1";}function voidSearchterm(){	var index1 = document.flightsearch.selectActivity.selectedIndex;	var index2 = document.flightsearch.selectDestination.selectedIndex;	var formok = true;	if (index1 == 0 && index2 == 0) 	{		alert("Debe seleccionar un destino o una actividad");		formok = (false);}	return (formok);}function checkForm2(form){	// calculation of dates used to check the search form	var dDay = new String(form.D_Day.options[form.D_Day.selectedIndex].value);	var dMonth = new String(form.D_Month.options[form.D_Month.selectedIndex].value);	var rDay = new String(form.R_Day.options[form.R_Day.selectedIndex].value);	var rMonth = new String(form.R_Month.options[form.R_Month.selectedIndex].value);	var depDate = new Date(Date.parse(dMonth.substring(4,6) + "/" + dDay + "/" + dMonth.substring(0,4))); 	var retDate = new Date(Date.parse(rMonth.substring(4,6) + "/" + rDay + "/" + rMonth.substring(0,4))); 	var RightNow = new Date()	var Hr = RightNow.getHours() + 1		var nAdults = new String(form.R_Adults.options[form.R_Adults.selectedIndex].value);		// check departure city	var	re = new RegExp("[A-Za-z0-9]"); // can refine the regular expression!	var chars = form.D_City.value.search(re);	if (chars < 0) {		alert("Debes introducir una ciudad o aeropuerto de salida");		form.D_City.focus();		return false;	}//	alert(parseInt(dMonth.substring(4,6)) +" - "+ parseInt(RightNow.getMonth() + 1));//	alert(parseInt(dDay) +" - "+ (parseInt(today.getDate()) + diasmas));	// Controla si quiere irse demasiado pronto		if (parseInt(dMonth.substring(4,6)) == parseInt(RightNow.getMonth() + 1))	{	 	if (parseInt(dDay) == (parseInt(today.getDate()) + diasmas))		{		document.fs_portal.D_Time.value = Hr;		}	}		// check departure date	if (depDate < minDate || depDate > maxDate)	{		alert("La fecha de salida debe ser entre 24 horas y 11 meses");		form.D_Day.focus();		return false;	}			// check destination city	var	re = new RegExp("[A-Za-z0-9]"); // can refine the regular expression!	var chars = form.A_City.value.search(re);	if (chars < 0) {		alert("Debes introducir una ciudad o aeropuerto de destino");		form.A_City.focus();		return false;	}	// check return date only if necessary	if (rDay == "" && rMonth == "")	{		form.TripType.value = "1"; // it's a one way trip	}	else	{		// check if the date is not complete		if (isNaN(retDate)) {			alert("Indica una fecha de retorno completa o dejas el campo en blanco");			form.R_Day.focus();			return false;		}		// check if it's valid		if (retDate < minDate || retDate > maxDate)	{			alert("La fecha de retorno debe ser posterior a la salida");			form.R_Day.focus();			return false;		}		// check if it's after departing date		if (depDate > retDate)	{			alert("La fecha de retorno debe ser posterior a la salida");			form.R_Day.focus();			return false;		}		form.TripType.value = "2"; // it's a roundtrip	}		// check number of adults	if (form.R_Adults.options[form.R_Adults.selectedIndex].value <= 0) {		alert("Debe seleccionarse un adulto como mínimo");		return false;	}		return true;}function fillMonthDropdown2(list,salida,leaveBlank,set,value){var sel = list.options.SelectedIndex;var m = today.getMonth();var mnames = new Array("","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");var mdays = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);var ind = 0;if (salida) {var val = minDate.getMonth() + 1;}else  {var val = minDate2.getMonth() + 1;}if (leaveBlank)	{list.options[0] = new Option("", "", (value=="")?true:false);ind++;}for (var i = m; i <= 11 ; i++) {var sm = (i<10)?"0"+i.toString():i.toString();list.options[ind] = new Option(mnames[i+1], sm, false);if (i == val) sel = ind;ind++;}for (var i = 0; i < m ; i++) {var sm = (i<10)?"0"+i.toString():i.toString();list.options[ind] = new Option(mnames[i+1], sm, false);if (i == val) sel = ind;ind++;}if (set) {list.options.selectedIndex = sel;}else {list.options.selectedIndex = 0;}}function checkForm4(form){	// calculation of dates used to check the search form	var tmpSal = new String(form.tmpSal.options[form.tmpSal.selectedIndex].value);	var tmpReg = new String(form.tmpReg.options[form.tmpReg.selectedIndex].value);	var dDay = tmpSal.substring(0,2);	var dMonth = tmpSal.substring(3,9);	var rDay = tmpReg.substring(0,2);	var rMonth = tmpReg.substring(3,9);	form.R_Day.value = rDay;	form.R_Month.value = rMonth;	form.D_Day.value = dDay;	form.D_Month.value = dMonth;	var depDate = new Date(Date.parse(dMonth.substring(4,6) + "/" + dDay + "/" + dMonth.substring(0,4))); 	var retDate = new Date(Date.parse(rMonth.substring(4,6) + "/" + rDay + "/" + rMonth.substring(0,4))); 		var RightNow = new Date()	var Hr = RightNow.getHours() + 1		var nAdults = new String(form.R_Adults.options[form.R_Adults.selectedIndex].value);	//	alert(parseInt(dMonth.substring(4,6)) +" - "+ parseInt(RightNow.getMonth() + 1));//	alert(parseInt(dDay) +" - "+ (parseInt(today.getDate()) + diasmas));	// Controla si quiere irse demasiado pronto		if (parseInt(dMonth.substring(4,6)) == parseInt(RightNow.getMonth() + 1))	{	 	if (parseInt(dDay) == (parseInt(today.getDate()) + diasmas))		{		document.fs_portal.D_Time.value = Hr;		}	}		// check departure date	if (depDate < minDate || depDate > maxDate)	{		alert("La fecha de salida debe ser entre 24 horas y 11 meses");		return false;	}			// check return date only if necessary	if (rDay == "" && rMonth == "")	{		form.TripType.value = "1"; // it's a one way trip	}	else	{		// check if the date is not complete		if (retDate < minDate || retDate > maxDate)	{			alert("La fecha de retorno debe ser posterior a la salida");			return false;		}		// check if it's after departing date		if (depDate > retDate)	{			alert("La fecha de retorno debe ser posterior a la salida");			return false;		}	}		// check number of adults	if (form.R_Adults.options[form.R_Adults.selectedIndex].value <= 0) {		alert("Debe seleccionarse un adulto como mínimo");		return false;	}		return true;}function checkFormAirlinePage(form){	// calculation of dates used to check the search form	var dDay = new String(form.D_Day.options[form.D_Day.selectedIndex].value);	var dMonth = new String(form.D_Month.options[form.D_Month.selectedIndex].value);	var rDay = new String(form.R_Day.options[form.R_Day.selectedIndex].value);	var rMonth = new String(form.R_Month.options[form.R_Month.selectedIndex].value);	var depDate = new Date(Date.parse(dMonth.substring(4,6) + "/" + dDay + "/" + dMonth.substring(0,4))); 	var retDate = new Date(Date.parse(rMonth.substring(4,6) + "/" + rDay + "/" + rMonth.substring(0,4))); 	var RightNow = new Date()	var Hr = RightNow.getHours() + 1	//	alert(parseInt(dMonth.substring(4,6)) +" - "+ parseInt(RightNow.getMonth() + 1));//	alert(parseInt(dDay) +" - "+ (parseInt(today.getDate()) + diasmas));	// Controla si quiere irse demasiado pronto		if (parseInt(dMonth.substring(4,6)) == parseInt(RightNow.getMonth() + 1))	{	 	if (parseInt(dDay) == (parseInt(today.getDate()) + diasmas))		{		document.fs_portal.D_Time.value = Hr;		}	}		// check departure date	if (depDate < minDate || depDate > maxDate)	{		alert("La fecha de salida debe ser entre 24 horas y 11 meses");		form.D_Day.focus();		return false;	}			// check return date only if necessary	if (rDay == "" && rMonth == "")	{		form.TripType.value = "1"; // it's a one way trip	}	else	{		// check if the date is not complete		if (isNaN(retDate)) {			alert("Indica una fecha de retorno completa o dejas el campo en blanco");			form.R_Day.focus();			return false;		}		// check if it's valid		if (retDate < minDate || retDate > maxDate)	{			alert("La fecha de retorno debe ser posterior a la salida");			form.R_Day.focus();			return false;		}		// check if it's after departing date		if (depDate > retDate)	{			alert("La fecha de retorno debe ser posterior a la salida");			form.R_Day.focus();			return false;		}		form.TripType.value = "2"; // it's a roundtrip	}		// check number of adults	if (form.R_Adults.options[form.R_Adults.selectedIndex].value <= 0) {		alert("Debe seleccionarse un adulto como mínimo");		return false;	}		return true;}function checkSearchHomeForm(form) {// check cities	if (form.departureCity.value == "")	{		alert("Debe indicar un aeropuerto de origen.");		form.departureCity.focus();		return false;	}		if (form.arrivalCity.value == "")	{		alert("Debe indicar un aeropuerto de destino.");		form.arrivalCity.focus();		return false;	}	if (form.depDate.value.length != 10) {		alert("El formato de la fecha de salida es incorrecto.");		return false;	}		if ((form.depDate.value.charAt(2) !='/') || (form.depDate.value.charAt(5) != '/'))  {		alert("El formato de la fecha de salida es incorrecto.");		return false;	}		var diafecha, mesfecha, anyofecha;	var d = new Date();	var diasmes = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];	diafecha = form.depDate.value.substring(0, 2);	mesfecha = form.depDate.value.substring(3, 5);	anyofecha = form.depDate.value.substring(6);		idep = parseInt(anyofecha + mesfecha + diafecha);	if (isNaN(diafecha) || isNaN(mesfecha) || isNaN(anyofecha)) {		alert("El formato de la fecha de salida es incorrecto.");		return false;	}		if (anyofecha < d.getYear()) {		alert("La fecha de salida es incorrecta.");		return false;	}		if ((mesfecha < 1) || (mesfecha > 12)) {		alert("La fecha de salida es incorrecta.");		return false;	}	if ((diafecha < 1) || (diafecha > diasmes[mesfecha])) {		alert("La fecha de salida es incorrecta.");		return false;	}	form.departureDate.value = diafecha + mesfecha + anyofecha;		if (form.trip.value == 1) {		if (form.retDate.value.length != 10) {			alert("El formato de la fecha de retorno es incorrecto.");			return false;		}			if ((form.retDate.value.charAt(2) !='/') || (form.retDate.value.charAt(5) != '/'))  {			alert("El formato de la fecha de retorno es incorrecto.");			return false;		}		diafecha = form.retDate.value.substring(0, 2);		mesfecha = form.retDate.value.substring(3, 5);		anyofecha = form.retDate.value.substring(6);		if (isNaN(diafecha) || isNaN(mesfecha) || isNaN(anyofecha)) {			alert("El formato de la fecha de retorno es incorrecto.");			return false;		}			if (anyofecha < d.getYear()) {			alert("La fecha de retorno es incorrecta.");			return false;		}			if ((mesfecha < 1) || (mesfecha > 12)) {			alert("La fecha de salida es incorrecta.");			return false;		}		if ((diafecha < 1) || (diafecha > diasmes[mesfecha])) {			alert("La fecha de salida es incorrecta.");			return false;		}		iret = parseInt(anyofecha + mesfecha + diafecha);				if (idep > iret) {			alert("La fecha de vuelta debe ser posterior a la de la ida.");			return false;		}		form.returnDate.value = diafecha + mesfecha + anyofecha;				if (form.searchType.options != null) {		if (idep == iret) {			form.searchType.options[1].selected = true;		}				}	}	return true;}function takeYear(theDate){	x = theDate.getYear();	var y = x % 100;	y += (y < 38) ? 2000 : 1900;	return y;}function fillTimeDropdownExt(list, leaveBlank, set, value) {	var d = today.getDate();	var ind = 0;	var sel = 0;		if (leaveBlank)	{		list.options[0] = new Option("", "", (value=="")?true:false);		ind++;	}  	list.options[0] = new Option("Lo + barato", "0000", (value=="")?true:false);	list.options[1] = new Option("a partir 09:00", "0900", (value=="")?true:false);	list.options[2] = new Option("a partir 13:00", "1300", (value=="")?true:false);	list.options[3] = new Option("a partir 16:00", "1600", (value=="")?true:false);	list.options[4] = new Option("a partir 18:00", "1800", (value=="")?true:false);	ind = 4; 	/*if (value == "") sel = ind; ind++;	 list.options[ind] = new Option("00:00", "2400", (value=="0")?true:false);	 if (value == "24") sel = ind; ind++;	for (var i = 1; i <= 23 ; i++) {		var st = (i<10)?"0"+i.toString():i.toString();		list.options[ind] = new Option(st+":00", i+"00", (value==i)?true:false);		if (value == i) sel = ind;		ind++;	} */	list.selectedIndex = 0;}function getDatePlusNdays(nDays) {	var monthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];	var today = new Date();	var day = today.getDate() + nDays;		var month = today.getMonth();	var year = today.getFullYear();	if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))      monthDays[1] = 29;		if (day > monthDays[month]) {		day = day - monthDays[month];		month = month + 1;				if (day <= 0) day = 1;	}		if (month > 11) {		month = 0;		year = year + 1;	}		month = month + 1;		if (month < 10) month = "0" + month;	if (day < 10) day = "0" + day;	return day +"/"+month+"/"+year;}function anyadirDias(pDate,pTotalDias,ptipo){	fecha= new Date(pDate.substring(3,5) + "/" + pDate.substring(0,2)+ "/" + pDate.substring(6));	fecha.setTime(fecha.getTime()+(pTotalDias*24*60*60*1000));	dia = fecha.getDate();	if (dia<10) dia = "0" + dia;	mes = fecha.getMonth()+1; if (mes<10) mes = "0" + mes;	return (ptipo=='data') ? dia+"/"+mes+"/"+takeYear(fecha) : takeYear(fecha)+""+mes+""+dia;}
