// ************************************************************************************************
// *** Groups utilities methods
// ************************************************************************************************

function Tools() {
	// ************************************************************************************************
	// *** Interface
	// ************************************************************************************************	

	this.formatSeconds = tools_FormatSeconds;
	
	
	// ************************************************************************************************
	// *** Implementations
	// ************************************************************************************************
	
	// Formats the seconds passed as argument to hh:mm:ss format (hh just appears if the number of hours is greater than 0)
	function tools_FormatSeconds(seconds) {
		var hrs, min, sec;
		
		// Hours
		hrs = parseInt(seconds / 3600);
		
		// Minutes
		seconds = seconds % 3600;
		min = parseInt(seconds / 60);
		if(min < 10) min = '0' + min;
		
		// Seconds
		sec = parseInt(seconds % 60);
		if(sec < 10) sec = '0' + sec;
		
		// Formatted string
		return ((hrs > 0) ? (hrs + ':') : '') + min + ':' + sec;
	}
}