	function spoil( myElem )
	{
		if ( myElem.nextSibling.style.display == "none" )
		{
			myElem.nextSibling.style.display = "block";
		}
		else
		{
			myElem.nextSibling.style.display = "none";
		}
	}

	function convert_to_time(secs)
	{
		secs = parseInt(secs);	
		hh = secs / 3600;	
		hh = parseInt(hh);	
		mmt = secs - (hh * 3600);	
		mm = mmt / 60;	
		mm = parseInt(mm);	
		ss = mmt - (mm * 60);	
			
		if (hh > 23)	
		{	
		   dd = hh / 24;	
		   dd = parseInt(dd);	
		   hh = hh - (dd * 24);	
		} else { dd = 0; }	
			
		if (ss < 10) { ss = "0"+ss; }	
		if (mm < 10) { mm = "0"+mm; }	
		if (hh < 10) { hh = "0"+hh; }	
		if (dd == 0) { return (hh+" h "+mm+" m "+ss); }	
		else {	
			if (dd > 1) { return (dd+" jours "+hh+" h "+mm+" m "+ss); }
			else { return (dd+" jour "+hh+" h "+mm+" m "+ss); }
		}	
	}

	function countdown( div, date )
	{
		if( $( 'footer' ) )
		{
			var options = { 
							method: "get" ,
							onSuccess: function (xhr)
							{							
								count	= parseInt( xhr.responseText );

								if (count < 0)		$( div ).innerHTML	= "Enchère terminée !";
								else				$( div ).innerHTML	= "reste " + convert_to_time( count );
							}
						  } 
			var ajaxCall = new Ajax.Request( "getdateJs.php?countto=" + date, options );
		}

		window.setTimeout( 'countdown( "' + div + '", "' + date + '" )', 1000 );
	}

	function changeType( type ) {
		
		var Origine	= $( 'cnxPassword' );
		var New		= document.createElement( 'input' );
		
		New.id		= 'cnxPassword' ;
		New.title	= 'password' ;

		if( type == "text" ) {
			if( Origine.type != "text" ) {
				if( Origine.value == '' ) {					
					New.value		= 'Puis votre mot de passe' ;
					New.className	= 'input-search margin_top' ;
					New.type		= type ;
					New.onfocus		= function() { changeType( 'password' ); }
					New.onclick		= function() { changeType( 'password' ); }
					Origine.parentNode.replaceChild( New, Origine );
				}
				else {
					Origine.onclick		= function() { changeType( 'password' ); }
				}
			}
		}
		else if( type == "password" ) {
			if( Origine.type != "password" ) {
				New.className	= 'input-search input-search-txt margin_top' ;
				New.type		= type ;
				New.onblur		= function() { changeType( 'text' ); }
				Origine.parentNode.replaceChild( New, Origine );
				setTimeout( function() { New.focus(); }, 10 );
			}
			else {
				Origine.className	= 'input-search' ;
				Origine.value		= '' ;
			}
		}

		if( submitIdentification == true )	Event.observe( "cnxPassword", "keypress", obj.validate_elem);
	}