// 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); var styleHTML = ''; // Drop in the widget's id styleHTML = styleHTML.replace(/#hfe-widget/g,"#hfe-widget-"+widget_id); document.write(styleHTML); document.write('
'); // Create header widget DOM fragment var header = document.createElement('div'); var dealList = document.createElement('div'); var widget = document.getElementById('hfe-widget-'+widget_id); header.className = "header"; header.innerHTML = ''+dealData.title_1+''; var dealListHTML = ''; // Analytics call dealListHTML += ''; dealList.innerHTML = dealListHTML; widget.appendChild(header); widget.appendChild(dealList); }; })(); var dealData = {"default_url" : "http://fodors.hotels-for-everyone.com/landmark_pages/view_destination/San+Diego/32.812241/-117.118767?pid=515&spec=0", "title_1" : "Fodor's Finds Hotel Deals in San Diego", "title_2" : "San Diego landmarks", "title_3" : "San Diego hotels", "title_4" : "in San Diego", "title_5" : "in
San Diego", "domain" : "fodors.hotels-for-everyone.com", "type" : "destination", "img_domain" : "img1.hotels-for-everyone.com", "phone" : "800-559-7314", "partner_id" : "515", "destination" : "san-diego", "name_slug" : "san-diego", "city_state_country" : "San Diego, California, USA", "min_date" : "03/16/2010", "max_date" : "02/08/2011", "click_tracking_code" : "onclick=\"linkCode(this,'event32');\" rel=\"nofollow\"", "category" : "beach", "deals" : [ {"promo_text" : "Bahia Resort Hotel - Save 50% On Your Stay", "url" : "http://fodors.hotels-for-everyone.com/booking/hotel_details?pid=&hid=203643&checkIn=04/05/2010&checkOut=04/09/2010", "discovered" : "03/16/2010", "source" : "Promotion from 10"}, {"promo_text" : "4 Star Hotel - 3rd Night Free", "url" : "http://fodors.hotels-for-everyone.com/landmark_pages/view_destination/San+Diego/32.812241/-117.118767?pid=515&spec=0&hhid=106054&checkIn=03/20/2010&checkOut=03/23/2010", "discovered" : "03/16/2010", "source" : "Promotion from 10"}, {"promo_text" : "Se San Diego - Save 45% On Your Stay", "url" : "http://fodors.hotels-for-everyone.com/booking/hotel_details?pid=&hid=271487&checkIn=03/22/2010&checkOut=03/29/2010", "discovered" : "03/16/2010", "source" : "Promotion from 10"}]}; HFE_TravelFinds_450_150_1(dealData);