window.onload=montre;


function montre(id) {

var d = document.getElementById(id);
	for (var i = 1; i<10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}




function quitte(){
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
}

 function confirmer() {
	
		if(confirm('Voulez-vous continuer ?')){
			
			return true;
		}else{
			 
			 return false;
		}
}



function affiche_formulaire(nb){
	
	if(nb==1){
		if(document.getElementById('paragraphe_colloque_e').style.display=="none"){
			document.getElementById('paragraphe_colloque_e').style.display="block";
		}
		else{	
			document.getElementById('paragraphe_colloque_e').style.display="none";
		}
	}else if(nb==2){
		if(document.getElementById('paragraphe_livre_papier').style.display=="none"){
			document.getElementById('paragraphe_livre_papier').style.display="block";
		}
		else{
		document.getElementById('paragraphe_livre_papier').style.display="none";
		}
	}else if(nb==3){
		if(document.getElementById('paragraphe_cd').style.display=="none"){
			document.getElementById('paragraphe_cd').style.display="block";
		}
		else{
			document.getElementById('paragraphe_cd').style.display="none";
		}
	}
}

function supprimer_formulaire(nb){
	alert('ca marche '+nb);
	window.location.href("#");
}


function affiche_adr_fac(){
	var affiche =document.getElementById('paragraphe-facturation').style.display; 
	
	if(document.getElementById('paragraphe-facturation').style.display=="none"){
		
		document.getElementById('paragraphe-facturation').style.display="block";
		}
	else{
		document.getElementById('paragraphe-facturation').style.display="none";
	}
}

function affiche_colloque_e(){
var affiche =document.getElementById('paragraphe_colloque_e').style.display; 
	if(document.getElementById('paragraphe_colloque_e').style.display=="none"){
		document.getElementById('paragraphe_colloque_e').style.display="block";
		}
	else{	
		document.getElementById('paragraphe_colloque_e').style.display="none";
	}
}


function affiche_livre_papier(){
var affiche =document.getElementById('paragraphe_livre_papier').style.display; 
	if(document.getElementById('paragraphe_livre_papier').style.display=="none"){
		document.getElementById('paragraphe_livre_papier').style.display="block";
		}
	else{
/**
 * 		
		document.fiche.p_etat[0].checked=false;
		document.fiche.p_etat[1].checked=false;
		document.fiche.p_etat[2].checked=false;
		document.fiche.p_souscription_prix.value="";
		document.fiche.p_souscription_date.value="";
		document.fiche.p_prix_normal.value="";
		document.fiche.p_nb_pages.value="";
		document.fiche.p_format.value="";
		document.fiche.p_commentaires.value="";
		alert('fichier'+document.fiche.p_photo.value);
		document.fiche.p_photo.value="aucune";
		alert('fichier'+document.fiche.p_photo.value);
 */
		document.getElementById('paragraphe_livre_papier').style.display="none";
	}
}

function affiche_cd(){
var affiche =document.getElementById('paragraphe_cd').style.display; 
	if(document.getElementById('paragraphe_cd').style.display=="none"){
		document.getElementById('paragraphe_cd').style.display="block";
		}
	else{
	/**
 * 	document.fiche.cd_etat[0].checked=false;
		document.fiche.cd_etat[1].checked=false;
		document.fiche.cd_etat[2].checked=false;
		document.fiche.cd_souscription_prix.value="";
		document.fiche.cd_souscription_date.value="";
		document.fiche.cd_prix_normal.value="";
		document.fiche.cd_commentaires.value="";
 */
		document.getElementById('paragraphe_cd').style.display="none";
	}

}


function affiche_pdf(bouton,nb_pdf,nb_pdf_plage,nom){
	var coche=0;
	for (var i=0; i<bouton.length;i++){
		if (bouton[i].checked){
			coche=bouton[i].value;
		}
	}
	

	var nb= nb_pdf*nb_pdf_plage;
	var clique = coche*nb_pdf_plage;
	
	
	for(i=1;i<=nb;i++){
		var affiche="none";
		if(i<=clique){
			affiche="block";
		}
		document.getElementById(nom + '_' + i).style.display=affiche;
	}
}




function AddText(startTag,defaultText,endTag,nom) 
{
	alert('je passe ');
    /**
 * with(document.fiche)
   {
      if (nom.createTextRange) 
      {
         var text;
         nom.focus(nom.caretPos);
         nom.caretPos = document.selection.createRange().duplicate();
         if(nom.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = nom.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            nom.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            nom.caretPos.text = startTag+defaultText+endTag;
      }
      else nom.value += startTag+defaultText+endTag;
   }
 */
}



/*function AddTextA(startTag,defaultText,endTag) 
{
   with(document.fiche)
   {
      if (argument.createTextRange) 
      {
         var text;
         argument.focus(argument.caretPos);
         argument.caretPos = document.selection.createRange().duplicate();
         if(argument.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = argument.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            argument.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            argument.caretPos.text = startTag+defaultText+endTag;
      }
      else argument.value += startTag+defaultText+endTag;
   }
}

function AddTextS(startTag,defaultText,endTag) 
{
   with(document.fiche)
   {
      if (com_sci.createTextRange) 
      {
         var text;
         com_sci.focus(com_sci.caretPos);
         com_sci.caretPos = document.selection.createRange().duplicate();
         if(com_sci.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = com_sci.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            com_sci.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            com_sci.caretPos.text = startTag+defaultText+endTag;
      }
      else com_sci.value += startTag+defaultText+endTag;
   }
}

function AddTextO(startTag,defaultText,endTag) 
{
   with(document.fiche)
   {
      if (com_org.createTextRange) 
      {
         var text;
         com_org.focus(com_org.caretPos);
         com_org.caretPos = document.selection.createRange().duplicate();
         if(com_org.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = com_org.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            com_org.caretPos.text = startTag + sel + endTag + fin;
         }
         else
           com_org.caretPos.text = startTag+defaultText+endTag;
      }
      else com_org.value += startTag+defaultText+endTag;
   }
}

function AddTextC(startTag,defaultText,endTag) 
{
   with(document.fiche)
   {
      if (communication.createTextRange) 
      {
         var text;
         communication.focus(communication.caretPos);
         communication.caretPos = document.selection.createRange().duplicate();
         if(communication.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = communication.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            communication.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            communication.caretPos.text = startTag+defaultText+endTag;
      }
      else communication.value += startTag+defaultText+endTag;
   }
}*/