
/* Dropdown jQuery script for Aurora Inc.  */
/* (c)2011 Schaub&Co, all rights reserved. */

/* Testing the slideDown/slideUp vs fadeIn fadeOut effects */

$(document).ready(function(){
	
	
	// The Press Room items (since they aren't really pages, but forwards to posts)
	var uriArray = window.location.pathname.split('/'); 
	//var uriLen = uriArray.length;
	//alert(uriLen);
	if( ( jQuery.inArray("press_releases", uriArray) > 0 || jQuery.inArray("news", uriArray) > 0 )){
		// Add "li.current_page_item" class to the press room item
		if( jQuery.inArray("press_releases", uriArray) > 0 ){
			$('.page-item-122').addClass('current_page_item');
			$('.page-item-23').addClass('current_page_parent');
		}else 
		if( jQuery.inArray("news", uriArray) > 0 ){
			$('.page-item-117').addClass('current_page_item');
			$('.page-item-23').addClass('current_page_parent');
		}else{
			$('.page-item-23').addClass('current_page_item');
		}
	}
	if( jQuery.inArray("facilities", uriArray) > 0 ){
		// Add "li.current_page_item" class to the facilities item
		$('.page-item-47').addClass('current_page_item');
		$('.page-item-9').addClass('current_page_parent');
		$('.page-item-47').removeClass('current_page_parent');
	}
	
	// Set all submenu hidden
	$(".menu ul ul").css("display", "none"); 
	
	// Open the current menu
	$("li.current_page_item").parent().fadeIn('fast');
	
	// Highlight the main nav item
	$("li.current_page_parent").find("a:first").css("color", "#3F2600");	
	
	// highlight the current menu item
	$("li.current_page_item").find("a:first").css("color", "#007A3D");
	
	// If the current_page_item is also a main navigation item put in the background image on it 
	if( !$("li.current_page_item").parent('ul').hasClass('children') ){

		// open the subs
		$("li.current_page_item .children").fadeIn('fast');
	} 
	
// Implement the rollover experience with the menu	
	$(".menu li").click(function(){
		
		if( !$(this).hasClass('current_page_item')  && !$(this).hasClass('current_page_parent') ){
			
			
		}
		
		
	});
	
});
