﻿// Archivo JScript

function aparece_info()
{
    document.getElementById("div_info").style.display = "block";
}
function desaparece_info()
{
    document.getElementById("div_info").style.display = "none";
}
function aparece_submit()
{
    document.getElementById("div_submit").style.visibility = "visible";
}
function borra_div_tarifas()
{
    document.getElementById("div_ed").style.backgroundColor = "#ffffff";
    //document.getElementById("div_e4").style.backgroundColor = "#ffffff";
    document.getElementById("div_ek").style.backgroundColor = "#ffffff";
    document.getElementById("div_gd").style.backgroundColor = "#ffffff";
    //document.getElementById("div_g4").style.backgroundColor = "#ffffff";
    document.getElementById("div_gk").style.backgroundColor = "#ffffff";
    document.getElementById("div_rd").style.backgroundColor = "#ffffff";
    document.getElementById("div_rk").style.backgroundColor = "#ffffff";
    document.getElementById("div_ld").style.backgroundColor = "#ffffff";
    document.getElementById("div_lk").style.backgroundColor = "#ffffff";
    document.getElementById("div_sd").style.backgroundColor = "#ffffff";
    document.getElementById("div_sk").style.backgroundColor = "#ffffff";

    document.getElementById("div_ed").innerHTML= "";
    //document.getElementById("div_e4").innerHTML= "";
    document.getElementById("div_ek").innerHTML= "";
    document.getElementById("div_gd").innerHTML= "";
    //document.getElementById("div_g4").innerHTML= "";
    document.getElementById("div_gk").innerHTML= "";
    document.getElementById("div_rd").innerHTML= "";
    document.getElementById("div_rk").innerHTML= "";
    document.getElementById("div_ld").innerHTML= "";
    document.getElementById("div_lk").innerHTML= "";
    document.getElementById("div_sd").innerHTML= "";
    document.getElementById("div_sk").innerHTML= "";
    document.getElementById("div_submit").style.visibility = "hidden";
}
function selected_div_tarifas(div_s, tarifa)
{
    document.getElementById("div_ed").style.backgroundColor = "#ffffff";
    //document.getElementById("div_e4").style.backgroundColor = "#ffdddd";
    document.getElementById("div_ek").style.backgroundColor = "#ffffff";
    document.getElementById("div_gd").style.backgroundColor = "#ffffff";
    //document.getElementById("div_g4").style.backgroundColor = "#ffdddd";
    document.getElementById("div_gk").style.backgroundColor = "#ffffff";
    document.getElementById("div_rd").style.backgroundColor = "#ffffff";
    document.getElementById("div_rk").style.backgroundColor = "#ffffff";
    document.getElementById("div_ld").style.backgroundColor = "#ffffff";
    document.getElementById("div_lk").style.backgroundColor = "#ffffff";
    document.getElementById("div_sd").style.backgroundColor = "#ffffff";
    document.getElementById("div_sk").style.backgroundColor = "#ffffff";

    document.getElementById(div_s).style.backgroundColor = "#ffffff";

}

function pasa_fechas()
{
    document.getElementById("fecha_ini").value = document.getElementById("fecha_sal").value;
    document.getElementById("fecha_fin").value = document.getElementById("fecha_reg").value;
    document.getElementById("c_noches").value = document.getElementById("noches").value;
    document.getElementById("n_per").value = document.getElementById("c_personas").value;
    document.getElementById("n_cuartos").value = document.getElementById("c_cuartos").value;
}

function calcula_cuartos()
{
    var n_per = document.getElementById("c_personas").value;
	if (n_per == 1) 
	{
	document.getElementById("c_cuartos").value = 1;
	}
	else
	{
    document.getElementById("c_cuartos").value = Math.round((n_per / 2) - .1);
	}
}
