
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_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_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_reloadPage(init) {  //reloads the window if Nav4 resized
	  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}

// Dhtml Programs
function init()
	{
	initlayers();
	for(m=1;m<3;m++)
		{
		divinit = eval("menu" + m)
		divinit.onmouseover = showmenu2;
		divinit.onmouseout = hidemenu2;
//		divinit.show();
		divinit.clipto = 19;
		divinit.setclipbottom(divinit.getheight());
		}
	if(!ismac) loop = setInterval("anim();",50);
	setTimeout("menutoplink.show()",100);
	}

function anim()
	{
	for(m=1;m<3;m++)
		{
		divanim = eval("menu" + m);
		bozo = divanim.clipto - divanim.getclipbottom();
		if(bozo)
			{
			divanim.setclipbottom(Math.floor(divanim.getclipbottom()+(bozo/1.3)));
			}
		else
			{
			divanim.hide();
			}
		}
	}

function hidemenu2()
	{
	if(ismac) this.hide();
	else this.clipto = 19;
	}

function showmenu2()
	{
	if(ismac) this.show();
	else this.clipto = this.getheight();
	}
	
function showmenu(id)
	{
	var showmenudiv = eval(id);
	showmenudiv.show();
	showmenudiv.clipto = showmenudiv.getheight();
	}
	
function hidemenu(id)
	{
	var hidemenu = eval(id)
	if(ismac) hidemenu.hide();
	else hidemenu.clipto = 19;
	}


//function animzoom()
//	div = eval("menu" + m);
//	bozo = product.clipto - product.getclipbottom();
//	
//	if(bozo)
//		{
//		product.setclipbottom(Math.floor(div.getclipbottom()+(bozo/1.3)));
//		}
//	else
//		{
//		div.hide();
//		}
//	}
	
// Fix for Netscape (doesnt work for 4.08)

function fix()
	{
	bVer='';
	bName = navigator.appName.toLowerCase();
    bVer=navigator.appVersion.substring(0,3);
	
    if(bName == "netscape" && bVer>= '4.08')
		{
		document.location = document.location
		}
	}	

var debut, fin, langid, lastid

// fonction qui permet de passer a la page equivalente dans une autre langue 

function changelangue(langid,lastid)
{
  var template = document.location.href.toLowerCase() ;
  debut  =  template.slice(0,template.lastIndexOf(lastid));
  debut  += langid ;
  fin    =  template.slice((template.lastIndexOf(lastid) + 4),template.length);
  document.location.href = (debut + fin) ;
}   
// fonction pour changer les images des sous sous section 
function rollover(nameid) { document['igs' + nameid].src = "/images/li_l3_on.gif" }
function rollout(nameid) { document['igs' + nameid].src = "/images/li_l3_off.gif" }

// fonction open window pour la sous-section "notre flotte"

function open_window(url,w,h)
{
window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=' + w + ',height=' + h + ',top=20,left=20')
}
 
// Pop windows pour les produits

// Screen Postion
function position(object,h,y,e)
	{
	if(isns4)
		{
		if ((e.y + h) > (window.pageYOffset + window.innerHeight))
			{
			y = ((window.innerHeight - h) + window.pageYOffset - 4)
			}
		else
			{
			y = y - 5
			}
		}
		
	else if(isie)
		{
		e = window.event;
	
		if ((e.y + h) > (document.body.clientHeight + document.body.scrollTop))
			{
		    y = ((document.body.clientHeight - h) + document.body.scrollTop - 4)
			}
	    else
			{
			y = y - 5
			}
		}
		
	object.setxy(x+5,y);		
	}

	
// Coordonate and html write
function zoom(id,state,e)
	{
	if(isie)
		{
		x = window.event.x+document.body.scrollLeft;
		y = window.event.y+document.body.scrollTop-20;
		}
	else
		{
		x = e.pageX;
		y = e.pageY-25;
		}

	product.html("<table bgcolor='6699FF' cellpadding='1' cellspacing='0' border='0'><tr><td><img src='../images/prod/" + id + ".jpg' onLoad='zoomshow(product)'></td></tr></table>");
	sizeX = product.getwidth();
	sizeY = product.getheight();
	zoomanim.html("<table bgcolor='6699FF' cellpadding='1' cellspacing='0' border='0'><tr><td><table width=" + sizeX + " height=" + sizeY + " cellpadding=0 cellspacing=1 border=0 bgcolor=ffffff><tr><td valign=middle align=center><img src=\"../images/loading.gif\" width=46 height=6 border=0></td></tr></table></td></tr></table>");
//	position.onmouseout = position.hide();
//	zoomanim.onmouseout = zoomanim.hide();
	position(zoomanim,sizeY,y,e);
	zoomanim.show();
	position(product,sizeY,y,e);
	}

function zoomout(id,state,e)
	{
	zoomanim.hide();
	product.hide();	
	}
	
function zoomshow(id)
	{
	zoomanim.hide();
	id.show();	
	}
last = 0
windowwidth = 0;
windowheight = 0;
ismac = (navigator.appVersion.indexOf("Mac") != -1);
isie = (document.all) ? 1 : 0;
isns4 = (document.layers) ? 1 : 0;
isns6 = (document.getElementById && !document.all) ? 1 : 0;


function initlayers()
	{
	if(isie) 		return ie_initlayers();
	else if(isns4)	return ns4_initlayers();
	else if(isns6)	return ns6_initlayers();
	}
	
function ie_initlayers()
	{
	LA = document.all.tags("DIV");
	for(x=0;x<LA.length;x++)
		{
		LA[x].init = mapping_ie;
		LA[x].init();
		}
	windowwidth = document.body.clientWidth;
	windowheight = document.body.clientHeight;
	return LA.length;
	}

function ns6_initlayers()
	{
	LA = document.getElementsByTagName("DIV");
	for(x=0;x<LA.length;x++)
		{
		eval(LA[x].id + " = LA[x]");
		LA[x].init = mapping_ns6;
		LA[x].init();
		}
	windowwidth = window.innerWidth;
	windowheight = window.innerHeight;
	return LA.length;
	}

layercount = 0;
function ns4_initlayers()
	{
	var x = 0;
	var LA = "";
	if(arguments.length)
		LA = arguments[0];
	else
		LA = document.layers;
	for(x=0;x<LA.length;x++)
		{
		eval(LA[x].name + " = LA[x]");
		LA[x].init = mapping_ns4;
		LA[x].init();
		layercount++;
		if(LA[x].document.layers.length)
			ns4_initlayers(LA[x].document.layers)
		}
	windowwidth = window.innerWidth;
	windowheight = window.innerHeight;
	return layercount;
	}
		
function mapping_ns4()
	{
	this.setx = 			sx_ns4;
	this.setz =				sz_ns4;
	this.sety =				sy_ns4;
	this.setxy = 			sxy_ns4;
	this.getx = 			gx_ns4;
	this.gety = 			gy_ns4;
	this.show = 			sh_ns4;
	this.hide = 			hi_ns4;
	this.setbgcolor = 		sbc_ns4;
	this.getbgcolor = 		gbc_ns4;
	this.setbg = 			sbi_ns4;
	this.getbg = 			gbi_ns4;
	this.getclipleft = 		gcl_ns4;
	this.getclipright = 	gcr_ns4;
	this.getcliptop = 		gct_ns4;
	this.getclipbottom =	gcb_ns4;
	this.setclipleft = 		scl_ns4;
	this.setclipright = 	scr_ns4;
	this.setcliptop = 		sct_ns4;
	this.setclipbottom = 	scb_ns4;
	this.html = 			ht_ns4;
	this.getheight = 		gh_ns4;
	this.getwidth = 		gw_ns4;
	this.childrens =		"";
	if(this.document.layers)
		this.childrens =	this.document.layers;
	}

function mapping_ns6()
	{
	this.setx = 			sx_w3c;
	this.setz =				sz_w3c;
	this.sety =				sy_w3c;
	this.setxy = 			sxy_w3c;
	this.getx = 			gx_w3c;
	this.gety = 			gy_w3c;
	this.show = 			sh_ns6;
	this.hide = 			hi_ns6;
	this.setbgcolor = 		sbc_w3c;
	this.getbgcolor = 		gbc_w3c;
	this.setbg = 			sbi_w3c;
	this.getbg = 			gbi_w3c;
	this.getclipleft = 		gcl_w3c;
	this.getclipright = 	gcr_w3c;
	this.getcliptop = 		gct_w3c;
	this.getclipbottom = 	gcb_w3c;
	this.setclipleft = 		scl_ns6;
	this.setclipright = 	scr_ns6;
	this.setcliptop = 		sct_ns6;
	this.setclipbottom = 	scb_ns6;
	this.getheight = 		gh_ns6;
	this.getwidth = 		gw_ns6;
	this.html = 			ht_ns6ie;
	this.style.clip = 		"rect(auto auto auto auto)"
	this.patch =			patch_ns6;
	this.childrens =		new Array();
	c = 0; nodeList = this.childNodes;
	for(n=0;n<nodeList.length;n++) 
		if(nodeList.item(n).nodeName=="DIV") this.childrens[c++] = nodeList.item(n);
	}

function mapping_ie()
	{
	this.setx = 			sx_w3c;
	this.setz =				sz_w3c;
	this.sety =				sy_w3c;
	this.setxy = 			sxy_w3c;
	this.getx = 			gx_w3c;
	this.gety = 			gy_w3c;
	this.show = 			sh_w3c;
	this.hide = 			hi_w3c;
	this.setbgcolor = 		sbc_w3c;
	this.getbgcolor = 		gbc_w3c;
	this.setbg = 			sbi_w3c;
	this.getbg = 			gbi_w3c;
	this.getclipleft = 		gcl_w3c;
	this.getclipright = 	gcr_w3c;
	this.getcliptop = 		gct_w3c;
	this.getclipbottom = 	gcb_w3c;
	this.setclipleft = 		scl_w3c;
	this.setclipright = 	scr_w3c;
	this.setcliptop = 		sct_w3c;
	this.setclipbottom = 	scb_w3c;
	this.html = 			ht_ns6ie;
	this.getheight = 		gh_ie;
	this.getwidth = 		gw_ie;
	this.style.clip = 		"rect(auto auto auto auto)"
	this.childrens =		new Array();
	c = 0; nodeList = this.all.tags("DIV");
	for(n=0;n<nodeList.length;n++) this.childrens[c++] = nodeList[n];
	}

// Netscape4-only functions ///////////////////////////////////////////////

function sx_ns4(x){
	this.left = x;}
function sy_ns4(y){
	this.top = y;}
function sz_ns4(z){
	this.zIndex = z;}
function sxy_ns4(x,y){
	this.moveTo(x,y);
	if(arguments.length>2) this.zIndex = arguments[2];}

function gx_ns4(){
	return this.left;}
function gy_ns4(){
	return(this.top);}
function getz_ns4(){
	return(this.zIndex);}

function sh_ns4(){
	this.visibility="inherit";}
function hi_ns4(){
	this.visibility="hidden";}

function gh_ns4(){
	return this.document.height;}
function gw_ns4(){
	return this.document.width;}

function ht_ns4(h){
	this.document.open();
	this.document.write(h);
	this.document.close();}

function location_ns4(x){
	this.src = x;}

function sbc_ns4(color){
	this.bgColor = color;}
function sbi_ns4(image){
	this.background.src = image;}

function gbc_ns4(){
	return this.bgColor;}
function gbi_ns4(){
	return this.background.src;}

function gcl_ns4(){
	return this.clip.left;}
function gcr_ns4(){
	return this.clip.right;}
function gct_ns4(){
	return this.clip.top;}
function gcb_ns4(){
	return this.clip.bottom;}

function scl_ns4(x){
	this.clip.left = x;}
function scr_ns4(x){
	this.clip.right = x;}
function sct_ns4(x){
	this.clip.top = x;}
function scb_ns4(x){
	this.clip.bottom = x;}

// Netscape6-only functions ///////////////////////////////////////////////

function scl_ns6(x){
	setclip(this,0,x);
	this.patch();}
function scr_ns6(r){
	setclip(this,1,r);
	this.patch();}
function sct_ns6(y){
	setclip(this,3,y);
	this.patch();}
function scb_ns6(b){
	setclip(this,2,b);
	this.patch();}

function sh_ns6(){
	this.style.visibility="visible";
	this.patch();}
function hi_ns6(){
	this.style.visibility="hidden";
	this.patch();
	}

function patch_ns6(){
	this.style.left=parseInt(this.style.left)-1;
	this.style.left=parseInt(this.style.left)+1;}

function gh_ns6(){
	st = getComputedStyle(this,0);
	return (parseInt(st.getPropertyValue("height")));}

function gw_ns6(){
	st = getComputedStyle(this,0);
	return (parseInt(st.getPropertyValue("width")));}
	
// W3C compliant functions ////////////////////////////////////////////////

function sx_w3c(x){
	this.style.left = x + "px";}
function sy_w3c(y){
	this.style.top = y + "px";}
function sz_w3c(z){
	this.style.zIndex = z;}
function sxy_w3c(x,y){
	this.style.left = x + "px";
	this.style.top = y + "px";
	if(arguments.length>2) this.style.zIndex = arguments[2];}

function gx_w3c(){
	return (parseInt(this.style.left));}
function gy_w3c()	{
	return(parseInt(this.style.top));}
function getz_w3c()	{
	return(parseInt(this.style.zIndex));}

function sh_w3c(){
	this.style.visibility="inherit";}
function hi_w3c(){
	this.style.visibility="hidden";}

function sbc_w3c(c){
	this.style.backgroundColor = c;}
function sbi_w3c(i){
	this.style.backgroundImage = "url(" + i + ")";}

function gbc_w3c(){
	return this.style.backgroundColor;}
function gbi_w3c(image){
	return this.style.backgroundImage;}

function gct_w3c(){
	clips = this.style.clip.substring(5,this.style.clip.length-1).split(" ");
	return parseInt(clips[0]);}
function gcr_w3c(){
	clips = this.style.clip.substring(5,this.style.clip.length-1).split(" ");
	return (clips[1]);}
function gcb_w3c(){
	clips = this.style.clip.substring(5,this.style.clip.length-1).split(" ");
	return parseInt(clips[2]);}
function gcl_w3c(){
	clips = this.style.clip.substring(5,this.style.clip.length-1).split(" ");
	return parseInt(clips[3]);}

function scl_w3c(x){
	setclip(this,0,x);}
function scr_w3c(r){
	setclip(this,1,r);}
function sct_w3c(y){
	setclip(this,3,y);}
function scb_w3c(b){
	setclip(this,2,b);}

function setclip(div,side,value)
	{
	if(!div.style.clip) div.style.clip = "rect(auto auto auto auto)"
	clips = div.style.clip.substring(5,div.style.clip.length-1).split(" ");
	clipstr = "";
	for(c=0;c<4;c++){
		if(side!=c)	clipstr += clips[c] + " ";
		else 		clipstr += value + " " ;}
	div.style.clip = "rect(" + clipstr + ")";
	}

// IE-specific functions //////////////////////////////////////////////////
	
function gh_ie(){
	if(ismac) return this.offsetHeight;
	else return this.scrollHeight;}
function gw_ie(){
	if(ismac) return this.offsetWidth;
	else return this.scrollWidth;}

// IE and NS6 specific functions //////////////////////////////////////////////////

function ht_ns6ie(content){
	this.innerHTML = content;}

// /////////////////////////////////////////////////////////////////////////

