		//***************************************************************************
		//CETTE FONCTION PERMET DE RELOADER UNE PAGE
		//***************************************************************************				

		function reloaderPage(obj, id_champ)
		{
			var reponse = HttpResponse("text",obj);	
			if (reponse!=false)
			{
				document.location.reload();
			}
		}
		
		function chargementFormulaire(obj, id_champ)
		{
			var reponse = HttpResponse("text",obj);	
			if (reponse!=false)
			{

			}
		
		}
   
		function openSpanAjax(lien,cache)
		{
			
			//on passe en paramétre l'url du script qui va etre appele via ajax
			var url = lien;	
			
			//on instancie l'objet
			var obj_ajax=new PFW_AJAX(url);
			if(cache != '')
			{
				obj_ajax.CacheMode			= 'auto';
			}
			obj_ajax.HTTPrequest();
		
				
		}		
		//***************************************************************************
		//CACHE UN DIV
		//***************************************************************************		
		function hide(cible)
		{
			document.getElementById(cible).style.display='none';
		}		
		
		
		
		//***************************************************************************
		//AFFICHE UN DIV
		//***************************************************************************		
		function show(cible)
		{
			document.getElementById(cible).style.display='block';
		}		


		//***************************************************************************
		//AFFICHE/CACHE SECTION ET CHANGE ETAT BOUTTON
		//***************************************************************************
		function show_recur(bool, i)
		{
			var section = get_object('section_'+i);
			var montrer = get_object('montrer_'+i);
			var cacher = get_object('cacher_'+i);
			section.style.display='none';
			cacher.style.display='none';
			montrer.style.display='inline';
			if (bool)
			{
				section.style.display='inline';
				cacher.style.display='inline';
				montrer.style.display='none';
			}
		}
		
		function get_object(name)
		{
			if (document.getElementById)
			{
				return document.getElementById(name);
		 	}
		 	else if (document.all)
			{
		  		return document.all[name];
		 	}
		 	else if (document.layers)
			{
		  		return document.layers[name];
			}
			return false;
		}	

		//***************************************************************************
		//PERMET SOIT D AFFICHER OU CACHER UN DIV SELON SON ETAT 
		//***************************************************************************	
		function afficheElementById(identifiant) 
		{

			if (getStyle(identifiant, 'display') == "none") 
			{

		    	show(identifiant);
		    } 
		    else 
			{
		    	hide(identifiant);
			}
		}



		
		//***************************************************************************
		//RECUPERE LA VALEUR D UNE PROPRIETE CSS D UN ELEMENT ID
		//***************************************************************************	
		function getStyle(elt,pro)
		{
		var element = document.getElementById(elt);
		
		if (window.getComputedStyle) // Mozilla Firefox & cie
		
		{
		
		var propriete = window.getComputedStyle(element,null).getPropertyValue(pro);
		
		}
		
		else if (element.currentStyle) // Microsoft Internet Explorer
		
		{
		
		// Formatage (IE) de la propriété CSS
		
		while (pro.indexOf('-') != -1) 
		
		{
		
		var lettresuivtiret = pro.charAt(pro.indexOf('-')+1);
		
		pro = pro.replace(/-\S{1}/,lettresuivtiret.toUpperCase());
		
		}
		
		var propriete = eval('element.currentStyle.'+pro);
		
		}
		return propriete;
		}

		//**************************************************************************************
		//CETTE FONCTION PERMET D'AFFICHER LE FORMULAIRE DE MODIFICATION D UN CONTACT OU D AJOUT
		//**************************************************************************************
		function openContacts(lien, parametres, i)
		{

			afficheElementById(i); 
			HttpRequest(lien,DefaultAction, parametres, i);
		}	

		//**************************************************************************************
		//ACTIVE LE LIVESEARCH... ATTENTION PENSER A INITIALISER LA VARIABLE TYPE DANS LA PAGE
		//**************************************************************************************		
		function recherche()
		{
			var sep = '@*@';
			document.searchform.concat.value = document.getElementById('param').value + '@@@@' + document.getElementById('id_type_aff').value + '@@@@' + document.searchform.nom.value+sep+document.searchform.prenom.value+sep+document.searchform.surnom.value+sep+document.searchform.societe.value+sep+document.searchform.tel.value+sep+document.searchform.mobile.value;
			var  sh = document.getElementById("LSShadow");  
			sh.innerHTML = "<center><br><br><img src='../images/ajax-loader2.gif'></center>";		
			liveSearchStart(); //modif ici
		}
	
		//cette fonction permet juste de fermer la popup et de remplir les champs de la fenetre appelante
		//on lui passe la string contenant toutes les infos du contact et le pref qui est le prefixe des champs ex : contact_ 
		function choisirContact(id_contact, param)
		{		
			if(param==0)
			{	
				param='';
			}	

			if(window.opener.document.getElementById("id_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("id_contact"+param).value=document.getElementById("id_"+id_contact).value;
			}

			if(window.opener.document.getElementById("civilite_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("civilite_contact"+param).value=document.getElementById("civilite_"+id_contact).value;
			}

			if(window.opener.document.getElementById("nom_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("nom_contact"+param).value=document.getElementById("nom_"+id_contact).value;
			}
			
			if(window.opener.document.getElementById("prenom_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("prenom_contact"+param).value=document.getElementById("prenom_"+id_contact).value;
			}
			
			if(window.opener.document.getElementById("surnom_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("surnom_contact"+param).value=document.getElementById("surnom_"+id_contact).value;
			}
			
			if(window.opener.document.getElementById("societe_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("societe_contact"+param).value=document.getElementById("societe_"+id_contact).value;
			}

			if(window.opener.document.getElementById("email_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("email_contact"+param).value=document.getElementById("email_"+id_contact).value;
			}
			
			if(window.opener.document.getElementById("fonction_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("fonction_contact"+param).value=document.getElementById("fonction_"+id_contact).value;
			}			
			
			if(window.opener.document.getElementById("tel_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("tel_contact"+param).value=document.getElementById("tel_"+id_contact).value;
			}						
			
			if(window.opener.document.getElementById("fax_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("fax_contact"+param).value=document.getElementById("fax_"+id_contact).value;
			}						

			if(window.opener.document.getElementById("mobile_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("mobile_contact"+param).value=document.getElementById("mobile_"+id_contact).value;
			}						

			if(window.opener.document.getElementById("msn_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("msn_contact"+param).value=document.getElementById("msn_"+id_contact).value;
			}						

			if(window.opener.document.getElementById("skype_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("skype_contact"+param).value=document.getElementById("skype_"+id_contact).value;
			}						

			if(window.opener.document.getElementById("adr1_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("adr1_contact"+param).value=document.getElementById("adr1_"+id_contact).value;
			}					

			if(window.opener.document.getElementById("adr2_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("adr2_contact"+param).value=document.getElementById("adr2_"+id_contact).value;
			}					

			if(window.opener.document.getElementById("adr3_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("adr3_contact"+param).value=document.getElementById("adr3_"+id_contact).value;
			}					

			if(window.opener.document.getElementById("cp_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("cp_contact"+param).value=document.getElementById("cp_"+id_contact).value;
			}					
			if(window.opener.document.getElementById("ville_contact"+param)!=undefined)
			{
				window.opener.document.getElementById("ville_contact"+param).value=document.getElementById("ville_"+id_contact).value;
			}					

			window.close();
		}
		
		function changeAction(name_formulaire, action_formulaire, target)
		{
			if(target)
			{
				document.forms[name_formulaire].target = target;
			}
				
			document.forms[name_formulaire].action = action_formulaire;
			document.forms[name_formulaire].submit();
		}

		







function CheckAll(name_form)
{
count = document.forms[name_form].elements.length;
    for (i=0; i < count; i++) 
	{
		if (document.forms[name_form].elements[i].name != "contact")
		{
			document.forms[name_form].elements[i].checked = true; 			
		}
	}
}

function UnCheckAll(name_form)
{
count = document.forms[name_form].elements.length;
    for (i=0; i < count; i++) 
	{
		if (document.forms[name_form].elements[i].name != "contact")
		{
	    	document.forms[name_form].elements[i].checked = false; 
	    }
	}
}
















































				
		////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////
		//FONCTION A GARDER POUR PIOCHER DEDANS
		////////////////////////////////////////////////////////////////////////////////
		function addLigneContact(destination_id, reponse) 
		{
			var param_ligne=reponse.split('&');
			
			var nom=param_ligne[0];
			var prenom=param_ligne[1];
			var societe=param_ligne[2];
			var tel=param_ligne[3];
			var mobile=param_ligne[4];	
			
			
						   
		   	var destination = document.getElementById(destination_id);
		    
		   	var newtr = document.createElement('tr');
		   	var newtd1 = document.createElement('td');
		   	var newtd2 = document.createElement('td');
		   	var newtd3 = document.createElement('td');
		   	var newtd4 = document.createElement('td');
		   	var newtd5 = document.createElement('td');
		   	var newtd6 = document.createElement('td');
		   
			//recup des datas de chaque td source
		     
			// affectation des donnees dans les td de destination
		   	newtd1.innerHTML = '&nbsp;';
 		  	newtd2.innerHTML = nom;
			newtd3.innerHTML = prenom;
		   	newtd4.innerHTML = societe;
		   	newtd5.innerHTML = tel;
		   	newtd6.innerHTML = mobile;
		   
		   // incrustation des td dans le tr
		   newtr.appendChild(newtd1);
		   newtr.appendChild(newtd2);
		   newtr.appendChild(newtd3);
		   newtr.appendChild(newtd4);
		   newtr.appendChild(newtd5);
		   newtr.appendChild(newtd6);
		   
		   // on insere la ligne dans le tableau
		   document.getElementById(destination_id).appendChild(newtr);
		   //destination.parentNode.insertBefore(newtr, destination); 
		   
		 }		
		 
		//***************************************************************************
		//CETTE FONCTION PERMET DE DEFINIR L ACTION A EFFECTUEE APRES L ENREGISTREMENT  D UN CONTACT
		//***************************************************************************		
		function rafraichirVisuContact(lien, parametres, id_divmodif, id_divvisu, action)
		{

			HttpRequest(lien, action , parametres, id_divvisu);
		}
		

		//***************************************************************************
		//MODIFIE UNE LIGNE
		//***************************************************************************			
		function modifLigne(obj, id_champ)
		{
		
			reponse = HttpResponse("text",obj);	
			if (reponse!=false)
			{
				var param_ligne=reponse.split('&');
				document.getElementById('nom_'+id_champ).innerHTML=param_ligne[0];
				document.getElementById('prenom_'+id_champ).innerHTML=param_ligne[1];
				document.getElementById('societe_'+id_champ).innerHTML=param_ligne[2];
				document.getElementById('tel_'+id_champ).innerHTML=param_ligne[3];
				document.getElementById('mobile_'+id_champ).innerHTML=param_ligne[4];								
			}
		}	

		//***************************************************************************
		//MODIFIE UNE LIGNE
		//***************************************************************************			
		function AjouterLigne(obj, id_champ)
		{
		
			reponse = HttpResponse("text",obj);	
			if (reponse!=false)
			{
				addLigneContact('liste_contact', reponse); 
			}
		}	
		/**
		 * Retourne les paramÃ¨tres par dÃ©faut d'un popin
		 * 
		 * @author cdolivet
		 * @since 1.0 - 30/11/2007
		 * @return Array Tableau de paramÃ¨tre Ã  passer Ã  la fonction popin.open()
		 */
		function get_popin_params()
		{
		 var params= new Array();
		 params['bg_color']= '#000';
		 params['bg_opacity']= 0.3;
		 // cache les select sous IE6
		 params['style']= 'select{visibility:visible !important; visibility:hidden;} ';
		 // cache les pub flash
		 params['style']+= 'object, embed{visibility:hidden;} ';
		 
		 return params
		}	
		
		//*******************************************************************************
		//**PERMET D'AFFICHER LES MESSAGES D'AVERTISSEMENT
		//*******************************************************************************
		function affiche(lib,lien) 
		{ 
			if (confirm(""+lib+"")) 
			{
				document.location.href=lien;
			}
		}
		
		
		function afficheSubmit(lib)
		{
			if (confirm(""+lib+"")) 
			{
				return true;
			}
			else
			{
				return false;
			}	
		}
						 			
		function zolLienAjax(url, showhide, popin)			
		{

			if(popin != '')
			{
				 window.popin_reaction= new PFW_Popin();
				 var params= get_popin_params();
				 params['width']  = '1000px';
				 window.popin_reaction.open('popin_reaction', params);		

			}
			//on instancie l'objet
			var obj_ajax=new PFW_AJAX(url);
			if(showhide != '')
			{
				afficheElementById(showhide);
			}

			obj_ajax.action_debut_ATTENTE = function()
			{
				if(document.getElementById('popup')!=undefined)		
				{

					document.getElementById('popup').style.display='inline';
				}
			}
			
			obj_ajax.action_fin_ATTENTE = function()
			{
				if(document.getElementById('popup')!=undefined)		
				{
					document.getElementById('popup').style.display='none';
				}
			}
			if(popin != '')	
			{			
				obj_ajax.action_OK_old= obj_ajax.action_OK;
				obj_ajax.action_OK= function()
				{
					this.action_OK_old();
					
					window.popin_reaction.set_moving_element("popmove");
				}			
			}	
	
			obj_ajax.HTTPrequest();		

		}	 			
		
		function zolAjax(url_ajax, id_form, popin_close, method)
		{
			//on passe en paramétre l'url du script qui va etre appele via ajax
			var url = url_ajax;	
			
			//on instancie l'objet
			var obj_ajax=new PFW_AJAX(url);
			
			//On recupere tous les champs du formulaires... et on les passe dans l'URL 
			if(method == 'GET')
			{
				obj_ajax.url += "?"+PFW_getQueryString(id_form);
			}
			else
			{
				obj_ajax.setParametres(PFW_getQueryString(id_form));
			}		
			

			obj_ajax.action_debut_ATTENTE = function()
			{
				if(document.getElementById('popup')!=undefined)		
				{

					document.getElementById('popup').style.display='inline';
				}
			}
			
			obj_ajax.action_fin_ATTENTE = function()
			{
				if(document.getElementById('popup')!=undefined)		
				{
					document.getElementById('popup').style.display='none';
				}
			}
			if(popin_close != '')
			{
				obj_ajax.action_OK_old= obj_ajax.action_OK;
				obj_ajax.action_OK= function()
				{
					this.action_OK_old();
					popin_reaction.close();
				}			
			}

			obj_ajax.HTTPrequest();
		}	
		
		var calendrier=false; 
		function zolCalendar(name_cal)
		{
	
			if(!calendrier)
			{
				calendrier =new PFW_Calendrier()
				calendrier.set_param({'custom_css': 'a {color: red}'});
			}
			calendrier.open(name_cal);
			return false;
		}	 			
