function controle_presence(champ_cache)
	{
	formulaire[champ_cache].value = "enabled";
	} 

function suppression_lien(donnees , reference )
	{
	heure = new Date();
	lien = heure.getTime();

	var effacement = confirm("Etes-vous sure de vouloir supprimer ce lien");

	if( effacement == true)
		{
		self.location = donnees + "?reference="+ reference + "&tc="  + lien;
		}
	} 

function changement( parametre )
	{
	ascenseur = "yes";
	largeur = 600;
	hauteur = 400;

	var options = "toolbar=yes,location=yes,directories=yes,status=yes,"
	+ "menubar=yes, scrollbars=" + ascenseur + ",resizable=yes,copyhistory=yes,"
	+ "width=" + largeur +  ",height=" + hauteur + ",left=140,top=150";
	window.open( parametre ,"",options);
	}

function page_avis(donnees , page , reference_categorie , reference_site , page_chatroom  )
	{
	heure = new Date();
	lien = heure.getTime();

	self.location = donnees + "?numero_page=" + page + "&categorie=" + reference_categorie + "&reference=" + reference_site + "&page_chatroom=" + page_chatroom + "&tc="  + lien;
	}

function page_index(donnees , page , reference_categorie   )
	{

	heure = new Date();
	lien = heure.getTime();


	self.location = donnees + "?numero_page=" + page + "&catanu=" + reference_categorie +  "&tc="  + lien;
	}

function pourvoter( parametre , refsite , refcat , page )
	{
	heure = new Date();
	lien = heure.getTime();


	self.location = "voter.php3?categorie=" + refcat + "&reference=" + refsite + "&point=" + parametre + "&numero_page=" + page +  "&tc=" + lien; 
	}

function recherche(donnees , param )
	{
	heure = new Date();
	lien = heure.getTime();

	if( param.length > 0)
		{
		self.location = donnees + "?search=" + param + "&tc=" + lien;
		}

	}

function page_inscrit(donnees , page , reference_chatroom , page_chatroom  )
	{

	heure = new Date();
	lien = heure.getTime();


	self.location = donnees + "?numero_page=" + page + "&page_chatroom=" + page_chatroom + "&reference=" + reference_chatroom + "&tc="  + lien;
	}

function page_chatroom(donnees , page   )
	{

	heure = new Date();
	lien = heure.getTime();


	self.location = donnees + "?numero_page=" + page + "&tc="  + lien;
	}

function effacer_user( donnees, ref_annonce , nom_base  , page , numero_page , photo )
	{
	heure = new Date();
	lien = heure.getTime();

	var effacement = confirm("Etes-vous sure de vouloir effacer cet utilisateur");

	
	if( effacement == true)
		{
		self.location = donnees + "?reference=" + ref_annonce + "&nom_base=" + nom_base + "&nom_photo=" + photo + "&page_chatroom=" + page + "&numero_page=" + numero_page + "&tc=" + lien ; 
		}
	}


function changement_statut(donnees , ref_annonce , nom_base , page , numero_page )
	{
	heure = new Date();
	lien = heure.getTime();

	self.location = "changement_statut.php3?data=" + donnees + "&reference=" + ref_annonce + "&nom_base=" + nom_base + "&page_chatroom=" + page + "&numero_page=" + numero_page + "&tc=" + lien;

	} 

function retour_boite()
	{
	history.forward();
	} 

function supprimer_message( donnees , ref_profil , reference_message , sens_boite , section_retour , numero_page , ref_chatroom )
	{
	heure = new Date();
	lien = heure.getTime();

	var effacement = confirm("Etes-vous sure de vouloir supprimer ce message");

	if( effacement == true)
		{
		self.location = donnees + "?profil=" + ref_profil + "&reference=" + reference_message + "&direction=" + sens_boite + "&message=" + section_retour + "&numero_page=" + numero_page + "&chatroom=" + ref_chatroom + "&tc=" + lien ; 
		}
	} 



function selection_page_courrier(donnees , page , sens_boite , statut_message  )
	{

	heure = new Date();
	lien = heure.getTime();

	self.location = donnees + "?direction=" + sens_boite + "&message=" + statut_message + "&numero_page="+  page + "&tc="  + lien;
	}

function boite_aux_lettres( donnees , direction , nouveau , ref_chatroom )
	{
	heure = new Date();
	lien = heure.getTime();

	parent.chatroom.location = donnees + "?direction=" + direction + "&message=" + nouveau + "&chatroom=" + ref_chatroom + "&tc=" + lien; 
	}

function voir_profil( donnee , reference_profil , ref_chatroom )
	{

	heure = new Date();
	lien = heure.getTime();

	parent.location = donnee + "?profil=" + reference_profil + "&reference=" + ref_chatroom + "&tc=" + lien;
	}


function suppression_profil( donnees, proprietaire , ref_chatroom )
	{
	heure = new Date();
	lien = heure.getTime();

	if( proprietaire == 0 )
		{
		var effacement = confirm("Etes-vous sure de vouloir effacer votre compte");
	
		if( effacement == true)
			{
			parent.location = donnees + "?reference=" + ref_chatroom + "&tc=" + lien ; 
			}
		}
	else
		{
		alert("Vous ne pouvez pas supprimer votre compte, car vous êtes propriétaire de cette chatroom");
		}
	}

function chargement_initial( ref_chatroom , nom_base , nom_chatroom )
	{

	heure = new Date();
	lien = heure.getTime();

	parent.charge_chat.location = "load_chatroom.php3?nom_salle=" + nom_chatroom + "&reference=" + ref_chatroom + "&nom_table=" + nom_base + "&tc=" + lien;
	}

function changement_etat()
	{
	heure = new Date();
	lien = heure.getTime();

	index = select_etat.liste_etat.selectedIndex;
	param = select_etat.liste_etat[index].value;

	if ( param.length >2 )
		{
		parent.region.location = "selection_etat.php3?etat=" + param + "&" + lien; 
		parent.ville.location  = "vide.php3?" + lien; 

		parent.memo.location = "memorisation.php3?data=" + param + "&type=etat&tc=" + lien; 
		}
	else
		{
		parent.region.location = "vide.php3?" + lien; 
		parent.ville.location  = "vide.php3?" + lien; 

		parent.memo.location = "memorisation.php3?data=" + param + "&type=etat&tc=" + lien; 
		}
	}




function changement_pays()
	{
	heure = new Date();
	lien = heure.getTime();

	index = select_region.liste_region.selectedIndex;
	param = select_region.liste_region[index].value;

	if ( param.length >2 )
		{
		parent.ville.location = "selection_ville.php3?region="  + param + "&tc=" + lien; 

		parent.memo.location = "memorisation.php3?data=" + param + "&region&tc=" + lien; 

		}
	else
		{
		parent.ville.location = "vide.php3?tc=" + lien; 

		parent.memo.location = "memorisation.php3?data=" + param + "&region&tc=" + lien; 

		}
	}

function changement_region()
	{
	heure = new Date();
	lien = heure.getTime();

	index = select_region.liste_region.selectedIndex;
	param = select_region.liste_region[index].value;

	if ( param.length >2 )
		{
		parent.memo.location = "memorisation.php3?data=" + param + "&type=ville&tc=" + lien; 
		}

	}

function changement_continent()
	{
	heure = new Date();
	lien = heure.getTime();

	index = select_pays.liste_pays.selectedIndex;
	param = select_pays.liste_pays[index].value;


	if ( (param != "amn_usa") && (param != "amn_can") ) 
		{	
		if ( param.length >2 )
			{
			parent.region.location = "selection_region.php3?pays=" + param + "&" + lien; 
			parent.etat.location  = "vide.php3?" + lien; 
			parent.ville.location  = "vide.php3?" + lien; 

			parent.memo.location = "memorisation.php3?data=" + param + "&type=pays&tc=" + lien; 
			}
		else
			{
			parent.region.location = "vide.php3?" + lien; 
			parent.etat.location  = "vide.php3?" + lien; 
			parent.ville.location  = "vide.php3?" + lien; 

			parent.memo.location = "memorisation.php3?data=" + param + "&type=pays&tc=" + lien; 
			}
		}
	else
		{
		if ( param.length >2 )
			{
			parent.etat.location = "selection_region.php3?pays=" + param + "&" + lien; 
			parent.region.location = "vide.php3?" + lien; 
			parent.ville.location  = "vide.php3?" + lien; 

			parent.memo.location = "memorisation.php3?data=" + param + "&type=pays&tc=" + lien; 


			}
		else
			{
			parent.etat.location = "vide.php3?" + lien; 
			parent.region.location = "vide.php3?" + lien; 
			parent.ville.location = "vide.php3?" + lien; 

			parent.memo.location = "memorisation.php3?data=" + param + "&type=pays&tc=" + lien; 
			}
		}
	}

function frame_localisation(donnees , nom_continent )
	{

	heure = new Date();
	lien = heure.getTime();

	self.localisation.location = donnees + "?continent=" + nom_continent + "&type=continent&tc=" + lien;
	}

function ajouter( parametre , ligne_un , ligne_deux , champ_cache)
	{
	var tableau = new Array();  


	deja_fait = "false";
	i = parametre[ligne_un].selectedIndex;
	texte =parametre[ligne_un].options[i].text;
	index = parametre[ligne_deux].options.length;
	for (var e = 0; e < index; e++) 
		{       	
		if (texte == parametre[ligne_deux].options[e].text)
			{
			deja_fait = "true";
			}
		}
	if ( deja_fait == "false" )
		{
		entree = new Option(texte, parametre[ligne_un].value);
		parametre[ligne_deux].options[index] = entree;
		}

	e= 0;
	for (var i = 0; i < parametre[ligne_deux].options.length; i++) 
		{       	
		tableau[e] = parametre[ligne_deux].options[i].value;
		e++;
		}
	tableau_temporaire = tableau.join();
	formulaire[champ_cache].value = tableau_temporaire.replace( /,/g , "|" );

	}

function effacer(parametre,ligne_un,ligne_deux,champ_cache)
	{
	var tableau = new Array();  

	if ( parametre[ligne_deux].options.length > 0 )
		{
		index = parametre[ligne_deux].selectedIndex;
		parametre[ligne_deux].options[index] = null;
		if ( parametre[ligne_deux].options.length > 1 )
			{
			parametre[ligne_deux].options[0].selected;
			}
		}
	e= 0;
	for (var i = 0; i < parametre[ligne_deux].options.length; i++) 
		{       	
		tableau[e] = parametre[ligne_deux].options[i].value;
		e++;
		}
	tableau_temporaire = tableau.join();
	formulaire[champ_cache].value = tableau_temporaire.replace( /,/g , "|" );

	}

function retour_chatroom(donnees , nom_salle , reference_chatroom , nom_base )
	{
	heure = new Date();
	lien = heure.getTime();

	parent.chatroom.location = donnees + "?salle=" + nom_salle + "&reference=" + reference_chatroom + "&nom_table=" + nom_base + "&tc=" + lien; 
	}

function acces_menu(donnees , ref_chatroom )
	{
	heure = new Date();
	lien = heure.getTime();

	parent.chatroom.location = donnees + "?reference=" + ref_chatroom + "&tc="  + lien; 
	}

function zindows_chat( largeur , hauteur , ascenseur , profil  )
	{
	heure = new Date();
	lien = heure.getTime();

	if ( profil != "" )
		{
		var chemin = "image_chat.php3?nom_photo=" + profil + "&tc=" + lien; 
		var options = "toolbar=no,location=no,directories=no,status=no,"
		+ "menubar=no, scrollbars=" + ascenseur + ",resizable=no,copyhistory=no,"
		+ "width=" + largeur +  ",height=" + hauteur + ",left=140,top=150";
		window.open( chemin ,"",options);
		}
	}

function charge_message_chat( objet , salle , derniere_lecture )
	{
	heure = new Date();
	lien = heure.getTime();

	formulaire.texte_chat.value = formulaire.texte_chat.value.replace( /(%27)/g , "\'" );

	parent.liste.document.getElementById(objet).innerHTML = formulaire.texte_chat.value ;


	valeur_lien = "load_chatroom.php3?salle=" + salle + "&chat=" + derniere_lecture + "&tc=" + lien;

	setTimeout( "self.location=valeur_lien" ,3000 ); 

	}

function effacer_message_chat(p)

	{
	p.message_chat.value = "";
	}

function fenetre_modele(information , largeur , hauteur  )
	{
	var chemin = information; 
	var ascenseur = "yes"; 
	
	var options = "toolbar=no,location=no,directories=no,status=no,"
	+ "menubar=no, scrollbars=" + ascenseur + ",resizable=yes,copyhistory=no,"
	+ "width=" + largeur +  ",height=" + hauteur;

	window.open( chemin ,"",options);
	}

function suppression(donnees , ref_chatroom , ref_base , numero_page  )
	{
	heure = new Date();
	lien = heure.getTime();

	var effacement = confirm("Etes-vous sure de vouloir effacer votre chatroom");

	if( effacement == true)
		{
		self.location = donnees + "?reference=" + ref_chatroom + "&nom_base=" + ref_base + "&numero_page=" + numero_page + "&" + lien;
		}




	} 


function oublie(donnees , p)
	{

	heure = new Date();
	lien = heure.getTime();

	self.location = donnees + "?email=" + escape(p.email.value) + "&tc="  + lien; 
	}

function ajout_liens(fichier,information,permis,internaute)
	{
	heure = new Date();
	lien = heure.getTime();

	if( permis == "vrai" )
		{
		if( information != "root" )
			{
			document.cookie =  "cookie_parametre=" + information + "&" + internaute ;
	
			self.location = fichier + "?catanu=" + information + "&tc=" + lien;
			}
		else
			{
			alert("Vous ne pouvez pas inscrire un site à ce niveau");
			}
		}
	else
		{
		alert("Vous ne pouvez pas inscrire un site à ce niveau");
		}
	}

function ajout_categorie( donnees , information , permis , internaute )
	{
	heure = new Date();
	lien = heure.getTime();


	if( permis == "vrai" )
		{
		self.location = donnees + "?catanu=" + information + "&adulte=" + internaute + "&"  + lien;
		}
	else
		{
		alert("Vous ne pouvez pas inscrire une categorie à ce niveau");
		}
	}

function soumettre_basique()
	{
	document.formulaire.submit();
	}

function soumettre()
	{
	document.formulaire.submit();	
	}

