Menu = "";
Index = 1;
Pays = "";
FirstLoad = 0;
NbFlag = 9;
NbSection = 5;

//-----------------------------------
function Redirect(Val){
WinFRT = window.open(Val,"WinFRT","toolbar=no,menubar=no,scrollbars=yes,status=no,top=0,left=0,width=700");
}

//-----------------------------------
function returnCountryFromCountryTampon(ImgSrc){

Pays = ImgSrc;
Pays = Pays.replace('ImgSite/','');
Pays = Pays.replace('.jpg','');
Len = Pays.length;
Pays = Pays.substring(Len-2);
Pays = Pays.toUpperCase();

return Pays;

}
//-----------------------------------
function SelectCountry(Page,Val){

eval('document.'+Menu+'.src = \'ImgSite/'+Menu+'.jpg\'');	

switch(Page){
case "Renseignements":
	Index = 1;
	document.Tampon.src = 'ImgSite/Dot.gif';

	for (i=0;i<=NbSection;i++)
		eval('document.Section'+i+'.src = \'ImgSite/Dot.gif\'');


		if (Menu != "Identification"){
		   for (i=1;i<=NbFlag;i++)
			eval('document.Country_'+i+'.src = "ImgSite/Dot.gif";');

		   switch(Menu){
			case "Maintenance":
				Cadre.location.href = 'Maintenance_Liste.php';
				break;
			case "Rassemblement":
				Cadre.location.href = 'Rassemblement_Liste.php';
				break;
            case "Propagande":
				Cadre.location.href = 'Propagande.php';
				break;
			case "Recipiendaires":
				Cadre.location.href = 'Recipiendaires.php';
				break;
			}

		}
		else{

               document.Tampon.src = eval('document.Country_'+Val+'.src');
               Pays = returnCountryFromCountryTampon(document.Tampon.src);

			if (Pays != "IF")
				Cadre.location.href = 'Identification_Liste.php?pPays='+Pays;
			else
				 Cadre.location.href = 'Identification_Liste.php';
		}
	
	break;
}
}

//-----------------------------------
function InitCountry(Page,Val){

Menu = Val;

switch(Page){
case "Accueil":
	if (Menu == "Actualites")
		Cadre.location.href = 'Accueil_Actualites.php';
	else
		Cadre.location.href = 'Accueil_Recrutement.php';
	break;
}

if ((Val == 'Identification') && (Pays != ''))
	Cadre.location.href = 'Identification_Liste.php?pPays='+Pays;
else
	SelectCountry(Page,1);
	
}



//-----------------------------------
function ResizeObj(Val,H,W){
	var obj = document.getElementById(Val);

	obj.style.height = H;
	obj.style.width = W;
}
//-----------------------------------
function AdjustDivContainer(Page){

HeightAvailable = document.body.clientHeight;

if (HeightAvailable < 768)
            document.vign2.src = 'ImgSite/Dot.gif';
else 
	document.vign2.src = 'ImgSite/Vignette'+RandomFileNumber(12)+'.jpg';

TopDivContainer = document.getElementById("DivContainer").offsetTop;
ResizeObj('DivContainer',(HeightAvailable-TopDivContainer)-160,DivContainer.style.width);
 
}

//-----------------------------------
function RandomFileNumber(MaxVal){
    return Math.floor(Math.random()*MaxVal)+1;
}




























