/**
 * @author:		TFuhlroth
 * @copyright	Maxomedia - Agentur für Crossmedia-Kommunikation BSW
 */

// debug
if (window['console'] === undefined) window.console = { log: $empty };

// $E
$E = document.getElement.bind(document);

// set namespace
var GVB = {};

// flashloader
var FlashLoader = new Class({

	initialize: function (containers) {
		this.containers = containers;
		this.containers.forEach(function (item) {
			this.loadParams(item);	
		}.bind(this));
	},
	loadParams: function (item) {
		this.container = $(item);
		this.objTag = this.container.getElement('object');
		this.params = new Hash();
		this.paramElements = this.container.getElements('param');
		this.paramElements.each(function (param) {
			this.params.include(param.get('name'), param.get('value'));
		}, this);
		this.loadSwiff();

	},
	loadSwiff: function () {
		new Swiff(this.params.get('movie'), {
			width: this.objTag.width,
			height: this.objTag.height,
			params: this.params.getClean(),
			container: this.container
		});
	}
});
window.addEvent('domready', function () {
	if($('teaser_hagel')) new FlashLoader(['teaser_hagel', 'teaser_schnee', 'teaser_wasser', 'teaser_wind']);
	if($('flash-info')) new FlashLoader(['flash-info']);
});

// load accordion
// setup accordion
/*
GVB.Accordion = {
	init: function () {
		new Accordion($('accordion'), 'h2.box_trigger', 'div.box', {
			display: -1,
			alwaysHide: true
		});
	}
};
window.addEvent('domready', function () {
	if($('info')) GVB.Accordion.init();
});
*/
