$(document).ready(function () {
	   var image = $('#map_pipeline');
	   var xref = {
	   		a: "<h1>Local 818</h1><h2>Contact</h2><p>Tony Dagley</p><h2>Address</h2><p>10412 Lexington Dr<br> Knoxville, TN 37932</p><h2>Phone Number</h2><p>(865) 966-2009</p><h2>Trade Jurisdiction</h2><p>Building/Heavy/Highway Construction<br> TVA<br> Industrial Maintenance<br> Pipeline</p>",
	   		b: "<h1>Local 386</h1><h2>Contact</h2><p>Johnny Orton</p><h2>Address</h2><p>115 Harris St, Madison<br> TN 37115</p><h2>Phone Number</h2><p>(615) 612-2386</p><h2>Trade Jurisdiction</h2><p>Building/Heavy/Highway Construction<br> TVA<br> Industrial Maintenance<br> Pipeline<br> Public Sector</p>",
			c: "<h1>Local 846</h1><h2>Contact</h2><p>Keith Robinson</p><h2>Address</h2><p>1701 Central Ave, Chattanooga<br> TN 37408</p><h2>Phone Number</h2><p>(423) 267-1802</p><h2>Trade Jurisdiction</h2><p>Building/Heavy/Highway Construction<br> TVA Plant Maintenance<br> Pipeline</p>",
			d: "<h1>Local 366</h1><h2>Contact</h2><p>Kerry Hale</p><h2>Address</h2><p>1405 Shop Pike<br> Sheffield, AL 35660</p><h2>Mailing Adress</h2><p>PO Box 687, Sheffield, AL 35660</p><h2>Phone Number</h2><p>(256) 383-2466</p><h2>Trade Jurisdiction</h2><p>Building/Heavy/Highway Construction<br> TVA<br> Industrial Maintenance<br> Pipeline<br> Service Contract</p>",
			e: "<h1>Local 692</h1><h2>Contact</h2><p>Harold Elkins</p><h2>Address</h2><p>26955 Graves Dr<br> Slaughter, LA 70777</p><h2>Phone Number</h2><p>(225) 658-4886</p><h2>Trade Jurisdiction</h2><p>Pipeline</p>",
			f: "<h1>Local 559</h1><h2>Contact</h2><p>Jerome Peterson</p><h2>Address</h2><p>1229 22nd St N<br> Birmingham, AL 35234</p><h2>Mailing Address</h2><p>PO Box 1211<br> Birmingham, AL 35201</p><h2>Phone Number</h2><p>(205) 251-8810</p><h2>Trade Jurisdiction</h2><p>Building/Heavy/Highway Construction<br> Pipeline<br> Industrial Maintenance</p>",
			g: "<h1>Local 692</h1><h2>Contact</h2><p>Harold Elkins</p><h2>Address</h2><p>26955 Graves Dr<br> Slaughter, LA 70777</p><h2>Phone Number</h2><p>(225) 658-4886</p><h2>Trade Jurisdiction</h2><p>Pipeline</p>",
			h: "<h1>Local 517</h1><h2>Contact</h2><p>Pat Moore</p><h2>Address</h2><p>580 Irene St<br> Orlando, FL 32805</p><h2>Phone Number</h2><p>(407) 299-4000</p><h2>Trade Jurisdiction</h2><p>Building/Heavy/ Highway Construction<br> Pipeline<br> Public Sector<br> Industrial Maintenance</p><p><a href='http://www.unionlocal517.com'>www.unionlocal517.com</a></p>",
			i: "<h1>Construction and Craft Workers' Local 1652</h1><h2>Contact</h2><p>Tom Matthews</p><h2>Address</h2><p>2020 NW 32nd St<br> Pompano Beach, FL 33064</p><h2>Phone Number</h2><p>(954) 975-7600</p><h2>Trade Jurisdiction</h2><p>Building/Heavy/Highway Construction<br> Pipeline<br> Industrial Maintenance</p>"
	   };
	   var aTooltip = '<h1>Local 818</h1>';
	   var bTooltip = '<h1>Local 386</h1>';
	   var cTooltip = '<h1>Local 846</h1>';
	   var dTooltip = '<h1>Local 366</h1>';
	   var eTooltip = '<h1>Local 692</h1>';
	   var fTooltip = '<h1>Local 559</h1>';
	   var gTooltip = '<h1>Local 692</h1>';
	   var hTooltip = '<h1>Local 517</h1>';
	   var iTooltip = '<h1>Local 1652</h1>';
	   image.mapster(
       {
       		fillOpacity: 0.5,
       		fillColor: "ffffff",
       		strokeColor: "ffffff",
       		strokeOpacity: .8,
       		strokeWidth: 1,
       		stroke: true,
            isSelectable: true,
			singleSelect: true,
            mapKey: 'name',
            listKey: 'name',
            onClick: function (e) {
            $('#selections').html(xref[e.key]);
			},
            showToolTip: true,
            toolTipClose: ["tooltip-click", "area-click"],
            areas: [
                {
                	key: "a",
                	fillColor: "ffffff",
					toolTip:aTooltip
                },
				{
                	key: "b",
                	fillColor: "ffffff",
					toolTip:bTooltip
                },
				{
                	key: "c",
                	fillColor: "ffffff",
					toolTip:cTooltip
                },
				{
                	key: "d",
                	fillColor: "ffffff",
					toolTip:dTooltip
                },
				{
                	key: "e",
                	fillColor: "ffffff",
					toolTip:eTooltip
                },
				{
                	key: "f",
                	fillColor: "ffffff",
					toolTip:fTooltip
                },
				{
                	key: "g",
                	fillColor: "ffffff",
					toolTip:gTooltip
                },
				{
                	key: "h",
                	fillColor: "ffffff",
					toolTip:hTooltip
                },
				{
                	key: "i",
                	fillColor: "ffffff",
					toolTip:iTooltip
                }
                
                ]
        });
      });
