function timeout(func,delay) {
	// init
	if (typeof _timeout == "undefined") _timeout = {};		
	if (typeof _timeout.count == "undefined") _timeout.count = 0; 	
	if (typeof _timeout.funcs == "undefined") _timeout.funcs = new Array(); 
	// set timeout
	if (typeof func =='string') return setTimeout(func, delay); 
	if (typeof func =='function') {
		_timeout.count++;
		_timeout.funcs[_timeout.count] = func;
		return setTimeout("_timeout.funcs["+_timeout.count+"]();", delay);
	}
}
function interval(func,delay) {
	// init
	if (typeof _interval == "undefined") _interval = {};		
	if (typeof _interval.count == "undefined") _interval.count = 0; 	
	if (typeof _interval.funcs == "undefined") _interval.funcs = new Array(); 
	// set interval
	if (typeof func =='string') return setInterval(func, delay); 
	if (typeof func =='function') {
		_interval.count++;
		_interval.funcs[_interval.count] = func;
		return setInterval("_interval.funcs["+_interval.count+"]();", delay);
	}
}
function idle(func,delay) {
	// init
	if (typeof _idle == "undefined") _idle = {};		
	if (typeof _idle.lasttimeout == "undefined") _idle.lasttimeout = null;
	if (typeof _idle.lastfunc == "undefined") _idle.lastfunc = null;
	// set idle timeout
	if (_idle.timeout) { clearTimeout(_idle.timeout); _idle.timeout = null; _idle.lastfunc = null; }
	if (typeof(func)=='string') { 
		_idle.timeout = setTimeout(func, delay); 
		return _idle.timeout;
	}		
	if (typeof(func)=='function') { 
		_idle.lastfunc = func;
		_idle.timeout = setTimeout("_idle.lastfunc();", delay);
		return _idle.timeout;
	}
}