$(document).ready(function() {
								
$(".menucontents").hide(); //hides global nav hover menus
$(".l3").hide(); //hides expandable nav items in side nav
$(".annual_months").hide(); //hides expandable nav items in side nav
$(".searchbar").corner("tl bl 9px"); //adds rounded corner to searchbar
$(".plus").text("+");
$(".gallery:not(0)").hide();//hides gallery
$(".gallery:eq(0)").show();//hides gallery
$(".toggle_show:eq(0)").text("Hide");
$(".career").hide();//hides careers
$(".media").media(); 

$('a[@rel*="external"]').click( function() {
window.open( $(this).attr("href") );
return false;
});



$("#gallery_show").cycle({ 
    fx:    "fade", 
	timeout: 3000,
    speed:  300,
	pause: 1
	

});

//var slideshow_text = $("#gallery_show a").attr("title");
//$("#gallery_slide_desc").text(slideshow_text);

// global nav
// shows & hides hover menu when link is hovered
$(".menuitem").hover(function(){
	$(this)
	.parent()
	
	//.find(".menucontents").fadeIn("slow");
	//.find(".menucontents").animate({"show"},"slow");
	.find(".menucontents").show();
	
},function(){
	$(this)
	.parent()
	.find(".menucontents").hide();
});

// preserves hover when the actual menu is hovered
$(".menucontents").hover(function(){
	$(this).show();
	$(this).parent()
	.find(".menuitem")
	.addClass("linkhover");
	
},function(){
		$(this).hide();
		$(this).parent()
	.find(".menuitem")
	.removeClass("linkhover");
});			

$(".level3:eq(2)").parent().parent().parent(".menucontents").css("width","485px"); //sets width of box if there are 3 sections


//show - hide sidenav items
	$(".toggle_nav").click(function(){
		$(this).parent()
		.find(".l3").animate({ height: 'toggle', opacity: 'toggle' }, 'slow' );
		
		 if ($(this).find(".plus").text() == "+"){
			 $(this).find(".plus").text("-")
		 }
		 else if ($(this).find(".plus").text() == "-"){
			 $(this).find(".plus").text("+")
		 }
		
		return false;
  });
	
//show - hide sidenav items
	$(".toggle_nav_annual").click(function(){
		$(this).parent()
		.find(".annual_months").animate({ height: 'toggle', opacity: 'toggle' }, 'slow' );
		
		 if ($(this).find(".plus").text() == "+"){
			 $(this).find(".plus").text("-")
		 }
		 else if ($(this).find(".plus").text() == "-"){
			 $(this).find(".plus").text("+")
		 }
		
		return false;
  });
	
$("#activepage").parent(".l3").show();//shows expandable side nav menu by default if section is active
$("#activepage").parent(".l3").parent().find(".plus").text("-");

//show - hide gallery sliders
	$(".toggle_show").click(function(){
		$(this).parent().parent().next(".gallery")
		.animate({ height: 'toggle', opacity: 'toggle' }, 'slow' );
		
		 if ($(this).text() == "Show"){
			 $(this).text("Hide")
		 }
		 else if ($(this).text() == "Hide"){
			 $(this).text("Show")
		 }
		return false;
  });



//show - hide career sliders
	$(".toggle_career").click(function(){
		$(this).parent().parent().next(".career")
		.animate({ height: 'toggle', opacity: 'toggle' }, 'slow' );
		
		 if ($(this).text() == "Show"){
			 $(this).text("Hide")
		 }
		 else if ($(this).text() == "Hide"){
			 $(this).text("Show")
		 }
		return false;
  });
	
	
	
	// gallery hover thumbnails
$(".thumb").hover(function(){
	var this_lg = $(this).attr("href");
	var this_desc = $(this).attr("title");

	
		$("div.head_img  img").attr("src",this_lg);
		$("div.head_img  img").attr("title",this_desc);
		$(".gallery_desc").text(this_desc);
});			
	
	//gallery - makes sure no action is performed on thumb click
	$(".thumb").click(function(){
		return false;
		});			
	

});