var FlashHeaders = {

	initialize: function() {
		if (Browser.Plugins.Flash.version < 8) return;
		FlashHeaders.pageTitle();
		FlashHeaders.newsTitle();
	},

	pageTitle: function() {
		var headers = $$('h2.pageTitle');

		headers.each(function(el, eli) {
			var tag = el.get('tag');
			var text = el.get('text');
			var color = el.getStyle('color').replace('#', '');
			el.empty().setStyles({
				'padding': 0,
				'height': '28px',
				'padding-left' : '10px'
			});
			new Swiff('/htdoc/flash/header.swf', {
			    id: 'fheader-' + eli,
			    width: 600,
			    height: 28,
				container: el,
			    params: {
			        'wmode': 'transparent'
			    },
				vars: {
					'txt': text,
					'color': color ? (color.length == 6 ? color : color + color) : 'ffffff'
				}
			});
		});
	},

	newsTitle: function() {
		var headers = $$('div.title a');
		headers.each(function(el, eli) {
			var tag = el.get('tag');
			var text = el.get('text');
			var color = el.getStyle('color').replace('#', '');
			el.empty().setStyles({
				'padding': 0,
				'height': '26px',
				'margin-left' : '-2px'
			});
			new Swiff('/htdoc/flash/news.swf', {
			    id: 'fheader-' + eli,
			    width: 440,
			    height: 28,
				container: el,
			    params: {
			        'wmode': 'transparent'
			    },
				vars: {
					'txt': text,
					'color': color ? (color.length == 6 ? color : color + color) : 'ffffff'
				}
			});
		});
	}
}; window.addEvent('domready', FlashHeaders.initialize);
