﻿function getChildNodes(f) {
    f.appendChild(GetHiddenField("fIdioma"));
    f.appendChild(GetHiddenField("fCurrency"));
    f.appendChild(GetHiddenField("fcal-arr"));
    f.appendChild(GetHiddenField("fcal-go"));
    f.appendChild(GetHiddenField("fPax"));
    f.appendChild(GetHiddenField("fPaxKids"));
    f.appendChild(GetHiddenField("fPaxBabies"));
    f.appendChild(GetHiddenField("fidDestino"));
    return f;
}
function Book(IdApart) {

    var action = "https://" + window.location.host + "/reservation/personalDetails.aspx";

    var f = document.createElement("form");
    f.setAttribute("name", "formBook");
    f.setAttribute("action", action);
    f.setAttribute("method", "POST");
    f = getChildNodes(f);
    var field = document.createElement("input");
    field.setAttribute("type", "hidden");
    field.setAttribute("name", "fidApart");
    field.setAttribute("value", IdApart);
    f.appendChild(field);
    var field = document.createElement("input");
    field.setAttribute("type", "hidden");
    field.setAttribute("name", "initBooking");
    field.setAttribute("value", 1);
    f.appendChild(field);
    document.body.appendChild(f);
    f.submit();

}