//
// $Id: StringFuns.js,v 1.2 2010/07/10 16:47:59 steve Exp $
//
var StringFuns = function() {

    this.getNResultsString = function(n) {

        var str = ''
        switch(n) {
            case 0:
                str ='No results'
            case 1:
                str = '1 result'
            default:
                str = n + ' results'
        }
        return str
    }
    
    this.trim = function(str) {
	
	    str = str.replace(/^\s*/, '')
	    str = str.replace(/\s*$/, '')
		
		return str 
	}

    this.ucFirst = function(str) {

        return str.substr(0, 1).toUpperCase() + str.substr(1) 
    }

    this.lcFirst = function(str) {

        return str.substr(0, 1).toLowerCase() + str.substr(1) 
    }
	
	this.formatTime = function(n) {
	
	    if (n < 10) {
		    return '0' + n
		} else {
		    return n
		}
	}
}