document.write("<scr" + "ipt type=\"text/javascript\" src=\"http://maps.google.com/maps/api/js?sensor=true\"></scr" + "ipt>");var myCookies = new Array();var GoogleMap = new Class.create();GoogleMap.prototype = {initialize: function(zoom,type,canvas,name,pageID){try{this.version = "2.7";this.map;this.name = name;this.pageID = pageID;this.zoom = zoom;switch(type){case 'h':this.type = google.maps.MapTypeId.HYBRID;break;case 's':this.type = google.maps.MapTypeId.SATELLITE;break;default:this.type = google.maps.MapTypeId.ROADMAP;break;}this.mapTypes = new Array(google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID);this.printHTML;this.currentStoreARR;this.canvas = canvas;this.markersARR = [];this.infoWindowsARR = [];this.geocoder = new google.maps.Geocoder();this.directionsDisplay = new google.maps.DirectionsRenderer();this.directionsService = new google.maps.DirectionsService();}catch(err){alert(err);}},setZoomFactor: function(myZoomFactor){if(arguments.length == 3){this.setLocation(arguments[1],arguments[2],"main");}this.map.setZoom(myZoomFactor);},setLocation: function(myLat,myLng,myMapLoc){var tempLocation = new google.maps.LatLng(myLat,myLng);if(this.map == undefined){var tempOptions = {zoom: this.zoom, center: tempLocation, mapTypeId: this.type, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, mapTypeIds: this.mapTypes}};if(myMapLoc != "main"){tempOptions.disableDefaultUI = true;}this.map = new google.maps.Map($(this.canvas), tempOptions);}else{this.map.setCenter(tempLocation);}tempLocation = undefined;},setStateLocations: function(myState){var myOBJ = this;this.removeAllMarkers();this.closeAllInfoWindows();if(this.directionsDisplay.getMap() != "undefined"){this.directionsDisplay.setMap(null);}var setZoom = "n";for(var x = 0; x < storesARR.length; x++) {if(storesARR[x][5] == myState){if(setZoom == "n"){this.setZoomFactor(6,storesARR[x][9],storesARR[x][10]);setZoom = "y";}this.setMarker(storesARR[x],x);}}switch(myState){case "AL":this.adjustFocus(7,33.34773740901673,-86.76259852500002);break;case "CA":this.adjustFocus(6,36.35376930663966,-119.6627812008915);break;case "CT":this.adjustFocus(8,41.71542497685755,-72.71286185312499);break;case "DE":this.adjustFocus(8,39.67901651499206,-75.65306116665651);break;case "FL":this.adjustFocus(6,28.4889021,-81.4114142);break;case "GA":this.adjustFocus(10,33.905239072598505,-84.352662671875);break;case "IL":this.adjustFocus(9,41.97504411709434,-88.01211259296875);break;case "LA":this.adjustFocus(8,30.15694606361625,-90.556465821875);break;case "MA":this.adjustFocus(8,42.169714775037676,-70.85943750000001);break;case "MD":this.adjustFocus(8,38.91863599919814,-77.05797879843752);break;case "MI":this.adjustFocus(10,42.516795516750825,-83.11806172412109);break;case "MN":this.adjustFocus(9,44.9698513219477,-93.270128878125);break;case "MO":this.adjustFocus(6,38.91948285993472,-92.576921909375);break;case "NC":this.adjustFocus(7,35.53221693002346,-79.777289984375);break;case "NJ":this.adjustFocus(7,40.4430064,-74.4818698);break;case "NV":this.adjustFocus(10,36.11404654998346,-115.17162660898437);break;case "NY":this.adjustFocus(7,42.10945153283206,-75.87029167812501);break;case "OH":this.adjustFocus(7,40.037526945292115,-83.004370815625);break;case "ON":this.adjustFocus(10,43.73214642457259,-79.44159720703125);break;case "OR":this.adjustFocus(8,45.662058338632086,-122.91594877265626);break;case "PA":this.adjustFocus(6,40.92929957076616,-77.63174649999999);break;case "TN":this.adjustFocus(7,35.75714686313091,-88.1834704375);break;case "TX":this.adjustFocus(7,31.48361610346082,-97.11849690624999);break;case "EU":this.adjustFocus(13,51.50340606712897,-0.1495985236816333);break;case "UT":this.adjustFocus(6,39.5934363384599,-111.717032421875);break;case "VA":this.adjustFocus(8,38.4140900015792,-77.635513440625);break;case "WA":this.adjustFocus(11,47.62694217026953,-122.25664711308593);break;case "WI":this.adjustFocus(7,43.17016192554761,-88.6322025546875);break;default:break;}myOBJ = undefined;setZoom = undefined;},adjustFocus: function(myZoom,myLat,myLng){this.setZoomFactor(myZoom);this.map.panTo(new google.maps.LatLng(myLat,myLng));},setMarker: function(locARR,myIndex){var myOBJ = this;var markerTitle = locARR[1];if(markerTitle == ""){markerTitle = locARR[2]}var markerOBJ = new google.maps.Marker({position: new google.maps.LatLng(locARR[9],locARR[10]),map:this.map,title:markerTitle,zIndex:myIndex});var myHTML = "<div class=\"iwContainer\"><div class=\"iwImage\"><img src=\"/anthro/images/";if(locARR[12] == ""){myHTML += "location_default.gif?1.101";}else{myHTML += locARR[12];}myHTML += "\" border=\"0\"/><div class=\"mapLink\" onClick=\"" + this.name + ".showRoutePane(\'" + locARR[0] + "\',";if(locARR[5] == "EU"){myHTML += "\'EU\'";}else{myHTML += "\'US\'";}myHTML += ")\">find route</div></div><div class=\"iwAddr\"><div class=\"iwAddrName\">" + locARR[1] + "</div><div class=\"iwAddrLoc\">" + locARR[2];if(locARR[3] != ""){myHTML += ", " + locARR[3];}myHTML += "<br>" + locARR[4];if(locARR[5] != "EU"){myHTML += ", " + locARR[5];}else{myHTML += ", " + locARR[7];}myHTML += " " + locARR[6] + "<br>" + locARR[8];myHTML += "</div><div class=\"iwHours\"><span class=\"boldText\">HOURS:</span><br/>" + this.parseHours(locARR[13]) + "</div></div></div>";var infoWindow = new google.maps.InfoWindow({content:myHTML,pixelOffset:0});google.maps.event.addListener(markerOBJ,'click',function(){cmCreatePageElementTag("marker_clicked-" + locARR[0],this.pageID);myOBJ.setCurrentStore(locARR);myOBJ.closeAllInfoWindows();infoWindow.open(myOBJ.map,markerOBJ);myOBJ.infoWindowsARR.push(infoWindow);});this.markersARR.push(markerOBJ);this.infoWindowsARR.push(infoWindow);},showInfoWindow: function(markerOBJ){infoWindow.open(this.map,markerOBJ);},removeAllMarkers: function(){if(this.markersARR.length != 0){for(var x = 0; x < this.markersARR.length; x++){this.markersARR[x].setMap(null);}}this.markersARR.length = 0;},closeAllInfoWindows: function(){if(this.infoWindowsARR.length != 0){for(var x = 0; x < this.infoWindowsARR.length; x++){this.infoWindowsARR[x].close();}}this.infoWindowsARR.length = 0;},updateMap: function(myID,caller) {if(caller == "store"){cmCreatePageElementTag("focus_map-" + myID,this.pageID);}else{cmCreatePageElementTag("show_hours-" + myID,this.pageID);}this.removeAllMarkers();this.closeAllInfoWindows();if(this.directionsDisplay.getMap() != "undefined"){this.directionsDisplay.setMap(null);}for(var x = 0; x < storesARR.length; x++){if(storesARR[x][0] == myID){this.setZoomFactor(16);this.setLocation(storesARR[x][9],storesARR[x][10],"main");this.setMarker(storesARR[x],0);this.setCurrentStore(storesARR[x]);this.infoWindowsARR[0].open(this.map,this.markersARR[0]);}}$(this.canvas).focus();},setCurrentStore: function(locARR){this.currentStoreARR = locARR;},getCurrentStore: function(returnType){if(returnType == "string"){return this.currentStoreARR[2] + ", " + this.currentStoreARR[4] + ", " + this.currentStoreARR[5] + ", " + this.currentStoreARR[6];}else{return this.currentStoreARR;}},setNearbyLocations: function(){if($('locSearchSelect').value != "init"){$('locSearchSelect').value = "init";}this.closeAllInfoWindows();var myOBJ = this;var myMiles = $('proxSearchDistance').value;var myZip = $('proxSearchZip').value;if(myZip == "" || myZip == "zip/city"){$('proxSearchFormAlert').innerHTML = "Please enter a code or city.";}else{var nearbyStoresARR = new Array();if(this.geocoder){this.geocoder.geocode({'address':myZip}, function(results, status){if(status == google.maps.GeocoderStatus.OK){var nearbyCounter = 0;var tempLat = results[0].geometry.location.lat();var tempLng = results[0].geometry.location.lng();var distanceIndex;myOBJ.setZoomFactor(7,tempLat,tempLng);myOBJ.removeAllMarkers();if(myOBJ.directionsDisplay.getMap() != "undefined"){myOBJ.directionsDisplay.setMap(null);}for(var x = 0; x < storesARR.length; x++){var tempDist = myOBJ.getDistance(tempLat,tempLng,storesARR[x][9],storesARR[x][10]);if(tempDist < myMiles){var distanceIndex = storesARR[x].push(tempDist);nearbyStoresARR[nearbyCounter] = storesARR[x];myOBJ.setMarker(storesARR[x],x);nearbyCounter++;}}}if($('proxSearchFormAlert').innerHTML != ""){$('proxSearchFormAlert').innerHTML = "";}nearbyStoresARR.sort(function(a, b) {var valueA = a[distanceIndex-1];var valueB = b[distanceIndex-1];if (valueA < valueB){return -1;}else if (valueA > valueB){return 1;}else{return 0;}});myOBJ.buildStoreList('searchResultsData',nearbyStoresARR);nearbyStoresARR = undefined;nearbyCounter = undefined;tempLat = undefined;tempLng = undefined;distanceIndex = undefined;});}this.setMapMode("results");}},getDistance: function(lat1,lon1,lat2,lon2) {var R = (6371 * 0.621371192);var dLat = (lat2-lat1) * Math.PI / 180;var dLon = (lon2-lon1) * Math.PI / 180;var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(lat1 * Math.PI/180) * Math.cos(lat2 * Math.PI/180) * Math.sin(dLon/2) * Math.sin(dLon/2);var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));var d = R * c;return d;},evalStartAddr: function(country){var alertMsgARR = $$('#addrFormUS .alertMsg');for(var x = 0; x < alertMsgARR.length; x++){alertMsgARR[x].innerHTML = "";}if(country != "eu"){cmCreatePageElementTag("find_directions-US",this.pageID);if($('addrFormUS_Street').value.indexOf("your") != -1||$('addrFormUS_Street').value == ""||$('addrFormUS_Street').value.length < 5){$('addrFormUS_StreetErr').innerHTML = "Please provide a valid street address.";$('addrFormUS_Street').value = "";$('addrFormUS_Street').focus();}else{if($('addrFormUS_City').value.indexOf("your") != -1||$('addrFormUS_City').value == ""||$('addrFormUS_City').value.length < 5){$('addrFormUS_CityErr').innerHTML = "Please provide a valid city name.";$('addrFormUS_City').value = "";$('addrFormUS_City').focus();}else{if($('addrFormUS_State').value == ""){$('addrFormUS_StateErr').innerHTML = "Please choose a state.";$('addrFormUS_State').focus();}else{if($('addrFormUS_Zip').value.indexOf("your") != -1){$('addrFormUS_Zip').value = "";}this.setDirections(country);}}}}else {cmCreatePageElementTag("find_directions-EU",this.pageID);if($('addrFormEU_Zip').value.indexOf("your") != -1){$('addrFormEU_Zip').value = "";}this.setDirections(country);}},getStartAddr: function(country){if(country != "eu"){var myStreet = $('addrFormUS_Street').value;var myCity = $('addrFormUS_City').value;var myState = $('addrFormUS_State').value;var myZip = $('addrFormUS_Zip').value;return myStreet + " " + myCity + " " + myState + " " + myZip;}else{this.currentStartAddr = "UK " + $('addrFormEU_Zip').value; return "UK " + $('addrFormEU_Zip').value;}},getRouteMode: function(country){var myMode;if(country != "eu"){for(var x = 0; x < $('addrFormUS').addrFormMode.length; x++){if($('addrFormUS').addrFormMode[x].checked){myMode = $('addrFormUS').addrFormMode[x].value;}}}else{myMode = "DRIVING";}return myMode;},setDirections: function(country){this.setMapMode("route");this.removeAllMarkers();this.closeAllInfoWindows();var myOBJ = this;if(this.map == undefined){alert("Please select a store location first.  You can do this by either searching for stores by state or searching for stores by proximity.");}else{$('mapDirections').innerHTML = "<br><br><br><br><div class=\"loaderWheel\">Please wait a moment while we generate your custom directions.<br><img src=\"/anthro/images/loaderWheel.gif?1.101\"/></div>";$('mapDirections').style.display = "block";var myAddr = this.getStartAddr(country);var myMode = this.getRouteMode(country);var tempGeoCoder = new google.maps.Geocoder();tempGeoCoder.geocode({'address':myAddr},function(data){var dirStart = myAddr;var dirStop = myOBJ.getCurrentStore("string");myOBJ.calculateRoute(dirStart,dirStop,myMode);});}},calculateRoute: function(myStart,myStop,myMode) {var myOBJ = this;switch(myMode){case "BICYCLING":myMode = google.maps.DirectionsTravelMode.BICYCLING;break;case "WALKING":myMode = google.maps.DirectionsTravelMode.WALKING;break;default:myMode = google.maps.DirectionsTravelMode.DRIVING;break;}var request = {origin: myStart, destination: myStop,unitSystem: google.maps.DirectionsUnitSystem.IMPERIAL,travelMode: myMode};this.directionsService.route(request, function(response, status) {switch(status){case google.maps.DirectionsStatus.ZERO_RESULTS:myOBJ.setMapMode("form");myOBJ.showHideAlert("Unfortunately no routes could be found.  This may be due in part to the distance.  Please review your start and end locations as well as your travel mode and try again.");break;default:myOBJ.directionsDisplay.setDirections(response);break;}var directionsOBJ = myOBJ.directionsDisplay.getDirections();var myRoute = directionsOBJ.routes[0].legs[0];myOBJ.parseRoute(myRoute);});},parseRoute: function(routeOBJ){var totalDistance = 0;var currentRowStyle;var startLat = this.getLatLng(routeOBJ.start_location,"lat");var startLng = this.getLatLng(routeOBJ.start_location,"lng");var stopLat = this.getLatLng(routeOBJ.end_location,"lat");var stopLng = this.getLatLng(routeOBJ.end_location,"lng");this.printHTML = "<table cellspacing=\"0\" cellpadding=\"5\" border=\"0\"><tr class=\"routeFromAddr\"><td><img src=\"/anthro/images/icn_greenMarkerA.png\"/></td><td colspan=\"2\">" + routeOBJ.start_address + "</td></tr>";var tempHTML = "<div class=\"mapRoute\">";tempHTML += "<div class=\"routeFromAddr\"><img src=\"/anthro/images/icn_greenMarkerA.png\"/><div class=\"routeFromAddrText\">" + routeOBJ.start_address + "</div></div>";tempHTML += "<div class=\"routePath\">";$('mapDirections').style.display = "block";for (var x = 0; x < routeOBJ.steps.length; x++) {if(x%2){currentRowStyle = "evenIndex";}else{currentRowStyle = "oddIndex";}totalDistance += routeOBJ.steps[x].distance.value;tempStepDist = routeOBJ.steps[x].distance.value * 0.000621371192;if(tempStepDist < .25){tempStepDist = Math.round((tempStepDist * 5280)*1)/1 + " ft";}else{tempStepDist = Math.round(tempStepDist * 100)/100 + " mi";}tempTotalDist = totalDistance * 0.000621371192;if(tempTotalDist < 1){tempTotalDist = Math.round((tempTotalDist * 5280)*1)/1 + " ft";}else{tempTotalDist = Math.round(tempTotalDist * 100)/100 + " mi";}this.printHTML += "<tr class=\"" + currentRowStyle + "\">";this.printHTML += "<td width=\"35\">" + (x+1) + ".</td>";this.printHTML += "<td width=\"580\">" + routeOBJ.steps[x].instructions + "</td>";this.printHTML += "<td width=\"100\">go " + tempStepDist + "<br></td>";this.printHTML += "</tr>";tempHTML += "<div class=\"routeStep " + currentRowStyle + "\">";tempHTML += "<div class=\"stepIndex\">" + (x+1) + ".</div>";tempHTML += "<div class=\"stepDesc\">" + routeOBJ.steps[x].instructions + "</div>";tempHTML += "<div class=\"stepDists\"><div class=\"stepDist\">go " + tempStepDist + "</div></div>";tempHTML += "</div>";}this.printHTML += "<tr class=\"routeToAddr\">";this.printHTML += "<td><img src=\"/anthro/images/icn_greenMarkerB.png\"/></td>";this.printHTML += "<td colspan=\"2\">" + routeOBJ.end_address + "</td>";this.printHTML += "</tr>";this.printHTML += "</table>";tempHTML += "</div>";tempHTML += "<div class=\"routeToAddr\"><img src=\"/anthro/images/icn_greenMarkerB.png\"/><div class=\"routeToAddrText\">" + routeOBJ.end_address + "</div></div>";tempHTML += "</div>";this.directionsDisplay.setMap(this.map);$('subNavRouteHeader').innerHTML = "Directions to " + routeOBJ.end_address + "<br>" + routeOBJ.distance.text + " - about " + routeOBJ.duration.text;if(navigator.userAgent.indexOf("MSIE 6.0") != -1){$('mapDirections').innerHTML = this.printHTML;}else{$('mapDirections').innerHTML = tempHTML;}tempHTML = undefined;totalDistance = undefined;currentRowStyle = undefined;startLat = undefined;startLng = undefined;stopLat = undefined;stopLng = undefined;},getLatLng: function(mySTR,myCoord){if(myCoord == "lat"){return String(mySTR).substring(1,String(mySTR).indexOf(","));}else {return String(mySTR).substring(String(mySTR).indexOf(",")+1,String(mySTR).length-1);}},showRoutePane: function(myID,country){if($('routeFormPane').style.display == "block"){this.showHideAlert("Please fill in your starting address in the form in the left column.");}else{if(country == "EU"){cmCreatePageElementTag("show_route_pane-EU",this.pageID);if(($('addrFormUS').style.display == "block")||($('addrFormUS').style.display == "")){$('addrFormUS').style.display = "none";$('addrFormEU').style.display = "block";}}else{cmCreatePageElementTag("show_route_pane-US",this.pageID);$('addrFormUS').style.display = "block";$('addrFormEU').style.display = "none";}this.setMapMode("form");}},buildStoreList: function(){var resultText;var tempHTML = "";var storeCounter = 0;if(typeof arguments[1] == "object") {var listCanvas = arguments[0];var foundStoresARR = arguments[1];for(var x = 0; x < foundStoresARR.length; x++){for(var y = 0; y < storesARR.length; y++){if(foundStoresARR[x][0] == storesARR[y][0]){tempHTML += "<div class=\"searchItemDist\">" + Math.round((storesARR[y][storesARR[y].length-1])*10)/10 + " miles</div>";tempHTML += "<div id=\"" + storesARR[y][0] + "\" class=\"searchItem searchItemEven siDist\" onClick=\"" + this.name + ".updateMap(\'" + storesARR[y][0] + "\',\'store\')\">";tempHTML += "<div class=\"searchItemIconsContainer\">";if(storesARR[y][11] != "false"){tempHTML += "<div class=\"searchItemIcons\">";tempHTML += "<img src=\"/anthro/images/icn_legendShoes.gif?1.101\" border=\"0\"/>";tempHTML += "</div>";}else{tempHTML += "";}if(storesARR[y][14] == "true"){tempHTML += "<div class=\"searchItemIcons2\">";tempHTML += "<img src=\"/anthro/images/FTD-store-search-icon-v2.gif?1.101\" border=\"0\"/>";tempHTML += "</div>";}else{tempHTML += "&nbsp;";}tempHTML += "</div>";tempHTML += "<div class=\"searchItemData\">";if(storesARR[y][1] != ""){tempHTML += storesARR[y][1] + "<br>";}tempHTML += storesARR[y][2];if(storesARR[y][3] != ""){tempHTML += ",<br>" + storesARR[y][3];}tempHTML += "<br>" + storesARR[y][4];if(storesARR[y][5] != "EU"){tempHTML += ", " + storesARR[y][5];}else{tempHTML += ", " + storesARR[y][7];}tempHTML += " " + storesARR[y][6] + "<br>" + storesARR[y][8];tempHTML += "<div class=\"searchItemLinkGroup\"><div class=\"searchItemLink mapLink\" onClick=\"" + this.name + ".showRoutePane(\'" + storesARR[y][0] + "\',\'";if(storesARR[y][5] == "EU"){tempHTML += storesARR[y][5];}else{tempHTML += "US";}tempHTML += "\')\">find route</div>";tempHTML += "<div class=\"searchItemLink mapLink\" onClick=\"" + this.name + ".updateMap(\'" + storesARR[y][0] + "\',\'hours\')\">show hours</div></div>";tempHTML += "</div>";tempHTML += "</div>";storeCounter++;}}}}else {var listCanvas = arguments[0];var mySelectedState = arguments[1];for(var x = 0; x < storesARR.length; x++) {if(storesARR[x][5] == mySelectedState) {tempHTML += "<div id=\"" + storesARR[x][0] + "\" class=\"searchItem searchItemEven\" onClick=\"" + this.name + ".updateMap(\'" + storesARR[x][0] + "\',\'store\');\">";tempHTML += "<div class=\"searchItemIconsContainer\">";if(storesARR[x][11] != "false"){tempHTML += "<div class=\"searchItemIcons\">";tempHTML += "<img src=\"/anthro/images/icn_legendShoes.gif?1.101\" border=\"0\"/>";tempHTML += "</div>";}else{tempHTML += "";}if(storesARR[x][14] == "true"){tempHTML += "<div class=\"searchItemIcons2\">";tempHTML += "<img src=\"/anthro/images/FTD-store-search-icon-v2.gif?1.101\" border=\"0\"/>";tempHTML += "</div>";}else{tempHTML += "&nbsp;";}tempHTML += "</div>";tempHTML += "<div class=\"searchItemData\">";if(storesARR[x][1] != ""){tempHTML += storesARR[x][1] + "<br>";}tempHTML += storesARR[x][2];if(storesARR[x][3] != ""){tempHTML += ",<br>" + storesARR[x][3];}tempHTML += "<br>" + storesARR[x][4];if(storesARR[x][5] != "EU"){tempHTML += ", " + storesARR[x][5];}else{tempHTML += ", " + storesARR[x][7];}tempHTML += " " + storesARR[x][6] + "<br>" + storesARR[x][8];tempHTML += "<div class=\"searchItemLinkGroup\"><div class=\"searchItemLink mapLink\" onClick=\"" + this.name + ".showRoutePane(\'" + storesARR[x][0] + "\',\'";if(storesARR[x][5] == "EU"){tempHTML += storesARR[x][5];}else{tempHTML += "US";}tempHTML += "\')\">find route</div>";tempHTML += "<div class=\"searchItemLink mapLink\" onClick=\"" + this.name + ".updateMap(\'" + storesARR[x][0] + "\',\'hours\')\">show hours</div></div>";tempHTML += "</div>";tempHTML += "</div>";storeCounter++;}}}$(listCanvas).scrollTop = 0;if(storeCounter < 2){resultText = "store";}else{resultText = "stores";}if(tempHTML.length > 10){$(listCanvas).innerHTML = tempHTML;if(typeof arguments[1] == "object"){cmCreatePageElementTag("show_nearby_locations-" + $('proxSearchDistance').value + "_" + $('proxSearchZip').value,this.pageID);var searchHeader = storeCounter + " " + resultText + " within " + $('proxSearchDistance').value + " miles of " + $('proxSearchZip').value;if(searchHeader.length > 45){searchHeader = searchHeader.substring(0,39) + "...";}$('searchResultsHeader').innerHTML = searchHeader;}else{$('searchResultsHeader').innerHTML = storeCounter + " " + resultText;}}else if(mySelectedState == ""){$(listCanvas).innerHTML = "<div class=\"widthPadding\"><span class=\"boldText\">Please come visit...</span><br><br>Each of our stores is a unique, unimagined experience. To find a nearby store, select a state from the select list above.<br><br>If you would like to explore one of our European stores, please click <span class=\"locIntlLink mapLink\" onClick=\"" + this.name + ".showStateLocations(\'EU\')\">here</span> to see our locations.</div>";$('searchResultsHeader').innerHTML = "store locator";}else{switch($('proxSearchDistance').value){case "10":$('proxSearchDistance').value = "20";this.setNearbyLocations();break;case "20":$('proxSearchDistance').value = "50";this.setNearbyLocations();break;case "50":$('proxSearchDistance').value = "100";this.setNearbyLocations();break;default:$('proxSearchDistance').value = "10";$('searchResultsHeader').innerHTML = "0 results";$(listCanvas).innerHTML = "<div class=\"noStores\">Unfortunately, there are no stores within at least 100 miles of the search query provided.  Please choose a location from the \"SEARCH BY LOCATION\" select list to see stores in that area.</div>";break;}}tempHTML = undefined;listCanvas = undefined;foundStoresARR = undefined;mySelectedState = undefined;},showStateLocations: function(myState){cmCreatePageElementTag("show_state_locations-" + myState,this.pageID);if(this.map == undefined){var tempOptions = {zoom: this.zoom, mapTypeId: this.type, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, mapTypeIds: this.mapTypes}};this.map = new google.maps.Map($(this.canvas), tempOptions);}this.setMapMode("results");this.buildStoreList('searchResultsData',myState);this.setStateLocations(myState);if($('proxSearchZip').value != "zip/city"){$('proxSearchZip').value = "zip/city";}if($('proxSearchDistance').value != "10"){$('proxSearchDistance').value = "10";}},buildSelectList: function(){var foundItem;var stateName = "";var provName = "";var usHTML = "<option class=\"locSearchSection\" value=\"\">United States</option>";var caHTML = "<option class=\"locSearchSection\" value=\"\">Canada</option>";var myHTML = "<div class=\"navHeader2\">Search By Location</div><form id=\"LocSearchForm\"><select id=\"locSearchSelect\" class=\"formData\" onChange=\"" + this.name + ".showStateLocations(this.value);\"><option value=\"init\">North American Stores</option>";var selectOptions = new Array();for(var x = 0; x < storesARR.length; x++){foundItem = "n";for(var y =0; y < selectOptions.length; y++){if(storesARR[x][5] == selectOptions[y]){foundItem = "y";break;}}if(foundItem == "n"){selectOptions.push(storesARR[x][5]);}}selectOptions.sort();for(var z = 0; z < selectOptions.length; z++){switch(selectOptions[z]){case "AL":stateName="Alabama";break;case "AK":stateName="Alaska";break;case "AZ":stateName="Arizona";break;case "AR":stateName="Arkansas";break;case "CA":stateName="California";break;case "CO":stateName="Colorado";break;case "CT":stateName="Connecticut";break;case "DE":stateName="Delaware";break;case "DC":stateName="District of Columbia";break;case "FL":stateName="Florida";break;case "GA":stateName="Georgia";break;case "HI":stateName="Hawaii";break;case "ID":stateName="Idaho";break;case "IL":stateName="Illinois";break;case "IN":stateName="Indiana";break;case "IA":stateName="Iowa";break;case "KS":stateName="Kansas";break;case "KY":stateName="Kentucky";break;case "LA":stateName="Louisiana";break;case "ME":stateName="Maine";break;case "MD":stateName="Maryland";break;case "MA":stateName="Massachusetts";break;case "MI":stateName="Michigan";break;case "MN":stateName="Minnesota";break;case "MS":stateName="Mississippi";break;case "MO":stateName="Missouri";break;case "MT":stateName="Montana";break;case "NE":stateName="Nebraska";break;case "NV":stateName="Nevada";break;case "NH":stateName="New Hampshire";break;case "NJ":stateName="New Jersey";break;case "NM":stateName="New Mexico";break;case "NY":stateName="New York";break;case "NC":stateName="North Carolina";break;case "ND":stateName="North Dakota";break;case "OH":stateName="Ohio";break;case "OK":stateName="Oklahoma";break;case "OR":stateName="Oregon";break;case "PA":stateName="Pennsylvania";break;case "RI":stateName="Rhode Island";break;case "SC":stateName="South Carolina";break;case "SD":stateName="South Dakota";break;case "TN":stateName="Tennessee";break;case "TX":stateName="Texas";break;case "UT":stateName="Utah";break;case "VT":stateName="Vermont";break;case "VA":stateName="Virginia";break;case "WA":stateName="Washington";break;case "WV":stateName="West Virginia";break;case "WI":stateName="Wisconsin";break;case "WY":stateName="Wyoming";break;case "AB":provName="Alberta";break;case "BC":provName="British Columbia";break;case "MB":provName="Manitoba";break;case "NB":provName="New Brunswick";break;case "NL":provName="Newfoundland";break;case "NT":provName="Northwest Territories";break;case "NS":provName="Nova Scotia";break;case "NU":provName="Nunavut";break;case "ON":provName="Ontario";break;case "PE":provName="Prince Edward Island";break;case "QC":provName="Quebec";break;case "SK":provName="Saskatchewan";break;case "YT":provName="Yukon";break;default:break;}if(stateName != ""){usHTML += "<option value=\"" + selectOptions[z] + "\">&nbsp;" + stateName + "</option>";stateName = "";}else if(provName != ""){caHTML += "<option value=\"" + selectOptions[z] + "\">&nbsp;" + provName + "</option>";provName = "";}}myHTML += usHTML + caHTML;myHTML += "</select><div class=\"locIntlLink mapLink\" onClick=\"" + this.name + ".showStateLocations(\'EU\')\">European Stores</div></form>";$('mapNavRightSubR').innerHTML = myHTML;usHTML = undefined;caHTML = undefined;myHTML = undefined;},printDirections: function(){cmCreatePageElementTag("print_directions",this.pageID);var winHeight = (screen.height * .8);var myHTML = "<html><head><title>Print-Friendly Route Instructions from Anthropologie</title><link rel=\"stylesheet\" type=\"text/css\" href=\"/anthro/ui/css/googleMap.css\"></link><style type=\"text/css\">body{font-family:Arial,sans-serif;color:#666;}.routeFromAddr,.routeToAddr{font-size:14pt;font-weight:700;}</style>";myHTML += "<script type=\"text/javascript\" src=\"http://maps.google.com/maps/api/js?sensor=true\"></script><script type=\"text/javascript\">function showHidePrintMap(myELE){if(!myELE.checked){document.getElementById('printMapFrame').style.display = \"none\";}else{document.getElementById('printMapFrame').style.display = \"block\";}}</script></head><body>";myHTML += "<div id=\"printRouteForm\"><div id=\"printMapLogo\"><img src=\"/anthro/images/logo_printMapAnthro.png\"/></div><div id=\"printRouteButton\" onClick=\"window.print();\">print</div><form><input type=\"checkbox\"/ onChange=\"showHidePrintMap(this);\" checked><label>show map</label></div>";myHTML += "<div id=\"printMapFrame\"><img id=\"printMapCanvas\" src=\"http://maps.google.com/maps/api/staticmap?center=" + this.getCurrentStore("string") + "&zoom=17&size=540x350&maptype=roadmap&markers=color:green|label:B|" + this.getCurrentStore("string") + "&sensor=false\"/></div>";myHTML += "<p>" + $('subNavRouteHeader').innerHTML + "</p>" + this.printHTML;myHTML += "</body></html>";var myWindow = window.open('','','width=780,height=' + winHeight + ',menubar=no,toolbar=no,resizable=no,scrollbars=yes,status=yes');myWindow.document.write(myHTML);myWindow.document.close();myHTML = undefined;},parseString: function(mySTR,myFind,myReplace){var tempSTR = "";for(var x = 0; x < mySTR.length; x++){if(mySTR.charAt(x) == "#"){tempSTR += "";}else if(mySTR.charAt(x) == myFind){tempSTR += myReplace;}else{tempSTR += mySTR.charAt(x);}}return tempSTR;},handleEnterKey: function(eventOBJ,formOBJ){var key;if(window.event){key = window.event.keyCode;}else{key = eventOBJ.which;}if(key == 13){switch(formOBJ.id){case "proxSearchForm":if(this.map == undefined){var tempOptions = {zoom: this.zoom, mapTypeId: this.type, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, mapTypeIds: this.mapTypes}};this.map = new google.maps.Map($(this.canvas), tempOptions);}this.setMapMode("results");this.setNearbyLocations();return false;case "addrFormUS":this.evalStartAddr('us');return false;case "addrFormEU":this.evalStartAddr('eu');return false;default:return false;}}},setMapMode: function(mode){switch(mode){case "results":if($('mapDataLeft').style.display != "block"){$('mapDataLeft').style.display = "block";}if($('mapLegend').style.display != "block"){$('mapLegend').style.display = "block";}if($('mapSearchResults').style.display != "block"){$('mapSearchResults').style.display = "block";}if($('mapDirections').style.display  != "none"){$('mapDirections').style.display  = "none";}if($('routeFormPane').style.display != "none"){$('routeFormPane').style.display = "none";}if($('legendResultsPane').style.display == "none"){$('legendResultsPane').style.display = "block";}if($('mapSubNav').style.display  != "none"){$('mapSubNav').style.display  = "none";}if($('subNavRouteHeader').style.display  != "none"){$('subNavRouteHeader').style.display  = "none";}if($('mapDataRight').style.width != "473px"){$('mapDataRight').style.width = "473px";}if($('mapCanvas').style.width != "473px"){$('mapCanvas').style.width = "473px";}google.maps.event.trigger(this.map, 'resize');break;case "form":if($('mapDataLeft').style.display != "block"){$('mapDataLeft').style.display = "block";}if($('mapLegend').style.display != "none"){$('mapLegend').style.display = "none";}if($('mapSearchResults').style.display != "none"){$('mapSearchResults').style.display = "none";}if($('mapDirections').style.display  != "none"){$('mapDirections').style.display  = "none";}if($('routeFormPane').style.display == "none"){$('routeFormPane').style.display = "block";}if($('legendResultsPane').style.display != "none"){$('legendResultsPane').style.display = "none";}if($('mapSubNav').style.display  != "none"){$('mapSubNav').style.display  = "none";}if($('subNavRouteHeader').style.display  != "none"){$('subNavRouteHeader').style.display  = "none";}if($('mapDataRight').style.width != "473px"){$('mapDataRight').style.width = "473px";}if($('mapCanvas').style.width != "473px"){$('mapCanvas').style.width = "473px";}google.maps.event.trigger(this.map, 'resize');break;case "route":if($('mapDataLeft').style.display != "none"){$('mapDataLeft').style.display = "none";}if($('mapLegend').style.display != "none"){$('mapLegend').style.display = "none";}if($('mapSearchResults').style.display != "none"){$('mapSearchResults').style.display = "none";}if($('routeFormPane').style.display != "none"){$('routeFormPane').style.display = "none";}if($('mapDirections').style.display  != "block"){$('mapDirections').style.display  = "block";}if($('mapDataRight').style.width != "725px"){$('mapDataRight').style.width = "725px";}if($('mapCanvas').style.width != "725px"){$('mapCanvas').style.width = "725px";}if($('mapSubNav').style.display  != "block"){$('mapSubNav').style.display  = "block";}if($('subNavRouteHeader').style.display  != "block"){$('subNavRouteHeader').style.display  = "block";}google.maps.event.trigger(this.map, 'resize');break;default:$('mapCanvas').innerHTML = "<img src=\"/anthro/images/splash_img.jpg?1.101\" border=\"0\"/>";if($('mapDataLeft').style.display != "none"){$('mapDataLeft').style.display = "none";}if($('mapLegend').style.display != "none"){$('mapLegend').style.display = "none";}if($('mapSearchResults').style.display != "none"){$('mapSearchResults').style.display = "none";}if($('routeFormPane').style.display != "none"){$('routeFormPane').style.display = "none";}if($('mapDirections').style.display  != "none"){$('mapDirections').style.display  = "none";}if($('legendResultsPane').style.display == "none"){$('legendResultsPane').style.display = "block";}if($('mapDataRight').style.width != "725px"){$('mapDataRight').style.width = "725px";}if($('mapCanvas').style.width != "725px"){$('mapCanvas').style.width = "725px";}if($('mapSubNav').style.display  != "none"){$('mapSubNav').style.display  = "none";}if($('subNavRouteHeader').style.display  != "none"){$('subNavRouteHeader').style.display  = "none";}google.maps.event.trigger(this.map, 'resize');break;}},showHideAlert: function(myMSG){if(arguments.length > 0){var myBdy = arguments[0];var screenHeight = screen.height;var screenWidth = screen.width;var myHTML = "<div id=\"alertCanvas\">";myHTML += "<div id=\"alertBody\">" + myBdy + "</div>";myHTML += "<div id=\"alertButton\" onClick=\"" + this.name + ".showHideAlert();\">close</div></div>";$('mapAlert').innerHTML = myHTML;$('mapAlert').style.width = "351px";$('mapAlert').style.height = "259px";}if($('mapAlert').style.top == ""){$('mapAlert').style.top = (screenHeight/2) - (parseInt($('mapAlert').style.height)/2 + 100) + "px";$('mapAlert').style.left = (screenWidth/2) - (parseInt($('mapAlert').style.width)/2) + "px";}if(($('mapAlertCurtain').style.display == "none")||($('mapAlertCurtain').style.display == "")){$('mapAlertCurtain').style.display = "block";$('mapAlert').style.display = "block";}else {$('mapAlert').style.display = "none";$('mapAlertCurtain').style.display = "none";}},parseHours: function(myHours){var tempHours = "";for(var x = 0; x < myHours.length; x++){if(myHours.charAt(x) == "|"){tempHours += "<br>";}else{tempHours += myHours.charAt(x);}}return tempHours;}};function clearText(myInput){if((myInput.id == "proxSearchZip")&&(myInput.value == geoLocation)){myInput.value = "";}else if(myInput.value.indexOf("your") != -1||myInput.value.indexOf("zip/city") != -1){myInput.value = "";}}function toggleDataPanes(showPane){if(showPane == "legend"){$('routeFormPane').style.display = "none";$('legendResultsPane').style.display = "block";}else{$('legendResultsPane').style.display = "none";$('routeFormPane').style.display = "block";}}function getVariable(myKey){var fullURL = window.location.toString();var startPoint = fullURL.indexOf("?");var queryString = fullURL.substr(startPoint+1,fullURL.length);var keyValuePairs = queryString.split("&");var myValue;for(var x = 0; x < keyValuePairs.length; x++){if(keyValuePairs[x].indexOf(myKey) != -1){myValue = keyValuePairs[x].substr(keyValuePairs[x].indexOf("=")+1,keyValuePairs[x].length);}}return myValue;}function getGeoLocation(){var geoInfo = new Array();geoInfo = headerInfo['X-Akamai-Edgescape'].split(",");var myHeaderLoc = "";for(var x = 0; x < geoInfo.length; x++) {if(geoInfo[x].indexOf("city") != -1){myHeaderLoc = geoInfo[x].substr(geoInfo[x].indexOf("=")+1,geoInfo[x].length);}}if(myHeaderLoc != ""){return myHeaderLoc;}else{return "";}}
