/** * GIJS, TerZake 2007-11-28 */ function logroute(address) { var httpconnect = createHTTPHandler(); httpconnect.open('POST', 'http://www.gullimex.com/include/logroute.ajax.php?address='+address, false); httpconnect.send(null); return false; } /** * NIELS, TerZake 2008-09-30 */ var lang = 'nl'; var locations = new Array(); locations['nl'] = new Array(); locations['nl']['latitude'] = 52.30855; locations['nl']['longitude'] = 6.74747; locations['nl']['nltoadres'] = 'Oostermaat 7 7623 CS Borne Nederland'; locations['nl']['frtoadres'] = 'Oostermaat 7 7623 CS Borne Pays-Bas'; locations['nl']['nlname'] = 'Gullimex BV - Borne, Nederland'; locations['nl']['frname'] = 'Gullimex BV - Borne, Pays-Bas'; locations['be'] = new Array(); locations['be']['latitude'] = 50.92481; locations['be']['longitude'] = 3.95250; locations['be']['nltoadres'] = 'Oudenaardsesteenweg 404 9420 Erpe-Mere België'; locations['be']['frtoadres'] = 'Oudenaardsesteenweg 404 9420 Erpe-Mere Belgique'; locations['be']['nlname'] = 'Gullimex BV - Erpe-Mere, België'; locations['be']['frname'] = 'Gullimex BV - Erpe-Mere, Belgique'; locations['fr'] = new Array(); locations['fr']['latitude'] = 48.84670; locations['fr']['longitude'] = 2.82845; locations['fr']['nltoadres'] = '9 Rue de la Prairie 77700 Bailly Romainvilliers Frankrijk'; locations['fr']['frtoadres'] = '9 Rue de la Prairie 77700 Bailly Romainvilliers France'; locations['fr']['nlname'] = 'Gullimex BV - Bailly Romainvilliers, Frankrijk'; locations['fr']['frname'] = 'Gullimex BV - Bailly Romainvilliers, France'; var getloc = ''; if(getloc == 'be') { var latitude = locations['be']['latitude']; var longitude = locations['be']['longitude']; var loc = 'be'; } else if(getloc == 'nl') { var latitude = locations['nl']['latitude']; var longitude = locations['nl']['longitude']; var loc = 'nl'; } else if(getloc == 'fr') { var latitude = locations['fr']['latitude']; var longitude = locations['fr']['longitude']; var loc = 'fr'; } else if(lang == 'nl') { var latitude = locations['nl']['latitude']; var longitude = locations['nl']['longitude']; var loc = 'nl'; } else if(lang == 'fr') { var latitude = locations['be']['latitude']; var longitude = locations['be']['longitude']; var loc = 'be'; } else { var latitude = locations['nl']['latitude']; var longitude = locations['nl']['longitude']; var loc = 'nl'; } var zoom = 15; var image_source = 'http://www.gullimex.com/image/web/googlemaps/logo.png'; 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 niet alle verplichte velden ingevuld.'); return false; } else if(adres == lang_input) { alert('U heeft niet alle verplichte velden ingevuld.'); 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; setDirections(place.address, document.getElementById('toAddress').value, document.getElementById('locale').value); 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['be']['latitude'], locations['be']['longitude']), icon); map.addOverlay(marker); 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['nl']['latitude'], locations['nl']['longitude']), icon); map.addOverlay(marker); 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['fr']['latitude'], locations['fr']['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('locnl').text = locations['nl'][lang + 'name']; document.getElementById('locbe').text = locations['be'][lang + 'name']; document.getElementById('locfr').text = locations['fr'][lang + 'name']; document.getElementById('locnl').value = locations['nl'][lang + 'toadres']; document.getElementById('locbe').value = locations['be'][lang + 'toadres']; document.getElementById('locfr').value = locations['fr'][lang + 'toadres']; if(getloc == 'be') { document.getElementById('locbe').selected="selected"; } else if(getloc == 'nl') { document.getElementById('locnl').selected="selected"; } else if(getloc == 'fr') { document.getElementById('locfr').selected="selected"; } else if(lang == 'nl') { document.getElementById('locnl').selected="selected"; } else if(lang == 'fr') { document.getElementById('locbe').selected="selected"; } else { document.getElementById('locnl').selected="selected"; } 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; } function selectchange(loc) { if(document.getElementById('locnl').value == loc) { loc = 'nl'; } if(document.getElementById('locbe').value == loc) { loc = 'be'; } if(document.getElementById('locfr').value == loc) { loc = 'fr'; } map.setCenter(new GLatLng(locations[loc]['latitude'], locations[loc]['longitude']), zoom); if(document.getElementById('fromAddress').value == '') { } else if(document.getElementById('fromAddress').value == lang_input) { } else { setroute(document.getElementById('fromAddress').value); } }