	
	
	
	
	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -
	//	gestion des rollover sur un objet ...
	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -
	
	function hilite()
	{
		if ( hilite.arguments.length != 0 ) {
			my_image = hilite.arguments[0] ;
			
			if ( document.getElementById ) {
				document.getElementById(my_image).src = eval(my_image + "_on.src") ;
			}
			else if ( document.all ) {
				document.all.my_image.src = eval(my_image + "_on.src") ;
			}
			else if ( document.images ) {
				document.images[my_image].src = eval(my_image + "_on.src") ;
			}
		}
		
		else {
			if ( document.getElementById ) {
				document.getElementById(my_image).src = eval(my_image + "_off.src") ;
			}
			else if ( document.all ) {
				document.all.my_image.src = eval(my_image + "_off.src") ;
			}
			else if ( document.images ) {
				document.images[my_image].src = eval(my_image + "_off.src") ;
			}
		}
	}
	
	
	
	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -
	//	gestion des rollover sur deux objets ...
	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -

	function roll_over()
	{
		if ( roll_over.arguments.length > 1 ) {
			my_image = roll_over.arguments[0] ;
			my_current = roll_over.arguments[1] ;
			
			if ( my_image == my_current ) return ;
			
			
			if ( document.getElementById ) {
				document.getElementById(my_current).src = eval(my_current + "_off.src") ;
				document.getElementById(my_image).src = eval(my_image + "_on.src") ;
			}
			else if ( document.all ) {
				document.all.my_current.src = eval(my_current + "_off.src") ;
				document.all.my_image.src = eval(my_image + "_on.src") ;
			}
			else if ( document.images ) {
				document.images[my_current].src = eval(my_current + "_off.src") ;
				document.images[my_image].src = eval(my_image + "_on.src") ;
			}
		}
		
		else {
			if ( my_image == my_current ) return ;
			
			
			if ( document.getElementById ) {
				document.getElementById(my_current).src = eval(my_current + "_sel.src") ;
				document.getElementById(my_image).src = eval(my_image + "_off.src") ;
			}
			else if ( document.all ) {
				document.all.my_current.src = eval(my_current + "_sel.src") ;
				document.all.my_image.src = eval(my_image + "_off.src") ;
			}
			else if ( document.images ) {
				document.images[my_current].src = eval(my_current + "_sel.src") ;
				document.images[my_image].src = eval(my_image + "_off.src") ;
			}
		}
	}
	
	
	
	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -
	
	var my_aujourdhui = new Date() ;
	
	function ecrire_date ()
	{
		my_reg = / (\d{2}):(\d{2}):\d{2}/g ;
		
		my_date  = my_aujourdhui.toLocaleString().replace ( my_reg, ", $1h$2." ) ;
		
		document.write( my_date ) ;
		document.close() ;
	}
	
	
	
	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -
	/*
		tableruler()
		written by Chris Heilmann for alistapart.
		enables a rollover of rows for each table with the classname "hlrows"
	*/
	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -

	function tableruler()
	{
		if (document.getElementById && document.createTextNode)
		{
			var tables=document.getElementsByTagName('table');
			
			for (var i=0;i<tables.length;i++){
				if(tables[i].className=='ruler'){
					var trs=tables[i].getElementsByTagName('tr');
			
					for(var j=0;j<trs.length;j++) {
				
						if(trs[j].parentNode.nodeName == 'TBODY') {	
							trs[j].onmouseover=function(){this.className='hilited';this.style.cursor = 'default';return false}
							trs[j].onmouseout=function(){this.className='';return false}
						}
					}
				}
			}
		}
	}
	

	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -

	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" ) ;
	}

	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -

	//	- - - - - - - - - - - - - - - - - - - - - - - - - - -
	//	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)\/([^0-9]+)([0-9]+)\/?$/;
				
		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;
	}	