var MAINDATABLOCKS = new Array('RATES','MAININFO','ADDITIONALSERVICES','DEPARTUREPOINTS','USEFULINFO','GALLERY'); var RelatedOffers_InfoPopboxState = false; var TextSize1 = 12; var TextSize2 = 11; var TextSize3 = 14; var TextSize4 = 16; var ActiveListID = ''; $(document).ready(function() { PageReflow(); RenderRates(RATESDATA); }); function PageReflow() { if (typeof GalleryImages !== 'undefined' && GalleryImages>0) { var MinHeight = 999; for (var i=0; i<=GalleryImages; i++) { if ($("#GALLERYIMAGE_"+i+"_1").length==0 || $("#GALLERYIMAGE_"+i+"_1").outerHeight()<=0) { continue; } if (MinHeight>$("#GALLERYIMAGE_"+i+"_1").outerHeight()) { MinHeight = parseInt($("#GALLERYIMAGE_"+i+"_1").outerHeight(),10); } } if (MinHeight<110) { MinHeight = 110; } for (var i=0; i<=GalleryImages; i++) { if ($("#GALLERYIMAGE_"+i+"_0").length==0) { continue; } $("#GALLERYIMAGE_"+i+"_0").css('height',MinHeight+'px'); } } } function ToggleDataBlock(id) { if (id=='MAININFO' || id=='ADDITIONALSERVICES' || id=='DEPARTUREPOINTS') { $("#DATABLOCK_CONTAINER").show(); } else { $("#DATABLOCK_CONTAINER").hide(); } for (var i=0; i'; HTMLDATA += '
'; HTMLDATA += '
'; HTMLDATA += '
' + RELATEDOFFERS[index][1] + ' '; if (RELATEDOFFERS[index][1]==1) { HTMLDATA += 'ден'; } else { HTMLDATA += 'дни'; } HTMLDATA += '
'; HTMLDATA += '
' + RELATEDOFFERS[index][2] + '
'; HTMLDATA += '
'; HTMLDATA += ''; $(datacell).empty().append(HTMLDATA); $("#RELATEDOFFERS_EXTRAINFO_CONTAINER").css('top',(CellPos.top-3)+'px').show(); RelatedOffers_InfoPopboxState = true; } function RelatedOffers_OfferOut(index) { $("#RELATEDOFFER_"+index).css('background',''); $("#RELATEDOFFER_"+index+"_LINK").css('color','#48347E').css('border-bottom',''); RelatedOffers_InfoPopboxState = false; setTimeout("RelatedOffers_HideInfoPopbox()",1000); } function RelatedOffers_PopboxOver() { RelatedOffers_InfoPopboxState = true; } function RelatedOffers_PopboxOut() { RelatedOffers_InfoPopboxState = false; setTimeout("RelatedOffers_HideInfoPopbox()",1000); } function RelatedOffers_HideInfoPopbox() { if (RelatedOffers_InfoPopboxState) { return; } $("#RELATEDOFFERS_EXTRAINFO_CONTAINER").hide(); } function DotLevelOver(id) { var Text = ''; var BarPos = $("#DOTLEVEL_"+id).position(); var BarLeft = BarPos.left; var BarTop = BarPos.top+27; var IconWidth = $("#DOTLEVEL_"+id).width(); var IconCenterLeft = BarLeft+Math.floor(IconWidth/2); // Initially, position it excessively to the left $("#DOTLEVEL_INFOBOX_TEXT").empty().append('
'+LEVELTEXT[id]+'
'); $("#DOTLEVEL_INFOBOX").css('top',BarTop+'px').css('left',(IconCenterLeft-200)+'px').show(); // Then position it more precisely BoxCenterLeft = Math.floor($("#DOTLEVEL_INFOBOX").width()/2); BoxHeight = $("#DOTLEVEL_INFOBOX").height(); $("#DOTLEVEL_INFOBOX").css('left',(IconCenterLeft-BoxCenterLeft)+'px').css('top',(BarTop)+'px'); $("#DOTLEVEL_"+id).css('cursor','pointer').css('background','#EEEEEE'); } function DotLevelOut(id) { $("#DOTLEVEL_INFOBOX").hide(); $("#DOTLEVEL_"+id).css('cursor','').css('background',''); } function TagOver(id) { $("#TAG_"+id+"_L").show(); $("#TAG_"+id+"_R").show(); $("#TAG_"+id+"_B").css('cursor','pointer').css('background-position','0px -100px'); $("#TAG_"+id+"_T").css('color','#FFFFFF'); } function TagOut(id) { $("#TAG_"+id+"_L").hide(); $("#TAG_"+id+"_R").hide(); $("#TAG_"+id+"_B").css('cursor','').css('background-position','0px 0px'); $("#TAG_"+id+"_T").css('color','#48347E'); } function PageButtonOver(obj) { $(obj).css('margin-top','-18px'); } function PageButtonOut(obj) { $(obj).css('margin-top','0px'); } function ShareLinkOver() { $("#PAGELINKS_SHARE_I").hide(); $("#PAGELINKS_SHARE_A").show(); } function ShareLinkOut() { $("#PAGELINKS_SHARE_I").show(); $("#PAGELINKS_SHARE_A").hide(); } function ResizeText(value) { if (value!=1 && value!=-1) { return; } if (value==1 && TextSize1>16) { return; } if (value==-1 && TextSize1<9) { return; } TextSize1 += value; TextSize2 += value; TextSize3 += value; TextSize4 += value; $('div.regtxtB1').css('font-size',TextSize1+'px'); $('div.smalltxtB1').css('font-size',TextSize2+'px'); $('div.bigtxtB2').css('font-size',TextSize3+'px'); $('div.headcell00').css('font-size',TextSize4+'px'); } function RenderRates(RESPONSE) { if (typeof RESPONSE === 'undefined') { NoRates(); return; } if (typeof RESPONSE.DATES === 'undefined') { NoRates(); return; } var HTMLDATA = ''; HTMLDATA += '
'; HTMLDATA += '
'; HTMLDATA += '
'; for (var i=0; i0) { HTMLDATA += '
'; } var DateKey = RESPONSE.DATES[i].replace(/\//ig,''); HTMLDATA += '
'; HTMLDATA += ''; HTMLDATA += '
'+RESPONSE.DATES[i].replace(/\//ig,'.')+'
'; HTMLDATA += '
'; } HTMLDATA += '
'; HTMLDATA += '
'; $("#RATES_DATA").empty().append(HTMLDATA); $("#RATES_WAIT").hide(); if ($("#RATES_LIST").height()>$("#RATES_RESULTS").height()) { $("#RATES_RESULTS").css('min-height',$("#RATES_LIST").height()+'px'); } RenderDate(RESPONSE,RESPONSE.DATES[0]); } function NoRates() { var HTMLDATA = '
В момента няма свободни места.
'; $("#RATES_DATA").empty().append(HTMLDATA); $("#RATES_WAIT").hide(); $("#RATE_DISCLAIMER").hide(); } function RateListOptionOver(id) { if (ActiveListID==id) { return; } $("#RATELISTOPT_"+id+"_0").css('background','#777777'); $("#RATELISTOPT_"+id+"_1").css('color','#FFFFFF'); } function RateListOptionOut(id) { if (ActiveListID==id) { return; } $("#RATELISTOPT_"+id+"_0").css('background',''); $("#RATELISTOPT_"+id+"_1").css('color','#483180'); } function RenderDate(RESPONSE,DepartureDate) { if (ActiveListID.length>0) { $("#RATELISTOPT_"+ActiveListID+"_0").css('background',''); $("#RATELISTOPT_"+ActiveListID+"_1").css('color','#483180'); } ActiveListID = DepartureDate.replace(/\//ig,''); $("#RATELISTOPT_"+ActiveListID+"_0").css('background','#483180'); $("#RATELISTOPT_"+ActiveListID+"_1").css('color','#FFFFFF'); var HTMLDATA = ''; var CURHOTELOUTPUT = ''; var HOTELPRICECODES = []; var HOTELS_ORDER = (typeof RESPONSE.HOTELS_ORDERED[DepartureDate] === 'object') ? RESPONSE.HOTELS_ORDERED[DepartureDate] : []; if (HOTELS_ORDER.length==0) { for (var CurHotelID in RESPONSE.HOTELS) { HOTELS_ORDER.push(CurHotelID); } } for (var hIndex=0; hIndex'+RESPONSE.HOTELS[CurHotelID][0]+''; } else { CURHOTELOUTPUT += '
'+RESPONSE.HOTELS[CurHotelID][0]+'
'; } if (RESPONSE.HOTELS[CurHotelID][2]>=1 && RESPONSE.HOTELS[CurHotelID][2]<=5) { CURHOTELOUTPUT += '
'; if (ExternalSource!='TEZTOUR') { CURHOTELOUTPUT += ''; } for (var st=1; st<=RESPONSE.HOTELS[CurHotelID][2]; st++) { CURHOTELOUTPUT += '
'; } CURHOTELOUTPUT += '
'; CURHOTELOUTPUT += '
'; } if (typeof RESPONSE.HOTELS[CurHotelID][3][DepartureDate] === 'undefined') { } else if (typeof RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['Promotion'] !== 'undefined' || typeof RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['SuperPromotion'] !== 'undefined' || typeof RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['LastMinute'] !== 'undefined' || typeof RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['EarlyBird'] !== 'undefined') { CURHOTELOUTPUT += ''; CURHOTELOUTPUT += ''; CURHOTELOUTPUT += ''; CURHOTELOUTPUT += ''; CURHOTELOUTPUT += ''; if (RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['SuperPromotion']) { CURHOTELOUTPUT += ''; } else if (RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['Promotion']) { CURHOTELOUTPUT += ''; } if (RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['LastMinute']) { CURHOTELOUTPUT += ''; } if (RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['EarlyBird']) { CURHOTELOUTPUT += ''; } CURHOTELOUTPUT += ''; CURHOTELOUTPUT += '
СУПЕР ПРОМОЦИЯ
ПРОМОЦИЯ
LAST MINUTE
РАННИ ЗАПИСВАНИЯ
'; CURHOTELOUTPUT += ''; } CURHOTELOUTPUT += ''; CURHOTELOUTPUT += ''; if (typeof RESPONSE.HOTELS[CurHotelID][3][DepartureDate] !== 'undefined' && typeof RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['Availability'] !== 'undefined') { CURHOTELOUTPUT += '
'; if (RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['Availability'] == 'AVAILABLE') { CURHOTELOUTPUT += 'има места'; } if (RESPONSE.HOTELS[CurHotelID][3][DepartureDate]['Availability'] == 'LIMITED') { CURHOTELOUTPUT += 'ограничени места'; } CURHOTELOUTPUT += '
'; } CURHOTELOUTPUT += ''; CURHOTELOUTPUT += '
'; CURHOTELOUTPUT += ''; CURHOTELOUTPUT += ''; CURHOTELOUTPUT += ''; if (ExternalSource=='TEZTOUR') { CURHOTELOUTPUT += ''; } var i=0; for (var CurPriceCode in RESPONSE.PRICECODES) { if (typeof HOTELPRICECODES[CurPriceCode] === 'undefined') { continue; } var CurColID = CurHotelID+'_PC'+i; CURHOTELOUTPUT += ''; i++; } CURHOTELOUTPUT += ''; for (var i=0; i'; CURHOTELOUTPUT += ''; if (ExternalSource=='TEZTOUR') { CURHOTELOUTPUT += ''; } var PriceCodeK=0; for (var CurPriceCode in RESPONSE.PRICECODES) { if (typeof HOTELPRICECODES[CurPriceCode] === 'undefined') { continue; } CURRATEHTML = ''; for (var j2=0; j2'; if (RESPONSE.RESULTS[i][5][j2][3] !== undefined && RESPONSE.RESULTS[i][5][j2][3]>RESPONSE.RESULTS[i][5][j2][1]) { CURRATEHTML += '
' + RESPONSE.RESULTS[i][5][j2][3] + '
'; } CURRATEHTML += System.FormatPrice(RESPONSE.RESULTS[i][5][j2][1],RESPONSE.RESULTS[i][4]); CURRATEHTML += ''; break; } if (CURRATEHTML.length==0) { CURHOTELOUTPUT += '
'; } else { CURHOTELOUTPUT += ''; } PriceCodeK++; } CURHOTELOUTPUT += ''; } CURHOTELOUTPUT += '
'; if (RESPONSE.PRICECODES[CurPriceCode][0].length==0) { CURHOTELOUTPUT += CurPriceCode; } else { CURHOTELOUTPUT += RESPONSE.PRICECODES[CurPriceCode][0].toUpperCase(); } CURHOTELOUTPUT += '
'; if (ExternalSource!='TEZTOUR') { CURHOTELOUTPUT += ''; } CURHOTELOUTPUT += '
'+RESPONSE.HOTELS[CurHotelID][1][RESPONSE.RESULTS[i][1]][0]+'
'; CURHOTELOUTPUT += '
'; CURHOTELOUTPUT += '
'+RESPONSE.HOTELS[CurHotelID][1][RESPONSE.RESULTS[i][1]][2]+'
'; CURHOTELOUTPUT += '
'; CURHOTELOUTPUT += '
'; CURHOTELOUTPUT += ''; CURHOTELOUTPUT += CURRATEHTML; CURHOTELOUTPUT += '
'; CURHOTELOUTPUT += '
'; if (HTMLDATA.length>0) { HTMLDATA += '
'; } HTMLDATA += CURHOTELOUTPUT; } $("#RATES_RESULTS").empty().append('
'+HTMLDATA+'
'); } function RateLineOver(obj,RowID) { $(obj).css('cursor','pointer'); $("#RATE_"+RowID+"_0").css('background','#EDEBF3'); $("#RATE_"+RowID+"_1").removeClass('holrates-resultC03').addClass('holrates-resultC03-a'); if ($("#RATE_"+RowID+"_2").length>0) { $("#RATE_"+RowID+"_2").removeClass('holrates-resultC03').addClass('holrates-resultC03-a'); } } function RateLineOut(obj,RowID) { $(obj).css('cursor',''); $("#RATE_"+RowID+"_0").css('background',''); $("#RATE_"+RowID+"_1").removeClass('holrates-resultC03-a').addClass('holrates-resultC03'); if ($("#RATE_"+RowID+"_2").length>0) { $("#RATE_"+RowID+"_2").removeClass('holrates-resultC03-a').addClass('holrates-resultC03'); } } function RateCellOver(RowID,CellID) { $("#RATE_"+RowID+"_R"+CellID).css('background','#483180') .find('.holrates-resultCT3').addClass('holrates-resultCT3-hover'); $("#RATE_"+RowID+"_R"+CellID+"_TXT").css('color','#FFFFFF'); } function RateCellOut(RowID,CellID) { $("#RATE_"+RowID+"_R"+CellID).css('background','') .find('.holrates-resultCT3').removeClass('holrates-resultCT3-hover'); $("#RATE_"+RowID+"_R"+CellID+"_TXT").css('color','#000000'); } function RateTooltipRoomName(CurRowID,HotelID,RoomID) { if (typeof RATESDATA.HOTELS[HotelID][1][RoomID][0] === 'undefined') { return; } if (RATESDATA.HOTELS[HotelID][1][RoomID][0].length<50 && RATESDATA.HOTELS[HotelID][1][RoomID][1].length==0) { return; } var HTMLDATA = '
'; HTMLDATA += '
'+RATESDATA.HOTELS[HotelID][1][RoomID][0]+'
'; if (RATESDATA.HOTELS[HotelID][1][RoomID][1].length>0) { HTMLDATA += '
'+RATESDATA.HOTELS[HotelID][1][RoomID][1]+'
'; } HTMLDATA += '
'; $("#TOOLTIP_HOLIDAYSRATES_BOX").css('width','480px'); Layout.TooltipShow('BOTTOM_LEFT','HOLIDAYSRATES','RATE_'+CurRowID+'_1',HTMLDATA,0,0); } function RateTooltipAccType(CurColID,PriceCode) { if (typeof RATESDATA.PRICECODES[PriceCode] === 'undefined') { return; } if (RATESDATA.PRICECODES[PriceCode][1].length==0) { return; } if (RATESDATA.PRICECODES[PriceCode][0]==RATESDATA.PRICECODES[PriceCode][1]) { return; } var HTMLDATA = '
'+RATESDATA.PRICECODES[PriceCode][1]+'
'; $("#TOOLTIP_HOLIDAYSRATES_BOX").css('width','auto'); Layout.TooltipShow('BOTTOM_LEFT','HOLIDAYSRATES','ACCTYPE_'+CurColID+'_0',HTMLDATA,41,0); } function rawurlencode(str) { str = (str + '').toString(); return encodeURIComponent(str) .replace(/!/g, '%21') .replace(/'/g, '%27') .replace(/\(/g, '%28') .replace(/\)/g, '%29') .replace(/\*/g, '%2A'); }