function centrePop(url,largeur,hauteur) {
  var gauche = (screen.width - largeur)/2
  var haut =  (screen.height - hauteur)/2
  return window.open(url,"","width="+largeur+",height="+hauteur+",left="+gauche+",top="+haut)
}

function centrePopup(url,largeur,hauteur) {
  var gauche = (screen.width - largeur)/2
  var haut =  (screen.height - hauteur)/2
  return window.open(url,"","scrollbars=yes,width="+largeur+",height="+hauteur+",left="+gauche+",top="+haut)
}

function First2UpperCase(texte) {
var t = new Array();
  for(j=0 ; j < texte.length ;j++) {
    if(j == 0) t[j] = texte.substr(j,1).toUpperCase();
    else t[j] = texte.substr(j,1).toLowerCase();
  }
  return t.join('');
}

$(document).ready(function() {
$("#rechercher-buy .torent").fadeTo("fast", 0.5);
$("#rechercher-rent .tobuy").fadeTo("fast", 0.5);
  $(".tobuy").click(function() {  	
  	$("#rechercher-rent").hide();
	$("#rechercher-buy").show();
  });
  $(".torent").click(function() {
  	$("#rechercher-buy").hide();
	$("#rechercher-rent").show();
  });
  $(".torent").mouseover(function() {
  	$(".tobuy").fadeTo("fast", 0.5);
	$(".torent").fadeTo("fast", 1);
  });
  $(".tobuy").mouseover(function() {
  	$(".tobuy").fadeTo("fast", 1);
	$(".torent").fadeTo("fast", 0.5);
  });
  
  $("#rechercher-buy .torent").mouseout(function() {
  	$(".tobuy").fadeTo("fast", 1);
	$(".torent").fadeTo("fast", 0.5);
  });
   $("#rechercher-rent .tobuy").mouseout(function() {
  	$(".tobuy").fadeTo("fast", 0.5);
	$(".torent").fadeTo("fast", 1);
  });

});