var Class = {
	create: function() {
		return function() {
			this.initialize.apply(this, arguments);
		}
	}
}

Timer = Class.create();
	Timer.prototype = {
	initialize: function( runFunction , delayThousandSecond ) {	// 要執行的Function , 千分之一小
		this.sleepTimerID = null ;
		this.sleepTimerRunning = false ;
		this.targetObject = null ;
		this.runFunction = ( typeof( runFunction ) == 'undefined' ? '' : runFunction ) ;
		this.sleepTimes =  ( typeof( delayThousandSecond ) == 'undefined' ? 0 : parseInt( '' + delayThousandSecond ) ) ;
	},
	start : function ( runFunction , delayThousandSecond ){
	
		if ( typeof( runFunction ) != 'undefined' ) this.runFunction = runFunction ;
		if ( typeof( delayThousandSecond ) != 'undefined' ) this.sleepTimes =  parseInt( '' + delayThousandSecond ) ;
		
		if ( this.runFunction == '' ) return false ;
		if ( this.sleepTimes == 0 ) return false ;
		
		this.stop( ) ;
		this.sleepShowTime( ) ;
	},
	stop : function (){
	    if ( this.sleepTimerRunning ) clearTimeout( this.sleepTimerID ) ;
		this.sleepTimerRunning = false ;
	},
	sleepShowTime : function ( ){
		this.sleepTimerID = setTimeout( this.runFunction , this.sleepTimes );
		this.sleepTimerRunning = true ;
	}
}

