$(document).ready(function(){
				
				$.ajax({
					type: "GET", url: "../xml/HatDistrict.xml", dataType: "xml", success: function(xml) {
						
						
						
						
						var CountryFound = new Array();
						var StateFound = new Array();
						
						$(xml).find('Vendor').each(function(){						
								var aStateFound = $(this).find('State').text();
								var VendorCountry = $(this).attr("Country");
								
								if (aStateFound) { 	StateFound[StateFound.length] =	aStateFound; } 
								
								if (VendorCountry) { CountryFound[CountryFound.length] = VendorCountry; }
						});
						
// This will add the Countries 						
						if (jQuery.inArray("United States", CountryFound) != -1) {
							$('<div class="TheFullCountry" id="USA"></div>').appendTo('.HatterCountries');	
							$('<span class="Countries" title="This link will show you all the Retailers in the United States">United States</span>').appendTo('#CountryLists');	
						}
						if (jQuery.inArray("England", CountryFound) != -1) {
							$('<div class="TheFullCountry"><div class="Section01 England"></div></div>').appendTo('.HatterCountries');	
							$('<span class="CountrySeperator">&#8226;</span>').appendTo('#CountryLists');
							$('<span class="Countries" title="This link will show you all the Retailers in the England">England</span>').appendTo('#CountryLists');				 
						}
						if (jQuery.inArray("Canada", CountryFound) != -1) {
							$('<div class="TheFullCountry"><div class="Section01 Canada"></div></div>').appendTo('.HatterCountries');	
							$('<span class="CountrySeperator">&#8226;</span>').appendTo('#CountryLists');
							$('<span class="Countries" title="This link will show you all the Retailers in the Canada">Canada</span>').appendTo('#CountryLists');				 
						}
// This will add the see all						
							$('<div class="TheFullCountry"><div class="Section01 EveryOneHere"></div></div>').appendTo('.HatterCountries');	
							$('<span class="CountrySeperator">&#8226;</span>').appendTo('#CountryLists');
							$('<span class="Countries" id="EveryOneHere" title="This link will show you all the Retailers">See All</span>').appendTo('#CountryLists');				 
						
						//console.log(jQuery.inArray("United States", CountryFound));

// This will add the individual lettered sections if there is a state in it 						
						var TurnOnUSAsub = new Array(); var USAsubFullname = new Array();
						
						if (jQuery.inArray("National", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="National"><strong class="TheState">Nationwide Offers</strong></div></div>').appendTo('#USA');
							TurnOnUSAsub[TurnOnUSAsub.length] = "Nationwide"; USAsubFullname[USAsubFullname.length] = "Nationwide"; 
						}
						if (jQuery.inArray("AL", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="AL"><strong class="TheState">Alabama</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "AL"; USAsubFullname[USAsubFullname.length] = "Alabama"; 

						}
						if (jQuery.inArray("AK", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="AK"><strong class="TheState">Alaska</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "AK"; USAsubFullname[USAsubFullname.length] = "Alaska"; 
						}
						if (jQuery.inArray("AZ", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="AZ"><strong class="TheState">Arizona</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "AZ"; USAsubFullname[USAsubFullname.length] = "Arizona"; 
						}
						if (jQuery.inArray("AR", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="AR"><strong class="TheState">Arkansas</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "AR"; USAsubFullname[USAsubFullname.length] = "Arkansas"; 
						}
						if (jQuery.inArray("CA", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="CA"><strong class="TheState">California</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "CA"; USAsubFullname[USAsubFullname.length] = "California"; 
						}
						if (jQuery.inArray("CO", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="CO"><strong class="TheState">Colorado</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "CO"; USAsubFullname[USAsubFullname.length] = "Colorado"; 
						}
						if (jQuery.inArray("CT", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="CT"><strong class="TheState">Connecticut</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "CT"; USAsubFullname[USAsubFullname.length] = "Connecticut"; 
						}
						if (jQuery.inArray("DE", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="DE"><strong class="TheState">Delaware</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "DE"; USAsubFullname[USAsubFullname.length] = "Delaware"; 
						}
						if (jQuery.inArray("DE", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="DC"><strong class="TheState">District of Columbia</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "DC"; USAsubFullname[USAsubFullname.length] = "District of Columbia"; 
						}
						if (jQuery.inArray("FM", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="FM"><strong class="TheState">Micronesia</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "FM"; USAsubFullname[USAsubFullname.length] = "Micronesia"; 
						}
						if (jQuery.inArray("FL", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="FL"><strong class="TheState">Florida</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "FL"; USAsubFullname[USAsubFullname.length] = "Florida"; 
						}
						if (jQuery.inArray("GA", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="GA"><strong class="TheState">Georgia</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "GA"; USAsubFullname[USAsubFullname.length] = "Georgia"; 
						}
						if (jQuery.inArray("GU", StateFound) != -1) {
							$('<div class="Section"><div class="StateList" id="GU"><strong class="TheState">Guam</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "GU"; USAsubFullname[USAsubFullname.length] = "Guam"; 
						}
						if ((jQuery.inArray("HI", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="HI"><strong class="TheState">Hawaii</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "HI"; USAsubFullname[USAsubFullname.length] = "Hawaii";  
						}
						if ((jQuery.inArray("ID", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="ID"><strong class="TheState">Idaho</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "ID"; USAsubFullname[USAsubFullname.length] = "Idaho";  
						}
						if ((jQuery.inArray("IL", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="IL"><strong class="TheState">Illinois</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "IL"; USAsubFullname[USAsubFullname.length] = "Illinois";  
						}
						if ((jQuery.inArray("IN", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="IN"><strong class="TheState">Indiana</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "IN"; USAsubFullname[USAsubFullname.length] = "Indiana";  
						}
						if ((jQuery.inArray("IA", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="IA"><strong class="TheState">Iowa</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "IA"; USAsubFullname[USAsubFullname.length] = "Iowa";  
						}
						if ((jQuery.inArray("KS", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="KS"><strong class="TheState">Kansas</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "KS"; USAsubFullname[USAsubFullname.length] = "Kansas";  
						}
						if ((jQuery.inArray("KY", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="KY"><strong class="TheState">Kentucky</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "KY"; USAsubFullname[USAsubFullname.length] = "Kentucky";  
						}
						if ((jQuery.inArray("LA", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="LA"><strong class="TheState">Louisiana</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "LA"; USAsubFullname[USAsubFullname.length] = "Louisiana"; 
						}
						if ((jQuery.inArray("ME", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="ME"><strong class="TheState">Maine</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "ME"; USAsubFullname[USAsubFullname.length] = "Maine"; 
						}
						if ((jQuery.inArray("MH", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="MH"><strong class="TheState">Marshall Islands</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "MH"; USAsubFullname[USAsubFullname.length] = "Marshall Islands"; 
						}
						if ((jQuery.inArray("MD", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="MD"><strong class="TheState">Maryland</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "MD"; USAsubFullname[USAsubFullname.length] = "Maryland"; 
						}
						if ((jQuery.inArray("MA", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="MA"><strong class="TheState">Massachusetts</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "MA"; USAsubFullname[USAsubFullname.length] = "Massachusetts"; 
						}
						if ((jQuery.inArray("MI", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="MI"><strong class="TheState">Michigan</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "MI"; USAsubFullname[USAsubFullname.length] = "Michigan"; 
						}
						if ((jQuery.inArray("MN", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="MN"><strong class="TheState">Minnesota</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "MN"; USAsubFullname[USAsubFullname.length] = "Minnesota"; 
						}
						if ((jQuery.inArray("MS", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="MS"><strong class="TheState">Mississippi</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "MS"; USAsubFullname[USAsubFullname.length] = "Mississippi"; 
						}
						if ((jQuery.inArray("MO", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="MO"><strong class="TheState">Missouri</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "MO"; USAsubFullname[USAsubFullname.length] = "Missouri"; 
						}
						if ((jQuery.inArray("MT", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="MT"><strong class="TheState">Montana</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "MT"; USAsubFullname[USAsubFullname.length] = "Montana"; 
						}
						if ((jQuery.inArray("NE", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="NE"><strong class="TheState">Nebraska</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "NE"; USAsubFullname[USAsubFullname.length] = "Nebraska"; 
						}
						if ((jQuery.inArray("NV", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="NV"><strong class="TheState">Nevada</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "NV"; USAsubFullname[USAsubFullname.length] = "Nevada"; 
						}
						if ((jQuery.inArray("NH", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="NH"><strong class="TheState">New Hampshire</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "NH"; USAsubFullname[USAsubFullname.length] = "New Hampshire"; 
						}
						if ((jQuery.inArray("NJ", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="NJ"><strong class="TheState">New Jersey</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "NJ"; USAsubFullname[USAsubFullname.length] = "New Jersey"; 
						}
						if ((jQuery.inArray("NM", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="NM"><strong class="TheState">New Mexico</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "NM"; USAsubFullname[USAsubFullname.length] = "New Mexico"; 
						}
						if ((jQuery.inArray("NY", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="NY"><strong class="TheState">New York</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "NY"; USAsubFullname[USAsubFullname.length] = "New York"; 
						}
						if ((jQuery.inArray("NC", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="NC"><strong class="TheState">North Carolina</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "NC"; USAsubFullname[USAsubFullname.length] = "North Carolina"; 
						}
						if ((jQuery.inArray("ND", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="ND"><strong class="TheState">North Dakota</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "ND"; USAsubFullname[USAsubFullname.length] = "North Dakota"; 
						}
						if ((jQuery.inArray("MP", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="MP"><strong class="TheState">Northern Mariana Islands</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "MP"; USAsubFullname[USAsubFullname.length] = "Northern Mariana Islands"; 
						}
						if ((jQuery.inArray("OH", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="OH"><strong class="TheState">Ohio</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "OH"; USAsubFullname[USAsubFullname.length] = "Ohio"; 
						}
						if ((jQuery.inArray("OK", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="OK"><strong class="TheState">Oklahoma</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "OK"; USAsubFullname[USAsubFullname.length] = "Oklahoma"; 
						}
						if ((jQuery.inArray("OR", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="OR"><strong class="TheState">Oregon</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "OR"; USAsubFullname[USAsubFullname.length] = "Oregon"; 
						}
						if ((jQuery.inArray("PW", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="PW"><strong class="TheState">Palau</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "PW"; USAsubFullname[USAsubFullname.length] = "Palau"; 
						}
						if ((jQuery.inArray("PA", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="PA"><strong class="TheState">Pennsylvania</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "PA"; USAsubFullname[USAsubFullname.length] = "Pennsylvania"; 
						}
						if ((jQuery.inArray("PR", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="PR"><strong class="TheState">Puerto Rico</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "PR"; USAsubFullname[USAsubFullname.length] = "Puerto Rico"; 
						}
						if ((jQuery.inArray("RI", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="RI"><strong class="TheState">Rhode Island</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "RI"; USAsubFullname[USAsubFullname.length] = "Rhode Island"; 
						}
						if ((jQuery.inArray("SC", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="SC"><strong class="TheState">South Carolina</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "SC"; USAsubFullname[USAsubFullname.length] = "South Carolina"; 
						}
						if ((jQuery.inArray("SD", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="SD"><strong class="TheState">South Dakota</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "SD"; USAsubFullname[USAsubFullname.length] = "South Dakota"; 
						}
						if ((jQuery.inArray("TN", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="TN"><strong class="TheState">Tennessee</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "TN"; USAsubFullname[USAsubFullname.length] = "Tennessee"; 
						}
						if ((jQuery.inArray("TX", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="TX"><strong class="TheState">Texas</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "TX"; USAsubFullname[USAsubFullname.length] = "Texas"; 
						}
						if ((jQuery.inArray("UT", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="UT"><strong class="TheState">Utah</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "UT"; USAsubFullname[USAsubFullname.length] = "Utah"; 
						}
						if ((jQuery.inArray("VA", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="VA"><strong class="TheState">Virginia</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "VA"; USAsubFullname[USAsubFullname.length] = "Virginia"; 
						}
						if ((jQuery.inArray("VT", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="VT"><strong class="TheState">Vermont</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "VT"; USAsubFullname[USAsubFullname.length] = "Vermont"; 
						}
						if ((jQuery.inArray("WA", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="WA"><strong class="TheState">Washington</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "WA"; USAsubFullname[USAsubFullname.length] = "Washington"; 
						}
						if ((jQuery.inArray("WV", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="WV"><strong class="TheState">West Virginia</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "WV"; USAsubFullname[USAsubFullname.length] = "West Virginia"; 
						}
						if ((jQuery.inArray("WY", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="WY"><strong class="TheState">Wyoming</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "WY"; USAsubFullname[USAsubFullname.length] = "Wyoming"; 
						}
						if ((jQuery.inArray("WI", StateFound) != -1)) {
							$('<div class="Section"><div class="StateList" id="WI"><strong class="TheState">Wisconsin</strong></div></div>').appendTo('#USA');	
							TurnOnUSAsub[TurnOnUSAsub.length] = "WI"; USAsubFullname[USAsubFullname.length] = "Wisconsin"; 
						}


// This will add the vendors to the page 						
						$(xml).find('Vendor').each(function(){
							var VendorCountry = $(this).attr("Country");
							var VendorName = $(this).find('VendorName').text();
							var VendorAddress = $(this).find('Address').text();
							var VendorCity = $(this).find('City').text();            
							var VendorState = $(this).find('State').text();            
							var VendorZip = $(this).find('Zip').text();            
							var VendorPhone = $(this).find('Phone').text(); 
							var VendorContact = $(this).find('Contact').text();
							var VendorWebsite = $(this).find('WebAddress').text();
							var VendorWebsite2 = $(this).find('WebAddress2').text();
							var VendorLogo = $(this).find('VendorLogo').text();
							var VendorOffer = $(this).find('Offers').text();
							var VendorExtraInfo = $(this).find('ExtraInfo').text();
							
							if (VendorLogo == "" || VendorLogo == " ") {
								var VendorLook = 'images/HatDistrictDefaultIcon.jpg';
							} else {
								var VendorLook = VendorLogo;
							}
							
							if (VendorWebsite) {
								var VendorWeb = '<a href="http://'+VendorWebsite+'" target="_blank" onClick="javascript:pageTracker._trackPageview(\'/HatDistrictAd/'+VendorWebsite+'\');">'+VendorWebsite+'</a>';
							} else {
								var VendorWeb = ' ';
							}

						if (VendorWebsite2) {
							// ADDED
							if (VendorWebsite2.substring(0,7) == "mailto:") {
								var VendorWeb2 = '<a href="' + VendorWebsite2 + '">'+ VendorWebsite2.substring(7) +'</a>';
								} 
								else { // END ADDED
							
								var VendorWeb2 = '<a href="http://'+VendorWebsite2+'" target="_blank" onClick="javascript:pageTracker._trackPageview(\'/HatDistrictAd/'+VendorWebsite2+'\');">'+VendorWebsite2+'</a>'; } // ADDED BRACKET
								
							} else {
								var VendorWeb2 = ' ';
							}
							
							if (VendorOffer) {
								var VendorOffers = '<span>Special Offers: <em>'+VendorOffer+'</em></span>';
							} else {
								var VendorOffers = ' ';
							}
							
							if (VendorExtraInfo) {
								var VendorExInfo = '<span><em>'+VendorExtraInfo+'</em></span>';
							} else {
								var VendorExInfo = ' ';
							}
							
							if ((VendorCountry == "United States") && (VendorState != "National")) {
								var EachVendor = '<div class="HatDistrictVendor" style="background-image:url('+VendorLook+');"><h1>'+VendorName+'</h1>'+VendorExInfo+VendorWeb2+'<span>'+VendorAddress+'</span><span>'+VendorCity+', '+VendorState+' '+VendorZip+'</span><span>'+VendorPhone+'</span><span class="VContact">'+VendorContact+'</span>'+VendorWeb+' '+VendorOffers+'</div>';
							} else if ((VendorCountry == "United States") && (VendorState == "National")) {
								var EachVendor = '<div class="HatDistrictVendor" style="background-image:url('+VendorLook+'); padding-bottom:39px;"><strong>'+VendorName+'</strong>'+VendorExInfo+VendorWeb2+'<span>'+VendorPhone+'</span><span class="VContact">'+VendorContact+'</span>'+VendorWeb+''+VendorOffers+'</div>';
							} else {
								var EachVendor = '<div class="HatDistrictVendor" style="background-image:url('+VendorLook+'); padding-bottom:17px;"><strong>'+VendorName+'</strong>'+VendorExInfo+VendorWeb2+'<span>'+VendorAddress+'</span><span>'+VendorCity+', '+VendorCountry+' '+VendorZip+'</span><span>'+VendorPhone+'</span><span class="VContact">'+VendorContact+'</span>'+VendorWeb+' '+VendorOffers+'</div>';
							}
							
							
							
							switch(VendorCountry) {
								case "United States":
									$('#'+VendorState+'').css('display', 'block');
									$(EachVendor).appendTo('#'+VendorState+'');
								break;
								default:
									$('.'+VendorCountry+'').css('margin-top', '14px');
									$('.'+VendorCountry+'').css('display', 'block');
									$(EachVendor).appendTo('.'+VendorCountry+'');
								break;
								
								
							}
							
							
						});
						


//	For right now this where we add new and sub sections		
					//console.log(TurnOnUSAsub.join());
					
					$('<span class="SubPicks" title="This link will show you all the Retailers in '+USAsubFullname[0]+'">'+TurnOnUSAsub[0]+'</span>').appendTo('#Jumpers');
					
					for (i=1;i<TurnOnUSAsub.length;i++) {
						$('<span class="SubPicks SubPick01" title="This link will show you all the Retailers in '+USAsubFullname[i]+'" >'+TurnOnUSAsub[i]+'</span>').appendTo('#Jumpers');
						//console.log(TurnOnUSAsub[i]);
					}
					
					if (TurnOnUSAsub.length > 15) {
						$('.SubPicks').css('float', 'left');
					}
					
					
		

// This is for clicking to reveal individual countries stuff
		$(".Countries").click(function () { 
			var indexed = $(".Countries").index(this);
			$('.TheFullCountry').hide();
			$('#Jumpers').hide();
			$('#Jumpers:eq('+indexed+')').css('display', 'block');
			$('.TheFullCountry:eq('+indexed+')').css('display', 'block');
		});
		
// This is for clicking pics in top area to reveal individual countries information	
		$(".countries02").click(function () { 
			var indexThis = $(".countries02").index(this);
			$('.TheFullCountry').hide();
			$('#Jumpers').hide();
			$('#Jumpers:eq('+indexThis+')').css('display', 'block');
			$('.TheFullCountry:eq('+indexThis+')').css('display', 'block');
		});
		
// If there is a sub section for a country... This countrols those
		$(".SubPicks").click(function () { 
			var indexed = $(".SubPicks").index(this);
			$('.Section').hide();
			$('.Section:eq('+indexed+')').css('display', 'block');
		});
// for the see all
		$("#EveryOneHere, #SeeAllPic").click(function () { 
			$('.TheFullCountry').css('display', 'block');
			$('.Section').css('display', 'block');
			$('.TheState').css('display', 'none');
		});

				  }
			});
				
	

});    