<!--//
//<![CDATA[
if($('big_map')){


var Rec;
tabPoint = new Array();
tabMarker = new Array();
tabTxt = new Array();

var lastpoint;
var OV;
var map = new GMap2(document.getElementById("big_map"));                             //create "map" object
map.addControl(new GSmallMapControl());                                         //add small map controls
map.addControl(new GOverviewMapControl());
map.addControl(new GMapTypeControl());
	
map.setCenter(new GLatLng(43.702688501414,7.2684135765841), 5);
	

function create_bigmap(my,mx){
	var mx;
	var my;
	if(!mx)mx=260;
	if(!my)my=-260;

	//new Effect.MoveBy( 'map', my,mx,   {  duration:1.0,queue: {scope:'myscope', position:'front'} });
	//Element.setStyle('map', {width:'480px',height:'350px'} )
 	Element.hide('show_bigmap');
	Element.hide('divshow_bigmap');
	Element.show('hide_bigmap');
	map_ctrl1=new GOverviewMapControl();
	map_ctrl2=new GMapTypeControl();
	map.addControl(map_ctrl1);
	map.addControl(map_ctrl2);
}

function hide_bigmap(my,mx){
	var mx=0;
	var my=0;
	//if(!mx)mx=-260;
	//if(!my)my=260;
	//new Effect.MoveBy( 'map', my,mx, {  duration:1.0,queue: {scope:'myscope', position:'front'} });
//	Element.setStyle('sup_big_map', {display:'none'} )
	Element.setStyle('sup_big_map', {visibility:'hidden',width: '0px',	height: '0px'} )
	
 	Element.show('show_bigmap');
	//Element.show('divshow_bigmap');
	Element.hide('hide_bigmap');
//	map.removeControl(map_ctrl1);
//	map.removeControl(map_ctrl2);
}
function show_bigmap(my,mx){
	var mx=0;
	var my=0;
	//if(!mx)mx=-260;
	//if(!my)my=260;
	//new Effect.MoveBy( 'map', my,mx, {  duration:1.0,queue: {scope:'myscope', position:'front'} });
	
	//Element.setStyle('sup_big_map', {display:'block'} );
	Element.setStyle('sup_big_map', {visibility:'visible',width: '580px',	height: '350px'} );
	
 	Element.hide('show_bigmap');
	//Element.show('divshow_bigmap');
	Element.show('hide_bigmap');
	
	window.setTimeout(function() { centerRectancle(lat_min,lat_max,long_min,long_max)}, 1000);
}

function Rectangle(bounds, opt_weight, opt_color) {
  this.bounds_ = bounds;
  this.weight_ = opt_weight || 2;
  this.color_ = opt_color || "#888888";
}

Rectangle.prototype = new GOverlay();
Rectangle.prototype.initialize = function(map) {
  var div = document.createElement("div");
  div.style.border = this.weight_ + "px solid " + this.color_;
  div.style.position = "absolute";
  map.getPane(G_MAP_MAP_PANE).appendChild(div);
  this.map_ = map;
  this.div_ = div;
}
Rectangle.prototype.remove = function() {
  this.div_.parentNode.removeChild(this.div_);
}
Rectangle.prototype.copy = function() {
  return new Rectangle(this.bounds_, this.weight_, this.color_,
                       this.backgroundColor_, this.opacity_);
}
Rectangle.prototype.redraw = function(force) {
  if (!force) return;
  var c1 = this.map_.fromLatLngToDivPixel(this.bounds_.getSouthWest());
  var c2 = this.map_.fromLatLngToDivPixel(this.bounds_.getNorthEast());
  this.div_.style.width = Math.abs(c2.x - c1.x) + "px";
  this.div_.style.height = Math.abs(c2.y - c1.y) + "px";
  this.div_.style.left = (Math.min(c2.x, c1.x) - this.weight_) + "px";
  this.div_.style.top = (Math.min(c2.y, c1.y) - this.weight_) + "px";
}
var bounds = map.getBounds();
var southWest = bounds.getSouthWest();
var northEast = bounds.getNorthEast();
var lngDelta = (northEast.lng() - southWest.lng()) / 4;
var latDelta = (northEast.lat() - southWest.lat()) / 4;


function createPOI(point, Txt) {
        var icon = new GIcon();
        icon.image = "http://www.french-riviera-mag.com/images/poi.png";
        icon.iconSize = new GSize(20, 34);
        icon.iconAnchor = new GPoint(10, 34);
        icon.infoWindowAnchor = new GPoint(10,5);

        var marker = new GMarker(point,icon);
       
        GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml("" + Txt + "");
       });
     map.setCenter(point);
        return marker;
}


function createMarker(point,num, Txt) {
	var icon = new GIcon();
	icon.image = "http://www.federal-hotel-luxe.fr/images/iconr"+num+".png";
	icon.iconSize = new GSize(20, 34);
	icon.iconAnchor = new GPoint(10, 34);
	icon.infoWindowAnchor = new GPoint(10,5); 

	var marker = new GMarker(point,icon);
 
/* GEvent.addListener(marker, "click", function() {
		 	marker.openInfoWindowHtml("" + Txt + "");
		 });
		  */
	 GEvent.addListener(marker, "click", function() {
	 		
	 		 if (map.getInfoWindow().getPoint()
           && map.getInfoWindow().getPoint().equals(marker.getPoint())
           && !map.getInfoWindow().isHidden() ) {
         map.closeInfoWindow();
       } else {
         marker.openInfoWindowHtml("" + Txt + "");
       } 
		 		
		 }
		 );	
	tabPoint[num] = point;
	tabMarker[num] = marker;
	tabTxt[num] = ""+Txt+"";
		
	return marker;
}
function center(num){
	map.panTo(tabPoint[num]);
	tabMarker[num].openInfoWindowHtml(""+tabTxt[num]+"");
}

function centerRectancle(lat_min,lat_max,long_min,long_max){
	
	SouthWest=new GLatLng(lat_max , long_max );
	NorthEast=new GLatLng(lat_min , long_min  );  
	
	var rectBounds = new GLatLngBounds(SouthWest,NorthEast);
 
	Rec = new Rectangle(rectBounds);
	
	lat_c=rectBounds.getCenter();
	lng_c=rectBounds.getCenter();
	if (lng_c.lng()<-150)
		center_lng=lng_c.lng() + 180;
	else
		center_lng=lng_c.lng()
	
	 var bounds = map.getBounds();

	testzomm=map.getBoundsZoomLevel(map.getBounds(new GLatLngBounds(SouthWest,NorthEast)));
	//testzomm=map.getBoundsZoomLevel(bounds);

	//alert(bounds+"testzomm="+testzomm);
	testzomm = testzomm+6;
	if(testzomm>13) testzomm=13;
	map.setCenter(new GLatLng(lat_c.lat(),center_lng),5);
	//map.setCenter(new GLatLng(lat_c.lat(),center_lng),testzomm);
}
}
//]]>
//-->