function TravelList() {
  this.displayTravelList = function(id, maxLength) {
    var container = document.getElementById(id);
    container.style.fontSize = '11px';
    maxLength = maxLength || 5;
    var rssUrl = '/travel/expediaRss.do';
    var adsUrl = 'http://ads.mytelus.com/event.ng/Type=click&clicktracker=expedia_travel_rss_feed&FlightID=24611&AdID=48378&TargetID=5157&Segments=35,1099,1772,1833,2066,2100,2101,2158,2196,2219,2225,2262,2271,2285,2457,2506,2532,2689,2692,2693,2718,2799,2815,2816,2818,2840,2854,2860,2882,2920,2945,2964,2979,3068,3075,3106,3118,3135&Targets=5157&Values=34,46,51,63,77,82,100,110,836,2304,2939,3351,3443,3474,3477,3687,3741,3863,3892,3951,4060,4199,4242,4559,4578,4579,4584,4695,4717,4723,4738,4757,4764,4768,4769,4775,4776,4890,4891&RawValues=&Redirect=';

    var http = new HttpRequest();
    http.getXml('get', rssUrl, displayList);

    function displayList(xml) {
      var data = xml.getElementsByTagName('deal');
      if (data == null) return;
      if (maxLength > data.length) maxLength = data.length;

      for (var i = 0; i < maxLength; i++) {
        var title = getChildValue(data.item(i), 'Route');
        var url = getChildValue(data.item(i), 'Url');
        var price = getChildValue(data.item(i), 'PriceNights');

        var div = document.createElement('div');
        div.style.paddingLeft = '8px';
        div.style.backgroundImage = 'url(/images/bullet.gif)';
        div.style.backgroundRepeat = 'no-repeat';
        container.appendChild(div);
        var a = document.createElement('a');
        div.appendChild(a);
        a.href = adsUrl + url;
        a.style.textDecoration = 'none';
        a.onmouseover = function() { this.style.textDecoration = 'underline'; }
        a.onmouseout = function() { this.style.textDecoration = 'none'; }
        var s = document.createElement('strong');
        s.appendChild(document.createTextNode(title));
        a.appendChild(s);
        a.appendChild(document.createElement('br'));
        a.appendChild(document.createTextNode(price));
      }
    }
  }
  function getChildValue(xmlNode, name) {
    try { return xmlNode.getElementsByTagName(name).item(0).firstChild.nodeValue; }
    catch(e) { return null; }
  }
}
