function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);

var newWin=null;

function popup(loc, name, width, height) {
        var _params = "width="+width+",height="+height+",resizable=no,status=no,scrollbars=no";

        // BROWSERS QUI SUPPORTENT JAVASCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-width) >>1 );
                 _top = ( (screen.height-height) >>1 );
        } else {
                 _left = ( (800-width) >>1 );
                 _top = ( (600-height) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

        newWin = window.open(loc, name, _params);
        if ( newWin!=null && !(IE && bVer<5) )
                newWin.focus(); // MSIE4 PAS DE FOCUS WINDows
				}



function lancerpopup( ) {
  var lalargeur =  774  ; // ici la largeur du popup
  var lahauteur = 580 ;  // ici la hauteur du popup
  var yes = 1;
  var no = 0;
  var menubar = no; //  Fichier, Editiion, Affichage...
  var scrollbars = no; // scrollbarre horizontale & verticale
  var locationbar = no; // Barre d'adresse
  var directories = no; // Barre de liens
  var resizable = no; // Permettre la fenetre d'être redimensionné
  var statusbar = no; // Status bar (with "Document: Done")
  var toolbar = no; // retour, Home, Stop bar d'outil
  var t = (screen.height-lahauteur)/2 ;  // pour centre selon la hauteur de l'écran
  var l = (screen.width-lalargeur)/2 ; // pour centrer selon la largeur de l'écran

  propriete = "width=" + (lalargeur) + ",height=" + (lahauteur) +  ",top=" + t +",left=" + l ;
  propriete += (menubar ? ",menubars" : "") + (scrollbars ? ",scrollbars" : "") + (locationbar ? ",location" : "") + (directories ? ",directories" : "") + (resizable ? ",resizable" : "") + (statusbar ? ",status" : "") + (toolbar ? ",toolbar" : "") ;
   
  popup = window.open('url.html', 'TITRE',propriete) ;
}

//alert((readCookie('peugeot_satisfaction') == 'oui'));
var langue = 'fr';
var txtUrl = document.location.href;
if (txtUrl.indexOf('/fr/') != -1) langue = 'fr';
if (txtUrl.indexOf('/en/') != -1) langue = 'en';

var bool = 0;

window.onunload = function(){ if (bool==1) {
				// on regarde si le cookie est présent
				if (readCookie('peugeot_satisfaction') == 'oui') {
					return;
				}
				else {
					// on crée un cookie ayant une durée de vie de 20 jours (=24*20=480 heures)
					writeCookie('peugeot_satisfaction', 'oui', 480)
					// Window.onunload = function(){ if(self.screenTop>9000)window.open('http://www.yahoo.fr',null, null) }
					MM_openBrWindow('/satisfaction/default.aspx?lng='+langue ,'satisfaction','width=480,height=550')
				}
			}
		}
		
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+'';
win = window.open(mypage,myname,settings);
if(win.window.focus)(win.window.focus());
}

/*************** Fonctions defini dans le fichier data/js/Pav2.js *****************/

/*
function readCookie(name) {
	var cookieValue = "";
	var search = name + "=";
	if(document.cookie.length > 0)   { 
		offset = document.cookie.indexOf(search);
		if (offset != -1)     { 
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
			cookieValue = unescape(document.cookie.substring(offset, end))
		}
	}
	return cookieValue;
}
function writeCookie(name, value, hours) {
	var expire = "";
	var path = ";path=/";
	if(hours != null)   {
		expire = new Date((new Date()).getTime() + hours * 3600000);
		expire = "; expires=" + expire.toGMTString();
	}
	document.cookie = name + "=" + escape(value) + expire + path;
}

function satisfaction(bool) {
	if (bool==1) {
		// on regarde si le cookie est présent
		if (readCookie('peugeot_satisfaction') == 'oui') {
			return;
		}
		else {
			// on crée un cookie ayant une durée de vie de 20 jours (=24*20=480 heures)
			writeCookie('peugeot_satisfaction', 'oui', 480)
			//window.onunload = function(){ if(self.screenTop>9000)window.open('http://www.yahoo.fr',null, null) }
			MM_openBrWindow('/satisfaction/default.aspx?lng='+langue ,'satisfaction','width=450,height=600')
		}
	}
}
*/