window.addEvent("domready",function(){
    
    	
	Fx.Height = Fx.Style.extend({initialize: function(el, options){this.parent(el, 'height', options);this.element.setStyle('overflow', 'hidden');},toggle: function(){return (this.element.offsetHeight > 0) ? this.custom(this.element.offsetHeight, 0) : this.custom(0, this.element.scrollHeight);},show: function(){return this.set(this.element.scrollHeight);}});
	
	Fx.Opacity = Fx.Style.extend({initialize: function(el, options){this.now = 1;this.parent(el, 'opacity', options);},toggle: function(){return (this.now > 0) ? this.start(1, 0) : this.start(0, 1);},show: function(){return this.set(1);}});
	
	
	if($('bottom_wrap')){
		var max_height = 0;
		$ES('.users', $('bottom_wrap')).each(function(el, i){
			var chld = el.getChildren()[0];
			var h = chld.getSize().size.y - chld.getStyle("padding-top").toInt() - chld.getStyle("padding-bottom").toInt();
			if(h > max_height) max_height = h;
		});
		
		$ES('.users', $('bottom_wrap')).each(function(el, i){
			el.getChildren()[0].setStyle("height", max_height+"px");
		});
	}




	var backs = new Array();

	if($$('.mainlevel_fx') != '' ){

	var list11 = $$('.mainlevel_fx');
	var menuVer;
	var inW = list11[0].getStyle('width').toInt();
	var inWplus = list11[0].getStyle('padding-right').toInt() + 0 + list11[0].getStyle('padding-left').toInt();
	var inH = 28;
	

		list11.each(function(element, i) {

		menuVer = element.getParent();

		backs[i] = new Element('div',{
      'styles': {
			'position': 'absolute',
      'width': '0%',
      'height': '27px',
      'border': '0px solid',
      'padding': '0px',
      'margin': '0px',
			'margin-top': '-16px',
			'background': '#eaeaea'
      }
	  });

		if (navigator.appName == "Microsoft Internet Explorer"){
			backs[i].setStyle('margin-top', '0px');
		}

		menuVer.setStyle('position', 'relative');
		//menuVer.setStyle('border', '1px solid');
		menuVer.setStyle('height', inH);
		menuVer.setStyle('width', inW);

		element.setStyle('position', 'absolute');
		element.setStyle('margin-top', '-16px');
		if (navigator.appName == "Microsoft Internet Explorer"){
			element.setStyle('margin-top', '0px');
		}
		element.setStyle('width', inW);
		element.setStyle('z-index', 100);

		backs[i].injectInside(menuVer);
		

		var fx11 = new Fx.Styles(backs[i], {duration:180, wait:false});
	

		element.addEvent('mouseenter', function(){
				
			fx11.start({ 'width': inW + inWplus });

		});

		element.addEvent('mouseleave', function(){

			fx11.start({ 'width': '0%' });

		});
					
 
	});

	}//if menuholder exists


/*


	//Multilevel Menu Display
  var menu = $$('.menu_fx');
  menu.setStyle('position', 'relative');
  
  var menuops = $$('.menu_fx li');
  menuops.each(function(o,i){
		o.setStyle('position', 'relative');
  
    var sub = o.getElements('ul');
    if(sub!=''){
		//alert(sub);

      sub.setStyle('position', 'absolute');
			sub.setStyle('float', 'left' );
      sub.setStyle('display', 'none');
			//sub.setStyle('z-index', 50);
      sub.setStyle('margin-top', -o.getStyle('height').toInt());
      sub.setStyle('margin-left', 0);
      
			var fxsub1 = new Fx.Styles(sub[0], {duration: 300, wait:false});

      o.addEvent('mouseenter', function(){
        sub.setStyle('display', 'block');
				fxsub1.start({
					'opacity': 1,
					'margin-left': o.getStyle('width')
				});
				
				var subul = sub.getElements('ul');

				if(subul!=''){
		      //sub.setStyle('margin-left', o.getStyle('width').toInt());
					subul.each(function(s,i){
						s.setStyle('display', 'none');
					});
				}

      });
      
      o.addEvent('mouseleave', function(){
        fxsub1.start({
					'opacity': 0,
					'margin-left': 0
				});
      });

    }
    
  });


	//Menu Background Effect
	var menulinks = $$('.menu_fx a');
	menulinks.each(function(l,i){
		l.setStyle('position', 'relative');
	});

	var menuopx = $$('.menu_fx li');
	var backs = new Array();

	menuopx.each(function(o,i){

		backs[i] = new Element('div',{
	      'styles': {
				'position': 'absolute',
	      'width': '0%',
	      'height': '27px',
	      'padding': '0px',
	      'margin': '-27px 0px 0px 0px',
				'background': '#eaeaea'
	      }
		});

		backs[i].injectInside(o);
		var fxb = new Fx.Styles(backs[i], {duration:180, wait:false});

		o.addEvent('mouseenter', function(){
			fxb.start({'width': o.getStyle('width')});
		});

		o.addEvent('mouseleave', function(){
			fxb.start({'width': '0px'});
		});

	});
*/



});


 

