Compare and save on Manchester hotels
var ListPage = {
maxTries: 20,
interval: 0,
xhrRequests: [],
update: function(url, count, callback){
var fingerprint = "&t=" + (new Date().getTime());
var reqcount = "&req_count=" + count;
this.loader("on");
var self = this;
var req = new XMLHttpRequest();
req.open("GET", url + fingerprint + reqcount, true);
ListPage.xhrRequests.push(req);
req.onreadystatechange = function() {
if (req.readyState === 4 && (req.status === 200 || req.status === 202)) {
eval(req.responseText);
self.loader("off");
if (req.status === 200 || req.status !== 202 ) callback(req.status);
if (req.status === 202) {
if (count < self.maxTries) {
setTimeout(function(){ListPage.update(url, ++count, callback)}, self.interval);
self.interval += 100;
} else {
callback(req.status);
}
}
}
};
req.send(null);
},
loader: function(status) {
var spinnerD = document.querySelector('.spinnersD');
var spinnerM = document.querySelector('.spinnersM');
if (spinnerD && spinnerM) {
if (status === "on") {
spinnerD.className = "spinnersD shownow";
spinnerM.className = "spinnersM shownow";
} else {
// hide
spinnerD.className = "spinnersD";
spinnerM.className = "spinnersM";
}
}
},
ajax: function(url, callback) {
this.update(url, 1, callback);
}
};
ListPage.ajax("https://www.skyscanner.net/trip/hotels/hotel_list_page?action=index&clean_path=manchester&controller=topics&country_code=¤t_user_id=&filters=&id=2000000000525&klass_name=Region&list_type=hotels&nearby=false&order=asc&page=2&path=manchester%2Fhotels&place=2000000000525&place_type=City&place_type=region®ion=2000000000525&sort=best_value", function(status){
if (status === 200) {
HotelRates.ajax();
}
});
var HotelRates = {
hotels: "hotel_ids%5B%5D=5000000415716&hotel_ids%5B%5D=5000001253551&hotel_ids%5B%5D=5000000069187&hotel_ids%5B%5D=5000000396994&hotel_ids%5B%5D=5000000106030&hotel_ids%5B%5D=5000000212040&hotel_ids%5B%5D=5000000925087&hotel_ids%5B%5D=5000003678474&hotel_ids%5B%5D=5000000001409&hotel_ids%5B%5D=5000000163054&hotel_ids%5B%5D=5000000701797&hotel_ids%5B%5D=5000000123116&hotel_ids%5B%5D=5000000140388&hotel_ids%5B%5D=5000000320540&hotel_ids%5B%5D=5000000341459&hotel_ids%5B%5D=5000000402635&hotel_ids%5B%5D=5000000282153&hotel_ids%5B%5D=5000000385312&hotel_ids%5B%5D=5000000365874&hotel_ids%5B%5D=5000000233061&hotel_ids%5B%5D=5000000161256&hotel_ids%5B%5D=5000000065423&hotel_ids%5B%5D=5000000128696&hotel_ids%5B%5D=5000000190037&hotel_ids%5B%5D=5000000362900&hotel_ids%5B%5D=5000000343691&hotel_ids%5B%5D=5000000016872&hotel_ids%5B%5D=5000000384153&hotel_ids%5B%5D=5000000345285&hotel_ids%5B%5D=5000000011101",
ajaxCalls: function(tryIndex) {
if (this.hotels) {
ListPage.update("https://www.skyscanner.net/trip/hotels/hotel_rates_list?bookable_only=&country_code=¤t_user_id=&locale=en-GB®ion=2000000000525" + "&" + this.hotels, tryIndex, function(){
var placeholder = document.querySelectorAll('.metasearch_featured .placeholder');
for (var i = 0; i < placeholder.length; i++) {
placeholder[i].style.display='none';
}
});
}
},
ajax: function() {
this.ajaxCalls(1);
},
singleAjax: function() {
this.ajaxCalls(ListPage.maxTries);
}
};
if (typeof IntentMedia !== 'undefined' && window.IntentMedia && IntentMedia.trigger) {
window.IntentMediaProperties.site_currency = 'GBP',
window.IntentMediaProperties.travel_date_start = ''
window.IntentMediaProperties.travel_date_end = ''
IntentMedia.trigger("onpage_ads_redraw");
}