
MM_preloadImages('images/image111.png','images/image111o.png','images/image121.png','images/image131.png','images/image112.png','images/image122.png','images/image132.png','images/image211.png','images/image221.png','images/image231.png','images/image212.png','images/image222.png','images/image232.png','images/image311.png','images/image321.png','images/image331.png','images/image312.png','images/image322.png','images/image332.png') 

function $ (id) 
{
return document.getElementById (id ) ; 
}

$('slmi').style .backgroundImage = 'url(images/image332.png)' ; 
$('slmi').style .backgroundImage = 'url(images/image331.png)' ;
$('slmi').style .backgroundImage = 'url(images/image322.png)' ;
$('slmi').style .backgroundImage = 'url(images/image321.png)' ;
$('slmi').style .backgroundImage = 'url(images/image312.png)' ;
$('slmi').style .backgroundImage = 'url(images/image311.png)' ;
$('slmi').style .backgroundImage = 'url(images/image232.png)' ;
$('slmi').style .backgroundImage = 'url(images/image231.png)' ;
$('slmi').style .backgroundImage = 'url(images/image222.png)' ;
$('slmi').style .backgroundImage = 'url(images/image221.png)' ;
$('slmi').style .backgroundImage = 'url(images/image212.png)' ;
$('slmi').style .backgroundImage = 'url(images/image211.png)' ;
$('slmi').style .backgroundImage = 'url(images/image132o.png)' ;
$('slmi').style .backgroundImage = 'url(images/image132.png)' ;
$('slmi').style .backgroundImage = 'url(images/image131o.png)' ;
$('slmi').style .backgroundImage = 'url(images/image131.png)' ;
$('slmi').style .backgroundImage = 'url(images/image122o.png)' ;
$('slmi').style .backgroundImage = 'url(images/image122.png)' ;
$('slmi').style .backgroundImage = 'url(images/image121o.png)' ;
$('slmi').style .backgroundImage = 'url(images/image121.png)' ;
$('slmi').style .backgroundImage = 'url(images/image112o.png)' ;
$('slmi').style .backgroundImage = 'url(images/image112.png)' ;
$('slmi').style .backgroundImage = 'url(images/image111o.png)' ;
$('slmi').style .backgroundImage = 'url(images/image111.png)' ;

$('slmi').className = 'st21o' ; 
$('slmi').className = 'st22o' ; 
$('slmi').className = 'st11o' ; 
$('slmi').className = 'st12o' ; 
$('slmi').className = 'st31o' ; 
$('slmi').className = 'st32o' ; 
 


function changecol (num, ty ) 
{

if (ty == 1)
{

$('dr'+num ).style.backgroundColor="#FFFFFF"; 
} 
else
{
	 if (document.all){	$('dr'+num ).style.removeAttribute("backgroundColor","false")}
	 else{ $('dr'+num ).style.backgroundColor = "" };
}

}

function changerBack (num , etat , per) 
{

var objet = document.getElementById('k'+num);
var elf    =    objet.style.height ;
var elf2 = elf.split ('p') ; 
var  hActuel = elf2 [0] ; 
if(  ( ! objet.style.height )| ( hActuel == 0 ) )
{ 
	if ( etat  ==1 ) 
	{$('f'+num ).style.backgroundPosition ='0px 0px'   }
	else
	{ 
	$('f'+num ).style.backgroundPosition ='0px -120px' 
	}
}
else
{
//$('f'+num ) .style .backgroundImage='url(images/image1'+num+etat+'o.png )' ;
//$('f'+num ).className = 'st'+num+etat +'o'

if ( etat  ==1 ) 
	{
		
		$('f'+num ).style.backgroundPosition ='0px -60px' ;   }
	else
	{ 
		$('f'+num ).style.backgroundPosition ='0px -180px' ; 
	}

} 

$('m'+num ) .style .backgroundImage='url(images/image3'+num+etat+'.png )' ;  
$('s'+num ) .style .backgroundImage='url(images/image2'+num+etat+'.png )' ; 

		if (etat ==2 )  
		{
			$('f'+num ).style.color = '#FFFFFF'; 
			frt  = $('s'+num ).getElementsByTagName('ul')  ; 
			for ( i = 0 ; i< frt.length  ; i++   ) 
			{
				if (frt[i].className=='listegrist') 
				{
					frt[i].className= 'listegrisb' ; 
				}
				if (frt[i].className=='listegrist2') 
				{
					frt[i].className= 'listegrisb2' ; 
				}
					frt[i].style.color =  '#FFFFFF'; 
				}
			}
		else
		{
			$('f'+num ).style.color = '#000000';
			for ( i = 0 ; i< frt.length  ; i++   ) 
			{
				if (frt[i].className=='listegrisb') 
				{
					frt[i].className= 'listegrist' ; 
				}
				if (frt[i].className=='listegrisb2') 
				{
					frt[i].className= 'listegrist2' ; 
				}
				frt[i].style.color =  '#000000'; 
			}

		
		
}
}

function changepuce(id,classeCible)
{
	document.getElementById(id).className= classeCible;
	
}


function  accor ( id, hFinal ) 
{
var objet = document.getElementById('k'+id);
var elf    =    objet.style.height ;
var elf2 = elf.split ('p') ; 
var  hActuel = elf2 [0] ; 
if(  ( ! objet.style.height )| ( hActuel == 0 ) )
{  
 ouvrepopup( id, hFinal ) ; 
 }
if ( hActuel == hFinal ) 
{ fermepopup(id) ; }

}



function ouvrepopup( num , hFinal){

var objet = document.getElementById('k'+num);
$('s'+num ) . style.display = "block";
$('s'+num ).style.overflow = "hidden";
$('f'+num ) .style.color = '#FFFFFF'; 


//$('f'+num ) .style .backgroundImage  =  'url(images/image1'+num+'2o.png )' ; 
//$('f'+num ) .style =  
//$('f'+num ) .style .backgroundImage='url(images/image1'+num+'2o.png )' ;  
//$('f'+num ) .className = 'st'+num+'2o';

$('f'+num ).style.backgroundPosition ='0px -180px' ; 


$('m'+num ) .style .backgroundImage='url(images/image3'+num+'2.png )' ; 
 


hActuel =  0 ; 
if ( ! objet.style.height )	{ $('s'+num ) .style.height = '0px' ; objet.style.height ='0px' ;  $('zs'+num ) .style.height = '0px'   }
else {$('s'+num ) .style.height = '0px' ; objet.style.height ='0px'  ;  $('zs'+num ) .style.height = '0px' }

var timer;



fm = 200 ; 
var fct = function () {
objet.style.display = "block";
objet.style.overflow = "hidden"; 
 hActuel  +=10;  
 fm-=10 ; 
 // $("zitoun").style.height = fm +'px';
$('s'+num ) .style.height =hActuel + 'px';
$('zs'+num ) .style.height = hActuel + 'px' ;
objet.style.height =hActuel + 'px'; 
if( hActuel > hFinal)
{
		objet.style.height =hFinal + 'px'; clearInterval(timer);
		deplacerscroll () ;
}
};
timer = setInterval(fct,40); 
}

function fermepopup(id){
  
var objet = document.getElementById('k'+id);
var hFinal      =     0;
var elf    =    objet.style.height ;
var elf2 = elf.split ('p') ; 
var  hActuel = elf2 [0] ; 
var timer;
/*
if ( (document.body.scrollTop + document.body.clientHeight ) == document.body.scrollHeight ) {
 document.body.scrollTop -= 200 ;
 }

*/
var fct = function (){
hActuel  -=   10; 
//if ( (document.body.scrollTop + document.body.clientHeight ) == document.body.scrollHeight ) {
 document.body.scrollTop -= 15 ;
 //}
 //document.style.overflow = 'hidden'; 
//document.body.scroll="no";
objet.style.height     =	 hActuel      +     'px';
$('s'+id ) .style.height = hActuel + 'px';
$('zs'+id ) .style.height = hActuel + 'px';
if( hActuel <= 10) {
objet.style.height =0 + 'px';

//var htmlElement = document.getElementByTagName('html')[0];
//htmlElement.style.overflow = 'hidden';


clearInterval(timer);


if ( $('f'+id ) .style.color == '#000000' | $('f'+id ) .style.color == 'rgb(0, 0, 0)' ) 
{
	//$('f'+id ) .style .backgroundImage='url(images/image1'+id+'1.png )' ; 
	//$('f'+id ).className= 'st'+id+'1' ; 
	
	$('f'+id ).style.backgroundPosition ='0px 0px' ; 
	
	$('m'+id ) .style .backgroundImage='url(images/image3'+id+'1.png )' ;  
} 
else
{
	//$('f'+id ) .style .backgroundImage='url(images/image1'+id+'2.png )' ; 
	//$('f'+id ) .className = 'st'+id+'2' ; 
	
		$('f'+id ).style.backgroundPosition ='0px -120px' ; 
	$('m'+id ) .style .backgroundImage='url(images/image3'+id+'2.png )' ;  
}

$('s'+id ) . style.display = "none";
}
}
;
timer = setInterval(fct,30);    //Toute les 40 ms

}
function deplacerscroll ( )
  {
    while  ( (document.body.scrollTop + document.body.clientHeight + 15) < document.body.scrollHeight )
     {
           document.body.scrollTop += 2 ;
     }
  }
