var temporada_1_start = new Date(2008,4,1);
var temporada_1_end = new Date(2008,6,15);
var temporada_2_start = new Date(2008,6,16);
var temporada_2_end = new Date(2008,9,31);
var temporada_3_start = new Date(2008,10,1);
var temporada_3_end = new Date(2008,3,30);

var studio = new Array(39.5, 41.5, 54);
var bungalow_1 = new Array(47, 51, 59);
var bungalow_2 = new Array(70, 70, 110);
var chalet = new Array(120, 150, 195);
var hp_1 = new Array(20, 23, 34);
var hp_2 = new Array(24, 27, 39);
var cama_extra = 15.50;
var buffet_desayuno = 3.50;
var comida = 8.00;
var media_pension_valor = 11.22;

var noches_defecto = 6;
var alojamiento_defecto = 2;
var regimen_defecto = 0;
var cama_extra_defecto = 0;

var numerodias = new Array(10);
var temporadas = new Array(10);

var html_estilo_columna_izquierda_inicio = '<table width="230"><tr><td width="200" class="nobg">';
var html_estilo_columna_izquierda_final = '</td>';
var html_estilo_columna_derecha_inicio = '<td width="30" align="right" class="nobg">';
var html_estilo_columna_derecha_final = '</td></tr></table>';

var mail_estilo_columna_izquierda_inicio = '\t\t';
var mail_estilo_columna_izquierda_final = ':';
var mail_estilo_columna_derecha_inicio = '\t\t\t\t';
var mail_estilo_columna_derecha_final = '\n';
	
function traduce (texto) {
	if (language == 'de') {
		if (texto == 'MUST_WRITE_A_INT') {
			return 'Bitte geben Sie eine Zahl ein';
		}
		if (texto == 'BAD_DATE') {
			return 'Falsches Datum';
		}
		if (texto == 'TEMPORADA_HIGH') {
			return 'Hochsaison';
		}
		if (texto == 'TEMPORADA_HALF') {
			return 'Nebensaison';
		}
		if (texto == 'TEMPORADA_LOW') {
			return 'Vorsaison';
		}
		if (texto == 'NIGHTS') {
			return 'Anzahl der Nächte';
		}
		if (texto == 'studio_mp') {
			return 'Studio HP pro person';
		}
		if (texto == 'studio') {
			return 'Studio';
		}
		if (texto == 'bungalow_1_mp') {
			return 'Bungalow HP pro Person';
		}
		if (texto == 'bungalow_1') {
			return 'Bungalow (1 Zimmer)';
		}
		if (texto == 'bungalow_2') {
			return 'Bungalow (2 Zimmer)';
		}
		if (texto == 'chalet') {
			return 'Chalet';
		}
		if (texto == 'media_pension') {
			return 'Halbpension';
		}
		if (texto == 'buffet_desayuno') {
			return 'Buffet Frühstück';
		}
		if (texto == 'cena') {
			return 'Abendessen';
		}
		if (texto == 'almuerzo') {
			return "Mittagessen";
		}
		if (texto == 'desayuno') {
			return 'Frühstück';
		}
		if (texto == 'ExtraBed') {
			return 'Extra - bett';
		}
	}
	if (language == 'es') {
		if (texto == 'MUST_WRITE_A_INT') {
			return 'Debe escribir un número';
		}
		if (texto == 'BAD_DATE') {
			return 'La fecha escrita no es correcta';
		}
		if (texto == 'TEMPORADA_HIGH') {
			return 'Temporada alta';
		}
		if (texto == 'TEMPORADA_HALF') {
			return 'Temporada media';
		}
		if (texto == 'TEMPORADA_LOW') {
			return 'Temporada baja';
		}
		if (texto == 'NIGHTS') {
			return 'Número de noches';
		}
		if (texto == 'studio_mp') {
			return "Estudio con media pensión";
		}
		if (texto == 'studio') {
			return "Estudio";
		}
		if (texto == 'bungalow_1_mp') {
			return "Bungalow MP por persona";
		}
		if (texto == 'bungalow_1') {
			return "Bungalow(1 dormitorio)";
		}
		if (texto == 'bungalow_2') {
			return "Bungalow(2 dormitorios)";
		}
		if (texto == 'chalet') {
			return "Chalet";
		}
		if (texto == 'media_pension') {
			return "Media pensión";
		}
		if (texto == 'buffet_desayuno') {
			return "Buffet desayuno";
		}
		if (texto == 'cena') {
			return "Cena";
		}
		if (texto == 'almuerzo') {
			return "Almuerzo";
		}
		if (texto == 'desayuno') {
			return "Desayuno";
		}
		if (texto == 'ExtraBed') {
			return "Cama extra";
		}
	}
	
	if (language == 'en') {
		if (texto == 'MUST_WRITE_A_INT') {
			return 'You must write a number';
		}
		if (texto == 'BAD_DATE') {
			return 'The written date is not correct';
		}
		if (texto == 'TEMPORADA_HIGH') {
			return 'High stage';
		}
		if (texto == 'TEMPORADA_HALF') {
			return 'Half stage';
		}
		if (texto == 'TEMPORADA_LOW') {
			return 'Low stage';
		}
		if (texto == 'NIGHTS') {
			return 'Number of nights';
		}
		if (texto == 'studio_mp') {
			return 'Studio HB per person';
		}
		if (texto == 'studio') {
			return 'Studio';
		}
		if (texto == 'bungalow_1_mp') {
			return 'Bungalow HB per person';
		}
		if (texto == 'bungalow_1') {
			return 'Bungalow (1 Room)';
		}
		if (texto == 'bungalow_2') {
			return 'Bungalow (2 Room)';
		}
		if (texto == 'chalet') {
			return 'Chalet';
		}
		if (texto == 'media_pension') {
			return 'Average pension';
		}
		if (texto == 'buffet_desayuno') {
			return 'Buffet breakfast';
		}
		if (texto == 'cena') {
			return 'Dinner ';
		}
		if (texto == 'almuerzo') {
			return 'Lunch';
		}
		if (texto == 'desayuno') {
			return 'Breakfast';
		}
		if (texto == 'ExtraBed') {
			return 'Extra bed';
		}
	}
	
	return texto;
}
	
function inicio_calculos() {		
	//alojamiento
	if (alojamiento_defecto == 1) {
		document.getElementById('accommodation_studio').checked = true;
	}
	else {
		document.getElementById('accommodation_studio').checked = false;
	}
	if (alojamiento_defecto == 2) {
		document.getElementById('accommodation_bungalow_1').checked = true;
	}
	else {
		document.getElementById('accommodation_bungalow_1').checked = false;
	}
	if (alojamiento_defecto == 3) {
		document.getElementById('accommodation_bungalow_2').checked = true;
	}
	else {
		document.getElementById('accommodation_bungalow_2').checked = false;
	}
	if (alojamiento_defecto == 4) {
		document.getElementById('accommodation_chalet').checked = true;
	}
	else {
		document.getElementById('accommodation_chalet').checked = false;
	}
	
	//camas_extra
	document.getElementById('ExtraBed').value = cama_extra_defecto;
}

function validarEntero(valor){ 
    //intento convertir a entero. 
    //si era un entero no le afecta, si no lo era lo intenta convertir 
    valor = parseInt(valor) 

    //Compruebo si es un valor numérico 
    if (isNaN(valor)) { 
       //entonces (no es numero) devuelvo el valor cadena vacia 
       return "" 
    }else{ 
       //En caso contrario (Si era un número) devuelvo el valor 
       return valor 
    } 
} 
function validarFecha(fecha) {
	if (fecha) {  
		borrar = fecha;
		if ((fecha.substr(2,1) == "-") && (fecha.substr(5,1) == "-")){      
			for (i=0; i<10; i++){	
				if (((fecha.substr(i,1)<"0") || (fecha.substr(i,1)>"9")) && (i != 2) && (i != 5)){
					return 0;
				}  
			}
			a = fecha.substr(6,4);
			m = fecha.substr(3,2);
			d = fecha.substr(0,2);

			if ((a < 1900) || (a > 2050) || (m < 1) || (m > 12) || (d < 1) || (d > 31)) {
				return 0;
			}
			else {
				if ((a%4 != 0) && (m == 2) && (d > 28)) {
					return 0;// Año no bisiesto y es febrero y el dia es mayor a 28
				}
				else	{
					if ((((m == 4) || (m == 6) || (m == 9) || (m==11)) && (d>30)) || ((m==2) && (d>29))) {
						return 0;
					}
				}  // else
			} // fin else
		} // if ((fecha.substr(2,1) == "-") && (fecha.substr(5,1) == "-"))			    			
		else {
			return 0;
		}
	} // if (fecha)  
	
	//la fecha es posterior a la fecha actual
	
	return 1; 
}

function check(varname) {
	if (varname.name == "nights") {
	    enteroValidado = validarEntero(varname.value) 
	    if (enteroValidado == ""){ 
	       //si era la cadena vacía es que no era válido. Lo aviso 
	       alert (traduce('MUST_WRITE_A_INT')); 
	       //selecciono el texto 
	       varname.select() 
	       //coloco otra vez el foco 
	       varname.focus() 
		   return 0;
	    }
		else 
	       varname.value = enteroValidado
	}
}
function calculate_nights (fecha_inicial,fecha_final) {
	var numdias = 0;

	while (fecha_inicial.valueOf() < fecha_final.valueOf()) {
		fecha_inicial.setDate(fecha_inicial.getDate()+1);
		numdias++;
	}
	return numdias;
}

function calculate_prices() {
	//calcular el precio por dia
	var precio_alojamiento_studio = 0;
	var precio_alojamiento_bungalow_1 = 0;
	var precio_alojamiento_bungalow_2 = 0;
	var precio_alojamiento_studio_mp = 0;
	var precio_alojamiento_bungalow_1_mp = 0;
	var precio_alojamiento_bungalow_2_mp = 0;
	var precio_alojamiento_chalet = 0;
	for(i=0;i<=10;i++) {
		numerodias[i] = 0;
	}
	var fecha_inicio = document.getElementById('VonDatum.day').value+"-"+document.getElementById('VonDatum.month').value+"-"+document.getElementById('VonDatum.year').value;
	var fecha_final = document.getElementById('BisDatum.day').value+"-"+document.getElementById('BisDatum.month').value+"-"+document.getElementById('BisDatum.year').value;
	if (! validarFecha(fecha_inicio)) {
		document.getElementById('nights_label').innerHTML = '<strong style="color:red;">'+traduce('BAD_DATE')+'</strong>';
		return '';
	}
	if (! validarFecha(fecha_final)) {
		document.getElementById('nights_label').innerHTML = '<strong style="color:red;">'+traduce('BAD_DATE')+'</strong>';
		return '';
	}
	
	var vondatum = new Date(document.getElementById('VonDatum.year').value,document.getElementById('VonDatum.month').value -1,document.getElementById('VonDatum.day').value);

	var bisdatum = new Date(document.getElementById('BisDatum.year').value,document.getElementById('BisDatum.month').value-1,document.getElementById('BisDatum.day').value);

	var today = new Date();

	if (vondatum < today) {
		document.getElementById('nights_label').innerHTML = '<strong style="color:red;">'+traduce('BAD_DATE')+'</strong>';
		return '';
	}
	
	if (bisdatum < vondatum) {
		document.getElementById('nights_label').innerHTML = '<strong style="color:red;">'+traduce('BAD_DATE')+'</strong>';
		return '';
	}
	
	var difference = calculate_nights(vondatum,bisdatum);
	document.getElementById('nights_label').innerHTML = '<strong>'+difference+'</strong>';
	var temporada_label="";
	var temporada;
	var temporada_anterior = "";
	var temp = vondatum;
	temp.setYear(2000);
	var dia_actual = temp.valueOf();
	var point = 0;
	var numdias = 0;
	for (i=0;i<difference;i++) {
		//calculamos la temporada
		numdias++;
		if (dia_actual >= temporada_1_start.valueOf() && dia_actual <= temporada_1_end.valueOf()) {
			temporada = 0;
			if (temporada_label == "") {
				temporada_label = traduce('TEMPORADA_LOW');
			}
			else {
				if (temporada_anterior != 0) {
					temporada_label += ", "+traduce('TEMPORADA_LOW');
					point++;
					numdias = 1;
				}
			}
			temporada_anterior = 0;
			temporadas[point] = traduce('TEMPORADA_LOW');
		}
		else {
			if (dia_actual >= temporada_2_start.valueOf() && dia_actual <= temporada_2_end.valueOf()) {
				temporada = 1;
				if (temporada_label == "") {
					temporada_label = traduce('TEMPORADA_HALF');
				}
				else {
					if (temporada_anterior != 1) {
						temporada_label += ", "+traduce('TEMPORADA_HALF');
						point++;
						numdias = 0;
					}
				}
				temporada_anterior = 1;
				temporadas[point] = traduce('TEMPORADA_HALF');
			}
			else {
				temporada = 2;
				if (temporada_label == "") {
					temporada_label = traduce('TEMPORADA_HIGH');
				}
				else {
					if (temporada_anterior != 2) {
						temporada_label += ", "+traduce('TEMPORADA_HIGH');
						point++;
						numdias = 0;
					}
				}
				temporada_anterior = 2;
				temporadas[point] = traduce('TEMPORADA_HIGH');
			}
		}
		numerodias[point] = numdias;
		precio_alojamiento_studio += studio[temporada];
		precio_alojamiento_studio_mp += hp_1[temporada]*document.getElementById('Adults').value;
		precio_alojamiento_bungalow_1 += bungalow_1[temporada];
		precio_alojamiento_bungalow_1_mp += hp_2[temporada]*document.getElementById('Adults').value;
		precio_alojamiento_bungalow_2 += bungalow_2[temporada];
		precio_alojamiento_chalet += chalet[temporada];
		
		dia_actual += 86400000;
	}
		
	// temporada
	document.getElementById('temporada_label').innerHTML = temporada_label;
	
	document.getElementById('studio').value = precio_alojamiento_studio;
	document.getElementById('studio_label').innerHTML = Math.round(precio_alojamiento_studio*100)/100;
	document.getElementById('studio_mp').value = precio_alojamiento_studio_mp;
	document.getElementById('studio_mp_label').innerHTML = Math.round(precio_alojamiento_studio_mp*100)/100;
	
	document.getElementById('bungalow_1').value = precio_alojamiento_bungalow_1;
	document.getElementById('bungalow_1_label').innerHTML = Math.round(precio_alojamiento_bungalow_1*100)/100;
	document.getElementById('bungalow_1_mp').value = precio_alojamiento_bungalow_1_mp;
	document.getElementById('bungalow_1_mp_label').innerHTML = Math.round(precio_alojamiento_bungalow_1_mp*100)/100;
	
	document.getElementById('bungalow_2').value = precio_alojamiento_bungalow_2;
	document.getElementById('bungalow_2_label').innerHTML = Math.round(precio_alojamiento_bungalow_2*100)/100;
	
	document.getElementById('chalet').value = precio_alojamiento_chalet;
	document.getElementById('chalet_label').innerHTML = Math.round(precio_alojamiento_chalet*100)/100;
	
	alojamiento_checked = alojamiento_defecto;
	regimen_checked = regimen_defecto;
	if (document.getElementById('accommodation_studio').checked) {
		alojamiento_checked = 1;
		regimen_checked = 0;
	}
	else {
		if (document.getElementById('accommodation_studio_mp').checked) {
			alojamiento_checked = 1;
			regimen_checked = 1;
		}
		else {
			if (document.getElementById('accommodation_bungalow_1').checked) {
				alojamiento_checked = 2;
				regimen_checked = 0;
			}
			else {
				if (document.getElementById('accommodation_bungalow_1_mp').checked) {
					alojamiento_checked = 2;
					regimen_checked = 1;
				}
				else {
					if (document.getElementById('accommodation_bungalow_2').checked) {
						alojamiento_checked = 3;
						regimen_checked = 0;
					}
					else {
						if (document.getElementById('accommodation_chalet').checked) {
							alojamiento_checked = 4;
							regimen_checked = 0;
						}
					}
				}
			}
		}
	}
	
	//media pension
	media_pension = 0;
	if (regimen_checked == 0 && document.getElementById('media_pension').checked) {
		media_pension = media_pension_valor*difference*document.getElementById('Adults').value;
		document.getElementById('media_pension').value=media_pension;
		document.getElementById('buffet_desayuno').value = 0;
		document.getElementById('buffet_desayuno').checked = false;
		document.getElementById('cena').value = 0;
		document.getElementById('cena').checked = false;
	}
	else {
		document.getElementById('media_pension').value = 0;
		
		//buffet_desayuno
		buffet = 0;
		if (regimen_checked == 0 && document.getElementById('buffet_desayuno').checked) {
			buffet = buffet_desayuno*difference*document.getElementById('Adults').value;
			document.getElementById('buffet_desayuno').value = buffet;
		}
		else {
			document.getElementById('buffet_desayuno').value = 0;
		}
		
		//cena
		cena = 0;
		if (regimen_checked == 0 && document.getElementById('cena').checked) {
			cena = comida*difference*document.getElementById('Adults').value;
			document.getElementById('cena').value=cena;
		}
		else {
			document.getElementById('cena').value = 0;
		}
	}
	if (regimen_checked == 1) {
		document.getElementById('media_pension_div').className = 'invisible';
		document.getElementById('desayuno_cena').className = 'invisible';
	}
	else {
		document.getElementById('media_pension_div').className = 'visible';
		if (media_pension > 0) {
			document.getElementById('desayuno_cena').className = 'invisible';
		}
		else {
			document.getElementById('desayuno_cena').className = 'visible';
		}
	}
	//almuerzo
	almuerzo = 0;
	if (document.getElementById('almuerzo').checked) {
		almuerzo = comida*difference*document.getElementById('Adults').value;
		document.getElementById('almuerzo').value=almuerzo;
	}
	else {
		document.getElementById('almuerzo').value = 0;
	}
	
	calculate_total(alojamiento_checked,regimen_checked);
}

function calculate_total(alojamiento,mp) {
	// precio del alojamiento
	var total = 0;
	
	var resumen = "";
	
	var mail = "";
	
	var fecha_inicio = document.getElementById('VonDatum.day').value+"-"+document.getElementById('VonDatum.month').value+"-"+document.getElementById('VonDatum.year').value;
	var fecha_final = document.getElementById('BisDatum.day').value+"-"+document.getElementById('BisDatum.month').value+"-"+document.getElementById('BisDatum.year').value;
	mail += mail_estilo_columna_izquierda_inicio+traduce("DATE")+ mail_estilo_columna_izquierda_final+mail_estilo_columna_derecha_inicio+fecha_inicio +"-->"+fecha_final+mail_estilo_columna_derecha_final;

	for(i=0;i<=10;i++) {
		if (numerodias[i] > 0) {
			resumen += html_estilo_columna_izquierda_inicio+traduce("NIGHTS")+" "+numerodias[i]+" "+ temporadas[i] + html_estilo_columna_izquierda_final+html_estilo_columna_derecha_inicio+html_estilo_columna_derecha_final;
			
			mail += mail_estilo_columna_izquierda_inicio+traduce("NIGHTS")+" "+numerodias[i]+" "+ temporadas[i] + mail_estilo_columna_izquierda_final+mail_estilo_columna_derecha_inicio+mail_estilo_columna_derecha_final;
		}
	}
	
	if (alojamiento == 1) {
		if (mp == 1) {
			total = document.getElementById('studio_mp').value;
			resumen += html_estilo_columna_izquierda_inicio+traduce("studio_mp")+ html_estilo_columna_izquierda_final;
			mail += mail_estilo_columna_izquierda_inicio+traduce("studio_mp")+ mail_estilo_columna_izquierda_final;
		}
		else {
			total = document.getElementById('studio').value;
			resumen += html_estilo_columna_izquierda_inicio+traduce("studio")+ html_estilo_columna_izquierda_final;
			mail += mail_estilo_columna_izquierda_inicio+traduce("studio")+ mail_estilo_columna_izquierda_final;
		}
	}
	if (alojamiento == 2) {
		if (mp == 1) {
			total = document.getElementById('bungalow_1_mp').value;
			resumen += html_estilo_columna_izquierda_inicio+traduce("bungalow_1_mp")+ html_estilo_columna_izquierda_final;
			mail += mail_estilo_columna_izquierda_inicio+traduce("bungalow_1_mp")+ mail_estilo_columna_izquierda_final;
		}
		else {
			total = document.getElementById('bungalow_1').value;
			resumen += html_estilo_columna_izquierda_inicio+traduce("bungalow_1")+ html_estilo_columna_izquierda_final;
			mail += mail_estilo_columna_izquierda_inicio+traduce("bungalow_1")+ mail_estilo_columna_izquierda_final;
		}
	}
	if (alojamiento == 3) {
		total = document.getElementById('bungalow_2').value;
		resumen += html_estilo_columna_izquierda_inicio+traduce("bungalow_2")+ html_estilo_columna_izquierda_final;
		mail += mail_estilo_columna_izquierda_inicio+traduce("bungalow_2")+ mail_estilo_columna_izquierda_final;
	}
	if (alojamiento == 4) {
		total = document.getElementById('chalet').value;
		resumen += html_estilo_columna_izquierda_inicio+traduce("chalet")+ html_estilo_columna_izquierda_final;
		mail += mail_estilo_columna_izquierda_inicio+traduce("chalet")+ mail_estilo_columna_izquierda_final;
	}
	resumen += html_estilo_columna_derecha_inicio+Math.round(parseFloat(total)*100)/100+html_estilo_columna_derecha_final;
	mail += mail_estilo_columna_derecha_inicio+Math.round(parseFloat(total)*100)/100+mail_estilo_columna_derecha_final;
	
	//camas extras
	extrabed = parseFloat(document.getElementById('ExtraBed').value) * cama_extra;
	if (extrabed > 0) {
		resumen += html_estilo_columna_izquierda_inicio +document.getElementById('ExtraBed').value + "  " + traduce('ExtraBed')+ html_estilo_columna_izquierda_final + html_estilo_columna_derecha_inicio+ Math.round(parseFloat(extrabed)*100)/100 +html_estilo_columna_derecha_final;
		mail += mail_estilo_columna_izquierda_inicio +document.getElementById('ExtraBed').value + "  " + traduce('ExtraBed')+ mail_estilo_columna_izquierda_final + mail_estilo_columna_derecha_inicio+ Math.round(parseFloat(extrabed)*100)/100 +mail_estilo_columna_derecha_final;
	}
	
	//buffet desayuno
	buffet = document.getElementById('buffet_desayuno').value;
	if (buffet > 0) {
		resumen += html_estilo_columna_izquierda_inicio+traduce('buffet_desayuno')+ html_estilo_columna_izquierda_final + html_estilo_columna_derecha_inicio+ + Math.round(parseFloat(buffet)*100)/100 +html_estilo_columna_derecha_final;
		mail += mail_estilo_columna_izquierda_inicio+traduce('buffet_desayuno')+ mail_estilo_columna_izquierda_final + mail_estilo_columna_derecha_inicio+ + Math.round(parseFloat(buffet)*100)/100 +mail_estilo_columna_derecha_final;
	}
	
	//almuerzo
	almuerzo = document.getElementById('almuerzo').value;
	if (almuerzo > 0) {
		resumen += html_estilo_columna_izquierda_inicio+traduce('almuerzo')+ html_estilo_columna_izquierda_final + html_estilo_columna_derecha_inicio+ + Math.round(parseFloat(almuerzo)*100)/100 +html_estilo_columna_derecha_final;
		mail += mail_estilo_columna_izquierda_inicio+traduce('almuerzo')+ mail_estilo_columna_izquierda_final + mail_estilo_columna_derecha_inicio+ + Math.round(parseFloat(almuerzo)*100)/100 +mail_estilo_columna_derecha_final;
	}
	
	//cena
	cena = document.getElementById('cena').value;
	if (cena > 0) {
		resumen += html_estilo_columna_izquierda_inicio+traduce('cena')+ html_estilo_columna_izquierda_final + html_estilo_columna_derecha_inicio+ + Math.round(parseFloat(cena)*100)/100 +html_estilo_columna_derecha_final;
		mail += mail_estilo_columna_izquierda_inicio+traduce('cena')+ mail_estilo_columna_izquierda_final + mail_estilo_columna_derecha_inicio+ + Math.round(parseFloat(cena)*100)/100 +mail_estilo_columna_derecha_final;
	}
	
	//media pension
	media_pension = document.getElementById('media_pension').value;
	if (media_pension > 0) {
		resumen += html_estilo_columna_izquierda_inicio+traduce('media_pension')+ html_estilo_columna_izquierda_final + html_estilo_columna_derecha_inicio+ + Math.round(parseFloat(media_pension)*100)/100 +html_estilo_columna_derecha_final;
		mail += mail_estilo_columna_izquierda_inicio+traduce('media_pension')+ mail_estilo_columna_izquierda_final + mail_estilo_columna_derecha_inicio+ + Math.round(parseFloat(media_pension)*100)/100 +mail_estilo_columna_derecha_final;
	}
	
	total = parseFloat(total)+parseFloat(extrabed)+parseFloat(buffet)+parseFloat(almuerzo)+parseFloat(cena)+parseFloat(media_pension);
	total = Math.round(total*100)/100;
	
	mail += mail_estilo_columna_izquierda_inicio+traduce('total')+ mail_estilo_columna_izquierda_final + mail_estilo_columna_derecha_inicio+ total +mail_estilo_columna_derecha_final;
	
	document.getElementById('precio_total').value = total;
	
	document.getElementById('resumen_total').innerHTML = resumen;
	
	document.getElementById('mail').value = mail;
	
	document.getElementById('precio_total_label').innerHTML =  total;
}
