/**
 * @author pfrumillon
 */

 Event.observe(window, 'load', function() {
 
 

		
// #########################################################################
// 			REMPLACEMENT DU MENU HTML TYPO PAR UN JOLI FLASH QUI VA BIEN
// #########################################################################   
 
	var data = [];
	
	$$('#main-menu-flash > ul > li').each(function (li) {
		
		var item = {
			'libelle': (li.down().innerHTML.replace("&amp;", "&").replace("&gt;", ">").replace("&lt;", "<").replace("&quote;", "\"")),
			'link': (li.down().href)			
		};		
		if(li.hasClassName("act")){
			item.active = "true";
		}
		
		if(li.down("ul")){
			item.children = [];
			li.select('ul > li').each(function (li) {
				
				var itemSub = {
					'libelle': (li.down().innerHTML.replace("&amp;", "&").replace("&gt;", ">").replace("&lt;", "<").replace("&quote;", "\"")),
					'link': (li.down().href)
				};				
				if(li.hasClassName("act")){
					itemSub.active = "true";
				}				
				item.children.push(itemSub);						
			});			
		}		
		data.push(item);		
	});

	
	var flashvars = {
		dataJson: encodeURIComponent(data.toJSON())
	};	
	var params = {
		wmode: "transparent"
	};
	var attributes = {};

	swfobject.embedSWF("typo3conf/ext/belink_ipline/res/swf/mainMenu.swf", "main-menu-flash", "200", "550", "9.0.0","typo3conf/ext/belink_ipline/res/swf/expressInstall.swf", flashvars, params, attributes);
		
		
	}); 
