/* Hotel.si	Copyright © 2009 MAiS Informacijski sistemi.*//*params*//*povratni url, v primeru da se rezrvacije odprejo v istem oknu*/try {    if (hotelsi_HOReturnUrl == undefined)        ;}catch (e) {    hotelsi_HOReturnUrl = undefined;}/*interval menjavanja ponudb v milisekundah*/try {    if (hotelsi_HOinterval == undefined)        hotelsi_HOinterval = 10000;}catch (e) {    hotelsi_HOinterval = 10000;}/*false - ne naloži dodatnih javascript (trenutno za jquery)*/try {    if (hotelsi_HOscripts == undefined)        hotelsi_HOscripts = true;}catch (e) {    hotelsi_HOscripts = true;}/*look&feel*//*false - header "HOT OFFER" se ne prikaže*/try {    if (hotelsi_HODisplayHeader == undefined)        hotelsi_HODisplayHeader = true;}catch (e) {    hotelsi_HODisplayHeader = true;}/*false - ne prikaže imena hotela in kategorije (zvezdic)*/try {    if (hotelsi_HODisplayHotelName == undefined)        hotelsi_HODisplayHotelName = true;}catch (e) {    hotelsi_HODisplayHotelName = true;}/*false - odstrani Hotel.si povezavo */try {    if (hotelsi_HODisplayBrand == undefined)        hotelsi_HODisplayBrand = true;}catch (e) {    hotelsi_HODisplayBrand = true;}/*postavite elementov {HORIZONTAL,VERTICAL}*/try {    if (hotelsi_HOlayout == undefined)        hotelsi_HOlayout = "VERTICAL";}catch (e) {    hotelsi_HOlayout = "VERTICAL";}/*false - odstrani vse CSS class vrednosti */try {    if (hotelsi_HOInsertClasses == undefined)        hotelsi_HOInsertClasses = true;}catch (e) {    hotelsi_HOInsertClasses = true;}/*CSS class - table*/try {    if (hotelsi_HOtableClass == undefined)        hotelsi_HOtableClass = "class='hotelsi_HOtable'";    else if (hotelsi_HOtableClass.match("class='") == null)        hotelsi_HOtableClass = "class='" + hotelsi_HOtableClass + "'";}catch (e) {    hotelsi_HOtableClass = "class='hotelsi_HOtable'";}/*CSS class - header*/try {    if (hotelsi_HOheaderClass == undefined)        hotelsi_HOheaderClass = "class='hotelsi_HOhead'";    else if (hotelsi_HOheaderClass.match("class='") == null)        hotelsi_HOheaderClass = "class='" + hotelsi_HOheaderClass + "'";}catch (e) {    hotelsi_HOheaderClass = "class='hotelsi_HOhead'";}/*CSS class - ime hotela*/try {    if (hotelsi_HOHotelNameClass == undefined)        hotelsi_HOHotelNameClass = "class='hotelsi_HOHotelName'";    else if (hotelsi_HOHotelNameClass.match("class='") == null)        hotelsi_HOHotelNameClass = "class='" + hotelsi_HOHotelNameClass + "'";}catch (e) {    hotelsi_HOHotelNameClass = "class='hotelsi_HOHotelName'";}/*CSS class - naziv ponudbe*/try {    if (hotelsi_HOdescClass == undefined)        hotelsi_HOdescClass = "class='hotelsi_HOdesc'";    else if (hotelsi_HOdescClass.match("class='") == null)        hotelsi_HOdescClass = "class='" + hotelsi_HOdescClass + "'";}catch (e) {    hotelsi_HOdescClass = "class='hotelsi_HOdesc'";}/*CSS class - datum ponudbe*/try {    if (hotelsi_HOdateClass == undefined)        hotelsi_HOdateClass = "class='hotelsi_HOdate'";    else if (hotelsi_HOdateClass.match("class='") == null)        hotelsi_HOdateClass = "class='" + hotelsi_HOdateClass + "'";}catch (e) {    hotelsi_HOdateClass = "class='hotelsi_HOdate'";}/*CSS class - cena ponudbe*/try {    if (hotelsi_HOpriceClass == undefined)        hotelsi_HOpriceClass = "class='hotelsi_HOprice'";    else if (hotelsi_HOpriceClass.match("class='") == null)        hotelsi_HOpriceClass = "class='" + hotelsi_HOpriceClass + "'";}catch (e) {    hotelsi_HOpriceClass = "class='hotelsi_HOprice'";}/*CSS class - gumbe rezerviraj*/try {    if (hotelsi_HObtnClass == undefined)        hotelsi_HObtnClass = "class='hotelsi_HOdefaultBtn'";    else if (hotelsi_HObtnClass.match("class='") == null)        hotelsi_HObtnClass = "class='" + hotelsi_HObtnClass + "'";}catch (e) {    hotelsi_HObtnClass = "class='hotelsi_HOdefaultBtn'";}/*CSS class - div v ozadju, ajax loading animacija, ko prednji del postane prosojen*/try {    if (hotelsi_HObackgroundClass == undefined)        hotelsi_HObackgroundClass = "hotelsi_HObackground";}catch (e) {    hotelsi_HObackgroundClass = "hotelsi_HObackground";}if (!hotelsi_HOInsertClasses) {    hotelsi_HOtableClass = "";    hotelsi_HOheaderClass = "";    hotelsi_HOHotelNameClass = "";    hotelsi_HOdateClass = "";    hotelsi_HOpriceClass = "";    hotelsi_HObtnClass = "";    hotelsi_HObackgroundClass = "";}var hotelsi_DOMAIN2ND = "";var hotelsi_ServerAddress = window.location.protocol + "//www.fidelityhotel.net";var hotelsi_SecureServerAddress = "https://www.fidelityhotel.net";var hotelsi_SessionIdUrl = "";var hotelsi_hotOfferService = window.location.protocol + "//www.fidelityhotel.net/services/HotOfferEmbeded.aspx";var hotelsi_hotOfferDirectLink = "https://www.fidelityhotel.net/book/start.aspx";var hotelsi_hotOfferInquiryLink = "https://www.fidelityhotel.net/thread/ThreadStart.aspx";/*Transaltions1-SLO, 2-ENG, 3-GER, 4-ITA, 5-FRA, 6-CHN*/var hotelsi_HOTransInt = new Array();hotelsi_HOTransInt["SLO"] = [1];hotelsi_HOTransInt["ENG"] = [2];hotelsi_HOTransInt["GER"] = [3];hotelsi_HOTransInt["ITA"] = [4];hotelsi_HOTransInt["FRA"] = [5];hotelsi_HOTransInt["CHN"] = [6];var hotelsi_HOLabels = new Array();hotelsi_HOLabels[1] = ["POSEBNA PONUDBA", "Rezerviraj","SLO"];hotelsi_HOLabels[2] = ["SPECIAL OFFER", "Book", "ENG"];hotelsi_HOLabels[3] = ["SONDERANGEBOT", "Buchen", "GER"];hotelsi_HOLabels[4] = ["OFFERTA SPECIALE", "Book", "ITA"];hotelsi_HOLabels[5] = ["OFFRE SPECIALE", "Réserver", "FRA"];hotelsi_HOLabels[6] = ["特别优惠", "预订", "CHN"];/*support functions*/function hotelsi_HOimportJS(src, look_for, onload) {    var s = document.createElement('script');    s.setAttribute('type', 'text/javascript');    s.setAttribute('src', src);    if (onload) hotelsi_HOwait_for_script_load(look_for, onload);    var head = document.getElementsByTagName('head')[0];    if (head) {        head.appendChild(s);    } else {        document.body.appendChild(s);    }}function hotelsi_HOimportCSS(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_HOwait_for_script_load(look_for, onload);    var head = document.getElementsByTagName('head')[0];    if (head) {        head.appendChild(s);    } else {        document.body.appendChild(s);    }}function hotelsi_HOwait_for_script_load(look_for, callback) {    var interval = setInterval(function() {        if (eval("typeof " + look_for) != 'undefined') {            clearInterval(interval);            callback();        }    }, 50);}/*load*/if (hotelsi_HOscripts) {    hotelsi_HOimportJS(hotelsi_ServerAddress + '/scripts/embeded/lib/jquery.js');}hotelsi_HOimportJS(hotelsi_ServerAddress + '/scripts/embeded/lib/opacity.js');hotelsi_HOimportCSS(hotelsi_ServerAddress + '/scripts/embeded/style/hotelsiHODefault.css');/*HO Functions*/function hotelsi_HOcallback(data, prevID, hotelID, divID, lang) {    var div = document.getElementById(divID + "_" + hotelID);    var htmlform = "";    var hotOfferBookLink = "";    var resSplit = data.split("#");    var hotelANDcategory = "";    if (resSplit[5] == 0 || resSplit[0] == "-1") {        document.getElementById(divID).className = "";        document.getElementById(divID).innerHTML = "";                return true;    }    if (document.getElementById(divID).className == "")        document.getElementById(divID).className = hotelsi_HObackgroundClass;    if (hotelsi_HOlayout == "HORIZONTAL") {        htmlform = "<table border='0' cellspacin='0' cellpaddin='0' align='left' " + hotelsi_HOtableClass + " style='width:300px;'>";        if (hotelsi_HODisplayHeader) {            htmlform += "<tr><td colspan='3' " + hotelsi_HOheaderClass + ">" + hotelsi_HOLabels[lang][0] + "</td></tr>";        }        if (hotelsi_HODisplayHotelName) {            var hotelANDcategory = resSplit[1].toUpperCase() + " <span style='white-space:nowrap;'>";            for (i = 0; i < resSplit[2]; i++) {                hotelANDcategory += "<img alt='*' src='" + hotelsi_ServerAddress + "/scripts/embeded/style/FullStar.gif'/>";            }            if (resSplit[8] != "-1") {                hotelANDcategory += "<img alt='+' src='" + hotelsi_ServerAddress + "/scripts/embeded/style/HalfStar.gif'/>";            }            hotelANDcategory += "</span>";            htmlform += "<tr><td align='left' colspan='3' " + hotelsi_HOHotelNameClass + ">" + hotelANDcategory + "</td></tr>";        }        if (resSplit[9] == "4") {            var language = hotelsi_HOLabels[lang][2];            hotOfferBookLink = hotelsi_hotOfferInquiryLink + resSplit[6] + "&language=" + language + (hotelsi_SessionIdUrl == "" ? "" : "&" + hotelsi_SessionIdUrl);        }        else {            var language = hotelsi_HOLabels[lang][2];            hotOfferBookLink = hotelsi_hotOfferDirectLink + resSplit[6] + "&lang=" + language + (hotelsi_SessionIdUrl == "" ? "" : "&" + hotelsi_SessionIdUrl);        }                htmlform += "<tr><td align='left' colspan='3' " + hotelsi_HOdescClass + ">" + resSplit[10] + "</td></tr>" +            "<tr><td align='left' colspan='3' " + hotelsi_HOdateClass + ">" + resSplit[3] + "</td></tr>" +            "<tr><td " + hotelsi_HOpriceClass + ">" + resSplit[4] + "</td><td>&nbsp;&nbsp;</td><td align='right'>" +            "<button type='button' " + hotelsi_HObtnClass + " onclick='javascript:hotelsi_OpenHotOffer(\"" + hotOfferBookLink + "\")'>" + hotelsi_HOLabels[lang][1] + "</button>" +            "</td></tr>";        if (hotelsi_HODisplayBrand) {            htmlform += "<tr>" +               "<td valing='bottom' colspan='3' align='right'><a class='hotelsi_HOdefaultInfo' href='http://www.hotel.si' target='_blank'>Hotel.si</a></td>" +               "</tr>";        }        htmlform += "</table>";    }    else {        htmlform = "<table " + hotelsi_HOtableClass + ">";        if (hotelsi_HODisplayHeader) {            htmlform += "<tr><td align='center' " + hotelsi_HOheaderClass + ">" + hotelsi_HOLabels[lang][0] + "</td></tr>";        }        if (hotelsi_HODisplayHotelName) {            var hotelANDcategory = resSplit[1].toUpperCase() + " <span style='white-space:nowrap;'>";            for (i = 0; i < resSplit[2]; i++) {                hotelANDcategory += "<img alt='*' src='" + hotelsi_ServerAddress + "/scripts/embeded/style/FullStar.gif'/>";            }            if (resSplit[8] != "-1") {                hotelANDcategory += "<img alt='+' src='" + hotelsi_ServerAddress + "/scripts/embeded/style/HalfStar.gif'/>";            }            hotelANDcategory += "</span>";            htmlform += "<tr><td align='center' " + hotelsi_HOHotelNameClass + ">" + hotelANDcategory + "</td></tr>";        }        if (resSplit[9] == "4") {            var language = hotelsi_HOLabels[lang][2];            hotOfferBookLink = hotelsi_hotOfferInquiryLink + resSplit[6] + "&language=" + language + (hotelsi_SessionIdUrl == "" ? "" : "&" + hotelsi_SessionIdUrl);        }        else {            var language = hotelsi_HOLabels[lang][2];            hotOfferBookLink = hotelsi_hotOfferDirectLink + resSplit[6] + "&lang=" + language + (hotelsi_SessionIdUrl == "" ? "" : "&" + hotelsi_SessionIdUrl);        }        htmlform += "<tr><td align='center' " + hotelsi_HOdescClass + ">" + resSplit[10] + "</td></tr>" +            "<tr><td align='center' " + hotelsi_HOdateClass + ">" + resSplit[3] + "</td></tr>" +            "<tr><td " + hotelsi_HOpriceClass + ">" + resSplit[4] + "</td></tr><tr><td align='center'>" +            "<button type='button' " + hotelsi_HObtnClass + " onclick='javascript:hotelsi_OpenHotOffer(\"" + hotOfferBookLink + "\");'>" + hotelsi_HOLabels[lang][1] + "</button>" +            "</td></tr>";        if (hotelsi_HODisplayBrand) {            htmlform += "<tr>" +               "<td valing='bottom' align='right'><a class='hotelsi_HOdefaultInfo' href='http://www.hotel.si' target='_blank'>Hotel.si</a></td>" +               "</tr>";        }        htmlform += "</table>";    }    div.innerHTML = htmlform;    if (prevID != -1)        hotelsi_shiftOpacity(divID + "_" + hotelID, 1500, "");    if (resSplit[5] > 1)        setTimeout("hotelsi_changeHO('" + resSplit[0] + "','" + hotelID + "','" + divID + "'," + lang + ");", hotelsi_HOinterval);    return true;}function hotelsi_changeHO(prevID, hotelID, divID, lang) {    hotelsi_shiftOpacity(divID + "_" + hotelID, 500, "hotelsi_switchHO('" + prevID + "'," + hotelID + ",'" + divID + "'," + lang + ");");    return true;}function hotelsi_switchHO(prevID, hotelID, divID, lang) {    if (document.domain == "www.hotel.si" || document.domain == hotelsi_DOMAIN2ND) {        $.post(hotelsi_hotOfferService, { HOid: prevID, HOhotel: hotelID, HOlang: hotelsi_HOLabels[lang][2], HOverified:0},            function(data) {                hotelsi_HOcallback(data, prevID, hotelID, divID, lang);                return true;            }	    );        return true;    }    else {        $.ajax({            dataType: 'jsonp',            data: 'HOid=' + prevID + '&HOhotel=' + hotelID + '&HOlang=' + hotelsi_HOLabels[lang][2] + '&HOverified=0',            jsonp: 'jsonp_callback',            url: hotelsi_hotOfferService,            success: function(data) {                hotelsi_HOcallback(data.Results, prevID, hotelID, divID, lang);                return true;            }        });        return true;    }    return true;}function hotelsi_setHotOffer(hotelID, divID, language) {    hotelsi_setHO(hotelID, divID, hotelsi_HOTransInt[language]);}function hotelsi_setHO(hotelID, divID, lang) {    if (hotelsi_HOlayout == "HORIZONTAL") {        document.getElementById(divID).innerHTML = "<div id='" + divID + "_" + hotelID + "' style='overflow:hidden;z-index:1;width:100%;'></div>";    }    else {        document.getElementById(divID).innerHTML = "<div id='" + divID + "_" + hotelID + "' style='overflow:hidden;z-index:1;'></div>";    }    document.getElementById(divID + "_" + hotelID).style.opacity = 100;    hotelsi_HOwait_for_script_load("jQuery", function() { hotelsi_switchHO(-1, "" + hotelID, divID, lang);  });        return true;}function hotelsi_OpenHotOffer(hotOfferLink) {    if (hotelsi_HOReturnUrl != undefined) {        window.location = hotOfferLink + "&ReturnUrl=" + hotelsi_HOReturnUrl;    }    else {        window.open(hotOfferLink, 'mywindow', 'toolbar=0, location=1, status=1, scrollbars=1, resizable=1');    }    return false;}

