function init()
{//init


}

function next()
{//code
}

function previous()
{//code
}
function titreTm()
{
  var nom = "";

  // update the number to the next value, if > num_slides, set to 1
  // mettre le no de page de titre dans numval
  	numval = PageTitre;
 	writeCookie(numval);
}
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}
// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(value)
{
  var expire = "";
  var hours = 24;
  var name = "pagecerf";
  var value2 = "";
	value2 = value + ""  
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }

  document.cookie = "pagecerf" + "=" + escape(value2) + expire;
  window.open("acces_livre.htm","output","toolbar=0,height=768,width=1024,scrollbars=1,resizable=1");
  
}

function preload()
{
  	var nom = "";
	var i = 0;
	var value1 = 0;
	var value2 = num_slides;
	var numval2 = 0;

	
	document.getElementById("loadingpage").value = "Chargement page " + i + "/" + value2;
	alert("Début du préchargement des pages en cache...."+ '\n' + "______________________________________" + '\n' +"Attention cette opération peut être longue..."+ '\n' + "Un message vous informera de la fin du préchargement...."+ '\n' + "Cliquez sur OK pour continuer");
	window.location.reload();
	if (document.all) for (var i=0;i < document.all.length; i++) document.all(i).style.cursor = 'wait';
	for (i = value1; i <= value2; i++)
	{
  		numval2 = numval2 + 1;
  		if (numval2 > num_slides) numval2 = 1;  //reset back to one
		
  		// set the attributes in the HTML elements
  		nom = basename + numval2;
  		if (numval2 < 1000) nom = basename + "0"  + numval2;
  		if (numval2 < 100) nom = basename + "00" + numval2;
  		if (numval2 < 10) nom = basename + "000" + numval2;
  		
		//document.getElementById("conteneur").loadmovie(0, "flash/" + nom + ".swf");
		
		x = 0;
		//while (x < 100) 
		//{
			//x = document.getElementById("conteneur").PercentLoaded();
			//document.getElementById("conteneur").onLoadChange = customFunction(x);
			
			
		//}
		
		document.getElementById("loadingpage").value = "Chargement page " + nom;
		window.location.reload();
		
		
	}


		
	if (document.all) for (var i=0;i < document.all.length; i++) document.all(i).style.cursor = 'default';
	alert("fin du préchargement...");
}
function customFunction(percent){
  //code to display load progress message
  document.getElementById("loadingpage").value = "Chargement page " + percent + " % /" + "100 %";
} 