//--

function LoadJSServiceEspaceMembres()
	{
		
	//--
	
	var_item 	= getParamValue("item",anchorTmp);
	var_action 	= getParamValue("action",anchorTmp);
	
	if(var_item==false)
		var_item = 0;

	//--
	
	if (anchorTmp.match("page_sw=send_newsletter"))
		{
	
		//--
		
		var id_client = "1";
	
		//--
		
		tinyMCE.init({
			// General options
			mode : "exact",
			theme : "advanced",
			elements : "message",
			extended_valid_elements : "iframe[name|src|framespacing|border|frameborder|scrolling|title|height|width]",
			language : "fr",
			plugins : "safari,style,layer,table,advhr,advimage,advlink,emotions,iespell,inlinepopups,preview,searchreplace,print,contextmenu,directionality,noneditable,nonbreaking,xhtmlxtras,template,futureimage",
	
			// Theme options
			theme_advanced_buttons1 : "fontselect,fontsizeselect,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor,bullist,numlist,",
			theme_advanced_buttons2 : "outdent,indent,link,unlink,hr,code,image,imagefichier,emotions",
			theme_advanced_buttons3 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : false,
			content_css : "css/content.css",
			template_external_list_url : "lists/template_list.js",
			external_link_list_url : "lists/link_list.js",
			external_image_list_url : "lists/image_list.js",
			media_external_list_url : "lists/media_list.js",
			relative_urls : false,
			remove_script_host : false, 
			// Replace values for the template plugin
			template_replace_values : {
				username : "Some User",
				staffid : "991234"
			}
			
		});
	
		}
	
	//-- Les onglets
	
	$("#tabsOK").tabs({ selected: var_item });
	$("#tabsOK2").tabs({ selected: var_item });
	
	//-- Applicarions des tools-tip
	
	$('*.Tips2').qtip(
	{
		position: {
			corner: {
				target: 'topRight',
				tooltip: 'bottomLeft'
			}
		},
		style: {
			name: 'dark',
			padding: '7px 13px',
			width: {
				max: 300,
				min: 0
			},
			border: {
				width: 3,
				radius: 5,
			},
			tip: true
		}
	});

	//-- Palette de couleurs

	$('.PaletteColor').ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {
	$(el).val( '#' + hex);
	$(el).css('backgroundColor', '#' + hex);
	$(el).ColorPickerHide();
	},
	onChange: function(hsb, hex, rgb, el) {
	$(el).val( '#' + hex );
	//$(el).css('backgroundColor', '#' + hex);
	$("#"+$(el).attr('id')+"VIEW").css('backgroundColor', '#' + hex);
	},
	onBeforeShow: function () {
	$(this).ColorPickerSetColor(this.value);
	}
	})
	.bind('keyup', function(){
	$(this).ColorPickerSetColor(this.value);
	});
	}

//-- Fonction : 

function EspaceMembreSearchMembre()
	{

	//-- On recupere les champs
	
	var formulaire 		= document.getElementById('recherche_membre');
	var mot_cles		= formulaire.mot_cles.value;
	var sort_by			= formulaire.sort_by.value;
	var sort_dir 		= formulaire.sort_dir.value;	
	var result_page 	= formulaire.result_page.value;	
	var statut 			= formulaire.statut.value;	
	
	//-- Preparation de la requete
	
	location.hash = "espace_membres.php?page_sw=gestion_membres&go_recherche=1&mot_cles="+encodeURIComponent(mot_cles)+"&sort_by="+sort_by+"&sort_dir="+sort_dir+"&result_page="+result_page+"&statut="+statut+"";
	GetPage("espace_membres.php?page_sw=gestion_membres&go_recherche=1&mot_cles="+encodeURIComponent(mot_cles)+"&sort_by="+sort_by+"&sort_dir="+sort_dir+"&result_page="+result_page+"&statut="+statut+"");
	
	//--
	
	return false;
	}


//-- Fonction : 

function EspaceMembreSearchLien()
	{

	//-- On recupere les champs
	
	var formulaire 		= document.getElementById('recherche_lien');
	var mot_cles		= formulaire.mot_cles.value;
	var sort_by			= formulaire.sort_by.value;
	var sort_dir 		= formulaire.sort_dir.value;	
	var result_page 	= 0;	
	
	//-- Preparation de la requete
	
	location.hash = "espace_membres.php?page_sw=gestion_liens&go_recherche=1&mot_cles="+encodeURIComponent(mot_cles)+"&sort_by="+sort_by+"&sort_dir="+sort_dir+"&result_page="+result_page+"";
	GetPage("espace_membres.php?page_sw=gestion_liens&go_recherche=1&mot_cles="+encodeURIComponent(mot_cles)+"&sort_by="+sort_by+"&sort_dir="+sort_dir+"&result_page="+result_page+"");
	
	//--
	
	return false;
	}


//-- Fonction : 

function EspaceMembreSearchPage()
	{

	//-- On recupere les champs
	
	var formulaire 		= document.getElementById('recherche_pages');
	var mot_cles		= formulaire.mot_cles.value;
	var sort_by			= formulaire.sort_by.value;
	var sort_dir 		= formulaire.sort_dir.value;	
	var result_page 	= 0;	
	
	//-- Preparation de la requete
	
	location.hash = "espace_membres.php?page_sw=gestion_pages&go_recherche=1&mot_cles="+encodeURIComponent(mot_cles)+"&sort_by="+sort_by+"&sort_dir="+sort_dir+"&result_page="+result_page+"";
	GetPage("espace_membres.php?page_sw=gestion_pages&go_recherche=1&mot_cles="+encodeURIComponent(mot_cles)+"&sort_by="+sort_by+"&sort_dir="+sort_dir+"&result_page="+result_page+"");
	
	//--
	
	return false;
	}

	
//--

function EspaceMembreAddMembre(action)
	{
			
	//-- 
	
	if(action=="add_membre")
		var ListeChamps = "EspaceMembreAction=AddMembre";
	else
		var ListeChamps = "EspaceMembreAction=UpdateMembre";
	
	//
	
	ListeChamps = ListeChamps + '&id_membre=' + encodeURIComponent (document.getElementById('id_membre').value ) + '';
	
	//-- On recupere tous les champs input text
	
	$("input:text").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs input password
	
	$("input:password").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
		
	//-- On recupere tous les champs input checked
	
	$("input:checked").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs textarea
	
	$("textarea").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs select
	
	$("select").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});

	//--
	
	var xhr = getXhr();
	xhr.open('POST', '/includes/ajax/fonctions.ajax.php', true);
	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=iso-8859-15');

	var data = ListeChamps;
	xhr.send(data);

	//-- On recupere le resultat
	
	xhr.onreadystatechange = function ()
		{
	
		//-- Le code http
		
		if (xhr.readyState == 4 && xhr.status == 200)
			{
	
			//-- On recupere le resultat
			
			result_html = xhr.responseText;	

			//--
			
			if(result_html==1)
				{
		
				//--
				
				location.hash = "espace_membres.php?page_sw=gestion_membres";
				GetPage("espace_membres.php?page_sw=gestion_membres");
	
				//--
				
				if(action=="add_membre")
					AjaxMsgConfirmation("Informations","Le membre a bien été enregistré.","good.png");
				else
					AjaxMsgConfirmation("Informations","Le membre a bien été modifié.","good.png");
					
				}
			else
				{
				AjaxMsgConfirmation("Informations","Erreur lors de l'enregistrement.","error.png");
				}
				
			}

		}
		
	//--

	return false;
	}

//--

function EspaceMembreAddLien(action)
	{
			
	//-- 
	
	if(action=="add_lien")
		var ListeChamps = "EspaceMembreAction=AddLien";
	else
		var ListeChamps = "EspaceMembreAction=UpdateLien";
	
	//
	
	ListeChamps = ListeChamps + '&id_lien=' + encodeURIComponent (document.getElementById('id_lien').value ) + '';
	
	//-- On recupere tous les champs input text
	
	$("input:text").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
		
	//-- On recupere tous les champs input checked
	
	$("input:checked").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs textarea
	
	$("textarea").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs select
	
	$("select").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});

	//--
	
	var xhr = getXhr();
	xhr.open('POST', '/includes/ajax/fonctions.ajax.php', true);
	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=iso-8859-15');

	var data = ListeChamps;
	xhr.send(data);

	//-- On recupere le resultat
	
	xhr.onreadystatechange = function ()
		{
	
		//-- Le code http
		
		if (xhr.readyState == 4 && xhr.status == 200)
			{
	
			//-- On recupere le resultat
			
			result_html = xhr.responseText;	

			//--
			
			if(result_html==1)
				{
		
				//--
				
				location.hash = "espace_membres.php?page_sw=gestion_liens";
				GetPage("espace_membres.php?page_sw=gestion_liens");
	
				//--
				
				if(action=="add_membre")
					AjaxMsgConfirmation("Informations","Le lien a bien été enregistré.","good.png");
				else
					AjaxMsgConfirmation("Informations","Le lien a bien été modifié.","good.png");
					
				}
			else
				{
				AjaxMsgConfirmation("Informations","Erreur lors de l'enregistrement.","error.png");
				}
				
			}

		}
		
	//--

	return false;
	}

//--

function EspaceMembreSendNewsletter()
	{
			
	//-- 
	
	ListeChamps = "EspaceMembreAction=SendNewsletter";
	
	//--
	
	var message = tinyMCE.get('message');
	
	// Do you ajax call here, window.setTimeout fakes ajax call
	message.setProgressState(1); // Show progress
	window.setTimeout(function() 
	{
	message.setProgressState(0); // Hide progress
	//alert(message.getContent());
	
	document.getElementById('FormAddNewsletter').message.value = message.getContent();

	//-- On recupere tous les champs input text
	
	$("input:text").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
		
	//-- On recupere tous les champs input checked
	
	$("input:checked").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs textarea
	
	$("textarea").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs select
	
	$("select").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});

	//--
	
	var xhr = getXhr();
	xhr.open('POST', '/includes/ajax/fonctions.ajax.php', true);
	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=iso-8859-15');

	var data = ListeChamps;
	xhr.send(data);

	//-- On recupere le resultat
	
	xhr.onreadystatechange = function ()
		{
	
		//-- Le code http
		
		if (xhr.readyState == 4 && xhr.status == 200)
			{
	
			//-- On recupere le resultat
			
			result_html = xhr.responseText;	

			//--
			
			if(result_html==1)
				{
		
				//--
				
				location.hash = "espace_membres.php?page_sw=send_newsletter";
				GetPage("espace_membres.php?page_sw=send_newsletter");
	
				//--
				
				AjaxMsgConfirmation("Informations","La newsletter a bien été envoyée.","good.png");
					
				}
			else
				{
				AjaxMsgConfirmation("Informations","Erreur lors de l'enregistrement.","error.png");
				}
				
			}

		}
		
	//---
	
	}, 1000);
	
	//--

	return false;
	}

//--

function EspaceMembreSendMPGroupe()
	{
			
	//-- 
	
	ListeChamps = "EspaceMembreAction=SendMPGroupe";
	
	//-- On recupere tous les champs input text
	
	$("input:text").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
		
	//-- On recupere tous les champs input checked
	
	$("input:checked").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs textarea
	
	$("textarea").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs select
	
	$("select").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});

	//--
	
	var xhr = getXhr();
	xhr.open('POST', '/includes/ajax/fonctions.ajax.php', true);
	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=iso-8859-15');

	var data = ListeChamps;
	xhr.send(data);

	//-- On recupere le resultat
	
	xhr.onreadystatechange = function ()
		{
	
		//-- Le code http
		
		if (xhr.readyState == 4 && xhr.status == 200)
			{
	
			//-- On recupere le resultat
			
			result_html = xhr.responseText;	

			//--
			
			if(result_html==1)
				{
		
				//--
				
				location.hash = "espace_membres.php?page_sw=mp_groupe";
				GetPage("espace_membres.php?page_sw=mp_groupe");
	
				//--
				
				AjaxMsgConfirmation("Informations","Le MP de groupe a bien été envoyé.","good.png");
					
				}
			else
				{
				AjaxMsgConfirmation("Informations","Erreur lors de l'enregistrement.","error.png");
				}
				
			}

		}
		
	//--

	return false;
	}

//--

function EspaceMembreSaveParametres()
	{
			
	//-- 
	
	ListeChamps = "EspaceMembreAction=SaveParametres";
	
	//-- On recupere tous les champs input text
	
	$("input:text").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
		
	//-- On recupere tous les champs input checked
	
	$("input:checked").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs textarea
	
	$("textarea").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs select
	
	$("select").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});

	//--
	
	var xhr = getXhr();
	xhr.open('POST', '/includes/ajax/fonctions.ajax.php', true);
	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=iso-8859-15');

	var data = ListeChamps;
	xhr.send(data);

	//-- On recupere le resultat
	
	xhr.onreadystatechange = function ()
		{
	
		//-- Le code http
		
		if (xhr.readyState == 4 && xhr.status == 200)
			{
	
			//-- On recupere le resultat
			
			result_html = xhr.responseText;	

			//--
			
			if(result_html==1)
				{
		
				//--
				
				location.hash = "espace_membres.php?page_sw=configuration";
				GetPage("espace_membres.php?page_sw=configuration");
	
				//--
				
				AjaxMsgConfirmation("Informations","Les paramètres ont bien été enregistrés.","good.png");
					
				}
			else
				{
				AjaxMsgConfirmation("Informations","Erreur lors de l'enregistrement.","error.png");
				}
				
			}

		}
		
	//--

	return false;
	}

//--

function EspaceMembreAddPage(action)
	{
			
	//-- 
	
	if(action=="add_page")
		var ListeChamps = "EspaceMembreAction=AddPage";
	else
		var ListeChamps = "EspaceMembreAction=UpdatePage";
	
	//-- 
	
	ListeChamps = ListeChamps + '&id_page=' + encodeURIComponent (document.getElementById('id_page').value ) + '';
	
	//-- On recupere tous les champs input text
	
	$("input:text").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
		
	//-- On recupere tous les champs input checked
	
	$("input:checked").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent ( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs textarea
	
	$("textarea").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});
	
	//-- On recupere tous les champs select
	
	$("select").each(function ()
		{
		ListeChamps = ListeChamps + '&' + $(this).attr('name') + '=' + encodeURIComponent( $(this).attr('value') ) + '';
		});
		
	//--
	
	ListeChamps = ListeChamps + '&list_user_visible=' + encodeURIComponent( $('#list_user_visible').val()) + '';

	//--
	
	var xhr = getXhr();
	xhr.open('POST', '/includes/ajax/fonctions.ajax.php', true);
	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=iso-8859-15');

	var data = ListeChamps;
	xhr.send(data);

	//-- On recupere le resultat
	
	xhr.onreadystatechange = function ()
		{
	
		//-- Le code http
		
		if (xhr.readyState == 4 && xhr.status == 200)
			{
	
			//-- On recupere le resultat
			
			result_html = xhr.responseText;	

			//--
			
			if(result_html==1)
				{
		
				//--
				
				location.hash = "espace_membres.php?page_sw=gestion_pages";
				GetPage("espace_membres.php?page_sw=gestion_pages");
	
				//--
				
				AjaxMsgConfirmation("Informations","La page a bien été ajoutée.","good.png");
					
				}
			else
				{
				AjaxMsgConfirmation("Informations","Erreur lors de l'enregistrement.","error.png");
				}
				
			}

		}
		
	//--

	return false;
	}

//-- Fonction : Actions sur les modules

function EspaceMembreActionModule(action)
	{
	
	//--
	
	var ListeIDModule = "EspaceMembreAction="+action+"&id=";
			
	//-- On recupere tous les modules cochés
	
	$(function() {$(".checked_module:checked").each(function (){ListeIDModule = ListeIDModule + $(this).attr('value') + "|"})});
		
	//--
	
	var result_html = file("/includes/ajax/fonctions.ajax.php?"+ListeIDModule+"");
	
	//--
	
	if(result_html==1)
		{
		
		//--
		
		if(action=="validation_membre")
			{
			AjaxMsgConfirmation("Informations","Les membres sélectionnés ont bien été validés.","good.png");
			page = "gestion_membres";
			}
		else if(action=="activation_membre")
			{
			AjaxMsgConfirmation("Informations","Les membres sélectionnés ont bien été activés.","good.png");
			page = "gestion_membres";
			}
		else if(action=="desactivation_membre")
			{
			AjaxMsgConfirmation("Informations","Les membres sélectionnés ont bien été désactivés.","good.png");
			page = "gestion_membres";
			}
		else if(action=="suppretion_membre")
			{
			AjaxMsgConfirmation("Informations","Les membres sélectionnés ont bien été supprimés.","good.png");
			page = "gestion_membres";
			}
		else if(action=="suppression_lien")
			{
			AjaxMsgConfirmation("Informations","Les liens sélectionnés ont bien été supprimés.","good.png");
			page = "gestion_liens";
			}
		else if(action=="suppression_stats")
			{
			AjaxMsgConfirmation("Informations","Les stats sélectionnées ont bien été supprimées.","good.png");
			page = "statistiques";
			}
		else if(action=="suppretion_no_connexion")
			{
			AjaxMsgConfirmation("Informations","Les stats sélectionnées ont bien été supprimées.","good.png");
			page = "statistiques";
			}
		else if(action=="suppression_page")
			{
			AjaxMsgConfirmation("Informations","Les pages sélectionnées ont bien été supprimées.","good.png");
			page = "gestion_pages";
			}
		
		//--
		
		location.hash = "espace_membres.php?page_sw="+page+"";
		GetPage("espace_membres.php?page_sw="+page+"");
		}
	else
		{
		
		if(action=="validation_membre")
			{
			AjaxMsgConfirmation("Informations","Erreur lors de la validation des membres","error.png");
			page = "gestion_membres";
			}
		else if(action=="activation_membre")
			{
			AjaxMsgConfirmation("Informations","Erreur lors de l'activation des membres","error.png");
			page = "gestion_membres";
			}
		else if(action=="desactivation_membre")
			{
			AjaxMsgConfirmation("Informations","Erreur lors de la désactivation des membres","error.png");
			page = "gestion_membres";
			}
		else if(action=="suppretion_membre")
			{
			AjaxMsgConfirmation("Informations","Erreur lors de la suppression des membres","error.png");
			page = "gestion_membres";
			}
		else if(action=="suppression_lien")
			{
			AjaxMsgConfirmation("Informations","Erreur lors de la suppression des liens","error.png");
			page = "gestion_liens";
			}
		else if(action=="suppression_stats")
			{
			AjaxMsgConfirmation("Informations","Erreur lors de la suppression des stats","error.png");
			page = "statistiques";
			}
		else if(action=="suppretion_no_connexion")
			{
			AjaxMsgConfirmation("Informations","Erreur lors de la suppression des stats","error.png");
			page = "statistiques";
			}
		else if(action=="suppression_page")
			{
			AjaxMsgConfirmation("Informations","Erreur lors de la suppression des pages","error.png");
			page = "gestion_pages";
			}

		//--
	
		location.hash = "espace_membres.php?page_sw="+page+"";
		GetPage("espace_membres.php?page_sw="+page+"");
		}
	
	}

//--

function GenerationCHtmlInscription(id_membre,type)
	{
	
	if(type=="formulaire_inscription")
		{
		etoile_rouge 	= "<b><i><font color=\"#ff0000\">*</font></i></b>";
		etoile_champ 	= new Array;
		etoile_champ[1] = "";
		etoile_champ[2] = "";
		etoile_champ[3] = "";
		etoile_champ[4] = "";
		etoile_champ[5] = "";
		
		document.getElementById('resultat_inscription').value = "<!--Code HTML service espace membre de Service-Webmaster.fr -->\n";
		
		document.getElementById('resultat_inscription').value+= "<script type=\"text/javascript\">\n";
	
		document.getElementById('resultat_inscription').value+= "function verification_inscription()\n";
		document.getElementById('resultat_inscription').value+= "{\n";
		document.getElementById('resultat_inscription').value+= "var champs_erreur = false;\n";
		
		document.getElementById('resultat_inscription').value+= "if (document.getElementById('forms').prenomm.value=='')\n";
		document.getElementById('resultat_inscription').value+= "{ champs_erreur=false; } \n";
		document.getElementById('resultat_inscription').value+= "else\n";
		document.getElementById('resultat_inscription').value+= "{ champs_erreur=true; }\n\n";
	
		document.getElementById('resultat_inscription').value+= "if (document.getElementById('forms').nomm.value=='')\n";
		document.getElementById('resultat_inscription').value+= "{ champs_erreur=false; } \n";
		document.getElementById('resultat_inscription').value+= "else\n";
		document.getElementById('resultat_inscription').value+= "{ champs_erreur=true; }\n\n";
	
		document.getElementById('resultat_inscription').value+= "if (document.getElementById('forms').pseudom.value=='')\n";
		document.getElementById('resultat_inscription').value+= "{ champs_erreur=false; } \n";
		document.getElementById('resultat_inscription').value+= "else\n";
		document.getElementById('resultat_inscription').value+= "{ champs_erreur=true; }\n\n";
	
		document.getElementById('resultat_inscription').value+= "if (document.getElementById('forms').passem.value=='')\n";
		document.getElementById('resultat_inscription').value+= "{ champs_erreur=false; } \n";
		document.getElementById('resultat_inscription').value+= "else\n";
		document.getElementById('resultat_inscription').value+= "{ champs_erreur=true; }\n\n";
	
		document.getElementById('resultat_inscription').value+= "if (document.getElementById('forms').emailm.value=='')\n";
		document.getElementById('resultat_inscription').value+= "{ champs_erreur=false; } \n";
		document.getElementById('resultat_inscription').value+= "else\n";
		document.getElementById('resultat_inscription').value+= "{ champs_erreur=true; }\n\n";
		
		//--
		
		try
		{
			
		for(i=1; i<6; i++)
			{
			
			//--
			
			if(document.getElementById('obli_'+i+'').checked == true)
				{
				document.getElementById('resultat_inscription').value+= "if (document.getElementById('forms').champs_"+i+".value=='')\n";
				document.getElementById('resultat_inscription').value+= "{ champs_erreur=false; } \n";
				document.getElementById('resultat_inscription').value+= "else\n";
				document.getElementById('resultat_inscription').value+= "{ champs_erreur=true; }\n\n";
				etoile_champ[i] = etoile_rouge;
				}
				
			}
	
		}
		catch(e)
		{
			
		}
		
		
		document.getElementById('resultat_inscription').value+= "if (champs_erreur==false)\n";
		document.getElementById('resultat_inscription').value+= "{\n";
		document.getElementById('resultat_inscription').value+= "alert('Veuillez remplire tous les champs !');\n";
		document.getElementById('resultat_inscription').value+= "return false;\n";
		document.getElementById('resultat_inscription').value+= "}\n";
		
		
		document.getElementById('resultat_inscription').value+= "}\n";
		
		document.getElementById('resultat_inscription').value+= "<\/script>\n";
			
	
		document.getElementById('resultat_inscription').value+= "<form method=\"POST\" action=\"http://services.service-webmaster.fr/espace-membres/inscription-"+id_membre+".html\" name=\"forms\" id=\"forms\">\n";
		document.getElementById('resultat_inscription').value+= "<table width=\"" + document.getElementById('dimention').value + "\" border=\"0\" cellpadding=\"5\" id=\"table3\" style=\"border-collapse: collapse; border: 1px solid #000000; font-family:Arial, Helvetica, sans-serif; font-size:11px; color:" + document.getElementById('color').value + "\">\n";
		document.getElementById('resultat_inscription').value+= "<tr>\n";
		document.getElementById('resultat_inscription').value+= "<td colspan=\"2\" align=\"center\" style=\"background-image:url(http://www.service-webmaster.fr/images/barre_service/barre-vista.jpg); color:#FFFFFF\"><b>Inscrivez-vous</b></td>\n";
		document.getElementById('resultat_inscription').value+= "</tr>\n";
		document.getElementById('resultat_inscription').value+= "<tr>\n";
		document.getElementById('resultat_inscription').value+= "<td colspan=\"2\">Pour vous inscrire &agrave; notre espace membre, entrez les informations demandées dans le formulaire ci-dessous.</td>\n";
		document.getElementById('resultat_inscription').value+= "</tr>\n";
		document.getElementById('resultat_inscription').value+= "<tr>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"98\" align=\"right\">Prénom : " +  etoile_rouge + "</td>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"165\"><input type=\"text\" name=\"prenomm\" size=\"20\" maxlength=\"255\"></td>\n";
		document.getElementById('resultat_inscription').value+= "</tr>\n";
		document.getElementById('resultat_inscription').value+= "<tr>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"98\" align=\"right\">Nom : " +  etoile_rouge + "</td>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"165\"><input type=\"text\" name=\"nomm\" size=\"20\" maxlength=\"255\"></td>\n";
		document.getElementById('resultat_inscription').value+= "</tr>\n";
		document.getElementById('resultat_inscription').value+= "<tr>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"98\" align=\"right\">Pseudo : " +  etoile_rouge + "</td>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"165\"><input type=\"text\" name=\"pseudom\" size=\"20\" maxlength=\"255\"></td>\n";
		document.getElementById('resultat_inscription').value+= "</tr>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"98\" align=\"right\">Mot de passe : " +  etoile_rouge + "</td>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"165\"><input type=\"password\" name=\"passem\" size=\"20\" maxlength=\"255\"></td>\n";
		document.getElementById('resultat_inscription').value+= "</tr>\n";
		document.getElementById('resultat_inscription').value+= "<tr>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"98\" align=\"right\">Site web :</td>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"165\"><input type=\"text\" name=\"sitem\" size=\"20\" value=\"http://\" maxlength=\"255\"></td>\n";
		document.getElementById('resultat_inscription').value+= "</tr>\n";
		document.getElementById('resultat_inscription').value+= "<tr>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"98\" align=\"right\">Email : " +  etoile_rouge + "</td>\n";
		document.getElementById('resultat_inscription').value+= "<td width=\"165\"><input type=\"text\" name=\"emailm\" size=\"20\" maxlength=\"255\"></td>\n";
		document.getElementById('resultat_inscription').value+= "</tr>\n";
		
		//--
		
		try
		{
			
		for(i=1; i<6; i++)
			{
			
			//--
			
			if(document.getElementById('obli_'+i+''))
				{
				document.getElementById('resultat_inscription').value+= "<tr>\n";
				document.getElementById('resultat_inscription').value+= "<td width=\"98\" align=\"right\">Champ "+i+" : " +  etoile_champ[i] + "</td>\n";
				document.getElementById('resultat_inscription').value+= "<td width=\"165\"><input type=\"text\" name=\"champs_"+i+"\" size=\"20\"></td>\n";
				document.getElementById('resultat_inscription').value+= "</tr>\n";
				}
				
			}
	
		}
		catch(e)
		{
			
		}
		
		document.getElementById('resultat_inscription').value+= "<tr>\n";
		document.getElementById('resultat_inscription').value+= "<td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Inscription\" name=\"choix\" onclick=\"return verification_inscription();\"></td>\n";
		document.getElementById('resultat_inscription').value+= "</tr>\n";
		document.getElementById('resultat_inscription').value+= "</table>\n";
		document.getElementById('resultat_inscription').value+= "</form>\n";
		document.getElementById('resultat_inscription').value+= "<!--Code HTML service espace membre de Service-Webmaster.fr -->\n";
		
		}
	
	}

//--

function EspaceMembrResetLiens()
	{
		
	//
	
	ListeChamps =  '&EspaceMembreAction=ResetLiens';
	

	//--
	
	var xhr = getXhr();
	xhr.open('POST', '/includes/ajax/fonctions.ajax.php', true);
	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=iso-8859-15');

	var data = ListeChamps;
	xhr.send(data);

	//-- On recupere le resultat
	
	xhr.onreadystatechange = function ()
		{
	
		//-- Le code http
		
		if (xhr.readyState == 4 && xhr.status == 200)
			{
	
			//-- On recupere le resultat
			
			result_html = xhr.responseText;	

			//--
			
			if(result_html==1)
				{
		
				//--
				
				location.hash = "espace_membres.php?page_sw=gestion_liens";
				GetPage("espace_membres.php?page_sw=gestion_liens");
	
				//--
				
				AjaxMsgConfirmation("Informations","Les liens ont bien été réinitialisés.","good.png");
					
				}
			else
				{
				AjaxMsgConfirmation("Informations","Erreur lors de l'enregistrement.","error.png");
				}
				
			}

		}
		
	//--

	return false;	
	}
