	var path = document.location.toString().split('/');
	var cat_slug = path[4];

	function buildNavigation( dataProvider )
	{
		dataProvider.push({'label':'CLIENTS', 			'data':'/about/clients',				'active':cat_slug=='clients'			? '1':'0' });
		dataProvider.push({'label':'TESTIMONIALS', 	'data':'/about/testimonials',	'active':cat_slug=='testimonials'	? '1':'0' });
		
		var dynamic_ul = $('dynamic_about_nav');
		var static_ul = $('static_about_nav');
		$each( dataProvider,
			function( section, section_index )
			{
				var li = new Element('li');
			
				if( section.active=='1' || ( cat_slug=='' && section_index==0 ))
					li.addClass('active')
				
				var a = new Element('a', { 'href':section.data });
						a.appendText( section.label );

				li.adopt( a );
				
				if( section.id )
				{
					li.id = 'sortable-'+section.id;
					dynamic_ul.adopt( li );
				}
				else
					static_ul.adopt( li );
			});
			
			var s = new Sortables( dynamic_ul, {
				constrain: false,
				clone: true,
		    onComplete: function( e ) {
						saveOrder( s.serialize() );
					}
				});
		
		/* intro */
		//	pageIntro(cat_slug=='');
	}
	
	function saveOrder( o )
	{
		var newOrder = o.join('|').replace(/sortable-/g,'');
		var jsonRequest = new Request.JSON(
	  {
	   	url: "/about/save_order"
	  }).post({ 'order':newOrder });
	}
	
	function pageIntro( full_intro )
	{
		if( $('template') )
		{
			$('image').set('tween',{duration:400});
			$('image').tween('opacity', [0, 1]);
		
			var myEffect = new Fx.Morph( $('image'), { duration:700 });
					myEffect.start({ 'opacity':[0, 1] });
		
			var myEffect = new Fx.Morph( $('copy'), { duration:700 });
					myEffect.start({ 'opacity':[0, 1] });
		}
		else if( $('clientlist') )
		{
			$each( $$('#clientlist .market'),
				function( el, index )
				{
					var myEffect = new Fx.Morph( el, { duration:300+(index*300) });
							myEffect.start({ 'opacity':[0, 1] });
				});
		}
		else if( $('testimonials') )
		{
		
		}
		
		if( full_intro )
			$each( $$('#col_left li'),
				function( el, index )
				{
					var myEffect = new Fx.Morph( el, { duration:500+(index*100) });
							myEffect.start({
								'opacity'			: [0, 1]
							});
				});
	}

	window.addEvent('domready',
		function()
	  {
			if( $('delete_link') )
			    $('delete_link').addEvent('click',
    				function(event)
    			  {					
    					if(!confirm("Are you sure you want to delete this section? This cannot be undone." ) )
    						event.stop();
  				  });
			
			var jsonRequest = new Request.JSON(
		  {
		    url: "/about/menu",
		    onComplete:
		      function( response )
		      {
		      	buildNavigation( response );
		      }
		    }).post({ 'section':cat_slug });
	  });