/* favori */

function favoris() {
	if ( navigator.appName != 'Microsoft Internet Explorer' )
	{ window.sidebar.addPanel("Achat-location.com","http://www.achat-location.com","La nouvelle vision de l'immobilier"); }
	else { window.external.AddFavorite("http://www.achat-location.com","Achat-Location.com, la nouvelle vision de l'immobilier"); } }

/* fonction ouverture de div superposé generique avec appel d'url */

function getHTML_div(div_appel,url,paramet)
{         
        document.getElementById(div_appel).innerHTML = ''; 
		var url = 'http://'+window.location.hostname+'/'+url;  
		//alert(url);
        var myAjax = new Ajax.Updater(div_appel,url,{method: 'get',parameters:paramet, evalScripts : true});
		displaySubs(div_appel);
}

function getHTML_div2(div_appel,url,paramet)
{         
        document.getElementById(div_appel).innerHTML = ''; 
		var url = 'http://'+window.location.hostname+'/'+url; 
        var myAjax = new Ajax.Updater(div_appel,url,{method: 'get',parameters:paramet, evalScripts : true});
		displaySubs(div_appel);
}


	
/* ouverture site */

url_site = 'http://'+window.location.host+'/';
	
function aller_lien(url)
	{
		window.location.href = url;
	}
	
	
/* ouverture fenetre superpose */

var subs_array = new Array("fen_superpose_1","fen_superpose_2");
var visibil = 0;

function displaySubs(the_sub){                                       
        
        
    if(visibil == 0)
    {                        
    	voirSelect('hidden');
        visibil = 1;   
    }   
    else
    {
        voirSelect('visible');
        visibil = 0;   
    }
            
    if(navigator.appName=='Microsoft Internet Explorer') {
            
         var diff_pos;      
         pos_scroll = (navigator.appName == "Microsoft Internet Explorer") ? document.documentElement.scrollTop : window.pageYOffset; 
         document.getElementById(the_sub).style.top = pos_scroll+'px';
         document.getElementById(the_sub).style.position = 'absolute';
								 
         if(document.getElementById('id_body').style.overflowY != 'hidden')
             document.getElementById('id_body').style.overflowY = 'hidden'; 
         else
             document.getElementById('id_body').style.overflowY = 'auto'; 
					
    }                                                                   
            
	if (document.getElementById(the_sub).style.display=="") {
		
		document.getElementById(the_sub).style.display = "none";  
		return                                                         
		
	}
	/*
	for (i=0;i<subs_array.length;i++){
		var my_sub = document.getElementById(subs_array[i]);
		my_sub.style.display = "none";
	}
	*/
	document.getElementById(the_sub).style.display = "";
}  




/* rollover bloc maison */
				
		function blc_bien_on(nb_annonces,nb_annonces_bien,accroche,blc_1,blc_2) {        
        	document.getElementById(nb_annonces).className='INVISIBLE';
			document.getElementById(nb_annonces_bien).className='VISIBLE';
			document.getElementById(accroche).className='accroche_bien_ACTIV';
			document.getElementById(blc_1).className='ALPHA';
			document.getElementById(blc_2).className='ALPHA';
		}
		
		function blc_bien_off(nb_annonces,nb_annonces_bien,accroche,blc_1,blc_2) { 
			document.getElementById(nb_annonces).className='VISIBLE';
			document.getElementById(nb_annonces_bien).className='INVISIBLE';       
        	document.getElementById(accroche).className='accroche_bien';
			document.getElementById(blc_1).className='';
			document.getElementById(blc_2).className='';
			
			/*document.getElementById(nb_annonce_maison).className='INVISIBLE'; */
		}
		
		function valide_recherche_pro() {
			//alert(document.form_moteur_recherche_pro.action);
			var dep = document.getElementById('iddepartement').value;
			action_typ_ind = new Array('http://maison.achat-location.com/annuaire-agence-immobiliere-liste_1/',
									   'http://www.achat-terrain.com/annuaire-constructeur-liste-'+dep+'_fr.htm');
			if (document.getElementById('idtype_client').value == 'agence'){
				document.getElementById('iddepartement').value = '';
			}
			type_ind = document.form_moteur_recherche_pro.idtype_client.options.selectedIndex;
			document.form_moteur_recherche_pro.action = action_typ_ind[type_ind];
			document.form_moteur_recherche_pro.submit();      
		}

		function login() {
			document.identification.submit();      
		}
		
		function chgtypepro() {
			if (document.getElementById('idtype_client').value == 'constructeur'){
				document.getElementById('iddepartement').style.display = 'block';
				document.getElementById('ville_client').style.display = 'none';
				document.getElementById('distance_km').disabled='disabled';
			}
			if (document.getElementById('idtype_client').value == 'agence'){
				document.getElementById('iddepartement').style.display = 'none';
				document.getElementById('ville_client').style.display = 'block';
				document.getElementById('distance_km').disabled='';
			}
		}
		
		function supprtext_email() {
			if(document.getElementById('email_client').value == 'Email')
			{
				document.getElementById('email_client').value = '';
				document.getElementById('email_client').className='focus';
			}
		}
        function supprtext_password() {
            if(document.getElementById('password_client').value == '*****')
            {
                document.getElementById('password_client').value = '';
                document.getElementById('password_client').className='focus';
            }
        }
        function aff_email() {
            if(document.getElementById('email_client').value == '')
            {
                document.getElementById('email_client').value = 'Email';
                document.getElementById('email_client').className='normal';
            }
            else
                document.getElementById('email_client').className='normal';            
        }
        function aff_pswd() {
            if(document.getElementById('password_client').value == '')
            {
                document.getElementById('password_client').value = '*****';
                document.getElementById('password_client').className='normal';
            }
            else
                document.getElementById('password_client').className='normal';            
        }

		function changeImgAnnonce(srcImg, bigimg){	
			document.images[bigimg].src = srcImg; 
		}  