var map; var latlng; var geocoder; var panorama; var directionDisplay; var directionsService; function GeoInitialise() { geocoder = new google.maps.Geocoder(); latlng = new google.maps.LatLng( document.formulaire_geo.nLat_PM.value, document.formulaire_geo.nLng_PM.value ); var myOptions = { zoom: parseInt( document.formulaire_geo.nZoom_PM.value ), center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), myOptions); var marker = new google.maps.Marker({ position: latlng, map: map, title: $('#szTitreDialogue_PM').value }); directionsService = new google.maps.DirectionsService() directionsDisplay = new google.maps.DirectionsRenderer(); directionsDisplay.setMap(map); directionsDisplay.setPanel( document.getElementById('itineraire_resultat') ); document.getElementById('itineraire_resultat').innerHTML = ''; document.formulaire_geo.szItiAdresse_PM.value=''; document.formulaire_geo.szItiCodePostal_PM.value=''; document.formulaire_geo.szItiVille_PM.value=''; if( document.getElementById('panorama_canvas') ) { var panoramaOptions = { position: latlng, pov: { heading: parseInt( document.formulaire_geo.nStreetHeading_PM.value ), pitch: parseInt( document.formulaire_geo.nStreetPitch_PM.value ), zoom: parseInt( document.formulaire_geo.nStreetZoom_PM.value ) } }; panorama = new google.maps.StreetViewPanorama(document.getElementById('panorama_canvas'),panoramaOptions); map.setStreetView(panorama); } } function AfficheGeolocalisation( x, y, z, strH, strP, strZ) { $('#nLat_PM').val(x); $('#nLng_PM').val(y); $('#nZoom_PM').val(z); $('#nStreetHeading_PM').val(strH); $('#nStreetPitch_PM').val(strP); $('#nStreetZoom_PM').val(strZ); $('#cadre_localisation').show('slow'); $('#cadre_localisation').removeClass( 'display_none' ); GeoInitialise(); } function CacheGeolocalisation( ) { $('#cadre_localisation').addClass( 'display_none' ); $('#cadre_localisation').hide(); } function GeoInitineraire() { var adresse = document.formulaire_geo.szItiAdresse_PM.value; var code_postal = document.formulaire_geo.szItiCodePostal_PM.value; var ville = document.formulaire_geo.szItiVille_PM.value; var recherche = ''; if( adresse ) { if( recherche != '' ) recherche = recherche + ','; recherche = recherche + adresse; } if( code_postal ) { if( recherche != '' ) recherche = recherche + ','; recherche = recherche + code_postal; } if( ville ) { if( recherche != '' ) recherche = recherche + ','; recherche = recherche + ville; } var request = { origin: recherche, destination: latlng, region: 'FR', travelMode: google.maps.DirectionsTravelMode.DRIVING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } if (status == google.maps.DirectionsStatus.NOT_FOUND || status == google.maps.DirectionsStatus.ZERO_RESULTS ) { alert( 'Impossible de trouver un itinéraire. \nCela vient souvent d\'une erreur dans l\'adresse.\n\nRéessayez en indiquant la ville si vous n\'avez indiqué que le code postal.' ); } }); } function rechercher_public( mode, alphabet) { if( mode != "alphabet" ){ document.annuaire_recherche.szAlphabetRch_PM.value="";} else{ document.annuaire_recherche.szAlphabetRch_PM.value=alphabet; document.annuaire_recherche.szTri_PM.value="adherent"; } if( mode != "recherche" ){ document.annuaire_recherche.szRecherche_PM.value="";} else{ document.annuaire_recherche.szTri_PM.value="adherent"; } if( mode != "categorie" ){ document.annuaire_recherche.nIdCategorie_PM.value="";} else{ document.annuaire_recherche.szTri_PM.value="adherent"; } document.annuaire_recherche.submit(); } function rechercher_public_haut() { document.annuaire_recherche_haut.submit(); } function mailto_adh( id ) { var adresse = '../admin/fidelium/scripts/action_adherent.php?szMode_PM=get_email&nIdElement_PM='+id; var email_info = $.ajax({ url: adresse, async: false }).responseText; if( $('email', email_info).text() ) { var email = $('email', email_info).text(); location.href='mailto:'+email; /* var mailto_link = 'mailto:' + email window = window.open(mailto_link, 'emailWindow') */ }else{alert('L\'adresse mail de cet adhérent n\'est pas renseignée.')} }