/* Hotel.si	Copyright © 2009 MAiS Informacijski sistemi.*//*init*/var hotelsi_AdultsMAX = 5;var hotelsi_KidsMAX = 3;/*Parameter check*//*language*/try {    if (hotelsi_lang == undefined) {        alert("Parameter hotelsi_lang is missing!");    }}catch (e) {    alert("Parameter hotelsi_lang is missing!");}function hotelsi_ParameterCheck() {    try {        if (hotelsi_lang == undefined) {            alert("Parameter hotelsi_lang is missing!");            return false;        }    }    catch (e) {        alert("Parameter hotelsi_lang is missing!");        return false;    }    /*id hotela na portalu tip INT*/    try {        if (hotelsi_hotelID == undefined)            ;    }    catch (e) {        hotelsi_hotelID = undefined;    }    /*seznam hotelov tip ARRAY */    try {        if (hotelsi_hotels == undefined)            ;    }    catch (e) {        hotelsi_hotels = undefined;    }    if (hotelsi_hotels == undefined && hotelsi_hotelID == undefined) {        alert("One of parameters hotelsi_hotels or hotelsi_hotelID must be defined!");        return false;    }    return true;}/*koda cenika - opcijsko*/try {    if (hotelsi_rateCODE == undefined)        ;}catch (e) {    hotelsi_rateCODE = undefined;}/*seznam cenikov - opcijsko*/try {    if (hotelsi_rates == undefined)        ;    }    catch (e) {        hotelsi_rates = undefined;}/*povratni url, v primeru da se rezrvacije odprejo v istem oknu*/try {    if (hotelsi_ReturnUrl == undefined)        hotelsi_ReturnUrl = "";    }    catch (e) {        hotelsi_ReturnUrl = "";}/*look&feel prameters*//*false - odstrani Hotel.si povezavo*/ try {    if (hotelsi_DisplayBrand == undefined)        hotelsi_DisplayBrand = true;}catch (e) {    hotelsi_DisplayBrand = true;}/*false - odstrani izbiro odraslih in otrok*/try {    if (hotelsi_DisplayPersons == undefined)        hotelsi_DisplayPersons = true;}catch (e) {    hotelsi_DisplayPersons = true;}/*false - po koncu generiranja forme ne inicializira koledarjev*/try {    if (hotelsi_calendarInit == undefined)        hotelsi_calendarInit = true;}catch (e) {    hotelsi_calendarInit = true;}/*false - ne naloži dodatnih javascript (trenutno za koledar)*/try {    if (hotelsi_scripts == undefined)        hotelsi_scripts = true;}catch (e) {    hotelsi_scripts = true;}/*false - header "RESERVATIONS" se ne prikaže*/try {    if (hotelsi_DisplayHeader == undefined)        hotelsi_DisplayHeader = true;}catch (e) {    hotelsi_DisplayHeader = true;}/*postavite elementov {TWOCOLUMN,HORIZONTAL,VERTICAL}*/try {    if (hotelsi_layout == undefined)        hotelsi_layout = "VERTICAL";}catch (e) {    hotelsi_layout = "VERTICAL";}/*Preperties for custom calendar*/try {    if (hotelsi_txtArrivalProperties == undefined)        hotelsi_txtArrivalProperties = "";}catch (e) {    hotelsi_txtArrivalProperties = "";}try {    if (hotelsi_txtDepartureProperties == undefined)        hotelsi_txtDepartureProperties = "";}catch (e) {    hotelsi_txtDepartureProperties = "";}try {    if (hotelsi_btnArrivalProperties == undefined)        hotelsi_btnArrivalProperties = "";}catch (e) {    hotelsi_btnArrivalProperties = "";}try {    if (hotelsi_btnDepartureProperties == undefined)        hotelsi_btnDepartureProperties = "";}catch (e) {    hotelsi_btnDepartureProperties = "";}/*CSS style calendar*/try {    if (hotelsi_calendarCSS == undefined)        hotelsi_calendarCSS = window.location.protocol + "//www.hotel.si/scripts/embeded/cal/calendar-default.css";}catch (e) {    hotelsi_calendarCSS = window.location.protocol + "//www.hotel.si/scripts/embeded/cal/calendar-default.css";}/*false - odstrani vse CSS class vrednosti*/try {    if (hotelsi_InsertClasses == undefined)        hotelsi_InsertClasses = true;}catch (e) {    hotelsi_InsertClasses = true;}/*CSS class - table*/try {    if (hotelsi_tableClass == undefined)        hotelsi_tableClass = "class='hotelsi_defaultTable'";    else if (hotelsi_tableClass.match("class='") == null)        hotelsi_tableClass = "class='" + hotelsi_tableClass + "'";}catch (e) {    hotelsi_tableClass = "class='hotelsi_defaultTable'";}/*CSS class - header*/try {    if (hotelsi_headerClass == undefined)        hotelsi_headerClass = "class='hotelsi_defaultHead'";    else if (hotelsi_headerClass.match("class='") == null)        hotelsi_headerClass = "class='" + hotelsi_headerClass + "'";}catch (e) {    hotelsi_headerClass = "class='hotelsi_defaultHead'";}/*CSS class - labels*/try {    if (hotelsi_lblClass == undefined)        hotelsi_lblClass = "class='hotelsi_defaultLbl'";    else if (hotelsi_lblClass.match("class='") == null)        hotelsi_lblClass = "class='" + hotelsi_lblClass + "'";}catch (e) {    hotelsi_lblClass = "class='hotelsi_defaultLbl'";}/*CSS class - combobox*/try {    if (hotelsi_ddlClass == undefined)        hotelsi_ddlClass = "class='hotelsi_defaultSelect'";    else if (hotelsi_ddlClass.match("class='") == null)        hotelsi_ddlClass = "class='" + hotelsi_ddlClass + "'";}catch (e) {    hotelsi_ddlClass = "class='hotelsi_defaultSelect'";}/*CSS class - textfield*/try {    if (hotelsi_txtClass == undefined)        hotelsi_txtClass = "class='hotelsi_defaultInput'";    else if (hotelsi_txtClass.match("class='") == null)        hotelsi_txtClass = "class='" + hotelsi_txtClass + "'";}catch (e) {    hotelsi_txtClass = "class='hotelsi_defaultInput'";}/*CSS class - gumb za koledarček*/try {    if (hotelsi_btnCalClass == undefined)        hotelsi_btnCalClass = "class='hotelsi_CalBtn'";    else if (hotelsi_btnClass.match("class='") == null)        hotelsi_btnCalClass = "class='" + hotelsi_btnCalClass + "'";}catch (e) {    hotelsi_btnCalClass = "class='hotelsi_CalBtn'";}/*CSS class - gumbe rezerviraj*/try {    if (hotelsi_btnClass == undefined)        hotelsi_btnClass = "class='hotelsi_defaultBtn'";    else if (hotelsi_btnClass.match("class='") == null)        hotelsi_btnClass = "class='" + hotelsi_btnClass + "'";}catch (e) {    hotelsi_btnClass = "class='hotelsi_defaultBtn'";}if (!hotelsi_InsertClasses) {    hotelsi_headerClass = "";    hotelsi_tableClass = "";    hotelsi_lblClass = "";    hotelsi_ddlClass = "";    hotelsi_txtClass = "";    hotelsi_btnCalClass = "";    hotelsi_btnClass = "";}/*Transaltions1-SLO, 2-ENG, 3-GER, 4-ITA, 5-FRA*/var hotelsi_Labels = new Array();hotelsi_Labels[1] = ["ONLINE REZERVACIJE", "Hotel", "Paket", "Prihod", "Odhod", "Odrasli", "Otroci", "Rezerviraj"];hotelsi_Labels[2] = ["ONLINE RESERVATIONS", "Hotel", "Packet", "Arrival", "Departure", "Adults", "Children", "Book"];hotelsi_Labels[3] = ["ONLINE RESERVIERUNGEN", "Hotel", "Paket", "Anreise", "Abreise", "Erwachs.", "Kinder", "Buchen"];hotelsi_Labels[4] = ["ONLINE PRENOTAZIONI", "Hotel", "Pacchetto", "Arrivo", "Partenza", "Adulti", "Bambini", "Book"];hotelsi_Labels[5] = ["ONLINE RESERVATIONS", "Hotel", "Packet", "Arrival", "Departure", "Adults", "Children", "Book"];/*Load scripts*/function hotelsi_dateAddDays(date, days) {    return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);}function hotelsi_strToDate(datestring) {    var listdate = datestring.split(".");    var day = listdate[0];    var month = listdate[1] - 1;    var year = listdate[2];    var d = new Date(year, month, day);    return d;}function hotelsi_dateToString(date) {    var day = new String(date.getDate());    var month = new String(date.getMonth() + 1);    var year = new String(date.getFullYear());    if (day.length == 1) day = "0" + day;    if (month.length == 1) month = "0" + month;    return day + "." + month + "." + year;}function hotelsi_catcalc(cal) {    var date = cal.date;    var time = 0;    var time2 = 0;    var name = cal.params.inputField.id;    var field = null;    if (name.indexOf("Arrival") != -1) {        field = document.getElementById(name.replace("Arrival", "Departure"));        time2 = hotelsi_strToDate(field.value).getTime();        time = hotelsi_dateAddDays(date, 1).getTime();        if (time2 < time) {            time2 = time;        }    } else {        field = document.getElementById(name.replace("Departure", "Arrival"));        time2 = hotelsi_strToDate(field.value).getTime();        time = hotelsi_dateAddDays(date, -1).getTime();        if (time2 > time) {            time2 = time;        }    }    var date2 = new Date(time2);    field.value = date2.print("%d.%m.%Y");}function hotelsi_importJS(src, look_for, onload) {    var s = document.createElement('script');    s.setAttribute('type', 'text/javascript');    s.setAttribute('src', src);    if (onload) hotelsi_wait_for_script_load(look_for, onload);    var head = document.getElementsByTagName('head')[0];    if (head) {        head.appendChild(s);    } else {        document.body.appendChild(s);    }}function hotelsi_importCSS(href, look_for, onload) {    var s = document.createElement('link');    s.setAttribute('rel', 'stylesheet');    s.setAttribute('type', 'text/css');    s.setAttribute('media', 'screen');    s.setAttribute('href', href);    if (onload) hotelsi_wait_for_script_load(look_for, onload);    var head = document.getElementsByTagName('head')[0];    if (head) {        head.appendChild(s);    } else {        document.body.appendChild(s);    }}function hotelsi_wait_for_script_load(look_for, callback) {    var interval = setInterval(function() {        if (eval("typeof " + look_for) != 'undefined') {            clearInterval(interval);            callback();        }    }, 50);}/*EMBEDED FORM CODE*/if (hotelsi_scripts) {    hotelsi_importJS(window.location.protocol + '//www.hotel.si/scripts/embeded/cal/calendar_stripped.js');    hotelsi_wait_for_script_load("Calendar", function() { hotelsi_importJS(window.location.protocol + '//www.hotel.si/scripts/embeded/cal/calendar-setup_stripped.js'); });    if (hotelsi_lang == 1){        hotelsi_wait_for_script_load("Calendar", function() { hotelsi_importJS(window.location.protocol + '//www.hotel.si/scripts/embeded/cal/lang/calendar-si.js'); });    }    else if (hotelsi_lang == 3){        hotelsi_wait_for_script_load("Calendar", function() { hotelsi_importJS(window.location.protocol + '//www.hotel.si/scripts/embeded/cal/lang/calendar-de.js'); });    }    else if (hotelsi_lang == 4){        hotelsi_wait_for_script_load("Calendar", function() { hotelsi_importJS(window.location.protocol + '//www.hotel.si/scripts/embeded/cal/lang/calendar-it.js'); });    }    else{        hotelsi_wait_for_script_load("Calendar", function() { hotelsi_importJS(window.location.protocol + '//www.hotel.si/scripts/embeded/cal/lang/calendar-en.js'); });    }}hotelsi_importJS(window.location.protocol + '//www.hotel.si/scripts/embeded/booklib.js');try {    if (Ghotelsi_ReturnUrls == undefined)        Ghotelsi_ReturnUrls = new Array();}catch (e) {    Ghotelsi_ReturnUrls = new Array();}function hotelsi_Book(num, ReturnUrl) {    var arrival = document.getElementById('HotelSi_txtArrival' + num).value;    var departure = document.getElementById('HotelSi_txtDeparture' + num).value;    var adults = 1;    var kids = 0;    if (hotelsi_DisplayPersons) {        adults = document.getElementById('HotelSi_ddlAdults' + num).value;        kids = document.getElementById('HotelSi_ddlKids' + num).value;    }    hotel = document.getElementById('HotelSi_ddlHotel' + num).value;    var ratecode = undefined;    if (document.getElementById('HotelSi_ddlRate' + num) != null) {        ratecode = document.getElementById('HotelSi_ddlRate' + num).value;    }    if (Ghotelsi_ReturnUrls[num] == "") {        hotelsi_BookBlank(hotel, ratecode, arrival, departure, adults, kids, hotelsi_lang);    }    else {        hotelsi_BookParent(hotel, ratecode, arrival, departure, adults, kids, hotelsi_lang, Ghotelsi_ReturnUrls[num]);    }    return false;}hotelsi_importCSS(window.location.protocol + "//www.hotel.si/scripts/embeded/style/hotelsiDefault.css");if (hotelsi_calendarCSS != "")    hotelsi_importCSS(hotelsi_calendarCSS);function hotelsi_printForm(divID) {    if (!hotelsi_ParameterCheck()) {        return false;    }    try {        if (Ghotelsi_FormCount == undefined)            Ghotelsi_FormCount = 0;    }    catch (e) {        Ghotelsi_FormCount = 0;    }    var FormCount = Ghotelsi_FormCount++;    var lbl = 0;    var htmlform = "";    var hidden = "";    var colspan = 1;    Ghotelsi_ReturnUrls[FormCount] = hotelsi_ReturnUrl;    try {        lbl++;        if (hotelsi_layout == "TWOCOLUMN") {            var paired = false;            var rowprinted = false;            var titleRow = "<tr>";            var inputRow = "<tr>";            if (hotelsi_hotels != undefined) {                titleRow += "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>";                inputRow += "<td valing='middle' align='left'><select " + hotelsi_ddlClass + " name='HotelSi_ddlHotel" + FormCount + "' id='HotelSi_ddlHotel" + FormCount + "'>";                for (var i = 0; i < hotelsi_hotels.length; i++) {                    inputRow += "<option value='" + hotelsi_hotels[i][0] + "'>" + hotelsi_hotels[i][1] + "</option>";                }                inputRow += "</select></td>";                paired = true;                rowprinted = true;            }            else {                hidden += "<input type='hidden' id='HotelSi_ddlHotel" + FormCount + "' name='HotelSi_ddlHotel" + FormCount + "' value='" + hotelsi_hotelID + "'/>";                lbl++;            }            if (hotelsi_rates != undefined) {                titleRow += "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>";                inputRow += "<td valing='middle' align='left'><select " + hotelsi_ddlClass + " name='HotelSi_ddlRate" + FormCount + "' id='HotelSi_ddlRate" + FormCount + "'>";                for (var i = 0; i < hotelsi_rates.length; i++) {                    inputRow += "<option value='" + hotelsi_rates[i][0] + "'>" + hotelsi_rates[i][1] + "</option>";                }                inputRow += "</select></td>";                if (!paired) {                    titleRow += "<td></td>";                    inputRow += "<td></td>";                }                rowprinted = true;            }            else if (hotelsi_rateCODE != undefined) {                paired = false;                hidden += "<input type='hidden' id='HotelSi_ddlRate" + FormCount + "' name='HotelSi_ddlRate" + FormCount + "' value='" + hotelsi_rateCODE + "'/>";                lbl++;            }            else {                paired = false;                lbl++;            }            if (rowprinted) {                if (!paired) {                    titleRow += "<td></td>";                    inputRow += "<td></td>";                }                            htmlform += titleRow + "</tr>" + inputRow + "</tr>";            }            htmlform += "<tr>" +                   "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                   "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                   "</tr>" +                   "<tr>" +                   "<td valing='middle' align='left' style='white-space:nowrap;'><input " + hotelsi_txtClass + " type='text' name='HotelSi_txtArrival" + FormCount + "' id='HotelSi_txtArrival" + FormCount + "' value='" + hotelsi_dateToString(hotelsi_dateAddDays(new Date(), 1)) + "' " + hotelsi_txtArrivalProperties + "/><button name='HotelSi_btnArrival" + FormCount + "' id='HotelSi_btnArrival" + FormCount + "' " + hotelsi_btnCalClass + "></button></td>" +                   "<td valing='middle' align='left' style='white-space:nowrap;'><input " + hotelsi_txtClass + "type='text' name='HotelSi_txtDeparture" + FormCount + "' id='HotelSi_txtDeparture" + FormCount + "' value='" + hotelsi_dateToString(hotelsi_dateAddDays(new Date(), 2)) + "' " + hotelsi_txtDepartureProperties + "/><button name='HotelSi_btnDeparture" + FormCount + "' id='HotelSi_btnDeparture" + FormCount + "' " + hotelsi_btnCalClass + "></button></td>" +                   "</tr>";            if (hotelsi_DisplayPersons) {                htmlform += "<tr>" +                            "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                             "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                            "</tr>";                htmlform += "<tr>" +                "<td valing='top' align='left'><select " + hotelsi_ddlClass + " style='width:40px;' name='HotelSi_ddlAdults" + FormCount + "' id='HotelSi_ddlAdults" + FormCount + "'>";                for (var i = 1; i <= hotelsi_AdultsMAX; i++) {                    htmlform += "<option value='" + i + "'>" + i + "</option>";                }                htmlform += "</select></td>" +                "<td valing='top' align='left'><select " + hotelsi_ddlClass + " style='width:40px;' name='HotelSi_ddlKids" + FormCount + "' id='HotelSi_ddlKids" + FormCount + "'>";                for (var i = 0; i <= hotelsi_KidsMAX; i++) {                    htmlform += "<option value='" + i + "'>" + i + "</option>";                }                htmlform += "</select></td></tr>";            }            else {                lbl++;                lbl++;            }            htmlform += "<tr>" +                   "<td valing='middle' colspan='2' align='center'><button style='margin: 5px auto !important;' type='button' " + hotelsi_btnClass + " onclick='javascript:hotelsi_Book(" + FormCount + ",\"" + hotelsi_ReturnUrl + "\");'>" + hotelsi_Labels[hotelsi_lang][lbl++] + "</button></td>" +                   "</tr>";            if (hotelsi_DisplayBrand) {                htmlform += "<tr>" +                           "<td valing='bottom' colspan='2' align='right'><a class='hotelsi_defaultInfo' href='http://www.hotel.si' target='_blank'>Hotel.si</a></td>" +                           "</tr>";            }        }        else if (hotelsi_layout == "HORIZONTAL") {            htmlform += "<tr>";            if (hotelsi_hotels != undefined) {                htmlform += "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>";            }            else {                lbl++;            }            if (hotelsi_rates != undefined) {                htmlform += "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>";            }            else {                lbl++;            }            htmlform += "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                   "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>";            if (hotelsi_DisplayPersons) {                htmlform += "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                   "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>";            }            else {                lbl++;                lbl++;            }            htmlform += "</tr><tr>";            if (hotelsi_hotels != undefined) {                htmlform += "<td valing='middle' align='left'><select " + hotelsi_ddlClass + " name='HotelSi_ddlHotel" + FormCount + "' id='HotelSi_ddlHotel" + FormCount + "'>";                for (var i = 0; i < hotelsi_hotels.length; i++) {                    htmlform += "<option value='" + hotelsi_hotels[i][0] + "'>" + hotelsi_hotels[i][1] + "</option>";                }                htmlform += "</select></td>";            }            else {                hidden += "<input type='hidden' id='HotelSi_ddlHotel" + FormCount + "' name='HotelSi_ddlHotel" + FormCount + "' value='" + hotelsi_hotelID + "'/>";            }            if (hotelsi_rates != undefined) {                htmlform += "<td valing='middle' align='left'><select " + hotelsi_ddlClass + " name='HotelSi_ddlRate" + FormCount + "' id='HotelSi_ddlRate" + FormCount + "'>";                for (var i = 0; i < hotelsi_rates.length; i++) {                    htmlform += "<option value='" + hotelsi_rates[i][0] + "'>" + hotelsi_rates[i][1] + "</option>";                }                htmlform += "</select></td>";            }            else if (hotelsi_rateCODE != undefined) {                hidden += "<input type='hidden' id='HotelSi_ddlRate" + FormCount + "' name='HotelSi_ddlRate" + FormCount + "' value='" + hotelsi_rateCODE + "'/>";            }            htmlform += "<td valing='middle' align='left' style='white-space:nowrap;'><input " + hotelsi_txtClass + " type='text' name='HotelSi_txtArrival" + FormCount + "' id='HotelSi_txtArrival" + FormCount + "' value='" + hotelsi_dateToString(hotelsi_dateAddDays(new Date(), 1)) + "' " + hotelsi_txtArrivalProperties + "/><button name='HotelSi_btnArrival" + FormCount + "' id='HotelSi_btnArrival" + FormCount + "' " + hotelsi_btnCalClass + " " + hotelsi_btnArrivalProperties + "></button></td>" +                   "<td valing='middle' align='left' style='white-space:nowrap;'><input " + hotelsi_txtClass + " type='text' name='HotelSi_txtDeparture" + FormCount + "' id='HotelSi_txtDeparture" + FormCount + "' value='" + hotelsi_dateToString(hotelsi_dateAddDays(new Date(), 2)) + "' " + hotelsi_txtDepartureProperties + "/><button name='HotelSi_btnDeparture" + FormCount + "' id='HotelSi_btnDeparture" + FormCount + "' " + hotelsi_btnCalClass + " " + hotelsi_btnDepartureProperties + "></button></td>";            if (hotelsi_DisplayPersons) {                htmlform += "<td valing='middle' align='left'><select " + hotelsi_ddlClass + " style='width:40px;' name='HotelSi_ddlAdults" + FormCount + "' id='HotelSi_ddlAdults" + FormCount + "'>";                for (var i = 1; i <= hotelsi_AdultsMAX; i++) {                    htmlform += "<option value='" + i + "'>" + i + "</option>";                }                htmlform += "</select></td>";                htmlform += "<td valing='middle' align='left'><select " + hotelsi_ddlClass + " style='width:40px;' name='HotelSi_ddlKids" + FormCount + "' id='HotelSi_ddlKids" + FormCount + "'>";                for (var i = 0; i <= hotelsi_KidsMAX; i++) {                    htmlform += "<option value='" + i + "'>" + i + "</option>";                }                htmlform += "</select></td>";            }            htmlform += "</tr><tr>";            if (hotelsi_DisplayBrand) {                htmlform += "<td valing='middle' align='left'><a class='hotelsi_defaultInfo' href='http://www.hotel.si' target='_blank'>Hotel.si</a></td>";            }            else {                htmlform += "<td></td>";            }            if (hotelsi_hotels != undefined) {                colspan++;            }            if (hotelsi_rates != undefined)                colspan++;            if (hotelsi_DisplayPersons)                colspan += 2;            if (colspan > 1) {                htmlform += "<td valing='middle' align='right' colspan='" + colspan + "'>";            }            else {                htmlform += "<td valing='middle' align='right'>";            }            htmlform += "<button type='button' " + hotelsi_btnClass + " onclick='javascript:hotelsi_Book(" + FormCount + ",\"" + hotelsi_ReturnUrl + "\");'>" + hotelsi_Labels[hotelsi_lang][lbl++] + "</button></td>" +                   "</tr>";        }        else {            if (hotelsi_hotels != undefined) {                htmlform += "<tr>" +                            "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                            "<td valing='middle' align='left'><select " + hotelsi_ddlClass + " name='HotelSi_ddlHotel" + FormCount + "' id='HotelSi_ddlHotel" + FormCount + "'>";                for (var i = 0; i < hotelsi_hotels.length; i++) {                    htmlform += "<option value='" + hotelsi_hotels[i][0] + "'>" + hotelsi_hotels[i][1] + "</option>";                }                htmlform += "</select></td></tr>";            }            else {                hidden += "<input type='hidden' id='HotelSi_ddlHotel" + FormCount + "' name='HotelSi_ddlHotel" + FormCount + "' value='" + hotelsi_hotelID + "'/>";                lbl++;            }            if (hotelsi_rates != undefined) {                htmlform += "<tr>" +                            "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                            "<td valing='middle' align='left'><select " + hotelsi_ddlClass + " name='HotelSi_ddlRate" + FormCount + "' id='HotelSi_ddlRate" + FormCount + "'>";                for (var i = 0; i < hotelsi_rates.length; i++) {                    htmlform += "<option value='" + hotelsi_rates[i][0] + "'>" + hotelsi_rates[i][1] + "</option>";                }                htmlform += "</select></td></tr>";            }            else if (hotelsi_rateCODE != undefined) {                hidden += "<input type='hidden' id='HotelSi_ddlRate" + FormCount + "' name='HotelSi_ddlRate" + FormCount + "' value='" + hotelsi_rateCODE + "'/>";                lbl++;            }            else {                lbl++;            }            htmlform += "<tr>" +                   "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                   "<td valing='middle' align='left' style='white-space:nowrap;'><input " + hotelsi_txtClass + " type='text' name='HotelSi_txtArrival" + FormCount + "' id='HotelSi_txtArrival" + FormCount + "' value='" + hotelsi_dateToString(hotelsi_dateAddDays(new Date(), 1)) + "' " + hotelsi_txtArrivalProperties + "/><button name='HotelSi_btnArrival" + FormCount + "' id='HotelSi_btnArrival" + FormCount + "' " + hotelsi_btnCalClass + "></button></td>" +                   "</tr>" +                   "<tr>" +                   "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                   "<td valing='middle' align='left' style='white-space:nowrap;'><input " + hotelsi_txtClass + "type='text' name='HotelSi_txtDeparture" + FormCount + "' id='HotelSi_txtDeparture" + FormCount + "' value='" + hotelsi_dateToString(hotelsi_dateAddDays(new Date(), 2)) + "' " + hotelsi_txtDepartureProperties + "/><button name='HotelSi_btnDeparture" + FormCount + "' id='HotelSi_btnDeparture" + FormCount + "' " + hotelsi_btnCalClass + "></button></td>" +                   "</tr>";            if (hotelsi_DisplayPersons) {                htmlform += "<tr>" +                            "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                            "<td valing='top' align='left'><select " + hotelsi_ddlClass + " style='width:40px;' name='HotelSi_ddlAdults" + FormCount + "' id='HotelSi_ddlAdults" + FormCount + "'>";                for (var i = 1; i <= hotelsi_AdultsMAX; i++) {                    htmlform += "<option value='" + i + "'>" + i + "</option>";                }                htmlform += "</select></td></tr>";                htmlform += "<tr>" +                            "<td valing='middle' align='left' " + hotelsi_lblClass + ">" + hotelsi_Labels[hotelsi_lang][lbl++] + "</td>" +                            "<td valing='top' align='left'><select " + hotelsi_ddlClass + " style='width:40px;' name='HotelSi_ddlKids" + FormCount + "' id='HotelSi_ddlKids" + FormCount + "'>";                for (var i = 0; i <= hotelsi_KidsMAX; i++) {                    htmlform += "<option value='" + i + "'>" + i + "</option>";                }                htmlform += "</select></td></tr>";            }            else {                lbl++;                lbl++;            }            htmlform += "<tr>" +                   "<td valing='middle' colspan='2' align='center'><button style='margin: 5px auto !important;' type='button' " + hotelsi_btnClass + " onclick='javascript:hotelsi_Book(" + FormCount + ",\"" + hotelsi_ReturnUrl + "\");'>" + hotelsi_Labels[hotelsi_lang][lbl++] + "</button></td>" +                   "</tr>";            if (hotelsi_DisplayBrand) {                htmlform += "<tr>" +                           "<td valing='bottom' colspan='2' align='right'><a class='hotelsi_defaultInfo' href='http://www.hotel.si' target='_blank'>Hotel.si</a></td>" +                           "</tr>";            }        }        /*header rabm vedet kolk je colspan*/        if (hotelsi_DisplayHeader) {            htmlform = "<tr><td colspan='" + (colspan + 1) + "' " + hotelsi_headerClass + ">" + hotelsi_Labels[hotelsi_lang][0] + "</td></tr>" + "<tr><td colspan='" + (colspan + 1) + "'></td></tr>" + htmlform;        }        htmlform = "<table border='0' cellspacing='0' cellpadding='0' " + hotelsi_tableClass + ">" + htmlform;        htmlform += "</table>";        document.write(htmlform + hidden);    }    catch (e) {        alert(e);    }    if (hotelsi_calendarInit) {        var calINIT = "Calendar.setup({" +                            "inputField: \"HotelSi_txtArrival" + FormCount + "\"," +                            "button: \"HotelSi_btnArrival" + FormCount + "\"," +                            "ifFormat: \"%d.%m.%Y\"," +                            "weekNumbers: false," +                            "firstDay: 1," +                            "electric: false," +                            "showOthers: true," +                            "onUpdate: hotelsi_catcalc" +                        "});" +                        "Calendar.setup({" +                            "inputField: \"HotelSi_txtDeparture" + FormCount + "\"," +                            "button: \"HotelSi_btnDeparture" + FormCount + "\"," +                            "ifFormat: \"%d.%m.%Y\"," +                            "weekNumbers: false," +                            "firstDay: 1," +                            "electric: false," +                            "showOthers: true," +                            "onUpdate: hotelsi_catcalc" +                        "});";        hotelsi_wait_for_script_load("Calendar", function() { hotelsi_wait_for_script_load("Calendar._TT", function() { hotelsi_wait_for_script_load("Calendar.setup", function() { setTimeout(calINIT, 10); }); }); });    }}
