// JavaScript Document



var xhr = null; 
function getXhr()
{
     if(window.XMLHttpRequest)xhr = new XMLHttpRequest(); 
else if(window.ActiveXObject)
  { 
  try{
     xhr = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (e) 
     {
     xhr = new ActiveXObject("Microsoft.XMLHTTP");
     }
  }
else 
  {
  alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
  xhr = false; 
  } 
}
 
function ShowPage(page)
{
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('draggable'+page).innerHTML=xhr.responseText;
     }
    }
xhr.open("GET","ajax.php?page="+page,true);
xhr.send(null);
}
 

function ShowPage2(page)
{
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('menu_'+page).innerHTML=xhr.responseText;
     }
    }
xhr.open("GET","ajax.php?page="+page,true);
xhr.send(null);
}
 



function ShowPage3(page)
{
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('draggableX').innerHTML=xhr.responseText;
     }
    }
xhr.open("GET","ajax.php?page="+page,true);
xhr.send(null);
}
 




function Sweet(cases)
{
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('switch'+cases).innerHTML=xhr.responseText;
     }
    }
xhr.open("GET","ajax.php?cases="+cases,true);
xhr.send(null);
}
 
function Sweep(cases) {

  $("#switch"+cases).fadeOut(0);
  

};
 
 
 function Sweek(cases) {

 $("#switch0").fadeOut(0);
  $("#switch"+cases).fadeIn(950);

};
 
 
 
 

  //
  // fontion Hide win
  //

function close1(page) {

  $("#draggable"+page).hide("slow");

};


  //
  // fontion slide
  //

function slide_l(mg) {

  
  $("#book"+mg).show("slow");
  $('#book'+mg).animate({
    opacity: 0.25,
	
    left: '+=50',
    height: 'toggle'
  }, 5000, function() {
mg=i++;
  });

};

function slide_r(mg) {
  
  $("#book"+mg).show("slow");
  $('#book'+mg).animate({
    opacity: 0.25,
	
    right: '+=50',
    height: 'toggle'
  }, 5000, function() {
mg=i--;
  });

};





  //
  // fontion Hide all
  //

function close2() {
 
  $("#draggable"+page).hide("slow");
  $("#menu_"+page).hide("slow");

};


function close3() {
 
  $("#draggableX").hide("slow");


};



  //
  // fontion Showpage win
  //

function open1(page) {
  
  $("#draggable"+page).show("slow");

};



function sli2(mg)
{


getXhr();





xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('book'+mg).innerHTML=xhr.responseText;
     }
    }
	


	
	
xhr.open("GET","image.php?mg="+mg,true);



xhr.send(null);

};
 
 
 
 
 
 
 
 
 
 
 // sli1
function sli1(fg)
{


getXhr();



xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('book').innerHTML=xhr.responseText;
     }
    }


	
xhr.open("GET","image.php?mg="+fg,true);
	
xhr.send(null);

if (fg < 10) {

fg++;

}


else if (fg = 11) {

fg=1;
}







}

;
 
 
 
 // sli3
 
 function sli3(fg)
{


getXhr();



xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('book').innerHTML=xhr.responseText;
     }
    }


	
xhr.open("GET","image.php?mg="+fg,true);
	
xhr.send(null);

if (fg > 1) {

fg--;

}




else if (fg = 1) {

fg=10;
}


	





}

;
 
 
 
 
 
  //
  // fontion Showpage all
  //

function open2() {
	

  
  $("#draggableX").show("slow");

  


};


function dem(so)
{

 $("#book"+so).fadeOut(0);

};
 


function op(dos) {
  
  $("#book"+dos).fadeIn(0);

};

function demx()
{

 $("#bookx").fadeOut(0);

};
 

