//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Partie Configuration : Ne pas modifier
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Liste des urls à appeler
var tabUrl = new Array();
tabUrl[0] = "press-all.htm";
tabUrl[1] = "press-tz.htm";
tabUrl[2] = "press-wasis.htm";
tabUrl[3] = "press-grace.htm";
tabUrl[4] = "press-hepatitex.htm";
tabUrl[5] = "press-stevies.htm";
tabUrl[6] = "press-ayo.htm";
tabUrl[7] = "press-imany.htm";

tabUrl[8] = "p-wasis01.htm";
tabUrl[9] = "p-wasis02.htm";
tabUrl[10] = "p-wasis03.htm";
tabUrl[11] = "p-wasis04.htm";
tabUrl[12] = "p-wasis05.htm";
tabUrl[13] = "p-wasis06.htm";
tabUrl[14] = "p-wasis07.htm";

tabUrl[35] = "v-wasis01.htm";
tabUrl[36] = "v-wasis02.htm";
tabUrl[37] = "v-wasis03.htm";
tabUrl[41] = "v-wasis04.htm";

tabUrl[15] = "p-hepatitex01.htm";
tabUrl[16] = "p-hepatitex02.htm";
tabUrl[17] = "p-hepatitex03.htm";
tabUrl[18] = "p-hepatitex04.htm";
tabUrl[19] = "p-hepatitex05.htm";
tabUrl[20] = "p-hepatitex06.htm";
tabUrl[21] = "p-hepatitex07.htm";

tabUrl[39] = "v-hepatitex01.htm";
tabUrl[40] = "v-hepatitex02.htm";
tabUrl[54] = "v-hepatitex03.htm";
tabUrl[56] = "v-hepatitex04.htm";

tabUrl[44] = "v-stevies01.htm";
tabUrl[45] = "v-stevies02.htm";
tabUrl[57] = "v-stevies03.htm";
tabUrl[49] = "v-stevies04.htm";
tabUrl[50] = "v-stevies05.htm";

tabUrl[22] = "p-imany01.htm";
tabUrl[23] = "p-imany02.htm";
tabUrl[24] = "p-imany03.htm";

tabUrl[38] = "v-imany01.htm";
tabUrl[42] = "v-imany02.htm";
tabUrl[43] = "v-imany03.htm";
tabUrl[46] = "v-imany04.htm";
tabUrl[47] = "v-imany05.htm";
tabUrl[48] = "v-imany06.htm";
tabUrl[55] = "v-imany07.htm";

tabUrl[25] = "p-grace01.htm";
tabUrl[26] = "p-grace02.htm";
tabUrl[27] = "p-grace03.htm";
tabUrl[28] = "p-grace04.htm";
tabUrl[29] = "p-grace05.htm";
tabUrl[30] = "p-grace06.htm";

tabUrl[51] = "v-grace01.htm";
tabUrl[52] = "v-grace02.htm";
tabUrl[53] = "v-grace03.htm";

tabUrl[31] = "p-ayo01.htm";
tabUrl[32] = "p-ayo02.htm";
tabUrl[33] = "p-ayo03.htm";
tabUrl[34] = "p-ayo04.htm";

// Liste des div de la page
var tabDiv = new Array();
tabDiv[0] = "contenu_right";
tabDiv[1] = "gallery";

// HTML à afficher dans la DIV en attendant le chargement
var loadingHtml = "<table width=\"100%\" height=\"35\"><tr valign=\"middle\"><td align=\"center\" class=\"bot\">loading</td></tr></table>";


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Partie AJAX : Ne pas modifier
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Variables utilisées pour annuler le chargement d'une Url si une autre a été appelée
var xmlhttpdiv = false;

var loadingDiv = new Array();

// Fonction JS effectuant l'appel AJAX
function loadDiv(IdUrl, IdDiv)
{
	tempDiv = loadingDiv[IdDiv];
	//Supression de l'ancienne requête
	if( tempDiv && tempDiv.readyState >= 1 && tempDiv.readyState <= 3)
	{
		tempDiv.abort();
	}
	
	//Nouvelle requête
   	xmlhttpdiv = getHTTPObject(IdUrl, IdDiv);
	loadingDiv[IdDiv] = xmlhttpdiv;
	
  	xmlhttpdiv.open("GET", tabUrl[IdUrl], true);
   	document.getElementById(tabDiv[IdDiv]).innerHTML = loadingHtml;
   	xmlhttpdiv.send(null);
}

// Fonction AJAX
function getHTTPObject(IdUrl, IdDiv)
{
	var xmlhttp = false;

	/* Compilation conditionnelle d'IE */
	/*@cc_on
	@if (@_jscript_version >= 5)
		   try
		   {
				   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		   }
		   catch (e)
		   {
				   try
				   {
				   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				   }
				   catch (E)
				   {
				   xmlhttp = false;
				   }
		   }
	@else
		   xmlhttp = false;
	@end @*/

	/* on essaie de créer l'objet si ce n'est pas déjà fait */
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
		   try
		   {
				   xmlhttp = new XMLHttpRequest();
		   }
		   catch (e)
		   {
				   xmlhttp = false;
		   }
	}

	if (xmlhttp)
	{
		   xmlhttp.onreadystatechange=function()
		   {
				   if (xmlhttp.readyState == 4) /* 4 : état "complete" */
				   {
				   			if (xmlhttp.status == 200) /* 200 : code HTTP pour OK */
								document.getElementById(tabDiv[IdDiv]).innerHTML = xmlhttp.responseText;
							else
							{
								 // VERSION 1
								 //  document.getElementById(tabDiv[IdDiv]).innerHTML = "Server Error";
								 
								 // VERSION 2
								 // On recharge la page car problème serveur ...
								 loadDiv(IdUrl, IdDiv);
							}
				   }
		   }
	}
	return xmlhttp;
}