
  
var QSMap = function (id, areas){
    this._mapid = id;
    this._areas = areas;
}

QSMap.prototype = {
    ApplyMap : function () {     
       if (!this._areas) return;
       var map = document.getElementById(this._mapid);
       for (var i=0;i<this._areas.length;i++){
               var area = document.createElement('area');
                area.setAttribute('shape', this._areas[i].shape);
                area.setAttribute('coords', this._areas[i].coords);
                area.setAttribute('href', 'LinkMgr.aspx?wa=' + RTA_USERNAME + '&url=' + encodeURIComponent(this._areas[i].url));
                area.setAttribute('target', '_blank');
                map.appendChild(area);
        }
    }
}

var qsmap = new QSMap('vacations_QS2_Map', [ 
    { shape: 'poly', 
      coords: '109,36,115,54,114,79,96,99,73,108,43,102,21,78,19,51,32,28,55,13,79,12,95,21,106,31', 
      url: 'http://partners.kcdataservices.com/partners/custom/buildMyOwn.jsp?agn_id=14564793&ui_path=ytb&disable_header=true&sv_phone=6186559520&sv_email=apple@ytbtravel.com&sv_id=#TRACKINGID#'
      },
    { shape: 'poly', 
      coords: '246,69,208,65,166,59,157,52,155,41,157,19,166,5,179,4,182,6,255,14,267,19,272,31,269,47,268,60,262,67,259,68', 
      url: 'http://ytb.spring-tour.com/?Agency=YTB&AgentID='+TrackID+'&Region=China Tours'
      },
    { shape: 'poly', 
      coords: '242,159,229,162,153,183,156,180,142,168,135,153,133,151,143,145,154,142,166,137,267,111,273,111,275,123,277,137,276,146,271,149,263,152,249,157', 
      url: 'http://www.pleasantholidays.com/PleasantHolidaysWeb/LinkAction.do?PartnerCode=59840&WebSerialNumber=2857&ReferralNumber='+TrackID
      },
    { shape: 'poly', 
      coords: '231,94,232,100,229,117,219,123,192,128,170,125,151,119,124,106,106,91,109,83,114,64,138,59,165,61,200,72,214,81,221,88,229,94', 
      url: 'http://partners.collettevacations.com/?&AffSubId='+TrackID+'&AffID=W363-AX1-918'
      },
    { shape: 'poly', 
      coords: '11,135,120,100,136,149,28,185,11,135', 
      url: 'http://crusader.travimp.com/TIDirect/TIDirectFrontServlet?request_type=search&TIConnectId='+TrackID+'&ParentAgencyCode=14564793&ClientName=YTB%20Travel%20Network&SearchURL=http://www.ytbtravel.com&ConfirmationEmail=travimpcomm@ytb.com&WantEmail=Yes&Phone=800-243-4450&CustServEmail=travimpcomm@ytb.com&Banner=Y&AgencyType=sub&dataFromURL=Yes' 
      } 
    ])

qsmap.ApplyMap();    
