// Wrap code with module pattern. (function() { var global = this; // widget constructor function global.HFE_TravelFinds_300_250_2 = function(dealData) { var widget_style = '300_250_2'; 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 content = document.createElement('div'); var widget = document.getElementById('hfe-widget-'+widget_id); header.className = "header"; header.innerHTML = '
'+dealData.tagline_1+' Hotel Deals
'; content.className = "content"; var contentHTML = '
\
\ \ '; if (showFreeForm) { contentHTML += ''; } var colCount=0; var k=0; var maxColCount = 2; var widgetDestArray = new Array(); for(var i=0; i < cities.length; i++) { colCount++; if (!widgetDestArray[k]) { widgetDestArray[k] = new Array(); } widgetDestArray[k][colCount -1] = cities[i]; // Reached the bottom, reset the figures if (colCount == maxColCount) { k++; colCount = 0; } } // Build the City Table for(var i=0; i < widgetDestArray.length; i++) { contentHTML += ''; for(var j=0; j < widgetDestArray[i].length; j++) { contentHTML += ''; } contentHTML += ''; } contentHTML += ' \
'; var destParts = widgetDestArray[i][j].split(','); var cityId = (i+10)*(j+1); contentHTML += '
'; contentHTML += '
\
\
\ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \
\ '+dealData.phone+'
\ \
\ \ \
\ \
'; // Analytics call contentHTML += ''; content.innerHTML = contentHTML; widget.appendChild(header); widget.appendChild(content); document.write('') document.write('') }; })(); var dealData = {"default_url" : "http://govisithawaii.hotels-for-everyone.com/", "tagline_1" : "Go Visit Hawaii Finds", "tagline_2" : "Go Visit Hawaii Find", "title_1" : "", "title_2" : "", "title_3" : "", "title_4" : "", "title_5" : "", "domain" : "govisithawaii.hotels-for-everyone.com", "widget_domain" : "govisithawaii.hotels-for-everyone.com", "type" : "booking", "img_domain" : "img1.hotels-for-everyone.com", "phone" : "800-570-7461", "partner_id" : "501", "destination" : "free-form//Waikiki/Honolulu (Oahu),HI,US//Kaanapali (Maui),HI,US//Wailea (Maui),HI,US//Kona (Big Island),HI,US//Kohala Coast (Big Is.),HI,US//Poipu (Kauai),HI,US", "name_slug" : "go-visit-hawaii---general", "city_state_country" : "free-form//Waikiki/Honolulu (Oahu),HI,US//Kaanapali (Maui),HI,US//Wailea (Maui),HI,US//Kona (Big Island),HI,US//Kohala Coast (Big Is.),HI,US//Poipu (Kauai),HI,US, Hawaii, USA", "min_date" : "01/27/2012", "max_date" : "12/22/2012", "click_tracking_code" : "", "category" : "", "hotel_id" : "", "hotel_name" : "", "deals" : [ ]}; HFE_TravelFinds_300_250_2(dealData);