function selectHotel( value ){ var mode = ''; if( arguments.length > 1){ // 1 param : mode if(arguments[1] != null) mode = arguments[1] ; //2 param : url cible if( arguments[2] != null) FICHIER_DESC = arguments[2] ; } new Ajax.Updater( container, FICHIER_DESC , { method : 'post', parameters :{ 'hid' : value , 'mode' : mode, 'selection': 'add'}, evalScripts : true }); } function removeHotel( value ){ var mode = ''; if( arguments.length > 1){ // 1 param : mode if(arguments[1] != null) mode = arguments[1] ; //2 param : url cible if( arguments[2] != null) FICHIER_DESC = arguments[2] ; } new Ajax.Updater( container , FICHIER_DESC , { method : 'post', parameters :{ 'hid' : value , 'mode': mode, 'selection': 'remove'}, evalScripts : true }); } function mapDesc( value ){ h = 'h'+value ; if( $(h) ){ eval( "new "+ $(h).getAttribute("onclick") ); return true ; }else{ return false ; } } function BAffiche( id ){ if($(id)){ $(id).style.display ="block" ; return true ; } return false; } function BCache( id ){ if($(id)){ $(id).style.display ="none" ; return true ; } return false ; } function zoomInHotel( lat, lng ){ var b = new GLatLngBounds() ; b.extend( new GLatLng( lat, lng) ); if(bounds.contains( b.getCenter())){ map.savePosition(); map.setZoom(map.getBoundsZoomLevel( b )); map.setCenter(b.getCenter()); }else{ map.panTo( new GLatLng( lat, lng) ); } } function zoomInVille( id ){ // on zoom sur les hotels de la ville et pas sur la ville elle même b = vBounds[id] ; c = b.getCenter() ; if(bounds.contains(c)){ map.savePosition(); map.setZoom(map.getBoundsZoomLevel( b )); map.setCenter(c); }else{ //alert( "chpeux pas zoomer sur la ville je zoom sur l'hotel" ); if( arguments.length > 1 ){ lat = arguments[1]; lng = arguments[2]; zoomInHotel( lat, lng ) ; } } } function zoomOut(){ map.returnToSavedPosition(); } // A function to create the marker and set up the event window function createMarker(point,name,html,typep,id) { if(typep == 3) { ICON = IconR; } else if(typep == 'golf') { ICON = IconG; } else {ICON = Icon;} var marker = new GMarker(point, ICON); //GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml( html ); }); GEvent.addListener(marker, "click", function(){ if( mapDesc( id ) === false){ m = gmarkers[id] ; z = ( map.getZoom() <= 11 ) ? 11 : map.getZoom() ; map.setCenter( m.getPoint() ,z) ; setTimeout(function(){mapDesc(id)}, 1000); } }); // save the info we need to use later for the side_bar gmarkers[id] = marker; htmls[id] = html; return marker; } /**************** affiche infobulle params : function infoAfficheWeb( i [, html]) 1. i -> id du marquer 2. contenu -> contenu à placer dans l'infobulbe *******************/ function infoAfficheWeb( i ){ contenu = (arguments[1] != null) ? arguments[1] : '' ; if(typeof(contenu) == 'object'){ var tabs = new Array() ; for( prop in contenu){ tabs[tabs.length] = new GInfoWindowTab( prop, contenu[prop] ) ; } gmarkers[i].openInfoWindowTabsHtml( tabs ) ; }else{ gmarkers[i].openInfoWindowHtml( contenu ); } }