window.addEvent('domready', function() {
	//---------------------REPLACE TEXT----------------------//	
	var count=0;
	if($$('.replaceFlash')){
		$$('.replaceFlash').each(function(item){
			item.addClass('flash');
			var url="";
			if(item.getElement('a')) url=item.getElement('a');
			count++;
			/*alert(item.getProperty('id')+' width: '+item.getStyle('width'));
			alert(item.getProperty('id')+' height: '+item.getStyle('height').toInt());*/
			var obj = new Swiff('../_res/swf/textreplace.swf', {
				id: 'myBeautifulMovie'+count,
				width: item.getStyle('width').toInt(),
				height: item.getStyle('height').toInt(),
				container: item,
				params: {
					codebase: 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
					quality: 'high',
					pluginspage: 'http://www.macromedia.com/go/getflashplayer',
					align: 'middle',
					play: 'true',
					loop: 'true',
					scale: 'noscale',
					wMode: 'window',
					devicefont: 'false',
					bgcolor: item.getStyle('background-color'),
					menu: 'false',
					allowFullScreen: 'false',
					allowScriptAccess:'sameDomain',
					salign: 'lt'
				},
				vars: {
					testo: item.get('html').trim(),
					dimensione: item.getStyle('font-size').toInt(),
					//carattere: 'Swis721 Cn BT',
					colore: item.getStyle('color').replace('#','0x'),
					coloreOver: '0x68004F',
					url: url
				}
			});
		});
	}
});
