window.addEvent('domready', function(){;

	var ua = navigator.userAgent.toLowerCase(),
		is = function(t){ return ua.indexOf(t) != -1; },
		b = (!(/opera|webtv/i.test(ua)) && /msie (\d)/.test(ua)) ? ((is('mac') ? 'ieMac ' : '') + 'ie ie' + RegExp.$1)
			: is('gecko/') ? 'gecko' : is('opera') ? 'opera' : is('konqueror') ? 'konqueror' : is('applewebkit/') ? 'webkit safari' : is('mozilla/') ? 'gecko' : ''

	bTest = (function(){return b != "ie ie6";});
	
	if(bTest()) {
	
		$$('li.grp ul li').each(function(el){
			var fx = new Fx.Styles(el, {duration:400, wait:false, transition:Fx.Transitions.Back.easeOut});
	
			el.addEvent('mouseenter', function(){
				fx.start({
					'padding':'0px 0px 2px 12px',
					'color': '#0095D5',
					'font-size':'11px',
					'borderColor': '#A0181C',
					'border-left-width': '14px',
					'backgroundColor': '#E34648',
					'border-top-width': '1px',
					'border-bottom-width': '1px'
				});
			});
		 
			el.addEvent('mouseleave', function(){
				fx.start({
					'padding':'1px 0px 3px 10px',
					'color': '#ffffff',
					'font-size':'11px',
					'backgroundColor': '#333',
					'borderColor': '#000',
					'border-left-width': '7px',
					'border-top-width': '0px',
					'border-bottom-width': '0px'
				});
			});
			
			fx.set({
				'padding':'1px 0px 3px 10px',
				'color': '#ffffff',
				'font-size':'11px',
				'backgroundColor': '#333',
				'borderColor': '#000',
				'border-left-width': '7px',
				'border-top-width': '0px',
				'border-bottom-width': '0px'
			});
			
		});
		
		$$('#nav .grp').each(function(el){
			
			var menu = 'sub_' + el.id;
			var func = 'tx_' + menu;
			var func2 = 'op_' + menu;
			eval(func + " = new Fx.Slide(menu,{duration:400, transition:Fx.Transitions.Cubic.easeOut,wait:0});");
			eval(func2 + " = new Fx.Style(menu,'opacity',{wait:0});");
			subMenu = eval(func);
			subMenu2 = eval(func2);
			menuOut = "";
	
			if (menu){
	
				$(el).addEvent('mouseenter', function(e){
					e = new Event(e);
					$$('#nav ul').each(function(th){
						if (th.id == menu){
							//document.getElementById(myFunc.replace(/tx_/,"")).style.display='';
							myFunc = 'tx_sub_' + el.id;
							opFunc = 'op_sub_' + el.id;
							eval(myFunc + '.stop();');
							eval(opFunc + '.stop();');
							eval(opFunc + '.start(-0.5,.92);');
							eval(myFunc + '.slideIn();');
						} else {
							myFunc = 'tx_' + th.id;
							opFunc = 'op_' + th.id;
							eval(myFunc + '.stop();');
							eval(opFunc + '.stop();');
							eval(myFunc + '.slideOut();');
							eval(opFunc + '.start(0,0);');
						}
					});
					e.stop();
				});
			
				$(el).addEvent('mouseleave', function(e){
													  
					e = new Event(e);
					myFunc = 'tx_sub_' + el.id;
					opFunc = 'op_sub_' + el.id;
					eval(myFunc + '.stop();');
					eval(opFunc + '.stop();');
					document.getElementById(myFunc.replace(/tx_/,"")).style.display='none';
					eval('menuOut = (function(){' + myFunc + '.slideOut(); ' + opFunc + '.start(0,0);}).delay(1);');
					document.getElementById(myFunc.replace(/tx_/,"")).style.display='';
					e.stop();
				});
				
				$(menu).addEvent('mouseenter', function(e){
					e = new Event(e);
					$clear(menuOut);
					e.stop();
				});
	
				subMenu2.set(0);
				subMenu.hide();
	
			}
			
		});
	}
	
});
