
function showPage(p)
{
  var i = 1;
  var fadespeed = 600;
  while ( document.getElementById('page_'+i) )
  {
    $('#page_'+i).hide(0);
    $('#show_page_'+i).html('<a href="#" onClick="return showPage('+i+');">'+i+'</a>');
    i = i+1;
  }

  $('#page_' + p).fadeIn(fadespeed);
  $('#page_' + p + ' .photo').each(function() {
    if( $(this).attr('name') ) {
      $(this).html('<img src="' + $(this).attr('name') + '" alt="' + $(this).attr('title') + '"/>');
      $(this).removeAttr( 'name' ).removeAttr( 'title' );
    }
  });
  
  document.getElementById('show_page_'+p).innerHTML = p;
}

function center_map(lat,lng)
{
  document.getElementById('general_map').className='detail_map';
  map.checkResize();
  map.setCenter( new GLatLng((min_lat+max_lat)/2,(min_long+max_long)/2),9);
  taille= map.getSize();
  taille = new GSize(taille.width - 32, taille.height - 32);
  map.setZoom( 13 );
                                       
  //document.getElementById('show_map').style.display='none';
  //document.getElementById('hide_map').style.display='block';

  map.setCenter( new GLatLng(lat,lng),map.getZoom() );
}
function seeMap()
{
  document.getElementById('general_map').className='detail_map';
  map.checkResize();
  map.setCenter( new GLatLng((min_lat+max_lat)/2,(min_long+max_long)/2),9);
  taille= map.getSize();
  taille = new GSize(taille.width - 32, taille.height - 32);
  map.setZoom(map.getCurrentMapType().getBoundsZoomLevel(new GLatLngBounds(new GLatLng(min_lat,min_long), new GLatLng(max_lat,max_long)), taille));
}

function showMap()
{
  //alert( navigator.userAgent );
  //if( navigator.userAgent.indexOf('MSIE') != -1 )
  //{
  //document.getElementById('gmap').className='gmap_show';
  document.getElementById('map').style.display='block';
    //document.getElementById('map').style.float='left';              
  //}
  //else
  //{
    // document.getElementById('gmap').style.display='block';
  //   document.getElementById('gmap').className='gmap_show';
  //}                      
}
function showMapPointDetail(current_value,bord)
{
  for(i=0;i<other_marker_bord.length;i++)
  {
    if(other_marker_bord[i]==bord)
    {
      if(current_value.checked)
      {
        other_marker[i].show();
      }
      else
      {
        other_marker[i].hide();
      }
    }
  }
}

function changePhoto( key_id )
{
  var i=0;
  while(document.getElementById("photo_"+new String(i)))
  {
    document.getElementById("photo_"+new String(i)).style.display="none";
    i++;    
  }
  document.getElementById("photo_"+key_id).style.display="block";
  return false;
}
