OngletFicheCourant=1;
/* ************************************************************* */ 
function FermerPopUpJQuery(NomDiv)
{
		$(document).ready(function () 
		{
				$("#"+NomDiv).css({ visibility:'hidden'});
		});
}
/* ************************************************************* */ 
function OuvrirPopUpJQuery(NomDiv)
{
		$(document).ready(function () 
		{
				$("#"+NomDiv).css({ visibility:'visible'});
		});
}
/* ************************************************************* */ 
function OpenZoom(Titre,Image,Largeur,Hauteur)
{
	Offset=5;	
	Largeur=Largeur+Offset;
	Hauteur=Hauteur+Offset;
	screen_width = screen.width - Largeur;
	screen_width = screen_width / 2;
	screen_width = Math.floor(screen_width);
	if(screen_width < 0)
		screen_width=0;
	screen_height = screen.height - Hauteur;
	screen_height = screen_height / 2;
	screen_height = Math.floor(screen_height);
	if(screen_height < 0)
		screen_height=0;
	if(document.layers)
  		window.open('zoommer.php?Titre='+Titre+'&Image='+Image+'&Width='+(Largeur-Offset)+'&Height='+(Hauteur-Offset),'fiche','width='+Largeur+',height='+Hauteur+',scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=yes,screenX='+screen_width+',screenY='+screen_height);
  	else
  		window.open('zoommer.php?Titre='+Titre+'&Image='+Image+'&Width='+(Largeur-Offset)+'&Height='+(Hauteur-Offset),'fiche','width='+Largeur+',height='+Hauteur+',scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=yes,left='+screen_width+',top='+screen_height);
}
/* ************************************************************* */ 
 function popupcentree(page,largeur,hauteur,options) 
 {
    var top=(screen.height-hauteur)/2;
    var left=(screen.width-largeur)/2;    
    window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options); 
}
function OpenAchat(Ean13)
{
	refedit=2;
 var url = "http://www.interforum.fr/Affiliations/accueil.do?refLivre="+Ean13+"&refEditeur="+refedit;
  //alert(url);
  popupcentree(url,640,710,"");
 }
 
function OpenAchatNumerique(Ean13)
{
 	var uneurl = "https://www.e-interforum.com/intra/placedesediteurs/editions.php?ean13="+Ean13+"";
  //alert(url);
    //var top=(screen.height-760)/2;
    //var left=(screen.width-720)/2;    
		//window.open(url,"",'width='+720+',height='+760+',scrollbars=yes,toolbar=yes,location=no,status=no,menubar=no,resizable=yes,left='+left+',top='+top);
		window.open(uneurl,"","");
 }
/* ************************************************************* */  

var bulleStyle=null

/* ************************************************************* */ 
function get_offset(elem, pos)
{
    var offset = 0;
    while(elem) {
        offset += elem[pos];
        elem = elem.offsetParent
    }
    return offset
}
/* ************************************************************* */ 
function get_full_position(id)
{
    var d = document.getElementById(id);
    var offsets = new Object;
    offsets.top = get_offset(d, "offsetTop");
    offsets.left = get_offset(d, "offsetLeft");
    offsets.width = d.clientWidth;
    offsets.height = d.clientHeight;
    return offsets;
}
/* ************************************************************* */ 
function bullepop(master,servant,decalagex,decalagey)
{
	offsets=get_full_position(master);
	
 	bulleStyle=null;
 
  if (document.layers) {
    bulleStyle=document.layers[servant];	
  } else if (document.all) {
    element=document.all[servant]
  } else if (document.getElementById) {
	  element=document.getElementById(servant)
  }
  
  if(element)  
  	bulleStyle=element.style;
  if(bulleStyle) {
  	xpage=offsets.left+offsets.width-decalagex;
  	ypage=offsets.top+offsets.height-decalagey;
		if(typeof(bulleStyle.left)=='string') {
				 bulleStyle.left=xpage+'px'; 
				 bulleStyle.top=ypage+'px';  
		} else {
				bulleStyle.left=xpage; 
				bulleStyle.top=ypage ;
				}
	   bulleStyle.visibility="visible"; 
	   bulleStyle.zIndex="99";
   }
}
/* ************************************************************* */ 
function divpop(master,servant,decalagex,decalagey)
{
	offsets=get_full_position(master);
	
 	UnbulleStyle=null;
 
  if (document.layers) {
    UnbulleStyle=document.layers[servant];	
  } else if (document.all) {
    element=document.all[servant]
  } else if (document.getElementById) {
	  element=document.getElementById(servant)
  }
  
  if(element)  
  	UnbulleStyle=element.style;
  if(UnbulleStyle) {
  	xpage=offsets.left+offsets.width-decalagex;
  	ypage=offsets.top+offsets.height-decalagey;
		if(typeof(UnbulleStyle.left)=='string') {
				 UnbulleStyle.left=xpage+'px'; 
				 UnbulleStyle.top=ypage+'px';  
		} else {
				UnbulleStyle.left=xpage; 
				UnbulleStyle.top=ypage ;
				}
	   UnbulleStyle.visibility="visible"; 
	   UnbulleStyle.zIndex="99";
   }
}
/* ************************************************************* */  
function couic(){
  if(bulleStyle)  
  	bulleStyle.visibility="hidden";
}

/* ************************************************************* */ 
	function ZoomDirect(Obj)
	{
		hs.showCredits = false;
		hs.graphicsDir = 'highslide/graphics/';
		hs.align = 'center';
		hs.transitions = ['expand', 'crossfade'];
		hs.wrapperClassName = 'wide-border';
		hs.fadeInOut = true;
		hs.dimmingOpacity = 0.75;
 		return hs.expand(Obj);
	}
/* ************************************************************* */  
function AjouteCommentaire(Ean)
{
	hs.graphicsDir = 'highslide/graphics/';
	hs.showCredits = false;
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
  hs.wrapperClassName= 'no-footer draggable-header '
	hs.fadeInOut = false;
	hs.width = 720+10;
	hs.height = 340+50;
	hs.dimmingOpacity = 0.75;
	hs.htmlExpand(null, {src: 'form_commentaire.php?EAN='+Ean, objectType: 'iframe'});	
}
/* ************************************************************* */  
function VoirCommentaire(Ean)
{
	hs.graphicsDir = 'highslide/graphics/';
	hs.showCredits = false;
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
  hs.wrapperClassName= 'no-footer draggable-header '
	hs.fadeInOut = false;
	hs.width = 720+10;
	hs.height = 550+50;
	hs.dimmingOpacity = 0.75;
	hs.htmlExpand(null, {src: 'commentaires.php?EAN='+Ean, objectType: 'iframe'});	
}
/* ************************************************************* */  
function AfficheBioAuteur(IdAut)
{
	hs.graphicsDir = 'highslide/graphics/';
	hs.showCredits = false;
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
  hs.wrapperClassName= 'no-footer draggable-header '
	hs.fadeInOut = false;
	hs.width = 720+10;
	hs.height = 550+50;
	hs.dimmingOpacity = 0.75;
	hs.htmlExpand(null, {src: 'biographie.php?AUT='+IdAut, objectType: 'iframe'});	
}
/* ************************************************************* */  
function AfficheAudioOuvrageAuteur(IdAut,Ean)
{
	hs.graphicsDir = 'highslide/graphics/';
	hs.showCredits = false;
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
  hs.wrapperClassName= 'no-footer draggable-header '
	hs.fadeInOut = false;
	hs.width = 720+10;
	hs.height = 550+50;
	hs.dimmingOpacity = 0.75;
	hs.htmlExpand(null, {src: 'audio.php?EAN='+Ean+'&AUT='+IdAut, objectType: 'iframe'});	
}
/* ************************************************************* */  
function AfficheVideoOuvrageAuteur(IdAut,Ean)
{
	hs.graphicsDir = 'highslide/graphics/';
	hs.showCredits = false;
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
  hs.wrapperClassName= 'no-footer draggable-header '
	hs.fadeInOut = false;
	hs.width = 720+10;
	hs.height = 550+50;
	hs.dimmingOpacity = 0.75;
	hs.htmlExpand(null, {src: 'video.php?EAN='+Ean+'&AUT='+IdAut, objectType: 'iframe'});	
}
/* ************************************************************* */  
function AfficheFocusAuteur(IdAut)
{
	hs.graphicsDir = 'highslide/graphics/';
	hs.showCredits = false;
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
  hs.wrapperClassName= 'no-footer draggable-header '
	hs.fadeInOut = false;
	hs.width = 720+10;
	hs.height = 550+50;
	hs.dimmingOpacity = 0.75;
	hs.htmlExpand(null, {src: 'focus.php?AUT='+IdAut, objectType: 'iframe'});	
}
/* ************************************************************* */  
function AfficheALaUneAuteur(IdAut,Ean)
{
	hs.graphicsDir = 'highslide/graphics/';
	hs.showCredits = false;
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
  hs.wrapperClassName= 'no-footer draggable-header '
	hs.fadeInOut = false;
	hs.width = 720+10;
	hs.height = 550+50;
	hs.dimmingOpacity = 0.75;
	hs.htmlExpand(null, {src: 'alaune.php?EAN='+Ean+'&AUT='+IdAut, objectType: 'iframe'});	
}
/* ************************************************************* */ 
function eMail_Valide(eMail)
{
	Un_Tableau=eMail.split("@")
	if(Un_Tableau.length!=2)
	{
		return false;
	}
	Un_Tableau=Un_Tableau[1].split(".")
	if(Un_Tableau.length<2)
	{
		return false;
	}
	if ((Un_Tableau[Un_Tableau.length-1].length<2))
	{
		return false;
	}
	return true;
}

/* ************************************************************* */ 
function ValideDeposeCommentaire() {
	Formulaire=document.FORMCOMMENTAIRE;	

	if(Formulaire.PSEUDO.value=="")
	{
		alert("Vous devez saisir votre pseudo.");
		return false;
	}
	
	if(Formulaire.EMAIL.value=="")
	{
		alert("Vous devez saisir votre eMail.");
		return false;
	}
	
	if(!(eMail_Valide(Formulaire.EMAIL.value)))
	{
		alert("Votre eMail n'est pas valide.");
		return false;
	}

	if(Formulaire.COMMENTAIRE.value=="")
	{
		alert("Vous devez saisir votre commentaire.");
		return false;
	}	
	Formulaire.submit();
}//-->
/* ************************************************************* */ 
	ClicOuvrageAuteur=false;
	DecalageOuvrageAuteur=0;
	DeltaOuvrageAuteur=130;
/* ************************************************************* */ 
	function ClicSuiteOuvrageAuteur()
	{
		if(!ClicOuvrageAuteur)
		{
			ClicOuvrageAuteur=true;
			$(document).ready(
				function () 
				{
					DecalageOuvrageAuteur++;
					LeDecalage=0-(DecalageOuvrageAuteur*DeltaOuvrageAuteur);
					$("#LISTEOUVRAGEAUTEUR").animate({ left:LeDecalage},function(){FinClicOuvrageAuteur();});
				}
			);
		}
	}
/* ************************************************************* */ 
	function ClicPrecedentOuvrageAuteur()
	{
		if(!ClicOuvrageAuteur)
		{
			ClicOuvrageAuteur=true;
			$(document).ready(
				function () 
				{
					DecalageOuvrageAuteur--;
					LeDecalage=0-(DecalageOuvrageAuteur*DeltaOuvrageAuteur);
					$("#LISTEOUVRAGEAUTEUR").animate({ left:LeDecalage},function(){FinClicOuvrageAuteur();});
				}
			);
		}
	}
/* ************************************************************* */ 
	function FinClicOuvrageAuteur()
	{
		ClicOuvrageAuteur=false;
		if(DecalageOuvrageAuteur==NbDecalageOuvrageAuteur)
			EtatFLD="hidden";
		else
			EtatFLD="visible";
		if(DecalageOuvrageAuteur==0)
			EtatFLG="hidden";
		else
			EtatFLG="visible";
		
		
			$(document).ready(function () 
			{
				$("#FLECHEG").css({ visibility:EtatFLG});
				$("#FLECHED").css({ visibility:EtatFLD});
			});		
	}
/* ************************************************************* */  
function Change_Video(Ean,IdAut,IdVid)
{
	$(document).ready(function () 
	{			
			LeNomDiv="#VIDEO";

			$.ajax({
			  url: "change_video.php",
			  cache: false,
			  type: "POST",
	      data: ({EAN:Ean,AUT:IdAut,VID:IdVid}),
	      dataType: "text",
			  success: function(uneData){
			    $(LeNomDiv).html(uneData);
			  }
			});
	});
}
/* ************************************************************* */  
function Change_Video_Accueil(IdVid)
{
	$(document).ready(function () 
	{			
			LeNomDiv="#CONTENTVIDEO";

			$.ajax({
			  url: "change_video_accueil.php",
			  cache: false,
			  type: "POST",
	      data: ({VID:IdVid}),
	      dataType: "text",
			  success: function(uneData){
			    $(LeNomDiv).html(uneData);
			  }
			});
	});
}
/* ************************************************************* */  

	function ConseillerOuvrage(Obj)
	{	
		hs.graphicsDir = 'highslide/graphics/';
		hs.showCredits = false;
		hs.align = 'center';
		hs.transitions = ['expand', 'crossfade'];
	  hs.wrapperClassName= 'no-footer draggable-header '
		hs.fadeInOut = false;
		hs.width = 720+10;
		hs.height = 500+50;
 		return hs.htmlExpand(Obj, {objectType: 'iframe'} );
 		
	}
/* ************************************************************* */ 
	function Envoyer_Conseil_Ouvrage()
	{	
		Formulaire=document.FORMENVOICONSEIL;		
	if(Formulaire.PRENOM.value=="")
	{
		alert("Veuillez saisir votre prénom.");
		return false;
	}

	if(Formulaire.NOM.value=="")
	{
		alert("Veuillez saisir votre nom.");
		return false;
	}	
		if(Formulaire.EMAIL.value=="")
		{
			alert("Veuillez saisir votre eMail.");
			return false;
		}
		if(!(eMail_Valide(Formulaire.EMAIL.value)))
		{
			alert("Votre eMail n'est pas valide.");
			return false;
		}
		
	if(Formulaire.PRENOMAMI.value=="")
	{
		alert("Veuillez saisir le prénom de votre ami.");
		return false;
	}

	if(Formulaire.NOMAMI.value=="")
	{
		alert("Veuillez saisir votre nom de votre ami.");
		return false;
	}	
		if(Formulaire.EMAILAMI.value=="")
		{
			alert("Veuillez saisir l'eMail de votre ami.");
			return false;
		}
		if(!(eMail_Valide(Formulaire.EMAILAMI.value)))
		{
			alert("Votre eMail n'est pas valide.");
			return false;
		}
 		Formulaire.submit();	
	}
/* ************************************************************* */ 
	function Imprimer_Fiche_Ouvrage(UneURL)
	{	
		$(document).ready(function () 
		{
				$("#CZONE").attr("src",UneURL);
		});	
	}
/* ************************************************************* */
function Imprime()
{
		window.parent.frames[0].focus();
		window.parent.frames[0].print();
}	
/* ************************************************************* */ 
	function AfficheOnglet(LeOnglet)
	{
		if(OngletFicheCourant!=LeOnglet)
		{
			$(document).ready(function () 
			{
				$("#ONGLET"+OngletFicheCourant).css({ visibility:"hidden"});
				$("#ONGLET"+LeOnglet).css({ visibility:"visible"});
				$("#CONTENUONGLET").html($("#CONTENUONGLET"+LeOnglet).html());
				OngletFicheCourant=LeOnglet;
			});	
		}	
	}
/* ************************************************************* */  
