	document.writeln('<style type="text/css">');
	document.writeln('#nav2 {height:0}');
	document.writeln('</style>');
	var visiblePriNav;
	var isOpen = false;
	var setNavHeight;
	
	
	function showSecNav( priNav )
	{

		if( priNav == "food" )
		{
			setNavHeight = 252;
		}
		else
		{
			setNavHeight = 150;
		}

		if( !isOpen )
		{
			$$("#nav2, #nav2-space").each(function( elm )
			{
				elm.get('tween', { duration:1200,transition:'pow:out', onComplete:function(){}
			}
			).start("height", setNavHeight );
		});
			
		isOpen = true;
			
		}
		else
		{
			if( priNav == "food" )
			{
				$$("#nav2, #nav2-space").each(function(elm) {
					elm.get('tween', {duration:1200,transition:'pow:out',onComplete:function(){
						}}).start("height", setNavHeight )
				});
			}
			else
			{
				$$("#nav2, #nav2-space").each(function(elm) {
					elm.get('tween', {duration:1200,transition:'pow:out',onComplete:function(){
						}}).start("height", setNavHeight)
				});
			}

			if( priNav == visiblePriNav || priNav == '' )
			{
				$$("#nav2, #nav2-space").each(function(elm) {
					elm.get('tween', {duration:1200,transition:'pow:out',onComplete:function(){
																							 
						}}).start("height",0 )
				});
				isOpen=false;
			}

		}

		if( priNav != "" )
		{
			$$("#nav2 .nav2-category").each(function(elm) {
				elm.setStyle("display","none");
			});
			
			$$("#nav2 ." + priNav ).setStyle("display","block");
			visiblePriNav = priNav;
			
		}
		//pageTracker._trackPageview('/menu/' + priNav);
		
		return false;

	}
	
	function flyNav( rObj )
	{
		$$("#nav2, #nav2-space").each(function(elm) {
			elm.get('tween', {duration:1200,transition:'pow:out',onComplete:function(){
					window.location = rObj;													 
				}}).start("height",0)
		});
		isOpen=false;

	}
	
	
	window.addEvent('domready', function()
	{
		$("nav2").addClass("js");
		
		$$("#nav2 li .text").each (function(el)
		{
			if( el.get('text').length > 23 )
			{
				if( Browser.Engine.trident4 )
				{
					el.setStyle("bottom", "2px");
				}
				else
				{
					el.setStyle("bottom", "18px");
				}
			}
			else
			{
				if( Browser.Engine.trident4 )
				{
					el.setStyle("bottom", "9px");
				}
				else
				{
					el.setStyle("bottom", "13px");
				}
			}
			
		});
		
		$$("#nav2 li").each(function(el){
			el.onmouseover=function()
			{
				this.className+=" liHover";
				//if( Browser.Engine.trident4 ){$("nav2").getElement("ul").setStyles({position:"relative", left:"-9px"});}
			}
		 });
		
		$$("#nav2 li").each(function(el){
			el.onmouseout=function()
			{
				this.className=this.className.replace(new RegExp(" liHover\\b"), "");
			}
		 });

		var hideBut = new Element('a', {
		"class": "hide",
		"href": "javascript:void(0)",
		"events": {
        "click": function(){
            showSecNav('');
			}
   		 }
	});
		
	var hideImg = new Element ('img', {
		'src':'/static/img/buttons/fly-out-up.gif',
		'alt':'Hide',
		'width':'30',
		'height':'23'
		});
	hideImg.inject(hideBut);					 
	hideBut.inject($$("#nav2 .header-buttons")[0]);

});

	
	
	