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