<!--




var domaine = "http://www.agylsystems.fr";




(function () {
  var escape_old = escape; //ancienne fonction escape
  escape = function (texte)
  {
	texte=escape_old(texte).replace(/\+/g,'%2B');
	return texte;
  };
})();









function getXhr(){
	
		var xhr = null; 
		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; 
		} 
		return xhr
}



function supp_compte(num) {

		if(confirm('Confirmez vous la suppression de cet administrateur ?')){
			
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send('supp_compte=ok&num='+num);
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
				
					   
						 location.reload(true);
						
				
				}}
		}
}



function supp_ref(id) {

		if(confirm('Confirmez vous la suppression de cette référence ?')){
			
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send('supp_ref=ok&id='+id);
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
				
					   
						 location.reload(true);
						
				
				}}
		}
}




function modif_compte(num) {
		
		var email = $('email_'+num).value;
		var mdp = $('mdp_'+num).value;
		var adr_ip = $('adr_ip_'+num).value;
		
		var envoi = 'modif_compte=ok&num='+num+'&email='+escape(email)+'&mdp='+escape(mdp)+'&adr_ip='+escape(adr_ip);
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				
				if(xhr.responseText!="") alert(xhr.responseText);
				
				
		
		}}
		
}




function supp_fichiers_partage(fichier_id){
		
		if(confirm('Confirmez vous la suppression du fichier ?')){
		
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send('supp_fichier_partage=ok&fichier_id='+fichier_id);
				
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
				
						   location.reload(true);
				}}
		
		}
}




function switch_page(valeur){

		if(valeur != "-1")
		document.location="update.php?id="+valeur+"";
		
}




function selectall(theField){

   //var tempval=eval("document.getElementById('"+theField+"'))
   var tempval=theField;
   tempval.focus()
   tempval.select()
}




function supp_img_associee(image_id){

        var xhr = getXhr();
        xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
        xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
        xhr.send('supp_img_associee=ok&image_id='+image_id);
		
        
        xhr.onreadystatechange = function(){
        if(xhr.readyState == 4 && xhr.status == 200){
		
				   location.reload(true);
        }}

}

function supp_fichier_associe(fichier_id){

        var xhr = getXhr();
        xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
        xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
        xhr.send('supp_fichier_associee=ok&fichier_id='+fichier_id);
		
        
        xhr.onreadystatechange = function(){
        if(xhr.readyState == 4 && xhr.status == 200){
		
				   location.reload(true);
        }}
}

function duplique_theme(id) {
		
		var envoi = "duplique_theme=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
		
				   document.location="perso_design.php?id="+xhr.responseText;
		}}
}

function switch_hidden_value(ele, id) {
		
		var hexadecimal = document.getElementById('input_'+ele).value;
		var hidden = document.getElementById('hidden_'+ele);
		
	
		var envoi = "switch_hidden_value=ok&hexadecimal="+escape(hexadecimal);
		
		if(hexadecimal=="")
		Effect.toggle('switch_'+ele,'blind', {duration:0.8});
		else {
				
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send(envoi);
				
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
				
						   if(xhr.responseText=="") {
						   		
								if(hexadecimal!="") { 
										document.getElementById(ele).style.background="#"+hexadecimal;
										hidden.value = "#"+hexadecimal;
								}
								Effect.toggle('switch_'+ele,'blind', {duration:0.8});
						   }
						   else
						   alert(xhr.responseText);
				}}
		}
		
	
		
}


function reset_textarea(id) {
		
		var envoi = "reset_textarea=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				
				location.reload(true);
		}}
}


function supp_theme_perso(id) {
		
		if(confirm('Confirmez vous la suppression du thème ?')){
				
				var envoi = "supp_theme_perso=ok&id="+id;
		
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send(envoi);
				
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
							
						
						location.reload(true);
				}}
		}
		
		
}



function supp_page(id) {
		
		if(confirm('Confirmez vous la suppression de la page ?')){
				
				var envoi = "supp_page=ok&id="+id;
		
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send(envoi);
				
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
							
						
						location.reload(true);
				}}
		}		
}


function select_type_page(val) {
		
		if(val==2 || val==3) {
				$('bloc_contact').style.display="none";		
				$('bloc_externe').style.display="block";
		}
		else if(val==5) {
				$('bloc_contact').style.display="block";
				$('bloc_externe').style.display="none";
		}
		else {
				$('bloc_contact').style.display="none";			
				$('bloc_externe').style.display="none";
		}
}

function select_niveau_page(id, niveau) {
		
		var envoi = "select_niveau_page=ok&id="+id+"&niveau="+niveau;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				if(niveau==1) {
						
						//actualiser partie2
						$("partie2").innerHTML = xhr.responseText;
				}
				else if(niveau==2) {
						
						//actualiser partie3
						$("partie3").innerHTML = xhr.responseText;
				}
				///location.reload(true);
		}}
}



function ajout_champ_formulaire(id) {
		
		var type_champ = $('type_champ').value;
		var nom_champ = $('nom_champ').value;
		var envoi = "ajout_champ_formulaire=ok&id="+id+"&type_champ="+type_champ+"&nom_champ="+escape(nom_champ);
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				if(xhr.responseText!="") alert(xhr.responseText);
				else
				location.reload(true);
		}}
}


function supp_champ_formulaire(id, r_id) {
		
		var envoi = "supp_champ_formulaire=ok&id="+id+"&r_id="+r_id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				
				location.reload(true);
		}}
}

function gerer_captcha_formulaire_contact(id) {
		
		
		var envoi = "gerer_captcha_formulaire_contact=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				
				location.reload(true);
		}}
}

function monter_champ(id) {
		
		var envoi = "monter_champ=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				//alert(xhr.responseText);
				location.reload(true);
		}}
}

function baisser_champ(id) {
		
		var envoi = "baisser_champ=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				//alert(xhr.responseText);
				location.reload(true);
		}}
}

function baisser_ordre_page(id) {
		
		var envoi = "baisser_ordre_page=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				//alert(xhr.responseText);
				location.reload(true);
		}}
}

function monter_ordre_page(id) {
		
		var envoi = "monter_ordre_page=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				//alert(xhr.responseText);
				location.reload(true);
		}}
}

function obligatoire_champ(id) {
		
		var envoi = "obligatoire_champ=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				//alert(xhr.responseText);
				location.reload(true);
		}}
}

function baisser_barre_navi_ele(id, type) {
		
		var envoi = "baisser_barre_navi_ele=ok&id="+id+"&type="+type;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				//alert(xhr.responseText);
				location.reload(true);
		}}
}

function monter_barre_navi_ele(id, type) {
		
		var envoi = "monter_barre_navi_ele=ok&id="+id+"&type="+type;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				//alert(xhr.responseText);
				location.reload(true);
		}}
}

function supp_barre_navi_ele(id, type) {
		
		var envoi = "supp_barre_navi_ele=ok&id="+id+"&type="+type;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				
				location.reload(true);
		}}
}


function switch_centre(id) {
		
		var nbr = $('nbr_item_menu').value;
		
		
		$('item_menu_'+id).style.display = "inline";
		
		for(i=1;i<=nbr;i++) 
		if(i!=id) $('item_menu_'+i).style.display = "none";
}


function dev_pages_enfants_1(id) {
		
		//-- On cache tous les blocs et on affiche le bloc de l'ID
		
		$$('.display-block').each(function (el,i){
				
				
				if(document.all) el.setAttribute("className", "display-none");
				else el.setAttribute("class", "display-none");
		});
		
		$$('.display-block-').each(function (el,i){
				
				
				if(document.all) el.setAttribute("className", "display-none-");
				else el.setAttribute("class", "display-none-");
		});
		
		if(document.all) $('niv2-'+id).setAttribute("className", "display-block");
		else $('niv2-'+id).setAttribute("class", "display-block");
}

function dev_pages_enfants_2(id) {
		
		//-- On cache tous les blocs et on affiche le bloc de l'ID
		
		$$('.display-block-').each(function (el,i){
				
				
				if(document.all) el.setAttribute("className", "display-none-");
				else el.setAttribute("class", "display-none-");
		});
		
		if(document.all) $('niv2-'+id).setAttribute("className", "display-block-");
		else $('niv2-'+id).setAttribute("class", "display-block-");
}




function active_page(id) {
		
		var envoi = "active_page=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				//alert(xhr.responseText);
				location.reload(true);
		}}
}


function navi_principale(id, type) {
		
		var envoi = "navi_principale=ok&id="+id+"&type="+type;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				if(xhr.responseText!="")
				alert(xhr.responseText);
				else
				location.reload(true);
		}}
}

function ajout_optionlist(id) {
		
		var nom = $('nom_option_'+id).value;
		
		var envoi = "ajout_optionlist=ok&id="+id+"&nom="+escape(nom);
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				if(xhr.responseText!="")
				alert(xhr.responseText);
				else
				location.reload(true);
		}}
}

function supp_optionlist(id) {
		
		var envoi = "supp_optionlist=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				
				location.reload(true);
		}}
}

function modif_optionlist(id) {
		
		var option = $('option_list_'+id).value;
		
		var envoi = "modif_optionlist=ok&id="+id+"&option="+escape(option);
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				
				if(xhr.responseText=="xxx_vide_xxx") {
						
						$('option_list_'+id).style.display = 'none';
						$('option_'+id).style.display = 'inline';
				}
				
				else {
					
						$('nom_option_'+id).innerHTML = option;
						$('option_list_'+id).style.display = 'none';
						$('option_'+id).style.display = 'inline';
				}
				
		}}
}

function modif_titre_rotator(id) {
		
		var titre = $('modif_titre_'+id).value;
		
		var envoi = "modif_titre_rotator=ok&id="+id+"&titre="+escape(titre);
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				
				if(xhr.responseText=="xxx_vide_xxx") {
						
						$('modif_titre_'+id).style.display = 'none';
						$('titre_'+id).style.display = 'inline';
				}
				
				else {
					
						$('titre_'+id).innerHTML = titre;
						$('modif_titre_'+id).style.display = 'none';
						$('titre_'+id).style.display = 'inline';
				}
				
		}}
}

function modif_txt_rotator(id) {
		
		var txt = $('modif_txt_'+id).value;
		
		var envoi = "modif_txt_rotator=ok&id="+id+"&txt="+escape(txt);
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				
				if(xhr.responseText=="xxx_vide_xxx") {
						
						$('modif_txt_'+id).style.display = 'none';
						$('txt_'+id).style.display = 'inline';
				}
				
				else {
					
						$('txt_'+id).innerHTML = txt;
						$('modif_txt_'+id).style.display = 'none';
						$('txt_'+id).style.display = 'inline';
				}
				
		}}
}

function baisser_rotator_item(id) {
		
		var envoi = "baisser_rotator_item=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				//alert(xhr.responseText);
				location.reload(true);
				
		}}
}

function monter_rotator_item(id) {
		
		var envoi = "monter_rotator_item=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				//alert(xhr.responseText);
				location.reload(true);
				
		}}
}

function add_model_champ() {
		
		
		var nouveau_champ = $('nouveau_champ').value;
		
		if(nouveau_champ=='') alert('Merci de saisir un intitulé');
		else {
				
				var type_champ = $('type_champ').value; 
		
				var nbr_champ = $("nbr_champ_model").value;
				nbr_champ = parseInt(nbr_champ);
				nbr_champ = nbr_champ + 1;
				
				
				var p = document.createElement("p");
				p.setAttribute("id", "p_"+nbr_champ);
				
				var span = document.createElement("span");
				var strong = document.createElement("strong");
				var txt1 = document.createTextNode(nouveau_champ+' ');
				
				strong.appendChild(txt1);
				span.appendChild(strong);
				p.appendChild(span);
				
				var span = document.createElement("span");
				
				if(type_champ==1)
				var txt1 = document.createTextNode("(champ texte) ");
				else if(type_champ==2)
				var txt1 = document.createTextNode("(champ multiligne) ");
				
				
				span.appendChild(txt1);
				p.appendChild(span);
				
				
				var input = document.createElement("input");
				input.setAttribute("type", "hidden");
				input.setAttribute("name", "intitule_"+nbr_champ);
				input.setAttribute("value", nouveau_champ);
				
				p.appendChild(input);
				
				var input = document.createElement("input");
				input.setAttribute("type", "hidden");
				input.setAttribute("name", "type_de_id"+nbr_champ);
				input.setAttribute("value", type_champ);
				
				p.appendChild(input);
				
				
				var a = document.createElement("a");
				a.setAttribute("href", "#");
				a.addEvent('click', function(e) {
						  
								remove_un_model_element(nbr_champ);
								
						  
						});
				var img = document.createElement("img");
				img.setAttribute("alt", "supprimer");
				img.setAttribute("src", "../img/autoprint/button_vider.png");
				a.appendChild(img); 
				
				p.appendChild(a);
				
				
				/*<p>
						<span>NOM</span> <input type="hidden" value="NOM" id="intitule_1" /> <input type="hidden" value="1 ou 2" id="type_de_id_887" /> <a href="" onclick="">supp</a>
				</p>*/
				$("area_champs").appendChild(p);
			
				
				
				$("nbr_champ_model").value = nbr_champ;
				
				$('nouveau_champ').value = "";
		}
		
		
		
		
}


function remove_un_model_element(i) {
		
		$('p_'+i).remove();
		var nbr_champ = $("nbr_champ_model").value;
		nbr_champ = parseInt(nbr_champ);
		nbr_champ = nbr_champ - 1;
		$("nbr_champ_model").value = nbr_champ;
}


function switch_model(id) {
		
		var envoi = "switch_model=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				
				$('model_switch_area').innerHTML = xhr.responseText;
				
		}}
}

function add_img_area() {
		
		
		var nbr_area_img = document.getElementById("nbr_img_area").value;
		nbr_area_img = parseInt(nbr_area_img);
		
		var cont = "";
		
		for(i=1;i<=(nbr_area_img+1);i++) {
		
				cont += '<p><label>Joindre une image : </label><br /><input type="file" name="img['+i+']" class="reaction" /></p>';
		
		}
		
		document.getElementById("area_img").innerHTML = cont;
	
		
		nbr_area_img = nbr_area_img + 1;
		document.getElementById("nbr_img_area").value = nbr_area_img;
		
		
}

function add_doc_area() {
		
		
		var nbr_area_img = document.getElementById("nbr_doc_area").value;
		nbr_area_img = parseInt(nbr_area_img);
		
		var cont = "";
		
		for(i=1;i<=(nbr_area_img+1);i++) {
		
				cont += '<p><label>Joindre un document : </label><br /><input type="file" name="doc['+i+']" class="reaction" /><br /><label>Titre du document : </label><br /><input type="text" name="titre_doc['+i+']" class="reaction" /></p>';
		
		}
		
		document.getElementById("area_doc").innerHTML = cont;
	
		
		nbr_area_img = nbr_area_img + 1;
		document.getElementById("nbr_doc_area").value = nbr_area_img;
		
		
}

function supp_fiche(id) {
		
		if(confirm('Confirmez vous la suppression de cette fiche ?')){
				
				var envoi = "supp_fiche=ok&id="+id;
		
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send(envoi);
				
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
						
						alert("Fiche supprimée");
						location.reload(true);
						
				}}
		}
	
}

function supp_img_fiche(id) {
		
		if(confirm('Confirmez vous la suppression de cette image ?')){
				
				var envoi = "supp_img_fiche=ok&id="+id;
		
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send(envoi);
				
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
						
						alert("Image supprimée");
						location.reload(true);
						
				}}
		}
}

function supp_doc_fiche(id) {
		
		if(confirm('Confirmez vous la suppression de ce document ?')){
				
				var envoi = "supp_doc_fiche=ok&id="+id;
		
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send(envoi);
				
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
						
						alert("Document supprimé");
						location.reload(true);
						
				}}
		}
}


function supp_cate_catalogue(id) {
		
		if(confirm('Confirmez vous la suppression de cette catégorie ?')){
				
				var envoi = "supp_cate_catalogue=ok&id="+id;
		
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send(envoi);
				
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
						
						if(xhr.responseText!="")
						alert(xhr.responseText);
						else {
							alert("Catégorie supprimée");
							location.reload(true);
						}
						
						
						
				}}
		}
}


function supp_model(id) {
		
		if(confirm('Confirmez vous la suppression de ce modèle ?')){
				
				var envoi = "supp_model=ok&id="+id;
		
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send(envoi);
				
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
						
						if(xhr.responseText!="")
						alert(xhr.responseText);
						else {
							alert("Modèle supprimé");
							location.reload(true);
						}
						
						
						
				}}
		}
}

function modif_intro_cate(id) {
		
		var intro = $('intro_cate_'+id).value;
		var envoi = "modif_intro_cate=ok&id="+id+"&intro="+escape(intro);
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				
			alert("Introduction modifiée");
			location.reload(true);
				
				
				
				
		}}
}

function baisser_cate_catalogue(id) {
		
		
		var envoi = "baisser_cate_catalogue=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				
			
			location.reload(true);
				
				
				
				
		}}
}

function monter_cate_catalogue(id) {
		
		
		var envoi = "monter_cate_catalogue=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
				
				
			
			location.reload(true);
				
				
				
				
		}}
}

function show_msg(id) {
		
		var envoi = "show_msg=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				$('msg').setStyle('display','block'); $('liste_msg').setStyle('display','none');
				$('le_msg').innerHTML = xhr.responseText;
		}}
}

function show_msg_lu(id) {
		
		var envoi = "show_msg_lu=ok&id="+id;
		
		var xhr = getXhr();
		xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(envoi);
		
		
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
					
				$('msg_lu').setStyle('display','block'); $('liste_msg_lu').setStyle('display','none');
				$('le_msg_lu').innerHTML = xhr.responseText;
		}}
}

function supp_msg(id) {
		
		if(confirm('Confirmez vous la suppression de message ?')){
				
				var envoi = "supp_msg=ok&id="+id;
		
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send(envoi);
				
				
				xhr.onreadystatechange = function(){
				if(xhr.readyState == 4 && xhr.status == 200){
							
						if($('supp_contact_messages_lu_'+id)) $('supp_contact_messages_lu_'+id).remove();
						if($('supp_contact_messages_'+id)) $('supp_contact_messages_'+id).remove();
				}}
		}
}

function ensemble(){
		
			
		if($('hidden_page_partage')) {
			
				
				
				var un_item = $$('.partage_item');
		
				un_item.each (function(el) {
						
						var elChild = el.getChildren();

						
						var btn = el.getElement('a.get-file');
						var partage_id = el.getElement('input.partage_id');
						
						
						
						btn.addEvent('click', function(e){ 
								
								//alert(webapp_id.value);
								var url = domaine+"/include/gestion_ajax.php";
								var options = {
									
										
										method : 'post',
										data : {
						
												'partage_cpt_clic':'ok',
												'num':''+escape(partage_id.value)+''
									
										},
										onSuccess:function(){
												
												//document.location=webapp_url.value;
												
												//alert(this.response.text);
										}

										
								};
								var monObjetAjax= new Ajax(url, options);
								monObjetAjax.request();
								
								

						});
						


				});
					  

		}
}




window.onload=function(){
		
		
		if($('rotator')) {
				
				var left_visuel = "38px";
				var left_texte = "585px";
				
				var rotate = new rotator($("rotator"),$$(".rotatorTitle"),$$(".rotatorContent"), $$(".rotatorTexte"), {
		 
						onActive:function(toggler) {
							
							$$(".rotatorContent").setStyle("left",left_visuel);
							$$(".rotatorTexte").setStyle("left",left_texte);
							
							toggler.addEvent('mouseover', function() { this.fireEvent('click'); });
							toggler.addEvent('click', function() { this.fireEvent('onRStop'); });
							//toggler.addEvent('mouseenter', function() { this.fireEvent('click'); });
							
						},
						
						
				 
						onBackground:function(toggler) {
							
							$$(".rotatorContent").setStyle("left",left_visuel);
							$$(".rotatorTexte").setStyle("left",left_texte);
							
							toggler.addEvent('mouseover', function() { this.fireEvent('click'); }); 
							toggler.addEvent('click', function() { this.fireEvent('onRStop'); });
							
							
						},
						rotatorDuration:10000,
						duration:500,
						transition:Fx.Transitions.Sine.easeOut
						//transition:Fx.Transitions.Sine.easeIn
						//transition:Fx.Transitions.Bounce.easeOut
						//transition:Fx.Transitions.Expo.easeOut
						//transition:Fx.Transitions.Circ.easeOut
						//transition:Fx.Transitions.Back.easeOut
						//transition:Fx.Transitions.Elastic.easeIn
				 
				});
		}
		
		
		
		
		
		
		/*
		var accordion;
		var accordionTogglers;
		var accordionContents;
		
	
		
		accordionTogglers = document.getElementsByClassName('toggler1');
		
		accordionContents = document.getElementsByClassName('content1');
		
		
		accordion = new Fx.Accordion(accordionTogglers, accordionContents,{
						
						//when an element is opened change the
						//background color to blue
						onActive: function(toggler){
								//toggler.fx.toColor('#6899CE');
								
								
								
								var a = toggler.getElement('a.bbb');
								a.style.color = 'white';
								
								var img = toggler.getElement('img.icn-navi-niv1-inactive');
								img.style.display='none';
								var img = toggler.getElement('img.icn-navi-niv1-active');
								img.style.display='inline';
								
						
						},
						onBackground: function(toggler){
						//change the background color to the original (green)
						//color when another toggler is pressed
						//toggler.setStyle('background-color', '#FFF');
								var a = toggler.getElement('a.bbb');
								a.style.color = '#515A63';
								
								var img = toggler.getElement('img.icn-navi-niv1-inactive');
								img.style.display='inline';
								var img = toggler.getElement('img.icn-navi-niv1-active');
								img.style.display='none';
								
						}
				});
				
		
		
		
		*/
		
		
		if($('map')) {
				
				var r_id = $('r_id').value;
				var envoie = "recup_adresse=ok&r_id="+r_id;
				var xhr = getXhr();
				xhr.open("POST", domaine+"/include/gestion_ajax.php",true);
				xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xhr.send(envoie);
				
				xhr.onreadystatechange = function() {
				if(xhr.readyState == 4 && xhr.status == 200) {
						
						if(xhr.responseText!="") {
								
								var adresse = xhr.responseText;
								var map = null;
								var geocoder = null;
								
							
								
								
								function load() {
								  if (GBrowserIsCompatible()) {
									  
									var options = {
										size: new GSize(400, 300)
									};
									
									map = new GMap2($("map"), options);
									map.addControl(new GMapTypeControl());
									//map.addControl(new GLargeMapControl());
									map.addControl(new GSmallZoomControl());
									//map.setCenter(new GLatLng(37.4419, -122.1419), 13);
									geocoder = new GClientGeocoder();
								  }
								}
							
								function showAddress(address) {
								  if (geocoder) {
									geocoder.getLatLng(
									  address,
									  function(point) {
										var plan_dacces = $("map");  
										if (!point) {
										  //alert(address + " n'existe pas. Modifiez la situation.");
										  
										  
										  
										  
											
										} else {
											
										  map.setCenter(point, 16);
										  var marker = new GMarker(point);
										  map.addOverlay(marker);
										  marker.openInfoWindowHtml(address);
										  plan_dacces.style.display="block";
										  $('titre_plan_acces').style.display="block";
										}
									  }
									);
								  }
								}
								
								load();
								
								
								showAddress(adresse);
								
								
								return false;
						}
						
						
						
				}}
				
				
				
		}
		
		
		
		ensemble();
		
}


-->
