var g_intPresentPageId = 0;
function showPage( p_intId, p_objThis ) {
	// on affiche le titre
	if ( p_intId != "contact" ) {
		document.getElementById( "pageContent" ).innerHTML = 
		(	document.getElementById('lang').innerHTML == 'fr' ? "Page en cours de chargement..." :
			document.getElementById('lang').innerHTML == 'en' ? "Page loading..." :	"Caricamento della pagina..." );
	}
	if ( p_objThis != null ) {
		document.getElementById( "pageTitle" ).innerHTML = p_objThis.innerHTML.toUpperCase();
		document.getElementById( "pageTitle" ).style.display = 'block';
	} else if (document.getElementById( "TITLE_" + p_intId ) != null) {
		document.getElementById( "pageTitle" ).innerHTML = document.getElementById( "TITLE_" + p_intId ).innerHTML;
		document.getElementById( "pageTitle" ).style.display = 'block';
	} else {
		document.getElementById( "pageTitle" ).innerHTML = '';
		document.getElementById( "pageTitle" ).style.display = 'block';
	}
	/* on masque la page actuelle
	if ( document.getElementById( "level0_" + g_intPresentPageId ) != null ) {
		document.getElementById( "level0_" + g_intPresentPageId ).style.display = "none";
	} else if ( g_intPresentPageId == 'contact' ) {
		document.getElementById( 'contact' ).style.display = "none";
	}*/
	// on affiche la page à afficher
	/*if ( document.getElementById( "level0_" + p_intId ) != null ) {
		checkLongSection(p_intId,0);
		document.getElementById( "level0_" + p_intId ).style.display = "block";*/
	if ( p_intId == 'contact' ) {
		document.getElementById( "pageContent" ).innerHTML = "";
		document.getElementById( 'contact' ).style.display = "block";
	} else {
		document.getElementById( 'contact' ).style.display = "none";
		document.getElementById( 'confirmMessage' ).innerHTML = "";
	}
	// on met à jour le paramètre correspondant à la page actuelle
	/*document.getElementById( "infoBulle" ).style.display = "none";*/
	g_intPresentPageId = p_intId;
	document.getElementById( "pageId" ).innerHTML = p_intId;
	document.getElementById( "welcome" ).innerHTML = "&nbsp;";
	window.location.href="#top";
}
//var g_ArrayImgLoaded = new Array();
function init(p_intId) {
	g_intPresentPageId = p_intId;
	if ( p_intId != 0 ) {
		showPage( p_intId, null );
		document.frames['pageLoader'].location.href='pagea490.html?ID=' + p_intId;
	}
	self.moveTo(0,0);
	if (window.screen) self.resizeTo(screen.availWidth,screen.availHeight);
	
	//checkLongSection(g_intPresentPageId,0);
}
function checkLongSection( p_intSectionId, p_intLevel ) {
	/*var l_objSection = document.getElementById('SECTION_' + p_intSectionId );
	var l_objAllLevelLiTags = l_objSection.getElementsByTagName("li");
	// on regarde s'il y a une image à initialiser dans cette section
	var l_objAllImg = l_objSection.getElementsByTagName("img"); // les tags <img>
	for ( var l_intImgCount = 0; l_intImgCount < l_objAllImg.length; ++l_intImgCount ) { // Pour toutes les images
		g_ArrayImgLoaded[ l_objAllImg[l_intImgCount].id ] == 'false';
		setImgSrc( l_objAllImg[l_intImgCount] );
	} 	
	// On compte le nombre de section ce niveau
	var l_intSectionCount = 0; // on va compter le nombre de section dans ce niveau
	var l_objSectionArray = new Array(); // on va stocker les objets qui représente les sections dans ce niveau
	for ( var l_intCount = 0; l_intCount < l_objAllLevelLiTags.length; ++l_intCount ) {
		// Si le titre de la section appartient du niveau en cours d'analyse ?
		if ( l_objAllLevelLiTags[l_intCount].id.indexOf('level' + p_intLevel) > -1 ) {
			l_objSectionArray[ l_intSectionCount ] = l_objAllLevelLiTags[l_intCount];
			++l_intSectionCount; // on incrémente le compteur de section
		}
	}
	// si on n'est pas sur la page d'accueil et
	// si d'après le compteur on a plus d'une section dans ce niveau, on doit effectuer la procédure qui permet de
	// masquer le contenu des sections
	/*if ( p_intSectionId != 0 && l_objSectionArray.length  > 40 ) {
		// Pour toutes les sections qu'on a stocker ci-avant
		for ( var l_intCount = 0; l_intCount < l_objSectionArray.length; ++l_intCount ) {
			var l_objSpanTag 	= l_objSectionArray[l_intCount].getElementsByTagName("span"); 	// les tags <span>
			var l_intSectionId	= l_objSpanTag[0].id.substring(6);								// l'dentifiant de la section
			var l_objSupSection	= document.getElementById('SECTION_' + l_intSectionId);			// le tag <ul>
			var l_objPara		= document.getElementById('TEXT_' + l_intSectionId);			// le tag <p>
			// si le paragraphe existe
			if ( l_objPara != null || ( l_objSupSection != null && l_objSupSection.innerHTML != '' ) ) {
				// on initialise la fermeture du paragraphe
				sectionOpen[l_intSectionId] = 'closed';
				if ( l_objPara != null ) { 
					l_objPara.style.display = 'none'; // si le para existe on le cache
				} 
				// on regarde si cette section a des sections filles
				if ( l_objSupSection != null && l_objSupSection.innerHTML != '' ) {
					l_objSupSection.style.display = 'none'; // si la section fille existe on la cache
					checkLongSection( l_intSectionId, p_intLevel + 1 ); // si oui, on check dans le niveau suppérieur
				}
				// on transforme le titre en lien
				if ( l_objSpanTag[0].getElementsByTagName("a").length == 0 ) {
					l_objSpanTag[0].innerHTML = 
						'<a id="#li' + l_intSectionId + '" href="javascript:showSection(' + l_intSectionId + ');">' +
						l_objSpanTag[0].innerHTML + '</a>';
				}							
			}
		}
	} else if ( l_objSectionArray[ 0 ] != null ) { // sinon on check quand même les niveau suppérieur
		checkLongSection( l_objSectionArray[ 0 ].id.substring(7), p_intLevel + 1 );
	}*/
}
/*var sectionOpen = new Array();
var paraOpen = new Array();
var boolStatHasChange = new Boolean();
function showSection( p_intId ) {
	boolStatHasChange = false;
	if ( sectionOpen[ p_intId ] != 'closed' && sectionOpen[ p_intId ] != 'opened' ) {
		sectionOpen[ p_intId ] = 'closed';
	}
	// Affichage de la section demandée
	if ( sectionOpen[p_intId] == 'closed' ) {
		if ( document.getElementById('TEXT_' + p_intId) != null ) {
			document.getElementById('TEXT_' + p_intId).style.display = 'block';
			sectionOpen[p_intId] = 'opened';
		}
		if ( document.getElementById('SECTION_' + p_intId) != null ) {
			document.getElementById('SECTION_' + p_intId).style.display = 'block';
			sectionOpen[p_intId] = 'opened';
			// on regarde s'il y a une image à afficher
			if ( document.getElementById('IMG_' + p_intId) != null ) {
				setImgSrc( l_objAllImg[l_intCount].id );
			}
		}
		return;
	}
	// On masque la dernière section affichée
	if ( sectionOpen[p_intId] == 'opened' ) {
		if ( document.getElementById('TEXT_' + p_intId) != null ) {
			document.getElementById('TEXT_' + p_intId).style.display = 'none';
			sectionOpen[p_intId] = 'closed';
		}
		if ( document.getElementById('SECTION_' + p_intId) != null ) {
			document.getElementById('SECTION_' + p_intId).style.display = 'none';
			sectionOpen[p_intId] = 'closed';
		}
	}
}
function setImgSrc( p_objImg ) {
	if ( document.getElementById('SRC_' + p_objImg.id) != null ) {
		p_objImg.src = document.getElementById('SRC_' + p_objImg.id).innerHTML;
	}
}*/