// 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 or for Tix4Tonight
if (dealData.partner_id != "515" && dealData.partner_id != "518") {
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 += 'Find More Deals';
// Analytics call
dealListHTML += '';
widget.innerHTML = dealListHTML;
};
})();
var dealData = {"default_url" : "http://fodors-finds.hotels-for-everyone.com/landmark_pages/view_destination/Los+Angeles/34.006733/-118.373749?pid=515&spec=0", "tagline_1" : "Fodor's Finds", "tagline_2" : "Fodor's Find", "title_1" : "Fodor's Finds Hotel Deals in Los Angeles", "title_2" : "Los Angeles landmarks", "title_3" : "Los Angeles hotels", "title_4" : "in Los Angeles", "title_5" : "in
Los Angeles", "domain" : "fodors-finds.hotels-for-everyone.com", "widget_domain" : "fodors.hotels-for-everyone.com", "type" : "destination", "img_domain" : "img1.hotels-for-everyone.com", "phone" : "800-916-8592", "partner_id" : "515", "destination" : "los-angeles", "name_slug" : "los-angeles", "city_state_country" : "Los Angeles, California, USA", "min_date" : "02/09/2012", "max_date" : "01/04/2013", "click_tracking_code" : "onclick=\"linkCode(this,'event32');\" rel=\"nofollow\"", "category" : "sun", "hotel_id" : "", "hotel_name" : "", "deals" : [ {"promo_text" : "The Tower Beverly Hills - Stay 3 Nts, Save 25%", "url" : "http://fodors-finds.hotels-for-everyone.com/booking/hotel_details?pid=515&hid=121701&checkIn=10/26/2012&checkOut=11/02/2012", "discovered" : "02/08/2012", "source" : "Deal from 000", "hotel_id" : "121701"}, {"promo_text" : "The Wilshire Hotel - Stay 2 Nts, Save 20%", "url" : "http://fodors-finds.hotels-for-everyone.com/booking/hotel_details?pid=515&hid=129339&checkIn=02/10/2012&checkOut=02/12/2012", "discovered" : "02/08/2012", "source" : "Deal from 000", "hotel_id" : "129339"}, {"promo_text" : "Book in Advance - Save 35%", "url" : "http://fodors-finds.hotels-for-everyone.com/landmark_pages/view_destination/Los+Angeles/34.006733/-118.373749?pid=515&spec=0&hhid=255662&checkIn=09/24/2012&checkOut=10/01/2012", "discovered" : "02/08/2012", "source" : "Deal from 000", "hotel_id" : "255662"}]};
HFE_TravelFinds_450_150_1(dealData);