	$(document).ready(function() {

	
		// --------------- MID NAV FUNCTIONS ---------------- //
		//$('#bannertxt_catalogs').triggerHandler('mouseenter');
		$('.bannerTextBlock:not(#bannerTxt_catalogs)').css('opacity', '0');
		$('.bannerImageBlock:not(#bannerImg_catalogs)').css('opacity', '0');

		mouseEnterAddHandler();
		
	});

	function mouseEnterAddHandler(){
		$('#mid_catalogs').mouseenter(function() {
			var area = $(this);
			if(!$(area).hasClass('activeArea')){
				$('.activeArea').removeClass('activeArea');
				$(area).addClass('activeArea');
				mouseOverColor($(area));
				navTransition('catalogs','0px','580px');
			}
        });
		$('#mid_mailing').mouseenter(function() {
			var area = $(this);
			if(!$(area).hasClass('activeArea')){
				$('.activeArea').removeClass('activeArea');
				$(area).addClass('activeArea');
				mouseOverColor($(area));
				navTransition('mailing','240px','620px');
			}
        });
		$('#mid_publications').mouseenter(function() {
			var area = $(this);
			if(!$(area).hasClass('activeArea')){
				$('.activeArea').removeClass('activeArea');
				$(area).addClass('activeArea');
				mouseOverColor($(area));
				navTransition('publications','480px','580px');
			}
        });
		$('#mid_directmail').mouseenter(function() {
			var area = $(this);
			if(!$(area).hasClass('activeArea')){
				$('.activeArea').removeClass('activeArea');
				$(area).addClass('activeArea');
				mouseOverColor($(area));
				navTransition('direct','720px','600px');
			}
			
        });
		$('#mid_union').mouseenter(function() {
			var area = $(this);
			if(!$(area).hasClass('activeArea')){
				$('.activeArea').removeClass('activeArea');
				$(area).addClass('activeArea');
				mouseOverColor($(area));
				navTransition('union','960px','580px');
			}
        });
	}
	function fadeBanner() {
		$('.bannerTextBlock').animate({left: '-600px', opacity: 0}, {duration: 300}, {easing: 200});
		$('.bannerImageBlock').animate({left: '1250px', opacity: 0}, {duration: 300}, {easing: 200});
	}
	
	function mouseOverColor(box) {
		$('.midNavText').css('color', '#333');
		$(box).find('.midNavText').css('color', '#c41230');
	}
	
	function animateArrow(arrowLeft){
		 $('#midNavArrow').animate({left: arrowLeft}, {duration: 300}, {easing: 200});
	}
	function navTransition(selectorSuffix, arrowLeft, bannerLeft){
		$.doTimeout('midnav_animation',300,function(){
			fadeBanner();
			animateArrow(arrowLeft);
			$('#bannerTxt_' + selectorSuffix).animate({left: '20px', opacity: 1}, {duration: 300}, {easing: 200});
			$('#bannerImg_' + selectorSuffix).animate({left: bannerLeft, opacity: 1}, {duration: 300}, {easing: 200});
		});

	}

