$(document).ready(function(){

	$(".titule_flash_r_l, .titule_flash_r_m, .titule_flash_r_s, .titule_flash_r_xs, " +
	  ".titule_flash_n_l, .titule_flash_n_m, .titule_flash_n_s, .titule_flash_n_xs").each(function(i , item){	
		var miclass = $(item).attr("class");
		var text_titule = $(item).text();
		var miid = miclass + i;
		var color_n = "0x484748";
		var color_r = "0xB40404";
		var size_l = 30;
		var size_m = 20;
		var size_s = 15;
		var size_xs = 12;
		var height_l = "45";
		var height_m = "30";
		var height_s = "25";
		var height_xs = "20";
			
		
		switch ( miclass ) {
			case 'titule_flash_r_l':
				text_color = color_r;
				text_size = size_l;
				alto_flash = height_l;
				break;
			case 'titule_flash_r_m':
				text_color = color_r;
				text_size = size_m;
				alto_flash = height_m;
				break;
			case 'titule_flash_r_s':
				text_color = color_r;
				text_size = size_s;
				alto_flash = height_s;
				break;
			case 'titule_flash_n_l':
				text_color = color_n;
				text_size = size_l;
				alto_flash = height_l;
				break;
			case 'titule_flash_n_m':
				text_color = color_n;
				text_size = size_m;
				alto_flash = height_m;
				break;
			case 'titule_flash_n_s':
				text_color = color_n;
				text_size = size_s;
				alto_flash = height_s;
				break;
			case 'titule_flash_r_xs':
				text_color = color_r;
				text_size = size_xs;
				alto_flash = height_xs;
				break;
			case 'titule_flash_n_xs':
				text_color = color_n;
				text_size = size_xs;
				alto_flash = height_xs;
				break;
			default:
				break;
		}
		$(item).attr('id', miid);
		if(text_titule.trim() != "" && text_titule.trim()!= null){
			change_titules_show_flash(miid, text_titule, text_color, text_size, alto_flash);
		}
	});
	
	
	
	function dump(obj) {
	    var out = '';
	    for (var i in obj) {
	        out += i + ": " + obj[i] + "\n";
	    }
	    //$('#debug_jquery').html( out );
	    alert(out);
	}

});

function change_titules_show_flash(miid, text_titule, text_color, text_size, alto_flash){
	//<![CDATA[
	var flashvars = {
		titule: text_titule.trim(),
		fontsize: text_size,		
		fontcolor: text_color,
		fontbold: "true"
	};
	var params = {
		menu: "false",
		wmode: "transparent"
	};
	var attributes = {
		id: miid,
		name: miid
	};

	swfobject.embedSWF("/site/include/text_format_as3.swf",
					miid,
					"100%",
					alto_flash,
					"9.0.0",
					INTRA_BASE_URL + 'DayAdmin/swfs/expressInstall.swf', flashvars, params, attributes );
	//]]>
}
