/* fonction preload de la carte */

// javascript disparition du preload de la carte
// Vous pouvez changer la vitesse (speed)
var speed = 10; 
var timer = 1; 
        preloding = 1;

function preload() 
{ 
	if (document.getElementById) 
	{
		document.getElementById('preloadIMG').style.visibility='hidden';
		opacity('preloader',100,0);
	}
			
	else 
	{
		if (document.layers) 
		{	
			document.preloadIMG.visibility = 'hidden';
			opacity('preloader',100,0);
		}
		else 
		{
			document.all.preloadIMG.style.visibility = 'hidden';
			opacity('preloader',100,0);
		}
	}  
}
		
function opacity(id, opacityStart, opacityEnd) 
{ 
	for(i = opacityStart; i >= opacityEnd; i--) 
	{ 
		setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
		timer++; 
	} 
} 
		
// Change l'opacité des fifférents navigateur
function changeOpac(opacity, id) { 
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100); 
	object.MozOpacity = (opacity / 100); 
	object.KhtmlOpacity = (opacity / 100); 
	object.filter = "alpha(opacity=" + opacity + ")"; 
			
	if (opacity == 0)
	{
		document.getElementById('preloader').style.visibility='hidden';
	}
} 
		                                              
		
<!--window.document.write("<style type=\"text/css\">#preloader { display: block !important; }</style>");-->
window.onload = function() { preload();  }
		

/* mise en avant du champs consulté */

function alert_select(i)
{
    document.form_moteur.iddepartement.selectedIndex = i;
    document.getElementById('blc_choix_dpt').className='blc_choix_dpt_ACTIV'; 
}


/* envoi de la recherche */

function envoyer_recherche()
{                                                      
    if(document.form_moteur.iddepartement.value == '' && document.form_moteur.nom_ville_annonce.value == '')
    {
        alert("Veuillez choisir un département.");
        document.form_moteur.iddepartement.focus();
        return;
    }  
    document.form_moteur.submit();
}

/* autocompletion */

function autocompleter(value_iddepartement)
{  
    if(document.form_moteur.nom_ville_annonce.value == 'Ville / CP')
        document.form_moteur.nom_ville_annonce.value = '';
	new Ajax.Autocompleter("nom_ville_annonce", "monDiv_nom_ville_annonce", "http://"+window.location.host+"/ajax_find_ville.php?iddepartement="+value_iddepartement,{minChars:2,frequency:0.1});               
} 


/* function ouverture + de criteres */
			
function plus_criteres_on(bt_pluscritere, bt_pluscritere_activ, bloc_rech_avance) {        
	document.getElementById(bt_pluscritere).className='INVISIBLE';
	document.getElementById(bt_pluscritere_activ).className='VISIBLE';
	document.getElementById(bloc_rech_avance).className='VISIBLE';
}
			
function plus_criteres_off(bt_pluscritere, bt_pluscritere_activ, bloc_rech_avance) {				
	document.getElementById(bt_pluscritere).className='VISIBLE';
	document.getElementById(bt_pluscritere_activ).className='INVISIBLE';
	document.getElementById(bloc_rech_avance).className='INVISIBLE';
}












		