function add_placeholder (id, placeholder) { if( !isPlaceholderSupported() ) { var el = document.getElementById(id); el.placeholder = placeholder; el.onfocus = function () { if(this.value == this.placeholder) { var width = el.style.width; this.value = ''; //el.style.cssText = 'color:#000000;'; el.style.width = width; } }; el.onblur = function () { if(this.value.length == 0) { var width = el.style.width; this.value = this.placeholder; //el.style.cssText = 'color:#A9A9A9;'; el.style.width = width; } }; el.onblur(); } } function isPlaceholderSupported() { var input = document.createElement("input"); return ('placeholder' in input); } // Add Salon Map function init() { if( initialize() ) initialize()[0].focus(); } function outit() { GUnload()[0].focus(); } window.onload = init; window.unload = outit; var map = null; var geocoder = null; function montreal() {map.setCenter(new GLatLng(45, -73),5);} function chicago() {map.setCenter(new GLatLng(41, -87),5);} function newyork() {map.setCenter(new GLatLng(40, -58),5);} function la() {map.setCenter(new GLatLng(34, -118),5);} function dallas() {map.setCenter(new GLatLng(23, -96),5);} function initialize() { if( document.getElementById("map") ) { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(41, -87),5); geocoder = new GClientGeocoder(); $('form[name*="add"]').submit(); } } } function showAddress(address,country) { if((address == 1 || address == "") && (country.toUpperCase()=='USA')) { var center = new GLatLng(41, -87); map.setCenter(center,5); map.panTo(center); } else if((address == 2 || address == 3 || address =="") && (country.toUpperCase()=='CANADA')) { var center = new GLatLng(60, -115); map.setCenter(center,3); map.panTo(center); } else if ((address == 4 || address =="") && (country.toUpperCase()=='MEXICO')) { var center = new GLatLng(23, -102); map.setCenter(center,5); map.panTo(center); }else if((address == 5 || address =="") && (country.toUpperCase()=='CHILE')) { var center = new GLatLng(-35, -71) map.setCenter(center,7); map.panTo(center); }else if((address == 6 || address =="") && (country.toUpperCase()=='UK')) { var center = new GLatLng(54.9, -2.7); map.setCenter(center,7); map.panTo(center); }else if((address == 7 || address =="") && (country.toUpperCase()=='BRAZIL')) { var center = new GLatLng(-8.6, -53); map.setCenter(center,5); map.panTo(center); }else if((address == 8 || address==10 || address =="") && (country.toUpperCase()=='SWEDEN')) { var center = new GLatLng(62.7, 16.64); map.setCenter(center,6); map.panTo(center); }else if((address == 9 || address == 11 || address =="") && (country.toUpperCase()=='DENMARK')) { var center = new GLatLng(55.6, 10.09); map.setCenter(center,7); map.panTo(center); }else if((address == 12 || address == 13 || address =="" ) && (country.toUpperCase()=='JAPAN')) { var center = new GLatLng(35.80,137.98); map.setCenter(center,5); map.panTo(center); } else if((address == 14 || address == 15 || address =="" ) && (country.toUpperCase()=='KOREA')) { var center = new GLatLng(36.6548028,127.9421778); map.setCenter(center,5); map.panTo(center); } else { if (geocoder) { map.clearOverlays(); if(country.toUpperCase()=='JAPAN' && address.toUpperCase()=="AREA") //use prefecture name to zoom to { address = $('#state option:selected').text(); } if(country.toUpperCase()=='JAPAN') cTLD = "JP"; else if(country.toUpperCase()=='DENMARK') cTLD = "DK"; else if(country.toUpperCase()=='USA') cTLD = "US"; else if(country.toUpperCase()=='CANADA') cTLD = "CA"; else if(country.toUpperCase()=='BRAZIL') cTLD = "BR"; else if(country.toUpperCase()=='SWEDEN') cTLD = "SE"; else if(country.toUpperCase()=='KOREA') cTLD = "KR"; else if(country.toUpperCase()=='MEXICO') cTLD = "MX"; else if(country.toUpperCase()=='CHILE') cTLD = "CL"; else if(country.toUpperCase()=='BELGIUM') cTLD = "BE"; else cTLD = ""; geocoder.setBaseCountryCode(cTLD); geocoder.getLatLng(address+', country:'+country, function(point) { if (!point) { } else { if(country.toUpperCase()=='KOREA') //korea has blacked out data stay zoomed out over general Korea { var center = new GLatLng(36.6548028,127.9421778); map.setCenter(center,5); map.panTo(center); } else if(country.toUpperCase()=='JAPAN') //map to Japan general prefecture selected { map.setCenter(GMarker(point),12); map.panTo(point); } else { map.setCenter(GMarker(point),12); map.addOverlay(new GMarker(point, {draggable: false})); map.panTo(point); } } }); } } } function clicked(overlay, latlng) { if (latlng) { geocoder.getLocations(latlng, function(addresses) { if(addresses.Status.code != 200) { alert("reverse geocoder failed to find an address for " + latlng.toUrlValue()); } else { address = addresses.Placemark[0]; var myHtml = address.address; map.openInfoWindow(latlng, myHtml); } }); } }