/*
#rtslib.inc /rtslib/DOM.js
#rtslib.inc /rtslib/player.js
#rtslib.inc /rtslib/scrollers.js
*/

function log(s) {
	var l = $('#debug .content');
	if (l.length > 0) {
		l.html(l.html() + s + '<br>');
		l.parent().scrollTop(l.height());
	}
	if (typeof(console) =='object' && typeof(console.info) =='function')
		console.info(s);
}

if (typeof RTS != 'object')
	RTS = {};

RTS.init = function(s) {
	var me = this;
	if (typeof s != 'string')
		return;

	if (s.indexOf('/') != -1)
		s = s.substring(s.lastIndexOf('/')+1, s.length);
	if (s.indexOf('.') != -1)
		s = s.substring(0, s.lastIndexOf('.'));

	o = RTS[s];
	if (typeof o == 'undefined')
		return;
	if (typeof o.init == 'function')
		o.init();
	else if (typeof o == 'function')
		o();
};

if (navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1 && document.location.href.search(/http:\/\/[a-zA-Z0-9\.\-\_]{0,}.tsr.ch/gi) != -1 && document.location.href.indexOf('http://dev.tsr.ch') == -1)
	document.write('<script src="/js/libs/ffRebuild.js"></script>');
