var DOM2 = ((document.getElementById && !document.all) ? true : false); 
var ie = ((document.all) ? true : false);
var tabImg=new Array();
var sorties=new Array("24-04","25-04","26-04","27-04","29-04","01-05","04-05");
var cptr_Img=0;
var marche_nb=new Array(36,52,39,39,39,12,39);
window.name="carresclp";

function sousMenu(io,info)
{
if(document.getElementById)
{
if (io==1)
{document.getElementById(info).style.visibility='visible';}
else
{document.getElementById(info).style.visibility='hidden';}
}
}



function preload(process,nb_ch,marche) 
{
window.status=".................... 7 MARCHES - 3 PROCESSUS ..................";

if (process=="p1")
{nb_ch=nbre;
var sort=sortie;
}
else if (process=="p3")
{sort=marche;
}
for (var i=1;i<=nb_ch;i++)
	{tabImg[i]=new Array(new Image,0);
	tabImg[i][0].src=sort+"/"+sort+"-"+i+".jpg";
	}
setTimeout("Verifie('"+process+"',"+nb_ch+")",200);
}


function cpteur()
{
cptr_Img++;
}

function Verifie(process,nb_ch) 
{
//window.status=process+",,,"+nb_ch;
ok=1;
if (process=="p3")
{var Wdth=90;
var Lft=929;
var Long=90;

document.getElementById("charge").style.visibility="visible";
document.getElementById("charge").style.left=650+"px";
document.getElementById("Tcharge").style.width = Wdth-(cptr_Img/nb_ch*Long)+"px";
		document.getElementById("Tcharge").style.left = Lft+(cptr_Img/nb_ch*Long)+"px";

}
else if (process=="p1")
{var Wdth=950;
var Lft=68;
var Long=254;

}

for (var i=1;i<=nb_ch;i++) 
	{
	if (!tabImg[i][0].complete)
	{ok=0}
	if ((tabImg[i][0].complete)&&(tabImg[i][1]!=1))
		{
		tabImg[i][1]=1;
		cpteur();
		document.getElementById("Tcharge").style.width = Wdth-(cptr_Img/nb_ch*Long)+"px";
		document.getElementById("Tcharge").style.left = Lft+(cptr_Img/nb_ch*Long)+"px";
		}
	}
        if (ok==0) {setTimeout("Verifie('"+process+"',"+nb_ch+")",200);}
		else{
		document.getElementById("charge").style.visibility="hidden";
		if (process=="p1")
		{demarre_P1();}
		}
}

function pr2()
{
stop_bouge();
bouge();
document.getElementById('cont_depot').style.visibility='visible';
document.getElementById('cont_depot').style.backgroundColor='#ff00cc';
setTimeout("fond_couleur()",1500);
aff_p3(0);
}
function fond_couleur()
{
document.getElementById('cont_depot').style.backgroundColor='black';
}

function pr3(mar_no)
{
cptr_Img=0;
place_Img(mar_no);
stop_bouge();bouge();
document.getElementById('proc3').style.visibility='hidden';
}

function liste(lst,lgn)
{
var num=eval("document.getElementById('"+lst+"').size");
if (num==lgn)
{
eval("document.getElementById('"+lst+"').size='1'");
}
else 
{eval("document.getElementById('"+lst+"').size='"+lgn+"'");}

}