/** * NIELS, TerZake 2008-08-13 */ function logroute(address) { var httpconnect = createHTTPHandler(); httpconnect.open('POST', 'http://www.gmt.nl/include/logroute.ajax.php?address='+address, false); httpconnect.send(null); return false; } // LOCATION var loc = 'bu5'; var lang = 'nl'; var locations = new Array(); locations['bu0'] = new Array(); locations['bu0']['latitude'] = 52.33769; locations['bu0']['longitude'] = 4.96396; locations['bu0']['image_source'] = 'http://www.gmt.nl/image/web/googlemaps/logo_rood.png'; locations['bu0']['nltoadres'] = 'Muiderstraatweg 15E 1111 PS Diemen Nederland'; locations['bu0']['uktoadres'] = 'Muiderstraatweg 15E 1111 PS Diemen Holland'; locations['bu0']['nlname'] = 'GMT groep - Diemen, Nederland'; locations['bu0']['ukname'] = 'GMT group - Diemen, Holland'; locations['bu1'] = new Array(); locations['bu1']['latitude'] = 52.33769; locations['bu1']['longitude'] = 4.96396; locations['bu1']['image_source'] = 'http://www.gmt.nl/image/web/googlemaps/logo_groen.png'; locations['bu1']['nltoadres'] = 'Muiderstraatweg 15E 1111 PS Diemen Nederland'; locations['bu1']['uktoadres'] = 'Muiderstraatweg 15E 1111 PS Diemen Holland'; locations['bu1']['nlname'] = 'GMT europe - Diemen, Nederland'; locations['bu1']['ukname'] = 'GMT europe - Diemen, Holland'; locations['bu2'] = new Array(); locations['bu2']['latitude'] = 52.28989; locations['bu2']['longitude'] = 6.77280; locations['bu2']['image_source'] = 'http://www.gmt.nl/image/web/googlemaps/logo_paars.png'; locations['bu2']['nltoadres'] = 'Adam Smithstraat 35 7559 SW Hengelo Nederland'; locations['bu2']['uktoadres'] = 'Adam Smithstraat 35 7559 SW Hengelo Holland'; locations['bu2']['nlname'] = 'GMT systems - Hengelo, Nederland'; locations['bu2']['ukname'] = 'GMT systems - Hengelo, Holland'; locations['bu3'] = new Array(); locations['bu3']['latitude'] = 51.96183; locations['bu3']['longitude'] = 6.01320; locations['bu3']['image_source'] = 'http://www.gmt.nl/image/web/googlemaps/logo_blauw.png'; locations['bu3']['nltoadres'] = 'Ratio 24 6921 RW Duiven Nederland'; locations['bu3']['uktoadres'] = 'Ratio 24 6921 RW Duiven Holland'; locations['bu3']['nlname'] = 'GMT logistic solutions - Duiven, Nederland'; locations['bu3']['ukname'] = 'GMT logistic solutions - Duiven, Holland'; locations['bu4'] = new Array(); locations['bu4']['latitude'] = 52.17494; locations['bu4']['longitude'] = 5.40702; locations['bu4']['image_source'] = 'http://www.gmt.nl/image/web/googlemaps/logo_oranje.png'; locations['bu4']['nltoadres'] = 'Hoefseweg 1 3821 AE Amersfoort Nederland'; locations['bu4']['uktoadres'] = 'Hoefseweg 1 3821 AE Amersfoort Holland'; locations['bu4']['nlname'] = 'GMT it services - Hengelo, Nederland'; locations['bu4']['ukname'] = 'GMT it services - Hengelo, Holland'; locations['bu5'] = new Array(); locations['bu5']['latitude'] = 52.0788801; locations['bu5']['longitude'] = 4.8857476; locations['bu5']['image_source'] = 'http://www.gmt.nl/image/web/googlemaps/logo_enterprise.png'; locations['bu5']['nltoadres'] = 'De Bleek 13 3447 GV Woerden Nederland'; locations['bu5']['uktoadres'] = 'De Bleek 13 3447 GV Woerden Holland'; locations['bu5']['nlname'] = 'GMT enterprise solutions - Woerden, Nederland'; locations['bu5']['ukname'] = 'GMT enterprise solutions - Woerden, Holland'; // SETTINGS var latitude = locations[loc]['latitude']; var longitude = locations[loc]['longitude']; var zoom = 15; var image_source = locations[loc]['image_source']; var image_hover = ''; var image_x = 30; var image_y = 75; var image_w = 100; var image_h = 80; var image_shadow = ''; var image_shadow_w = 48; var image_shadow_h = 48; var map; var gdir; var geocoder = null; var addressMarker; // LANGUAGE VARS var lang_adres = "uw vertrekpunt"; var lang_toadres = "naar"; var lang_input = 'straat, plaats'; var lang_submit = "plan route"; var lang_print = 'uitprinten'; function setroute(adres) { if(adres == '') { alert('U heeft uw vertrekpunt nog niet opgegeven!'); return false; } else if(adres == lang_input) { alert('U heeft uw vertrekpunt nog niet opgegeven!'); return false; } else { geocoder.getLocations(adres, GEOresponse); return false; } } function GEOresponse(response) { if (!response || response.Status.code != 200) { // NO RESPONSE AVAILABLE } else { place = response.Placemark[0]; adres = place.address + ' ' + place.AddressDetails.Country.CountryNameCode; locat = document.getElementById('locale').value; if(locat == 'uk') { locat = 'en'; } //alert(locat); setDirections(place.address, document.getElementById('toAddress').value, locat); document.getElementById('mapprint').style.visibility = 'visible'; return false; } } function initialize() { if(GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map")); gdir = new GDirections(map, document.getElementById("directions")); geocoder = new GClientGeocoder(); GEvent.addListener(gdir, "load", onGDirectionsLoad); GEvent.addListener(gdir, "error", handleErrors); map.setCenter(new GLatLng(latitude, longitude), zoom); map.addControl(new GSmallMapControl()); icon = new GIcon(); icon.image = image_source; icon.iconSize = new GSize(image_w, image_h); icon.shadow = image_shadow; icon.shadowSize = new GSize(image_shadow_w, image_shadow_h); icon.iconAnchor = new GPoint(image_x, image_y); var marker = new GMarker(new GLatLng(locations[loc]['latitude'], locations[loc]['longitude']), icon); map.addOverlay(marker); document.getElementById('langadres').innerHTML = lang_adres; document.getElementById('langtoadres').innerHTML = lang_toadres; document.getElementById('fromAddress').value = lang_input; document.getElementById('prompvalue').value = lang_input; document.getElementById('submitAddress').value = lang_submit; document.getElementById('textprint').innerHTML = lang_print; document.getElementById('toAddress').value = locations[loc][lang + 'toadres']; GEvent.addListener(marker, "click", function() { document.getElementById('prompwindow').style.visibility = 'visible'; }); } } function setDirections(fromAddress, toAddress, locale) { gdir.load("from: " + fromAddress + " to: " + toAddress, { "locale": locale }); } function handleErrors(){ if(gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) { // NO RESPONSE AVAILABLE } } function onGDirectionsLoad() { } function inputfocus(value) { if(value == lang_input) { value = ''; } return value; } function inputblur(value) { if(value == '') { value = lang_input; } return value; }