/**
 * @author Profitroom
 */

 function insertFlash(flashContainer,flashURL,flashWidth,flashHeight,flashParams,flashVars){
	if(parseInt(window.Browser.Plugins.Flash.version)<8)
		return
	if($chk($(flashContainer)))
	{
		//ustaw styl
		new Swiff(flashURL,{width:flashWidth,height:flashHeight,container:$(flashContainer),vars:flashVars,params:flashParams});
	}	
 	else
	{
		window.addEvent('domready',function(){
			//ustaw styl
			new Swiff(flashURL,{width:flashWidth,height:flashHeight,container:$(flashContainer),vars:flashVars,params:flashParams});
		})
	}
		
 }

 var horizontalMenu = new Class({
	initialize:function(menu_id)
	{
		this.main = $(menu_id);
		this.rootNode = this.main.getElements('li.rootLVL');		
		var $this = this;
		this.rootNode.each(function(node,index){
			
			node.ulChildNode = node.getElement('ul');
			if($chk(node.ulChildNode))
			{
				node.fx = new Fx.Morph(node.ulChildNode,{duration:500});
				node.addEvents({
					'mouseenter':function(){
						this.ulChildNode.setStyles({
							'display':'block',
							'opacity':'0',
							'width':'0'
						})
						this.fx.cancel();
						this.fx.start({'width':'230','opacity':'1'});
					},
					'mouseleave':function(){
						this.fx.cancel();
						this.fx.start({'width':'0','opacity':'0'});
					}
				})
			}
				
			
		})
	},
	checkChildNodes:function(node)
	{
		return node.getElement('ul').getElements('li');
	}
});

