
/* favori */
function add_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");
}

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>'); 
}             


/* tag commonline*/


    /* ---------- v01 
	sas_tmstp=Math.round(Math.random()*10000000000);sas_masterflag=1; 
    function SmartAdServer_iframe(sas_pageid,sas_formatid,sas_target,sas_w,sas_h) { 
    if (sas_masterflag==1) {sas_masterflag=0;sas_master='M';} else {sas_master='S';}; ------------- */
        /*document.write('http://www.smartadserver.com/call/pubif/' + sas_pageid + '/' + sas_formatid + '/'+sas_master + '/' + sas_tmstp + '/' + escape(sas_target) + '?');*/
        /* ---------- document.write('<IFRAME SRC="http://www.smartadserver.com/call/pubif/' + sas_pageid + '/' + sas_formatid + '/'+sas_master + '/' + sas_tmstp + '/' + escape(sas_target) + '?" width=' + sas_w + ' height=' + sas_h + ' marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>');  ------------- */
        /*document.write('<scr'+'ipt type="text/javascr'+'ipt">\ndocument.write\(\'<SCR\'+\'IPT SRC="http://www.smartadserver.com/call/pubj/' + sas_pageid + '/' + sas_formatid + '/'+sas_master + '/' + sas_tmstp + '/' + escape(sas_target) + '?"></SCR\'+\'IPT>\'\)\;\n</scr'+'ipt>'); */
        /* ---------- document.write('</IFRAME>');  
    }  ------------- */
	
	sas_tmstp=Math.round(Math.random()*10000000000);sas_masterflag=1;
	function SmartAdServer_iframe(sas_pageid,sas_formatid,sas_target,sas_w,sas_h) {
	    if (sas_masterflag==1) {sas_masterflag=0;sas_master='M';} else {sas_master='S';};
	    document.write('<IFRAME SRC="http://www.smartadserver.com/call/pubif/' + sas_pageid + '/' + sas_formatid + '/'+sas_master + '/' + sas_tmstp + '/' + escape(sas_target) + '?" width=' + sas_w + ' height=' + sas_h + ' marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>');
	    document.write('<scr'+'ipt type="text/javascr'+'ipt">\ndocument.write\(\'<SCR\'+\'IPT SRC="http://www.smartadserver.com/call/pubj/' + sas_pageid + '/' + sas_formatid + '/'+sas_master + '/' + sas_tmstp + '/' + escape(sas_target) + '?"></SCR\'+\'IPT>\'\)\;\n</scr'+'ipt>');
	    document.write('</IFRAME>'); 
    }
    
    
/*Login*/

                 
function login_client_test()
{                         
    login_test('');        
}
function login_test(refresh)                                                                                     
{                                                                             
    var url = 'http://maison.achat-location.com/compte_perso_AT.php';                                                                                                                                                      
    if(refresh == '')                                                   
    {
        login_client = document.getElementById("login_perso").value;
        password = document.getElementById("pass_perso").value;      
        document.getElementById("zone_perso_LOG").innerHTML = '';                                                                                                                                                   
        var myAjax = new Ajax.Updater('zone_perso_LOG', url, {method: 'post',parameters:'tmp='+Math.random()+'&email_client='+login_client+'&password_client='+password+'&verif=1', evalScripts : true });          
    }                                      
   else   
   {                                                                                                          
        document.getElementById("zone_perso_LOG").innerHTML = '';  
        var myAjax = new Ajax.Updater('zone_perso_LOG', url, {method: 'post',parameters:'refresh=1'}); 
   } 
}           

function login(refresh)                                                                                     
{                              
    document.identification.submit();    
    //alert('L');     
   // document.myform.submit();                                          
    //var url = 'http://maison.achat-location.com/compte_perso_AT.php';  
    /*if(refresh == '')                                                   
    {
        login = document.getElementById("login_perso").value;
        password = document.getElementById("pass_perso").value;      
        document.getElementById("zone_perso_LOG").innerHTML = '';                                                                                                                                                   
        var myAjax = new Ajax.Updater('zone_perso_LOG', url, {method: 'post',parameters:'tmp='+Math.random()+'&email_client='+login+'&password_client='+password+'&verif=1', evalScripts : true });
        //setTimeout("refresh_self();",100);  
    }                                      
   else   
   { 
        document.getElementById("zone_perso_LOG").innerHTML = '';  
        var myAjax = new Ajax.Updater('zone_perso_LOG', url, {method: 'post',parameters:'refresh=1', evalScripts : true }); 
   }  */
} 
                   
function deconnexion()
{                                                                                                     
    var url = 'http://maison.achat-location.com/compte_perso_AT.php';  
    var myAjax = new Ajax.Updater('zone_perso_LOG', url, {method: 'post',parameters:'deconnexion=1', evalScripts : true});        
    //window.location.replace("http://"+window.location.hostname+window.location.pathname);           
}
/*Login*/