// Wrap code with module pattern.
(function() {
var global = this;
// widget constructor function
global.HFE_TravelFinds_450_150_1 = function(dealData) {
var widget_style = '450_150_1';
var widget_id=Math.floor(Math.random()*10000);
// Don't do style for Fodor's
if (dealData.partner_id != "515") {
var styleHTML = '';
// Drop in the widget's id
styleHTML = styleHTML.replace(/#hfe-widget/g,"#hfe-widget-"+widget_id);
document.write(styleHTML);
}
document.write('
');
var widget = document.getElementById('hfe-widget-'+widget_id);
// Create header widget DOM fragment
var dealListHTML = '';
dealListHTML +='';
for (var i = 0; i < dealData.deals.length; i++) {
var deal = dealData.deals[i];
dealListHTML += '- '+deal.promo_text+'
';
}
dealListHTML +='
';
dealListHTML += '';
if (dealData.deals && dealData.deals.length > 0) {
dealListHTML += 'Deals found '+dealData.deals[0].discovered+' - ';
}
dealListHTML += 'Find yours now! Go »';
// Analytics call
dealListHTML += '';
widget.innerHTML = dealListHTML;
};
})();
var dealData = {"default_url" : "http://fodors.hotels-for-everyone.com/landmark_pages/view_destination/Berkshires/42.365921/-73.267838?pid=515&spec=0", "tagline_1" : "Fodor's Finds", "tagline_2" : "Fodor's Find", "title_1" : "Fodor's Finds Hotel Deals in Berkshires", "title_2" : "Berkshires landmarks", "title_3" : "Berkshires hotels", "title_4" : "in Berkshires", "title_5" : "in
Berkshires", "domain" : "fodors.hotels-for-everyone.com", "type" : "destination", "img_domain" : "img1.hotels-for-everyone.com", "phone" : "800-559-7314", "partner_id" : "515", "destination" : "lenox", "name_slug" : "berkshires", "city_state_country" : "Lenox, Massachusetts, USA", "min_date" : "09/02/2010", "max_date" : "07/29/2011", "click_tracking_code" : "onclick=\"linkCode(this,'event32');\" rel=\"nofollow\"", "category" : "", "deals" : [ {"promo_text" : "3.5 Star Hotel - Stay 1 Nts, Save 25%", "url" : "http://fodors.hotels-for-everyone.com/landmark_pages/view_destination/Berkshires/42.365921/-73.267838?pid=515&spec=0&hhid=153480&checkIn=09/04/2010&checkOut=09/05/2010", "discovered" : "09/02/2010", "source" : "Deal from 000", "hotel_id" : "153480"}, {"promo_text" : "3 Star Hotel from $89", "url" : "http://fodors.hotels-for-everyone.com/landmark_pages/view_destination/Berkshires/42.365921/-73.267838?pid=515&spec=0&hhid=137768", "discovered" : "09/02/2010", "source" : "Inventory from 000", "hotel_id" : "137768"}, {"promo_text" : "3.5 Star Hotel from $117", "url" : "http://fodors.hotels-for-everyone.com/landmark_pages/view_destination/Berkshires/42.365921/-73.267838?pid=515&spec=0&hhid=169107", "discovered" : "09/02/2010", "source" : "Inventory from 000", "hotel_id" : "169107"}]};
HFE_TravelFinds_450_150_1(dealData);