function montremenu(id) {
	var d = document.getElementById(id);
	for (var i = 1;i<=7;i++) {
		if (document.getElementById('smenu'+i)) {
			document.getElementById('smenu'+i).style.display='none';
		}
		if (d) {
			d.style.display='block';
		}
	}
}


function changeOpts(type) {
  var sel = document.searchForm.type;
  var opts = new Array(); 
  
  //On supprime toutes les options du select
  sel.options.length = 0;
  
  if (type == 1) { //Apparts
    //On affiche le sel
    sel.style.visibility = "visible";
    opts[0] = [-1, "Indifferent"];
    opts[1] = [5, "Studio"];
    opts[2] = [6, "T1"];
    opts[3] = [7, "T1 Bis"];
    opts[4] = [8, "T2"];
    opts[5] = [9, "T3"];
    opts[6] = [10, "T4"];
    opts[7] = [11, "T5 et +"];
  } else if (type == 2) { //Maisons
    sel.style.visibility = "visible";
    opts[0] = [-1, "Indifferent"];
    opts[1] = [1, "2 Chambres"];
    opts[2] = [2, "3 Chambres"];
    opts[3] = [3, "4 Chambres"];
    opts[4] = [4, "5 Chambres et +"];
  } else {
    sel.style.visibility = "hidden";
  }
  
  var value = "";
  var label = "";

  for (i = 0; i < opts.length; i++) {
    value = opts[i][0];
    label = opts[i][1];

    sel.options[i] = new Option(label, value, false, false);
  }
}

function vvPop(id) {
  var url = 'http://www.lowcost-immo.fr/vv.php?id=' + id;
  var winOpts = 'height=350,width=350';

  window.open(url, 'winvisite', winOpts);
  return false;
}

function vvPopPN(id) {
  var url = 'http://www.lowcost-immo.fr/vvPN.php?id=' + id;
  var winOpts = 'height=350,width=350';

  window.open(url, 'winvisite', winOpts);
  return false;
}

function calcPop(x, y) {
  var url = 'http://www.lowcost-immo.fr/calc.php';
  var winOpts = 'height=200,width=350,menubar=no,top=' + y + ',left=' + x;

  window.open(url, 'wincalc', winOpts);
  return false;
}

function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('popup'+i)) {document.getElementById('popup'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

function initialize() {
    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        var point = new GLatLng(43.303336, -0.378181);
        var texte = "<span style='color: #97be0d; font-size: 16px; font-weight: bold;'>Lowcost Immo</span><br/>Agence Immobilière Lowcost<br/>Vente de biens immobiliers et programmes neufs<br/>8, bvd Champetier de Ribes<br/>64000 Pau, France";
        map.setCenter(point, 13);
        map.addControl(new GSmallMapControl());
        map.addOverlay(new GMarker(point));
        map.openInfoWindow(map.getCenter(), texte);
    }
}
