var MAC = (navigator.appVersion.indexOf("Mac") != -1);
var OP = window.opera;
var pglng = '';
var corcls = '';

if(location.href.indexOf("en-US")>0)
  pglng = "en";
if(MAC)
	 corcls = 'macbody' + pglng;
else if(OP)
	 corcls = 'opbody' + pglng;

body_class(corcls);

function body_class(c){
	if(document.body==null){
		window.setTimeout("body_class('"+c+"')", 10);
		return;
	}
	if(c=='opbodyen')
	 c = 'opbody';
	keepcls = '';
	if(document.body.className!='')
	 keepcls = document.body.className + ' ';
	document.body.className = keepcls+c;
}

/* Effacement automatique des champs de saisie */
function auto_fill(o, i){
 if(i){
  if(o.refv==null)
   o.refv = o.value;
  if(o.value==o.refv)
   o.value='';
   o.select();
 }
 else{
  if(o.value=='')
   o.value=o.refv;
 }
}

/* RECL - Choix des regions */
function show_region(o){
 switch(o.selectedIndex){
  case 1:
   document.getElementById("regionlbl").className = 'enabled';
   document.getElementById("region").disabled = false;
   break;
  default:
   document.getElementById("regionlbl").className = 'disabled';
   document.getElementById("region").disabled = true;
   break;
 }
}

/* PAYS - Choix des continents */
function show_countries(o, id){
 o.blur();
 if(window.currentcount!=undefined){
  window.currentcount.className = 'off';
  document.getElementById("c"+window.currentcount.cid).style.display = 'none';
 }
 if(window.currentcont==undefined){
	window.currentcont = o;
	window.currentcont.cid = id;
 }
 else{
	window.currentcont.className = 'off';
	document.getElementById("countries"+window.currentcont.cid).style.display = 'none';
 }
 window.currentcont = o;
 window.currentcont.cid = id;
 window.currentcont.className = 'on';
 document.getElementById("countries"+window.currentcont.cid).style.display = 'block';
 document.getElementById("cbase").style.display = 'block';
 return false;
}

/* PAYS - Choix des pays/continents */
function show_country(o, id, p){
 o.blur();
 if(id<0)
  id = 1+Math.floor(3*Math.random());
 if(window.currentcount==undefined){
  window.currentcount = o;
  window.currentcount.cid = id;
 }
 else{
  window.currentcount.className = 'off';
  document.getElementById("c"+window.currentcount.cid).style.display = 'none';
 }
 window.currentcount = o;
 window.currentcount.cid = id;
 window.currentcount.className = 'on';
 document.getElementById("cbase").style.display = 'none';
 document.getElementById("c"+window.currentcount.cid).style.display = 'block';
 if(p==1){
  var _pop = window.open('pop.html', 'rmpop', 'width=797, height=618, top=150, left=150, location=no, menubar=no, resizable=0, scrollbars=yes, status=no, toolbar=no, fullscreen=no');
  _pop.focus();
 }
 return false;
}

var oldprod = null;
var plast = null;

/* HOME - Rollover produits */
function gfocus(){
 window.clearTimeout(plast);
 if(oldprod!=null){
  if(this==oldprod)
   return;
  else
   oldprod.gblur();
 }
 if(this.s)
  this.style.paddingLeft = '20px';
 else
  this.style.paddingRight = '20px';
 this.inf.style.visibility = 'visible';
 //RAJOUT SHT --> rendre INVISIBLE l'image et le descriptif par défaut lors du survol d'un modèle
 document.getElementById("gi").style.visibility = 'hidden';
 //FIN RAJOUT SHT
 oldprod = this;
}

function gblur(){
 if(this.s)
  this.style.paddingLeft = '0px';
 else
  this.style.paddingRight = '0px';
 this.inf.style.visibility = 'hidden';
 //RAJOUT SHT --> rendre VISIBLE l'image et le descriptif par défaut lors du survol d'un modèle
 document.getElementById("gi").style.visibility = 'visible';
 //FIN RAJOUT SHT
 window.clearTimeout(plast);
 oldprod = null;
}

function tm_gblur(){
 plast = window.setTimeout("oldprod.gblur()", 50);
}

function init_gfocus(){
 col = document.getElementById('gamm_list').getElementsByTagName('LI');
 for(i=0;i<col.length;i++){
  if(col[i].className=='')
   col[i].s = 1;
  else
   col[i].s = 0;
  // AJOUT SHT --> les événements onmouseover et onmouseout ne sont pas appliqués aux 'trous' de la gamme...
  if (document.getElementById('gi'+i) != null)	{
  // AJOUT SHT
	col[i].inf = document.getElementById('gi'+i);
	col[i].gfocus = gfocus;
	col[i].gblur = gblur;
	col[i].onmouseover = gfocus;
	col[i].onmouseout = tm_gblur;
// AJOUT SHT
  }
// FIN AJOUT SHT
 }
}

/* HOME texte defilant */
function writemrq(texte){
 speed = 4;
 document.write('<div id="news"><marquee scrollamount="'+speed+'"><span>'+texte+'</span></marquee></div>');
}

var theedge = null;

/* MPBREF rollovers */
function init_mp_frames(){
 if(arguments.length==0){
  window.setTimeout("init_mp_frames(0)", 500);
  return;
 }
 theedge = document.getElementById("edge");
 edgerd = findxy_r(theedge);
 for(i=0;i<8;i++){
 	if(document.getElementById("rollevt"+i)==null)
 	 continue;
  theevt = document.getElementById("rollevt"+i);
  theevt.obj = theobj = document.getElementById("roll"+i);
  theimg = theobj.getElementsByTagName("DIV")[1];
//  theobj.style.width = theevt.offsetWidth + 4 + 'px';
  theevt.dx = -11;
  theevt.dy = -4;

  evtrd = findxy_r(theevt);
  theevt.refx = evtrd.x - edgerd.x;
  theevt.refy = evtrd.y - edgerd.y;
  theobj.style.left = edgerd.x + theevt.refx - theevt.dx + 'px';
  updxy(theevt);
  theevt.onmouseover = theevt.hi_show = hi_show;
	theevt.obj.onmouseover = function(){
	 window.clearTimeout(curroll.tm);
	 curroll.tm = null;
	}
  theevt.obj.onmouseout = theevt.onmouseout = function(e){
   if(document.all){
    if(this.contains(event.toElement))
     return;
   }
   else if(e){
    if(e.relatedTarget!=null){
     oe = e.relatedTarget;
     while(oe = oe.parentNode){
      if(oe==this)
       return;
     }
    }
   }
	 curroll.tm = window.setTimeout("hi_hide()", 200); 
  }
 }
}

/* CATA_PV rollovers */
function init_cata_frames(){
 if(arguments.length==0){
  window.setTimeout("init_cata_frames(0)", 500);
  return;
 }
 theedge = document.getElementById("edge");
 edgerd = findxy_r(theedge);
 for(i=0;i<8;i++){
 	if(document.getElementById("rollevt"+i)==null)
 	 continue;
  theevt = document.getElementById("rollevt"+i);
	theevt.obj = theobj = document.getElementById("roll"+i);
	theimg = theobj.getElementsByTagName("IMG")[0];
	theobj.style.width = theevt.offsetWidth + 4 + 'px';
	theevt.inv = 0;
	theevt.dx = 3;
	theevt.dy = 3;

	if(theobj.className.indexOf("inv")>=0)
	theevt.inv = 1;

	evtrd = findxy_r(theevt);
	theevt.refx = evtrd.x - edgerd.x;
	theevt.refy = evtrd.y - edgerd.y;
	theobj.style.left = edgerd.x + theevt.refx - theevt.dx + 'px';
	updxy(theevt);
	theevt.ind = i;
	theevt.onmouseover = theevt.hi_show = hi_show;
	theevt.obj.onmouseover = function(){
	 window.clearTimeout(curroll.tm);
	 curroll.tm = null;
	}
  theevt.obj.onmouseout = theevt.onmouseout = function(e){
   if(document.all){
    if(this.contains(event.toElement))
     return;
   }
   else if(e){
    if(e.relatedTarget!=null){
     oe = e.relatedTarget;
     while(oe = oe.parentNode){
      if(oe==this)
       return;
     }
    }
   }
	 curroll.tm = window.setTimeout("hi_hide()", 200); 
  }
 }
}

/* HIMP rollovers */
function init_frames(){
 if(arguments.length==0){
  window.setTimeout("init_frames(0)", 500);
  return;
 }
 theedge = document.getElementById("edge");
 edgerd = findxy_r(theedge);
 for(i=0;i<6;i++){
 	if(document.getElementById("rollevt"+i)==null)
 	 continue;
  theevt = document.getElementById("rollevt"+i);
	theevt.obj = theobj = document.getElementById("roll"+i);
//	theevt.frm = theobj.frm = theobj.getElementsByTagName("DIV").item(0);
//	theevt.frm.rectg = {l:0, r:0, t:0, b:0};
	theimg = theobj.getElementsByTagName("IMG")[0];
	theobj.style.width = parseInt(theevt.offsetWidth) + 4 + 'px';
	theevt.inv = 0;
	theevt.dx = 3;
	theevt.dy = 3;

	if(theobj.className.indexOf("inv")>=0)
	theevt.inv = 1;

	evtrd = findxy_r(theevt);
	theevt.refx = evtrd.x - edgerd.x;
	theevt.refy = evtrd.y - edgerd.y;
	if(SAF)
	 edgerd.x = 0;
	theobj.style.left = edgerd.x + theevt.refx - theevt.dx + 'px';
	updxy(theevt);
	theevt.ind = i;
	theevt.onmouseover = theevt.hi_show = hi_show;
	theevt.obj.onmouseover = function(){
	 window.clearTimeout(curroll.tm);
	 curroll.tm = null;
	}
  theevt.obj.onmouseout = theevt.onmouseout = function(e){
	 if(document.all){
	  if(this.contains(event.toElement))
	   return;
	 }
	 else if(e){
	  if(e.relatedTarget!=null){
	   oe = e.relatedTarget;
	   while(oe = oe.parentNode){
	    if(oe==this)
	     return;
	   }
	  }
	 }
	 curroll.tm = window.setTimeout("hi_hide()", 200); 
	}
 }
}

function findxy(o) {
 var rd = {x:0, y:0};
 tmp = o;
 rd.x += o.offsetLeft;
 rd.y += o.offsetTop;
 while ((o = o.offsetParent)&&(o.id!="main")){
  rd.x += o.offsetLeft;
  rd.y += o.offsetTop;
 }
 return rd;
}

function findxy_r(o) {
 var rd = {x:0, y:0};
 tmp = o;
 rd.x += o.offsetLeft;
 rd.y += o.offsetTop;
 return rd;
}

var curroll = null;

function updxy(o){
 edgerd = findxy_r(theedge);
 if(o.inv)
  o.dy = o.obj.offsetHeight - o.offsetHeight - 3;
 o.obj.style.top = edgerd.y + o.refy - o.dy + 'px';
}

/*function updxy_mp(o){
 tmpc = findxy_r(o);
 o.obj.style.top = tmpc.y - o.dy + 'px';
}*/

function hi_show(){
 if(curroll!=null){
  window.clearTimeout(curroll.tm);
  curroll.tm = null;
  if(curroll==this)
   return;
  else
   hi_hide();
 }
 updxy(this);
 this.obj.style.visibility = "visible";
 curroll = this;
}

/*function hi_show_mp(){
 if(curroll!=null){
  if(curroll==this)
   return;
  else
   hi_hide();
 }
 updxy_mp(this);
// this.frm.style.height = this.obj.offsetHeight - 2 +'px';
// this.frm.style.width = this.obj.offsetWidth - 2 +'px';
 this.obj.style.visibility = "visible";
 tmpc = findxy_r(this);
// this.rectg.l = parseInt(tmpc.x);
// this.rectg.r = parseInt(this.rectg.l + this.offsetWidth);
// this.rectg.t = parseInt(tmpc.y);
// this.rectg.b = parseInt(this.rectg.t + this.offsetHeight);
 curroll = this;
}*/

function hi_hide(){
 curroll.obj.style.visibility = "hidden";
 curroll = null;
}

/* SOND ouverture popup */
function popen(u, w, h, l, t){
 var _popsond = window.open(u, 'popsond', 'width='+w+', height='+h+', top='+t+', left='+l+', location=no, menubar=no, resizable=0, scrollbars=no, status=no, toolbar=no, fullscreen=no');
 _popsond.focus();
 return false;
}

var _popcard = null;

/* SOND ouverture popup */
function popencard(u, w, h, l, t){
 if(_popcard!=null)
  _popcard.close();
 _popcard = window.open(u, 'popcard', 'width='+w+', height='+h+', top='+t+', left='+l+', location=no, menubar=no, resizable=0, scrollbars=1, status=no, toolbar=no, fullscreen=no');
 _popcard.focus();
 return false;
}

/* SOND fermeture popup */
function pclose(){
 self.close();
 return false;
}

/* SOND - CARD resize hauteur popup */
function match_height(){
 h = (document.all)?document.body.clientHeight:window.innerHeight;
 while(document.getElementById("popmain").offsetHeight!=h){
  h = (document.all)?document.body.clientHeight:window.innerHeight;
  window.resizeBy(0, document.getElementById("popmain").offsetHeight-h);
 }
}

/* SOND - CARD resize hauteur popup */
function match_card(){
 if(arguments.length==0)
  window.setTimeout("match_card(0)", 100);
 else{
  h = (document.all)?document.body.clientHeight:window.innerHeight;
  if(document.getElementById("popmain").offsetHeight<h)
   window.resizeBy(0, document.getElementById("popmain").offsetHeight-h);
 }
}

//MAJ zopen, match_size, tm_resize, tm_resize_inv en fonction de la maquette 1.1
var _popzoom = null;
var POPim = null;
var SAF = (navigator.userAgent.toLowerCase().indexOf('safari')>=0);

/* Zoom ouverture popup */
function zopen(u, l, t){
 dv = document.createElement("SPAN");
 dv.className = 'popdv';
 POPim = document.createElement("IMG");
 dv.appendChild(POPim);
 document.body.appendChild(dv);
 POPim.src = u;
 window.setTimeout("POPim_load('"+u+"',"+t+","+l+")", 100);
 return false;
}

/* Zoom launch popup safari */
function POPim_load(u, t, l){
 w = parseInt(POPim.offsetWidth);
 h = parseInt(POPim.offsetHeight) + 1;
 if((w==0)||(!SAF&&!(POPim.complete))){
  window.setTimeout("POPim_load('"+u+"',"+t+","+l+")", 100);
 }
 else{
  _popzoom = window.open(u, 'popzoom', 'width='+w+', height='+(h+SAF)+', top='+t+', left='+l+', location=no, menubar=no, resizable=0, scrollbars=auto, status=no, toolbar=no, fullscreen=no');
  _popzoom.document.open();
  _popzoom.document.write('<html><head><title>CITROËN</title></head><body style="margin:0;"><img src="'+u+'" width="'+w+'" height="'+h+'" style="display:block;cursor:pointer;cursor:hand;" onclick="self.close();if(opener){ opener.focus();}" alt="" title="Fermer la fenêtre"/></body></html>');
  _popzoom.document.close();
  _popzoom.focus();
 }
 return false;
}

/* Fonction d'impression */
function _print(){
 if(window.print)
  window.print();
 return false;
}

/*
function addBookmark(title,url) {
if (window.sidebar) 
{window.sidebar.addPanel(title, url,"");} 
else 
if( document.all ) 
{window.external.AddFavorite( url, title);} 
else 
if (window.opera && window.print ){ 
return true;} 
}*/

/* SOND ouverture popup */
function popen(u, w, h, l, t){
 var _popsond = window.open(u, 'popsond', 'width='+w+', height='+h+', top='+t+', left='+l+', location=no, menubar=no, resizable=0, scrollbars=no, status=no, toolbar=no, fullscreen=no');
 _popsond.focus();
 return false;
}

/*
function fill_vid(u, type, thumb, altimg){
 var HTMLvid = '';
 switch(type){
  case "w":
    HTMLvid += '<object id="videowindow" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject">'
  + '<param name="autostart" value="true">'
  + '<param name="filename" value="'+u+'">'
  + '<param name="showcontrols" value="true">'
  + '<param name="showstatusbar" value="false">'
  + '<param name="autosize" value="false">'
  + '<param name="sendplaystatechangeevents" value="true">'
  + '<embed id="videowindow" type="application/x-mplayer2" src="'+u+'" name="videowindow" showcontrols=1></embed>'
    + '</object> ';
  break;
  case "r":
  if(detectReal()==false){
   HTMLvid += '<p class="center">Pour voir cette vidéo, vous devez<br /><a href="http://www.real.com/freeplayer/?rppr=rnwk" target="_new">télécharger le plugin Real Player</a>.</p><img width="320" height="240" src="img/video_pict.gif" alt="Fenêtre Vidéo"/>';
   break;
  }
  HTMLvid += '<object id="videowindow" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">'
  + '<param name="src" value="'+u+'">'
  + '<param name="controls" value="ImageWindow">'
  + '<param name="console" value="one">'
  + '<param name="autostart" value="true">'
  + '<embed src="'+u+'" nojava=true controls=ImageWindow console=one autostart=false>'
  + '<noembed><p class="center">Pour voir cette vidéo, vous devez<br /><a href="http://www.real.com/freeplayer/?rppr=rnwk" target="_new">télécharger le plugin Real Player</a>.</p><img width="320" height="240" src="img/video_pict.gif" alt="Fenêtre Vidéo"/></noembed>'
  + '</object>';
  HTMLvid += '<br/><object id="videowindow" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">'
  + '<param name="controls" value="ControlPanel">'
  + '<param name="console" value="one">'
  + '<param name="autostart" value="true">'
  + '<embed src="'+u+'" nojava=true controls=ControlPanel console=one>'
  + '<noembed><p class="center">Pour voir cette vidéo, vous devez<br /><a href="http://www.real.com/freeplayer/?rppr=rnwk" target="_new">télécharger le plugin Real Player</a>.</p><img width="320" height="240" src="img/video_pict.gif" alt="Fenêtre Vidéo"/></noembed>'
  + '</object>';
  break;
 }
 document.getElementById("videobox").innerHTML = HTMLvid;
 if(thumb!='')
  document.getElementById(thumb).innerHTML = '<img src="'+altimg+'" alt="" />';
 return false;
}
*/

function fill_vid(u, type, thumb, altimg){
 var HTMLvid = '';
 switch(type){
  case "w":
  //HTMLvid += '<object id="videowindow" width="320" height="285" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject">'
  /* Modif ACS ANO 441 */
  //HTMLvid += '<object id="videowindow" width="100%" height="100%" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject">'
  HTMLvid += '<object id="videowindow" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject">'
  /* Fin Modif ACS ANO 441 */
  + '<param name="autostart" value="true">'
  + '<param name="filename" value="'+u+'">'
  + '<param name="showcontrols" value="true">'
  + '<param name="showstatusbar" value="false">'
  //
  //+ '<param name="TransparentAtStart" VALUE="true">'
  //
  + '<param name="autosize" value="false">'
  + '<param name="sendplaystatechangeevents" value="true">'
  /* Modif ACS ANO 441 */
  + '<embed id="videowindow" type="application/x-mplayer2" src="'+u+'" name="videowindow" showcontrols=1></embed>'
  //+ '<embed id="videowindow" type="application/x-mplayer2" src="'+u+'" name="videowindow" width="100%" height="100%" showcontrols=1></embed>'
  /* Fin Modif ACS ANO 441 */
  //+ '<embed id="videowindow" type="application/x-mplayer2" src="'+u+'" name="videowindow" width="320" height="285" showcontrols=1></embed>'
  + '</object> ';
  break;
  case "r":
  if(detectReal()==false){
   HTMLvid += '<p class="center">Pour voir cette vidéo, vous devez<br /><a href="http://www.real.com/freeplayer/?rppr=rnwk" target="_new">télécharger le plugin Real Player</a>.</p><img width="320" height="240" src="img/video_pict.gif" alt="Fenêtre Vidéo"/>';
   break;
  }
  //HTMLvid += '<object id="videowindow" width="320" height="240" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">'
  HTMLvid += '<object id="videowindow" width="100%" height="85%" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">'
  + '<param name="src" value="'+u+'">'
  + '<param name="controls" value="ImageWindow">'
  + '<param name="console" value="one">'
  + '<param name="autostart" value="true">'
  //+ '<embed src="'+u+'" width=320 height=240 nojava=true controls=ImageWindow console=one autostart=false>'
  //+ '<embed src="'+u+'" nojava=true controls=ImageWindow console=one autostart=false>'
  + '<embed src="'+u+'" nojava=true controls=ImageWindow console=one autostart=false>'
  //+ '<noembed><p class="center">Pour voir cette vidéo, vous devez<br /><a href="http://www.real.com/freeplayer/?rppr=rnwk" target="_new">télécharger le plugin Real Player</a>.</p><img width="320" height="240" src="img/video_pict.gif" alt="Fenêtre Vidéo"/></noembed>'
  + '</object>';
  //HTMLvid += '<object id="videowindow" width="320" height="45" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">'
  //HTMLvid += '<br/><object id="videowindow" width="100%" height="100%" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">'
  HTMLvid += '<br/><object id="videowindow" width="100%" height="45" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">'
  + '<param name="controls" value="ControlPanel">'
  + '<param name="console" value="one">'
  + '<param name="autostart" value="true">'
  + '<embed src="'+u+'" width="100%" height="45" nojava=true controls=ControlPanel console=one>'
  + '<embed src="'+u+'" nojava=true controls=ControlPanel console=one>'
  //+ '<noembed><p class="center">Pour voir cette vidéo, vous devez<br /><a href="http://www.real.com/freeplayer/?rppr=rnwk" target="_new">télécharger le plugin Real Player</a>.</p><img width="320" height="240" src="img/video_pict.gif" alt="Fenêtre Vidéo"/></noembed>'
  + '</object>';
  break;
 }
 document.getElementById("videobox").innerHTML = HTMLvid;
 if(thumb!='')
 /* Ajout ACS Ano 432 */
 {
	var thumbList = thumb.split(',');
	var altimgList = altimg.split(',');
	for (i=0;i<thumbList.length;i++) {
		var curThumb = thumbList[i]
		var curAltImg = altimgList[i]
		if (document.getElementById(curThumb) && (curAltImg) && (curAltImg != ""))
			document.getElementById(curThumb).innerHTML = '<img src="'+curAltImg+'" alt="" />';
	}
 }
 /* Fin Ajout ACS */
 //document.getElementById(thumb).innerHTML = '<img src="'+altimg+'" alt="" />';
 return false;
}

/* Centrage cadre en hauteur */
function win_height(){
 if(document.all)
  wh = document.body.clientHeight;
 else
  wh = window.innerHeight;	
 nh = (wh-document.getElementById("popmain").offsetHeight)/2;
 if(nh<0)
  nh = 0;
 document.getElementById("popmain").style.marginTop = parseInt(nh) + 'px';
 onresize = win_height;
}

function detectReal(){
 var pluginFound = false;
 var activeXFound = false;

 // If this Microsoft Internet Explorer 4.5 for Macintosh, plugins detection is impossible
 if (navigator.appVersion.indexOf("PPC")!=-1 && navigator.userAgent.indexOf("MSIE 4")!=-1)
  return false;

 // Check for Plug-in presence
 plugInFound = getPlugIn("RealPlayer","G2","Plug-In");

 // Check for RealPlayer ActiveX
 try {
  testObject = new ActiveXObject("rmocx.RealPlayer G2 Control.1");

  // Since G2 (Real 6), all Real player version numbers begin by 6
  embedVersion = testObject.GetVersionInfo();
		
  // First version supported : 6.0.6.131 = G2 Gold
  versionArray = embedVersion.split(".");
  conditionA = versionArray[0]>=6;
  conditionB = versionArray[1]>=0;
  conditionC = versionArray[2]>=6;
  conditionD = versionArray[3]>=131;
		
  if (conditionA && conditionB && conditionC && conditionD)
   activeXFound = true;
  else 
   activeXFound = false;
 } catch(e){
  activeXFound = false;
 }
 
 if (plugInFound || activeXFound)
  return true;
 else
  return false;
}

// Parse plugins collection with strings to find
// User has to pass strings to be found in plugin name and description
// Ex. "Shockwave","Flash","5"
function getPlugIn() {
 var allFound = false;
 var plugInsCollection = navigator.plugins;
 for (i=0;i<plugInsCollection.length;i++) {
  // Get plugin description
  plugInDescription = " " + plugInsCollection[i].description;
  plugInName = " " + plugInsCollection[i].name;
  for (j=0;j<arguments.length;j++) {
   if (plugInDescription.indexOf(" " + arguments[j])!=-1 || plugInName.indexOf(" " + arguments[j])!=-1)
    allFound = true;
   else{
    allFound = false;
    break;
   }
  }

  // Send back the search result
  if (allFound){
   return true;
  }
 }
 return false;
}

function popup(url, titre, width, height, loc, menu, resize, scroll,
status, tool){
 var left = (screen.width - width) / 2;
 var top = (screen.height - height) / 2 - 20;
 if(left < 0) left = 0;
 if(top < 0) top = 0;
 var _popup = window.open(url, ''+titre+'', 'width='+width+',height='+height+', top='+top+', left='+left+', location='+loc+',menubar='+menu+', resizable='+resize+', scrollbars='+scroll+',status='+status+', toolbar='+tool+'');
 _popup.focus();
}

/* Ajouter aux favoris */
function addFav() {
title = document.title;
url = location.href;
if (window.sidebar) {
// Mozilla Firefox Bookmark
window.sidebar.addPanel(title, url,"");
} else if( window.external ) {
// IE Favorite
window.external.AddFavorite( url, title);
}
else if(window.opera && window.print) {
// Opera Hotlist
return true; }
}