var arVersion = navigator.appVersion.split("MSIE");
var version = parseFloat(arVersion[1]);

function fixPNG(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}

// --

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_showHideLayers() { //v3.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; }
}


// -- Taille écran --------------------------------------------------------------------
var PETIT_ECRAN = true;

function calculerTailleEcran()
{

var frameWidth = 0;
var frameHeight = 0;

if (self.innerWidth)
{
	frameWidth = self.innerWidth;
	frameHeight = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientWidth)
{
	frameWidth = document.documentElement.clientWidth;
	frameHeight = document.documentElement.clientHeight;
}
else if (document.body)
{
	frameWidth = document.body.clientWidth;
	frameHeight = document.body.clientHeight;
}

if (frameHeight > 718){ PETIT_ECRAN = false; }

}


// --------------------------------------------------------------------------------------

function afficherMasquerCalque(idHidden, idVisible)
{
	if(idHidden != ''){document.getElementById(idHidden).style.visibility='hidden'; document.getElementById(idHidden).style.display='none';}
	if(idVisible != ''){document.getElementById(idVisible).style.visibility='visible'; document.getElementById(idVisible).style.display='block';}
}

// -- Affichage Lines --------------------------------------------------------------------

function gotoNextLinePage(page)
{
	idHidden = 'page'+page;
	page +=1;
	idVisible = 'page'+page;
	afficherMasquerCalque(idHidden, idVisible);
}

function gotoPreviousLinePage(page)
{
	idHidden = 'page'+page;
	page -=1;
	idVisible = 'page'+page;
	afficherMasquerCalque(idHidden, idVisible);
}

// -- Affichage Navigation --------------------------------------------------------------------

function afficherModelePrecedent(modelActuel)
{
	idHidden = 'Modele' + modelActuel;
	modelePrecedent = modelActuel-1;
	idVisible = 'Modele' + modelePrecedent;
	afficherMasquerCalque(idHidden, idVisible)
}

function afficherModeleSuivant(modelActuel)
{
	idHidden = 'Modele' + modelActuel;
	modeleSuivant = modelActuel+1;
	idVisible = 'Modele' + modeleSuivant;
	afficherMasquerCalque(idHidden, idVisible)
}

// -- Affichage Distributeur -------------------------------------------------------------------

var PAYS_ACTUEL = 'Switzerland0';

function afficherDistributeur(pays)
{
	var idHidden= '';
	if(PAYS_ACTUEL != '')
	{
		idHidden = PAYS_ACTUEL;
	}
	PAYS_ACTUEL = pays;
	var idVisible = PAYS_ACTUEL;
	afficherMasquerCalque(idHidden, idVisible)
}

// -- Affichage Région -------------------------------------------------------------------------

var REGION_ACTUELE = '';

function afficherRegion(region)
{
	var idHidden= '';
	if(REGION_ACTUELE != '')
	{
		idHidden = REGION_ACTUELE;
	}
	REGION_ACTUELE = region;
	var idVisible = REGION_ACTUELE;
	afficherMasquerCalque(idHidden, idVisible)
}

// -- Afficher animation Flash ----------------------------------------------------------------
function DisplayAnimation( anim, width, height )
{
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+width+'" height="'+height+'">');
	document.write('<PARAM name=movie value="'+anim+'"><PARAM name=quality value=high>');
	document.write('<EMBED src="'+anim+'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></EMBED>');
	document.write('</OBJECT>');
}
