// JS Compilation Effects

// 4 Concepts

function getCurrentPageName(){var path=window.location.pathname;var arrpath=path.split('/');return arrpath[arrpath.length-1];}
function hideAllSub(){$('.menuSubNav_area').each(function(){$(this).hide();});}
function revertMenus(){$('.menuNavLink li a img').each(function(){src=this.src.replace('_over','');this.src=src;});}
function hideAllDescription(){$('.fleet_description').each(function(){$(this).hide();});}
function resetState(){$('.charter_fleetlist li').each(function(){$(this).css({background:"#ffffff",color:"#32394A"});});}
function setState(){
	var curpage=getCurrentPageName();
	switch(curpage){
		case 'aircraft_sales.php':
			$('#anc_ac-sales img').attr('src','./images/menu/aircraft_sales_menu_over.gif');
			break;
		case 'aircraft_management.php':
			$('#anc_ac-management img').attr('src','./images/menu/aircraft_mgnt_menu_over.gif');
			break;
		case 'charter.php':
			$('#anc_charter img').attr('src','./images/menu/charter_menu_over.gif');
			break;
		case 'fleet.php':
			$('#anc_menu img').attr('src','./images/menu/fleet_menu_over.gif');
			break;
		case 'flight_operations.php':
			$('#anc_flightoperations img').attr('src','./images/menu/flight_operations_menu_over.gif');
			break;
		case 'lifestyle_empire.php':
			$('#anc_lifestyle img').attr('src','./images/menu/lifestyle_menu_over.gif');
			break;
	}
}

$('document').ready(function(){	
							 
	$('.menuNavLink li a').each(function(){

		$(this).mouseover(function(){					
			hideAllSub();
			revertMenus();
								
			var img=$('#'+this.id+' img');
			str=img.attr('src');
			str=str.replace('.gif','');
			img.attr('src',str+'_over.gif');
			
			switch(this.id){
				case 'anc_ac-sales':
					$('#aircraftsales_menusubNav').show().fadeIn();
					break;
				case 'anc_charter':
					$('#charter_menusubNav').show().fadeIn();
					break;
				case 'anc_lifestyle':
					$('#lifestyle_menusubNav').show().fadeIn();
					break;
				
				default:
					break;
			}
		}).mouseout(function(){revertMenus();setState();});
	});
	
	$("#imgLink img").hover(
		function(){this.src = this.src.replace("_up","_up");},
		function(){this.src = this.src.replace("_up","_up");}
	);
	
	
	$('.charter_fleetlist li a').each(function(){
		$(this).click(function(){
			hideAllDescription();
			resetState();
			$('#fd_'+this.id).show();
			$(this).parent().css({background:"#dbd6c2",color:"#ffffff"});
		}).mouseover(function(){this.style.color='#32394A';});	
	});
	
	hideAllDescription();
	$('#fd_gulfstreamg450').show();
	$('.charter_fleetlist li:first-child a').parent().css({background:"#dbd6c2",color:"#ffffff"});
	
	/* Revisions  July 14th */
	$('.breadcrumbs').remove(); //Remove Breadcrumbs.
	setState();

	
	
});	










