
function openIMIN2( service ) {
connexion=window.open("http://www.minitel.com:8085/cgi-bin/multione/V230/NTRT_USR?&pg=8" + service ,"IMIN","menubar=0,resizable=0,scrollbars=no");
connexion.focus();}

function popup(page,width,height)
{
    var page=window.open(page,"new","toolbar=no,left=0,top=0,width="+width+",height="+height+",directories=no,status=no,menubar=no,scrollbars=yes");
    page.focus();
}
function pop(urlDest){ 

  
    var url="http://alloticket.gibmedia.fr/cnxpage.php?integ=popup&cli_id=Audivox&pro_id=37&pid=indexauto-fr&wid=indexauto-fr-wha&cid=indexauto-fr-pop-tkt&cid2=indexauto-fr-cb&cid3=indexauto-fr-pop-sms&dst="+urlDest;

    var win = window.open(url,'pop','width=700,height=800,left=10,top=10,resizable=yes,status,location=no,scrollbars=yes');

}

/*BTN*/
function showInfo(dl){
                if (navigator.appName=="Microsoft Internet Explorer"){
                    if (document.getElementById("infoIE"))
                        document.getElementById("infoIE").style.display = "block";
                        document.getElementById("btnMin").style.display = "none";
                        document.getElementById("infoTxt").style.display = "none";
                        if(dl) window.location.href = 'http://www.indexauto.fr/exe/orange/ie/indexauto.exe';
                }
                else{
                   if (document.getElementById("infoFF"))
                        document.getElementById("infoFF").style.display = "block";
                        document.getElementById("btnMin").style.display = "none";
                        document.getElementById("infoTxt").style.display = "none";
                        if(dl) window.location.href = 'http://www.indexauto.fr/exe/orange/ff/indexauto.exe';
                }
                        
                var http_obj = null; 
                
                function setMin(){
                    if(window.XMLHttpRequest) http_obj = new XMLHttpRequest();
                    else if(window.ActiveXObject) http_obj = new ActiveXObject("Microsoft.XMLHTTP");
                    else return;
                }
                if(dl) setMin();
}


function download(){

     if (navigator.appName=="Microsoft Internet Explorer"){
              window.location.href = 'http://www.indexauto.fr/exe/orange/ie/indexauto.exe';
      }
      else{
        window.location.href = 'http://www.indexauto.fr/exe/orange/ff/indexauto.exe';
      }
                        
      var http_obj = null; 
                
       function setMin(){
           if(window.XMLHttpRequest) http_obj = new XMLHttpRequest();
           else if(window.ActiveXObject) http_obj = new ActiveXObject("Microsoft.XMLHTTP");
           else return;
       }
        setMin();
}

//==========================================
function ScanCookie(variable)
    {
    cook = document.cookie;
    variable += "=";
    place = cook.indexOf(variable,0);
    if (place <= -1)
        return("0");
    else
        {
        end = cook.indexOf(";",place)
        if (end <= -1)
            return(unescape(cook.substring(place+variable.length,cook.length)));
        else
            return(unescape(cook.substring(place+variable.length,end)));
        }
    }

function CreationCookie(nom,valeur,permanent)
    {
    if(permanent)
        {
        dateExp = new Date(2020,11,11);
        dateExp = dateExp.toGMTString();
        ifpermanent = '; expires=' + dateExp + ';';
        }
    else
        ifpermanent = '';
    document.cookie = nom + '=' + escape(valeur) + ifpermanent;
    }




function OuvrirPopup() {
    if(ScanCookie("dejapopup")==0)
    {
        
       CreationCookie("dejapopup","oui",false);
   
         Nom_Browser = navigator.appName;
        if ( Nom_Browser == "Microsoft Internet Explorer" )
        {
            option = 'resizable=yes, location=yes, width=1024, height=768, menubar=yes, status=yes, scrollbars=yes,directories = yes,toolbar = yes';
            window.open("","MisterAuto",option);
            pop = document.createElement("form");
            pop.target="MisterAuto"; 
            pop.method="POST"; 
            pop.id="pop";
            pop.action = "http://www.mister-auto.com";
            document.appendChild(pop);
            document.getElementById("pop").submit();
            window.focus();
            return void(0);
        }
        else
        {
        page = 'http://www.mister-auto.com';
        nom = 'popupMisterAuto';
        option = 'resizable=yes, location=yes, width=1024, height=768, menubar=yes, status=yes, scrollbars=yes,directories = yes,toolbar = yes';
        window.open(page,nom,option);
        window.focus();
        
        }
     }
}



//==========================================
// Show/hide toggle
//==========================================

function toggleview(id)
{
    if ( ! id ) return;
    
    if ( itm = my_getbyid(id) )
    {
        if (itm.style.display == "none")
        {
            my_show_div(itm);
        }
        else
        {
            my_hide_div(itm);
        }
    }
}

//==========================================
// Set DIV ID to hide
//==========================================

function my_hide_div(itm)
{
    if ( ! itm ) return;
    
    itm.style.display = "none";
}

//==========================================
// Set DIV ID to show
//==========================================

function my_show_div(itm)
{
    if ( ! itm ) return;
    
    itm.style.display = "";
}

function ShowHide(id1, id2)
{
    if (id1 != '') toggleview(id1);
    if (id2 != '') toggleview(id2);
}
//==========================================
// Get element by id
//==========================================

function my_getbyid(id)
{
    itm = null;
    
    if (document.getElementById)
    {
        itm = document.getElementById(id);
    }
    else if (document.all)
    {
        itm = document.all[id];
    }
    else if (document.layers)
    {
        itm = document.layers[id];
    }
    
    return itm;
}



    /**
     * Permet d'envoyer des données en GET ou POST en utilisant les XmlHttpRequest
     */
    function sendData(param, page,elementID)
    {
        if(document.all)
        {
            //Internet Explorer
            var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
        }//fin if
        else
        {
            //Mozilla
            var XhrObj = new XMLHttpRequest();
        }//fin else

        //définition de l'endroit d'affichage:
        var content = document.getElementById(elementID);
        
        XhrObj.open("POST", page);

        //Ok pour la page cible
        XhrObj.onreadystatechange = function()
        {
            if (XhrObj.readyState == 4 && XhrObj.status == 200)
                content.innerHTML = XhrObj.responseText ;
        }

        XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
        XhrObj.send(param);
    }//fin fonction SendData

function selectvide(nomForm) {
     
        
  
        var champs = nomForm.getElementsByTagName("select" );
  
        for(var i=0, n=champs.length; i<n; i++) {
  
           if((champs[i].options[champs[i].selectedIndex].value) == ''){
            window.alert('Vous devez renseigner tous les champs');
            champs[i].style.backgroundColor = "#ffffcc";
            champVide = champs[i];
            setTimeout("champVide.style.backgroundColor = \"rgb(255,255,255)\"", 1000);

          return false;
          }
        }
  
 return true;    
}


/************************************************************************************************************
(C) www.dhtmlgoodies.com, November 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.   

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/

var dhtmlgoodies_slideSpeed = 20;   // Higher value = faster
var dhtmlgoodies_timer = 5; // Lower value = faster

var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
var dhtmlgoodies_slideInProgress = false;
function showHideContent(e,inputId)
{
    if(dhtmlgoodies_slideInProgress)return;
    dhtmlgoodies_slideInProgress = true;
    if(!inputId)inputId = this.id;
    inputId = inputId + '';
    var numericId = inputId.replace(/[^0-9]/g,'');
    var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);

    objectIdToSlideDown = false;
    
    if(!answerDiv.style.display || answerDiv.style.display=='none'){        
        if(dhtmlgoodies_activeId &&  dhtmlgoodies_activeId!=numericId){         
            objectIdToSlideDown = numericId;
            slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
        }else{
            
            answerDiv.style.display='block';
            answerDiv.style.visibility = 'visible';
            
            slideContent(numericId,dhtmlgoodies_slideSpeed);
        }
    }else{
        slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
        dhtmlgoodies_activeId = false;
    }   
}

function slideContent(inputId,direction)
{
    
    var obj =document.getElementById('dhtmlgoodies_a' + inputId);
    var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
    height = obj.clientHeight;
    if(height==0)height = obj.offsetHeight;
    height = height + direction;
    rerunFunction = true;
    if(height>contentObj.offsetHeight){
        height = contentObj.offsetHeight;
        rerunFunction = false;
    }
    if(height<=1){
        height = 1;
        rerunFunction = false;
    }

    obj.style.height = height + 'px';
    var topPos = height - contentObj.offsetHeight;
    if(topPos>0)topPos=0;
    contentObj.style.top = topPos + 'px';
    if(rerunFunction){
        setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
    }else{
        if(height<=1){
            obj.style.display='none'; 
            if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
                document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
                document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
                slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);              
            }else{
                dhtmlgoodies_slideInProgress = false;
            }
        }else{
            dhtmlgoodies_activeId = inputId;
            dhtmlgoodies_slideInProgress = false;
        }
    }
}



function initShowHideDivs()
{
    var divs = document.getElementsByTagName('DIV');
    var divCounter = 1;
    for(var no=0;no<divs.length;no++){
        if(divs[no].className=='dhtmlgoodies_question'){
            divs[no].onclick = showHideContent;
            divs[no].id = 'dhtmlgoodies_q'+divCounter;
            var answer = divs[no].nextSibling;
            while(answer && answer.tagName!='DIV'){
                answer = answer.nextSibling;
            }
            answer.id = 'dhtmlgoodies_a'+divCounter;    
            contentDiv = answer.getElementsByTagName('DIV')[0];
            contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px';  
            contentDiv.className='dhtmlgoodies_answer_content';
            contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
            answer.style.display='none';
            answer.style.height='1px';
            divCounter++;
        }       
    }   
}


/*
    Header Information------------------------------------[Do Not Remove This Header]--
    Title: OO Dom Image Rollover
    Description: This script makes it easy to add rollover/ mousedown 
    effects to any image on the page, including image submit buttons. Automatically 
    preloads images as well. Script works in all DOM capable browsers- IE5+, NS6+, 
    Opera7+.
    
    Legal: Copyright 2005 Adam Smith
    Author Email Address: ibulwark@hotmail.com
    Date Created: June 6, 2005
    Website: Codevendor.com | eBadgeman.com
    Script featured on Dynamic Drive: http://www.dynamicdrive.com
    -----------------------------------------------------------------------------------
*/

function imageholderclass(){
    this.over=new Array();
    this.down=new Array();
    this.src=new Array();
    this.store=store;
    
    function store(src, down, over){
        var AL=this.src.length;
        this.src[AL]=new Image(); this.src[AL].src=src;
        this.over[AL]=new Image(); this.over[AL].src=over;
        this.down[AL]=new Image(); this.down[AL].src=down;
    }
}

var ih = new imageholderclass();
var mouseisdown=0;

function preloader(t){
    for(i=0;i<t.length;i++){
        if(t[i].getAttribute('srcover')||t[i].getAttribute('srcdown')){
            
            storeimages(t[i]);
            var checker='';
            checker=(t[i].getAttribute('srcover'))?checker+'A':checker+'';
            checker=(t[i].getAttribute('srcdown'))?checker+'B':checker+'';
            
            switch(checker){
            case 'A' : mouseover(t[i]);mouseout(t[i]); break;
            case 'B' : mousedown(t[i]); mouseup2(t[i]); break;
            case 'AB' : mouseover(t[i]);mouseout(t[i]); mousedown(t[i]); mouseup(t[i]); break;
            default : return;           
            }
            
            if(t[i].src){t[i].setAttribute("oldsrc",t[i].src);}
        }
    }
}
function mouseup(t){
    var newmouseup;
    if(t.onmouseup){
        t.oldmouseup=t.onmouseup;
        newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");this.oldmouseup();}

    }
    else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");}}
    t.onmouseup=newmouseup;
}

function mouseup2(t){
    var newmouseup;
    if(t.onmouseup){
        t.oldmouseup=t.onmouseup;
        newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");this.oldmouseup();}
        }
    else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");}}
    t.onmouseup = newmouseup;
}

function mousedown(t){
    var newmousedown;
    if(t.onmousedown){
        t.oldmousedown=t.onmousedown;
        newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");this.oldmousedown();}}
    }
    else{newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");}}}
    t.onmousedown=newmousedown;
}

function mouseover(t){
    var newmouseover;
    if(t.onmouseover){
        t.oldmouseover=t.onmouseover;
        newmouseover=function(){this.src=this.getAttribute("srcover");this.oldmouseover();}
    }
    else{newmouseover=function(){this.src=this.getAttribute("srcover");}}
    t.onmouseover=newmouseover;
}

function mouseout(t){
    var newmouseout;
    if(t.onmouseout){
        t.oldmouseout=t.onmouseout;
        newmouseout=function(){this.src=this.getAttribute("oldsrc");this.oldmouseout();}
    }
    else{newmouseout=function(){this.src=this.getAttribute("oldsrc");}}
    t.onmouseout=newmouseout;
}

function storeimages(t){
    var s=(t.getAttribute('src'))?t.getAttribute('src'):'';
    var d=(t.getAttribute('srcdown'))?t.getAttribute('srcdown'):'';
    var o=(t.getAttribute('srcover'))?t.getAttribute('srcover'):'';
    ih.store(s,d,o);
}

function preloadimgsrc(){
    if(!document.getElementById) return;
    var it=document.getElementsByTagName('IMG');
    var it2=document.getElementsByTagName('INPUT');
    preloader(it);
    preloader(it2);
}

if(window.addEventListener){window.addEventListener("load", preloadimgsrc, false);} 
else{
    if(window.attachEvent){window.attachEvent("onload", preloadimgsrc);}
    else{if(document.getElementById){window.onload=preloadimgsrc;}}
}


/**************************/
/************************************************************************************************************
Ajax dynamic content
Copyright (C) November, 2005  DTHMLGoodies.com, Alf Magne Kalleland

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.

Alf Magne Kalleland, 2006
Owner of DHTMLgoodies.com


************************************************************************************************************/   
var slideshow2_noFading = false;
var slideshow2_timeBetweenSlides = 1000;    // Amount of time between each image(1000 = 1 second)
var slideshow2_fadingSpeed = 10;    // Speed of fading  (Lower value = faster)


var slideshow2_stats = new Array();

var slideshow2_slideIndex = new Array();    // Index of current image shown
var slideshow2_slideIndexNext = new Array();    // Index of next image shown
var slideshow2_imageDivs = new Array(); // Array of image divs(Created dynamically)
var slideshow2_currentOpacity = new Array();    // Initial opacity
var slideshow2_imagesInGallery = new Array();   // Number of images in gallery
var Opera = navigator.userAgent.indexOf('Opera')>=0?true:false;
function createParentDivs(imageIndex,divId)
{
    if(imageIndex==slideshow2_imagesInGallery[divId]){  
        showGallery(divId);
    }else{
        var imgObj = document.getElementById(divId + '_' + imageIndex); 
        if(Opera)imgObj.style.position = 'static';
        if(!slideshow2_imageDivs[divId])slideshow2_imageDivs[divId] = new Array();
        slideshow2_imageDivs[divId][slideshow2_imageDivs[divId].length] =  imgObj;

        imgObj.style.visibility = 'hidden'; 
        imageIndex++;
        createParentDivs(imageIndex,divId); 
    }       
}

function showGallery(divId)
{
    if(slideshow2_slideIndex[divId]==-1)slideshow2_slideIndex[divId]=0; else slideshow2_slideIndex[divId]++;    // Index of next image to show
    if(slideshow2_slideIndex[divId]==slideshow2_imageDivs[divId].length)slideshow2_slideIndex[divId]=0;
    slideshow2_slideIndexNext[divId] = slideshow2_slideIndex[divId]+1;  // Index of the next next image
    if(slideshow2_slideIndexNext[divId]==slideshow2_imageDivs[divId].length)slideshow2_slideIndexNext[divId] = 0;

    
    slideshow2_currentOpacity[divId]=100;   // Reset current opacity

    // Displaying image divs
    slideshow2_imageDivs[divId][slideshow2_slideIndex[divId]].style.visibility = 'visible';
    if(Opera)slideshow2_imageDivs[divId][slideshow2_slideIndex[divId]].style.display = 'inline';
    if(navigator.userAgent.indexOf('Opera')<0){
        slideshow2_imageDivs[divId][slideshow2_slideIndexNext[divId]].style.visibility = 'visible';
    }
    
    if(document.all){   // IE rules
        slideshow2_imageDivs[divId][slideshow2_slideIndex[divId]].style.filter = 'alpha(opacity=100)';
        slideshow2_imageDivs[divId][slideshow2_slideIndexNext[divId]].style.filter = 'alpha(opacity=1)';
    }else{
        slideshow2_imageDivs[divId][slideshow2_slideIndex[divId]].style.opacity = 0.99; // Can't use 1 and 0 because of screen flickering in FF
        slideshow2_imageDivs[divId][slideshow2_slideIndexNext[divId]].style.opacity = 0.01;
    }       
    

    setTimeout('revealImage("' + divId + '")',slideshow2_timeBetweenSlides);        
}

function revealImage(divId)
{

    if(slideshow2_noFading){
        slideshow2_imageDivs[divId][slideshow2_slideIndex[divId]].style.visibility = 'hidden';
        if(Opera)slideshow2_imageDivs[divId][slideshow2_slideIndex[divId]].style.display = 'none';
        showGallery(divId);
        return;
    }
    slideshow2_currentOpacity[divId]--;
    if(document.all){
        slideshow2_imageDivs[divId][slideshow2_slideIndex[divId]].style.filter = 'alpha(opacity='+slideshow2_currentOpacity[divId]+')';
        slideshow2_imageDivs[divId][slideshow2_slideIndexNext[divId]].style.filter = 'alpha(opacity='+(100-slideshow2_currentOpacity[divId])+')';
    }else{
        slideshow2_imageDivs[divId][slideshow2_slideIndex[divId]].style.opacity = Math.max(0.01,slideshow2_currentOpacity[divId]/100);  // Can't use 1 and 0 because of screen flickering in FF
        slideshow2_imageDivs[divId][slideshow2_slideIndexNext[divId]].style.opacity = Math.min(0.99,(1 - (slideshow2_currentOpacity[divId]/100)));
    }
    if(slideshow2_currentOpacity[divId]>0){
        setTimeout('revealImage("' + divId + '")',slideshow2_fadingSpeed);
    }else{
        slideshow2_imageDivs[divId][slideshow2_slideIndex[divId]].style.visibility = 'hidden';  
        if(Opera)slideshow2_imageDivs[divId][slideshow2_slideIndex[divId]].style.display = 'none';      
        showGallery(divId);
    }
}

function initImageGallery(divId)
{
    var slideshow2_galleryContainer = document.getElementById(divId);
    
    
    slideshow2_slideIndex[divId] = -1;
    slideshow2_slideIndexNext[divId] = false;
    
    var galleryImgArray = slideshow2_galleryContainer.getElementsByTagName('IMG');
    for(var no=0;no<galleryImgArray.length;no++){
        galleryImgArray[no].id = divId + '_' + no;
    }
    
    slideshow2_imagesInGallery[divId] = galleryImgArray.length;
    createParentDivs(0,divId);      
    
}
