
/* 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;  
        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);
}


/* ouvertur fenetre superposée videos */

function aff_video(idvideo)
{
	if(idvideo == '1')
	{
        getHTML_div2('fen_superpose_1','/maison/video_iframe.php','url=http://www.achat-location.com/template/fr/video_01_services.html');
	}
    else if(idvideo == '2')
	{
        getHTML_div2('fen_superpose_1','/maison/video_iframe.php','url=http://www.achat-location.com/template/fr/video_02_visibilite.html');
	}
    var myAjax = new Ajax.Updater('','http://'+window.location.host+'/maison/espace_pro_videos_stats.php',{method: 'post',parameters:'idvideo='+idvideo});
					
}      
function closeSub_video(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";  
        document.getElementById(the_sub).innerHTML = '';
        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 = "";     
}  
	
/* 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 bouton type de bien */
				
function bt_typebien_on(barre) {        
	document.getElementById(barre).className='navig_haut_btderoul_ROLL';
}
		
function bt_typebien_out(barre) {				
	document.getElementById(barre).className='navig_haut_btderoul';
}

		
/* rollover fieldset */
				
function cadre_fieldset_on(num_cadre) {        
    document.getElementById(num_cadre).className='contour_ON';
}
		
function cadre_fieldset_out(num_cadre) {				
	document.getElementById(num_cadre).className='contour_OFF';
}
		
/* fonction changement de class générique */
		
function switch_class(num_cadre,class_type) {
	document.getElementById(num_cadre).className=class_type;
}

/* fonction scroll menu gauche */
		
function scrool_marque() {
   	marqu = document.getElementsByTagName('marquee');
    marqu[0].start(); 
}
		
/* fosnction iframe create gen*/
function load_iframe(url,w,h,nameframe,idframe)   
{            
    document.write('<if'+'rame name="'+ nameframe +'" id="'+ idframe +'" src="' + url + '" width="' + w + '" height="' + h + '" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no">');
    document.write('</if'+'rame>'); 
}             
