document.write('<script type="text/javascript" src="/scripts/extjs/adapter/ext/ext-base.js"></script>');
document.write('<script type="text/javascript" src="/scripts/extjs/ext-all.js"></script>');
var runOnLoad = function(f) {
	if (runOnLoad.loaded) {
		f(); /* If already loaded, just invoke f() now. */
	} else {
		runOnLoad.funcs.push(f); /* Otherwise, store it for later */
	}
};
runOnLoad.funcs = []; /* The array of functions to call when the document */
runOnLoad.loaded = false; /* The functions have not been run yet. */
/*
 * Run all registered functions in the order in which they were registered. It is safe to call runOnLoad.run() more than
 * once: invocations after the first do nothing. It is safe for an initialization function to call runOnLoad() to
 * register another function.
 */
runOnLoad.run = function() {
	if (runOnLoad.loaded) {
		return;
	};
	for ( var i = 0; i < runOnLoad.funcs.length; i++) {
		try {
			runOnLoad.funcs[i]();
		} catch (e) {
			/* An exception in one function shouldn't stop the rest */
		}
	};
	runOnLoad.loaded = true;
	delete runOnLoad.funcs;
	delete runOnLoad.run;
};
if (window.addEventListener) {
	window.addEventListener("load", runOnLoad.run, false);
} else if (window.attachEvent) {
	window.attachEvent("onload", runOnLoad.run);
} else {
	window.onload = runOnLoad.run;
};
runOnLoad(function() {
	var cPos = {};
	Ext.select('.sright').each(function(el, els) {
		el.fadeIn({
			duration : 2
		});
		var sl = el.up('div.referenz').down('div.pictures').down('div.slide');
		if (sl) {
			sl.currPos = 1;
			el.on('click', function(e, eld) {
				var c = sl.select('img').getCount();
				if (c == sl.currPos) {
					return;
				};
				var cx = sl.getX();
				sl.shift({
					x : cx - 535
				});
				sl.currPos++;
			});
		}
	});
	Ext.select('.sleft').each(function(el, els) {
		el.fadeIn({
			duration : 2
		});
		var sl = el.up('div.referenz').down('div.pictures').down('div.slide');
		if (sl) {
			sl.currPos = 1;
			el.on('click', function(e, eld) {
				var c = sl.select('img').getCount();
				if (sl.currPos == 1) {
					return;
				};
				var cx = sl.getX();
				sl.shift({
					x : cx + 535
				});
				sl.currPos--;
			});
		}
	});
	var sound = new Ext.FlashComponent({
		renderTo : 'sound',
		height : 9,
		width : 43,
		hideMode : 'offsets',
		hidden : false,
		url : '/sound.swf'
	});
});
