// Setup Lavalamp Menu Effect
/*
$(function() {
		$('#nav').lavaLamp({fx: 'swing', speed: 333});
		loadLamps(easing);
		
		$('select#easing option[value='+easing+']').attr('selected','selected');
		$('.easingLabel').text(easing);
	});

*/
$(document).ready(function(){	

	// Preload all the images in the stylesheet (which includes page banners).
	$.preloadCssImages();

	// Prepend the ajax container and hide it
	$('body').prepend('<div id="ajax" class="hidden"></div>');
	
	// Locate the ajax links, get the content, append it
	var $alinks = $('ul#nav>li>a[rel=ajax]')
	$($alinks).each(function(index){
				var status = $(this).parent().attr('class'); 
				if (status!='active') {
					var url = $(this).attr('href');
					var id = this.parentNode.id;
					$.get(url, {'aj':'1'}, function(data){
						// Put the data in the container so we can parse it							
						$('#ajax').append(data);
						
						// Move the graphic to the graphic container
						$('#ajax>div[id='+id+'_banner]').hide().appendTo('#header>.inner');
						// Move the content to the content container
						$('#ajax>li[id='+id+'_content]').hide().appendTo('ul#content');
					});
				}
				if (index==($alinks.length-1)) {				
					$.activateStreamline({
							container: "ul#content",
							nav: "ul#nav",
							effect: "slide" // Available Effects: slide, blind or drop
							});
					$($alinks).attr('href','javascript:void(0);');
			
					$('.button>.slideLink').each(function(){							  
							var target = $(this).attr('id');
							var p = target.split("_");
							var menuID = p[0];
							$(this).click(function () { 
								setActive(menuID, effect_up, effect_down); 
							}).attr('href','javascript:void(0);');
						});
					
							
				}
	
	});	

});
