/* 
 * PlatformGeneral.js
 * general activies of the platform
 *
 */

var PlatformGeneral = {
	container: null,
    init: function() {

},
    localizedTime: function(amount, unitsName, alternative ){
        
        if (amount == 1)
            var singularOrPlural = 'one';
        else
           var singularOrPlural = 'other';

       var unitsLocalized = AppData.localizedData.timeUnits[unitsName][singularOrPlural];
       return amount +' '+ unitsLocalized;
    },
	/*
	* @param timestamp - miliseconds 
	* @param separator - string - insert the char to use. defaults to space.
	* returns string	
	*/
    timeLeft: function(timeStamp, sepatator){
        if(typeof sepatator == 'undefined')
            sepatator = ' ';

        var timeLeft = new Date(timeStamp);
        return  PlatformGeneral.localizedTime(timeLeft.getMinutes(),'minute')
            +sepatator+ PlatformGeneral.localizedTime(timeLeft.getSeconds(),'second');
    }
}
$(document).ready(function() {

	PlatformGeneral.init();
});
