function affichage_popup(nom_de_la_page, nom_interne_de_la_fenetre) {
	window.open (nom_de_la_page, nom_interne_de_la_fenetre, config='height=510, width=420, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	document.cookie = name+"="+" ; expires=-1";
}

function createCookie(name,value) {
	document.cookie=name+"="+value;
}

//Stat click bien
function saveBienStat(pageCode, source, idBien, numPage, position, userInput, idGalerie, idRayon, typeAnnonceur, idAnnonceur, type) {
	$.post(
		"/an/saveBienStat.do",
		{
			pageCode:pageCode,
			source:source,
			idBien:idBien,
			numPage:numPage,
			position:position,
			userInput:userInput,
			idGalerie:idGalerie,
			idRayon:idRayon,
			typeAnnonceur:typeAnnonceur,
			idAnnonceur:idAnnonceur,
			type:type,
		}
	);
	
	var now = new Date();
	var exitTime = now.getTime()+25;
    while (true) {
        now = new Date();
        if (now.getTime() > exitTime) return;
    }
	
  	return true;
}

