// Fonction de changement de la barre de status
function mouseout(){
  window.status = "";
}

function mouseover_Selection(){
  window.status = "Ajouter cette annonce à votre panier de sélection";
}

function mouseover_Selection_en(){
  window.status = "Add this good to your basket of selection";
}

function mouseover_Contact(){
  window.status = "Envoyer cette annonce par email à un contact";
}

function mouseover_Contact_en(){
  window.status = "Send this good by email to a contact";
}

function mouseover_Information(){
  window.status = "Envoyer une demande d'informations par email pour cette annonce";
}

function mouseover_Information_en(){
  window.status = "Send a request for information by email for this good";
}

function mouseover_Detail(key1){
  window.status= "Détail de l'annonce n° "+key1+" ";
}

function mouseover_Detail_en(key1){
  window.status= "Detail of good n° "+key1+" ";
}

function mouseover_Retour(){
  window.status = "Retour à la liste des annonces";
}

function mouseover_Retour_en(){
  window.status = "Back to the list of goods";
}

function mouseover_Print(){
  window.status = "Imprimer cette annonce";
}

function mouseover_Print_en(){
  window.status = "Print this good";
}

// centre le PopUp sur l'écran
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 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('');
} 

function ajaxPOST(fichier, variables, async)
{
	asyn = false;
	if (async)
	{
		asyn = true;
	}
	if (window.XMLHttpRequest) // Firefox
	{
		xhr_object = new XMLHttpRequest();
	}
	else if (window.ActiveXObject) // Internet Explorer
	{
		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
		return(false);
	}
	xhr_object.open("POST", fichier, asyn);
	xhr_object.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xhr_object.send(variables);

	if (async)
	{
		xhr_object.onreadystatechange = function()
		{
			if (xhr_object.readyState == 4) // code asynchrone
			{
			}
			else
			{
				return(false);
			}
		}
	}
	else
	{
		if (xhr_object.readyState == 4)
		{
			/*if (fichier.indexOf("concerts") > -1)
			{
				initacc();
				window.addEvent('domready', Lightbox.init.bind(Lightbox));
			}
			if (fichier.indexOf("gallerie") > -1)
			{
				hs.addEventListener(window, 'load', hs.preloadImages);
			}*/
			return(xhr_object.responseText);
		}
		else
		{
			return(false);
		}
	}
}
