	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -
	//	routines pour faciliter la gestion des requetes dans les urls
	//	stocke dans un tableau les clefs et leurs valeurs ...
	//	usage : results.key(i) = results.value(i) ;
	//	- - - - - - - - - - - - - - - - - - - - - - - - - -
	
	function to_key(indice) {
		return this[indice][0] ;
	}
	
	function to_value(indice) {
		return this[indice][1] ;
	}
	
	Array.prototype.key = to_key ;
	Array.prototype.value = to_value ;

	
	
	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -
	
	function which_stat(option_value)
	{
		my_reg = /&s=(\d{4})$/ ;
		my_location = window.location.href ;
		
		
		if ( my_reg.test( my_location ) ) {
			my_location = my_location.replace(my_reg, "") ;
		}
		
		window.location.href = my_location + "&s=" + option_value ;
	}
	
	function which_filiere(option_value, idObject)
	{
		var my_select = document.getElementById(idObject);
		var my_filiere = my_select.options[my_select.selectedIndex].text.toLowerCase();
		
		regEx = /\/(particuliers|agents|concours|collectivites|poles_competence)\/(.+)\/([0-9]{1,3})\/?$/;
				
		new_url = window.location.href.replace(regEx, "/$1/contenu.php?id=$3");

		my_reg = /&f=([A-Z]{1})$/ ;
		my_reg2 = /&detail=([A-Z]{4})$/ ;
		my_reg3 = /\\?$/ ;
		
		my_location = new_url;
				
		if ( my_reg.test( my_location ) ) {
			my_location = my_location.replace(my_reg, "") ;
		}
		if ( my_reg2.test( my_location ) ) {
			my_location = my_location.replace(my_reg2, "") ;
		}
		
		if ( my_reg3.test( my_location ) ) {
			window.location.href = my_location + "&f=" + option_value ;
		} else {
			window.location.href = my_location + "?&f=" + option_value ;
		}
	
	}
	
	
	function which_session(option_value)
	{
		my_reg = /&ses=([0-9]{4})$/ ;
		my_reg2 = /&detail=([A-Z]{4})$/ ;
		my_reg3 = /\\?$/ ;

		my_location = window.location.href ;
		
		
		if ( my_reg.test( my_location ) ) {
			my_location = my_location.replace(my_reg, "") ;
		}
		if ( my_reg2.test( my_location ) ) {
			my_location = my_location.replace(my_reg2, "") ;
		}
		
		if ( my_reg3.test( my_location ) ) {
			window.location.href = my_location + "&ses=" + option_value ;
		} else {
			window.location.href = my_location + "?&ses=" + option_value ;
		}
	}
	
	
	var results = new Array() ;

	function parse_my_url()
	{
		var query_string = location.search.substring(1) ;
		
		var srchArray = query_string.split("&") ;
		var tempArray = new Array() ;

		for ( i = 0 ; i < srchArray.length ; i ++ ) {
			tempArray = srchArray[i].split("=") ;
			results[i] = new Array(tempArray[0], tempArray[1]) ;
		}
		
	}


	if ( window.location.search ) {
		parse_my_url() ;
	}
	//	- - - - - - - - - - - - - - - - - - - - - - - - - -
	
	
	function get_url (nom_parametre, parametre, parametre2) 
	{	
		var url = location.pathname +"?" ;

		for ( i = 0 ; i < results.length ; i++ ) {

			if ( results.key(i)!='type' && results.key(i)!='ses' && results.key(i)!='detail' && results.key(i)!='xsl' && results.key(i)!='' ) {
				url += "&" + results.key(i) + "=" + results.value(i) ;		
			}
		}

		url += "&" + nom_parametre + "=" + parametre ;
		if ( typeof(parametre2) != 'undefined' ) {
			url += "&type=" + parametre2 ;
		}
		window.location.href = url;
	}
	
	function url_modif () 
	{	
		var url = location.pathname +"?" ;

		for ( i = 0 ; i < results.length ; i++ ) {

			if ( results.key(i)=='id' || results.key(i)=='f' ) {
				url += "&" + results.key(i) + "=" + results.value(i) ;		
			}
		}
		window.location.href = url;
	}
	
	
	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -

	function jump_to ( where )
	{
		typeof(where) == 'undefined' ? alert("Une adresse doit etre specifiee ...") : window.location.href = where ;
	}
	
	
	
	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -
	
	function w_open ( my_file, my_width, my_height )
	{
		W = open (my_file, "my_window", "width=" + my_width + ",height=" + my_height + ",top=50,left=100" ) ;
	}
	
	
	function open_clip( which )
	{
		clip = open("/fr/particuliers/clips.php?v=" + which, "my_clip", "width=550,height=400,top=50,left=100" ) ;
	}